Use Case:
The user enters the amount on the checkout page OR the amount changes on the checkout page and the merchant doesn't want to refresh the Copy and Pay widget.
Is it possible for the merchant to change the amount without generating a new checkoutID?
Solution:
It is possible to implement this, it requires the merchant to trigger a server-to-server call before submitting the widget.
Once the widget is loaded, and the user clicks submit (at which point we assume the final amount is known) an event can be triggered before the form is submitted.
The events triggered for different payment methods are listed here:
API reference: https://peachpayments.docs.oppwa.com/widget-api
Events of relevance: onBeforeSubmitCard, onBeforeSubmitDirectDebit, onBeforeSubmitOnlineTransfer, onBeforeSubmitVirtualAccount
As these events are triggered the merchant must execute the following steps:
- Post the new amount to /checkouts/{id},
- Receive a successful response from Peach Payments server
- Continue with submitting to /checkouts/{id}/payment
If the response in step 2 is not successful then you must abort the payment process on your end.
The merchant should already have the checkoutId for the current request (similar to E366DFBC17F56D051F1F4A9A6B1FBD06.sbg-vm-tx02)
In the steps below replace {id} with your checkoutID i.e. in our example this would be E366DFBC17F56D051F1F4A9A6B1FBD06.sbg-vm-tx02
The URLs listed below are relative and depending on the test or live system would be added to the following hosts:
Updated to this article - change of endpoint:
Environment | Current Domain |
Production | https://card.peachpayments.com/ |
Customer Test (Staging) | https://sandbox-card.peachpayments.com/ |
Once you have completed the steps outlined above please ensure you have checked all your API calls have been updated to/are using the new endpoint.
FAQ’s around the Endpoint Change:
All credit card tokens are shared on card.peachpayments.com
Yes, this will have no impact on any tokens that have been created or any new tokens.
Is the same data shared on card.peachpayments.com?
Yes, the same data is shared and available.
With regards to transactions we see on BIP, is this data also shared?
Yes, it’s the same BIP and Console, there is no difference.
Deadline - End of September 2023 the current endpoint oppwa.com will be deactivated/redundant
https://peachpayments.freshdesk.com/a/solutions/articles/47001213445?portalId=47000077094