I’m using the quick_pay create payment link in the online-checkout API. The link that is returned is an older confirmation link that I had done earlier in the API explorer.
Here is what happens:
var_dump postdata
string(150) “{“idempotency_key”:“63b3877e3aa22”,“quick_pay”:{“name”:“Renewal Testing”,“price_money”:{“amount”:101,“currency”:“USD”},“location_id”:“QMM4HPWSNJ0W9”}}”
The square.link provide is an old confirmation link that I did with API explorer:
This test was done using production credentials. Similar thing happens with sandbox; however, the return result there contained two different confirmation links that I had done with API explorer.
I took a look at your API Logs and I only see one POST request from the API Explorer in production. Are you sure the call to CreatePaymentLink from the example worked?
Thank you Brian. I only did one API Explorer transaction in production. In my snippet on the execution in my code, I do receive a result from the cURL execution that contained an URL. But URL isn’t a link to complete the payment. The URL takes me to the confirmation from the API Explorer.
One extra thought here. When I used sandbox credentials, I received two URLs in the cURL result. Both links were to separate confirmations that I had done via the API Explorer. It seem that the way I’m doing the create payment link is returning me a list of confirmations and not the expected finish payment link.
Unfortunately not. All I have received is the same links repeatedly. Even tried different access token (changed it in dashboard). Different browser. Always get the same responses (same id, same url(s), same created_at(s))
Small update here. Instead of using the quick_pay option, I did the order option with couple of line items. Same result. I receive a payment_links object with URLs for completed orders that were done via the API Explorer couple of days ago.
Now looking at the API documentation and examples in API Explorer, the response is to provide a “payment_link” object with an URL. Both the name and description imply singular (only one link). The object I’m receiving is “payment_links” which contains more than one URL. I see no mention of this object in the online API documentation. Maybe a clue?
The outgoing HTTP header from cURL:
"GET /v2/online-checkout/payment-links HTTP/1.1 Host: connect.squareupsandbox.com Accept: / Square-Version: 2022-12-14 Authorization: Bearer ACCESS_TOKEN Content-Type:application/json "
The post data:
“{“idempotency_key”:“63b72c9ed6236”,“quick_pay”:{“name”:“Auto Detailing”,“price_money”:{“amount”:12500,“currency”:“USD”},“location_id”:“LW669T32BBAHV”}}”
The HTTP header information appears to match the information that is in the API Explorer (other than the access token)
The post data information appears to match the information that is in the API Explorer (other than the location id). The idempotency_key is always an unique value. Even tried it without an idempotency_key.
The return result is always the same. Containing links of confirmation of old transactions (days in the past). No sign of a payment link.
Is there a way to see what is going on in the Square server that would trigger to send these old links and not an actual payment link?