I’m developing a Windows desktop application which receives card information from a non-square card reader and supplies that information to square for payment processing. I am using a CEFSharp offscreen browser library in order to utilize the SqPaymentForm that is used via javascript. However, I’m having issues loading the SqPaymentForm because square requires the site its communicating with to be https.
I get this javascript error:
Uncaught (in promise) HttpsRequiredError: SqPaymentForm can only be embedded on sites that use HTTPS.
I’m not familiar with CEFSharp, but that’s simply one of the Square Payment Form requirements: it needs to be hosted on a server with HTTPS for security. Otherwise, it will never load as you found out. So, however you’re hosting it, you’ll need to add an SSL certificate so that the page is secure.
Thank you for your prompt response @sjosey. After taking another look at this, it appears that I approached this incorrectly, as CEFSharp just allows embedding of Chromium in .NET apps. What I actually need is to be able to utilize the SqPaymentForm within the WPF Windows application. How could I accomplish this?
No idea unfortunately, that is outside of my support scope. If WPF Windows application has a way of using SSL certificates it might work, but realistically the Square Payment Form is meant to be running on a web server since it relies on Javascript for client-side interaction. I’m not familiar with WPF to begin to show how to do that unfortunately.