Partial payment using gift card failing

I am facing issues with partial payment implementation using gift card.

On the Sandbox I made a request for partial payment with gift card which responded with APPROVED (payment id: Xdx6fGz0tmqV0aMY0fm6PIjLSxIZY). Then I sent another payment request using Credit Card which was declined (payment id: J8W1wqyHf076JxeusCPAFxWB0xNZY). I followed this with another payment request which was also APPROVED (payment id: 5WvhwsxiaWALKC6qXwEafnFqwQ7YY ).

But when I pass the paymentIDs to the Order Pay API, I get the response :slight_smile:

{“errors”: [{“code”: “BAD_REQUEST”,“detail”: “The card payment attached to the order must be AUTHORIZED: Xdx6fGz0tmqV0aMY0fm6PIjLSxIZY”,“category”: “INVALID_REQUEST_ERROR”}]}

This is happening only when there is card payment failure in between successful payment by giftcard and another successful payment by credit card.

Hi @anupbalagopal welcome to the forums!

Shortly after Xdx6fGz0tmqV0aMY0fm6PIjLSxIZY was created (about 11 seconds after creation), I see a call to the CancelPayment endpoint with the same application id (sandbox-sq0idb-qpV8EEySEZZlifIftzEPYQ), which caused it to be canceled, which means it can’t be used to pay for an order. This happened about 10 seconds before your call to PayOrder, so it sounds like your application canceled the payment prior to the order payment. Please let me know if I misunderstood or if you have additional questions!

Edited my last comment. Its a bug at my end. Thank you for your help.

1 Like