Payment Completes but also returns 404 - Live (API - Complete Payment)

I’m getting the following error when completing a payment in Live, although the payment is completing successfully (card is charged, order appears in seller dashboard):

Raw error: { “errors”: [ { “category”: “INVALID_REQUEST_ERROR”, “code”: “NOT_FOUND”, “detail”: “Resource not found.” } ] }

We create an order successfully, make payment with location successfully, but then the complete payment call returns a 404 even though the payment actually completes successfully.

That is odd. What’s your application Id and whats the payment_id for the successful payment?

Hi Brian. The application ID is: sq0idp-Ma4zHT_Fb7vtHT5G6whDIw
From what I can tell I didn’t get a payment id (which makes this even stranger). The last error occurred at: 6/7/2021, 3:36:22 PM (CST) if that helps. Thanks for looking into this!

Looking at the logs it looks like the customer_id was null and this is why the error was returned. Was this payment created with a token generated from the SqPaymentForm or Web Payments SDK?

Thanks Brian. The customer ID would have been blank as it was a guest user - is this not allowed? The nonce was from the SqPaymentForm.

Hi @Bryan-Square - Just checking to see if you have any more info on this. Thanks!

Hi @joel.h, looking at the logs for the app_id that you provided I see two calls to /v2/payments/{payment_id}/complete that resulted in a BAD_REQUEST. Also there are two payments that took place just about the exact time as the bad requests. They were successful and I see that autocomplete wasn’t set for those payments. Are you using autocomplete? If not there isn’t a need to use CompletePayment. :slightly_smiling_face:

I wasn’t explicitly setting autocomplete, but looking at the doc it defaults to true (which is “interesting”). This setup has been working fine with sandbox. Now I’m not getting a payment.status or a payment.card_details.status back from the Create payment call (https://connect.squareup.com/v2/payments) to verify that it’s COMPLETED or CAPTURED - I’m just getting empty values back in the response with a successful payment.

Do you have the payment_ids that didn’t show the details? The status and card details are supposed to be in the response.

I wasn’t getting a payment_id back either. I looked deeper into the response definition and there was an issue there. The original issue was resolved by not performing the “Complete payment” call (as the “Create payment” defaulted to autocomplete=true), and the other issues were related to an invalid response body definition. Thanks for your help on this Brian!