Braintree Local Payment Methods
This page provides an overview of the payments methods provided by the Braintree Local Payment Methods adapter in the IXOPAY platform. It also includes a full list of all configuration options available to you when integrating Braintree Local Payment Methods within your payments landscape, as well as an overview of the parameters required when submitting a transaction via IXOPAY's API.
Payment Methods
Payment Method | Transaction Flows | Transaction Types |
---|---|---|
Blik | payment.js | Debit, Refund |
Integration guide
Braintree requires you to display the PayPal Button on your Checkout page. This is handled by the payment.js integration.
1. Embed the payment.min.js in your page
<script data-main="payment-js" src="https://gateway.ixopay.com/js/integrated/payment.1.3.min.js"></script>
It is important to set the data-main="payment-js"
attribute on the script tag.
2. Provide a DIV element on your page for the Local Payment Method button
<div id='localPaymentButtonDiv'></div>
3. Initialize the payment.js with the following parameters:
- ID of the DIV element
- Javascript function to create a debit transaction and provide paymentId as transactionToken
- Javascript function to handle payment completion
- Javascript function to handle error events
- Javascript function to handle cancellation events
- Local Payment Method options (see example below)
<script>
var payment = new PaymentJs('1.3');
errorHandler = function (error) {
// handle error events here
}
cancellationHandler = function (data) {
// handle cancellation event here - called if user cancelled payment process
}
completeHandler = function (data) {
// handle completed transaction
}
paymentIdHandler = function (paymentId) {
// create a debit transaction including the paymentId in the request under the transactionToken parameter
}
let blikButtonDiv = document.getElementById('blikButtonDiv')
var localPaymentMethodOptions = {
paymentType: 'blik',
amount: '9.99',
currency: 'PLN',
firstName: 'Max',
lastName: 'Mustermann',
email: '[email protected]',
fallbackUrl: '[email protected]',
fallbackButtonText: 'Please retry'
};
payment.initBraintreeLocalPayment(
'public-integration-key',
blikButtonDiv,
paymentIdHandler,
completeHandler,
errorHandler,
cancellationHandler,
localPaymentMethodOptions
);
</script>
4. The transaction is created with a pending_postback status during the payment process by calling paymentIdHandler()
.
After the end customer has completed the payment, we rely on incoming webhooks from Braintree. Therefore, it can take up to 2 minutes
before we update the transaction status.