I am using Quick Pay to process payments in my online store. The payment itself is handled fine, but the buyer is not redirected back to my site after payment is complete.
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The issue might be due to the fact that the redirect_url is not an HTTPS URL. The Checkout API requires that the redirect_url be a secure (HTTPS) URL. After the buyer completes the payment, Square redirects the buyer to the HTTPS URL that you provide. If you provided an HTTP URL, the redirection might not work as expected. Please update your redirect_url to an HTTPS URL and try again.
Turns out this was user error (no surprise). My json request was not structured properly. I had pre_populated_data and checkout_options nested under quick_pay. Oops. Had I taken the trouble to inspect Square’s response to my request, I would have seen that much earlier. Apologies for the bother.
Redirect now works as expected.
Customer name and email address are now getting pre-populated into the payment page.
I added "enable_coupon":false to turn off the coupon field, and that is also working as expected.
One thing: I cannot confirm or deny that redirect_url must be https. I changed it to https when fixing the json structure, but never tested with plain http. (https definitely works, at least.) I see in the docs that https is required in OAuth situations, but then some of the examples show regular http.
Thank you, Square Dev AI, you botty little bot, and thank you @Bryan-Square .