Accepting local payments
How to support Braintree local payments
Last updated
How to support Braintree local payments
Last updated
You want to allow your customers to checkout with the Braintree-supported . You've properly your account in the Braintree control panel and integrated their client . You now need to set up the payment source in order to support the different local payment workflows.
The first steps to setup local payments are similar to the standard ones, with the only notable difference you need to set the local
attribute as true
when you create the payment source.
After that, paths differ based on two possible scenarios — whether the customer is or .
Assuming the customer goes back to your checkout application, you need to update the payment source with the payment_method_nonce
returned by Braintree as with standard payments.
Then you have just to update the order with the _place
attribute in order to complete the payment.
If the customer doesn't return to your checkout application, you need to follow a slightly different workflow:
Monitor the order's status, since our webhook will update the payment source with the payment_method_nonce
, place the order, and — upon successful response by Braintree — capture and approve it in a single step.
The following request creates a Braintree payment object and associates it with the order identified by the "qaMAhZkZvd" ID:
The following request updates the Braintree payment source identified by the "vdDEAsZYzR" ID with the payment_id
received from the client:
Configure to notify Commerce Layer about the payment results — to do that, use the webhook_endpoint_url
exposed by the Braintree gateway resource.
Update it with the payment_id
returned by the client , in order to let our webhook find and update the payment source used for the payment.
See our documentation if you need more information on how to and or if you need to learn more about .