paytrail/api-documentation

Handling pending and delayed status when immediate confirmation is required

ap4135543 opened this issue · 2 comments

According to Checkout documentation, once payment is completed the "checkout-status" sent to redirectUrls.success and callbackUrls.success can also be "pending" and "delayed" (instead of "ok"). What if immediate payment confirmation is required and such a "maybe ok" answer is not good enough? E.g. we cannot deliver goods until payment is confirmed, but due to time constrains, delivering goods later on (after payment has truly been confirmed) is not possible. So if the status is anything else than "ok", the payment process has effectively failed. What to do in such a situation? Refund immediately? Refund after receiving "ok" sometime (possibly much) later to the callbackUrls.success? It would be great if the "Payment create" API call could have a new feature: a flag that if enabled, then "pending" and "delayed" are not possible statuses and Checkout backend would handle all that is necessary to cancel the payment and then just call redirectUrls.cancel and callbackUrls.cancel.

This relates closely to my newly created issue #27

Hi @ap4135543

When pending or delayed is received and the desired outcome is to cancel the payment if it ever is confirmed, the correct way to handle this is to then make a refund call if an ok-status is later received.

While I understand the need for your suggestion, this is not technically feasible for us at the moment so the implementation you suggest here will probably not happen in the forseeable future.