Hey guys.
I have struggled for several weeks to figure it out how to connect our website’s customer id when users pay on the Square checkout page.
What I’m using is the create payment link API to issue the checkout page and detect payment/order updated webhook trigger to save if users successfully make a payment.
However, I noticed that Square changes order id many times when payment/order updated trigger happens.
I haven’t found any unique id that I can detect from webhook, Do you guys know any way to detect unchanged id even though webhook triggered?
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:
Additional Documentation
Checkout API Overview
Payments API Integration
Checkout API Overview
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.
When a payment link is created the order won’t change unless its a subscription. Are these subscriptions? Do you have an example?
Nop. I use one time payment function.
This is the request I sent to “/v2/online-checkout/payment-links”.
Then I try to capture payment update webhook to detect if customers made a payment.
The current problem is what I got from “/v2/online-checkout/payment-links” order id is different what I got from webhook payment update’s order id,
-d ‘{
“checkout_options”: {
“allow_tipping”: false,
“ask_for_shipping_address”: false,
“enable_coupon”: false,
“redirect_url”: “https://google.com”
},
“description”: “this is sample page”,
“idempotency_key”: “463f7334-f961-4faf-9b77-9d829dbc5066”,
“quick_pay”: {
“location_id”: “LPF38W2R0RWH6”,
“name”: “Purchase date request”,
“price_money”: {
“currency”: “JPY”,
“amount”: 880
}
},
“pre_populated_data”: {
“buyer_email”: “[email protected]”,
“buyer_address”: {
“first_name”: “aaa”,
“last_name”: “bbb”
},
“buyer_phone_number”: “+8108023456789”
}
}’
Okay, this is sandbox testing, right? If so the sandbox experience isn’t a complete experience and this does happen with the order. In production the order_id
will be the same as the order_id
that’s returned in the CreatePaymentLink
request.