commercelayer / dashboard-apps

Commerce Layer's Dashboard applications.
https://dashboard.commercelayer.io
MIT License
0 stars 3 forks source link

Manage pending orders with transactions in the order app #145

Closed marcomontalbano closed 6 days ago

marcomontalbano commented 1 week ago

closes commercelayer/issues-app#190 closes commercelayer/issues-app#238

What I did

"If an authorization or capture succeeded, but the associate order is still pending, it can happen that the order is updated and its total amount differs from the authorized or captured one. In this case, you must reset the related transaction by patching it (you need to use integration API credentials on the specific transaction type endpoint) with the _cancel trigger attribute set to true. At the end of the process, the order payment status will still be unpaid so that the payment can be completed with a different payment source." api-reference

This PR aims to manage the above situation.

Screenshot 2024-11-08 alle 16 10 08

You can try to place the order. Placing the order could fail for different reasons (e.g. authorization to old, order has been change in the meantime).

If "place" fails you can cancel the payment. In this case the order moves back to unpaid and the "checkout link" button becomes visible.

netlify[bot] commented 1 week ago

Deploy Preview for commercelayer-dashboard-apps ready!

Name Link
Latest commit 286beaffe98c7ccb80c7a28069e9fa0e174d19be
Latest deploy log https://app.netlify.com/sites/commercelayer-dashboard-apps/deploys/6731df862d0d4e0008c93ef0
Deploy Preview https://deploy-preview-145--commercelayer-dashboard-apps.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.