Configuring Boleto
Learn how to configure Boleto for DigitalRiver.js with Elements.
Last updated
Learn how to configure Boleto for DigitalRiver.js with Elements.
Last updated
If you're using DigitalRiver.js with Elements, you can create a Boleto payment method for your app or website in three easy steps:
Build the Boleto Source Request and Details object. The Boleto Source Request object requires the following fields:
Field | Value |
---|---|
Use the Boleto Source Details object code sample.
The Boleto Source Details object requires the following fields:
Use the DigitalRiver.js library to create and mount elements to the HTML container.
The address
object must contain postal code and state/province data that adheres to a standardized format using the state
attribute. Note that the state
attribute listed below corresponds to the countrySubdivision
attribute used when providing address information. The payment session manages the correct field name on the backend.
Once authorized, you can use the source by attaching it to a cart.
To use Boleto as a payment method:
Optional. Set the locale and currency.
curl --location --request GET 'https://{host}/v1/shoppers/me.json?locale=pt_BR¤cy=BRL' \
--header 'Content-Type: application/json'
--header 'authorization: bearer ***\
Optional. Set the the cart address to the BR address.
Attach the tax ID to the cart. This action inserts the tax ID into the payment session.
Create a Boleto source with a payment session ID. Note that the tax ID is required when creating the Boleto source. The payment session ID provides the tax ID.
Field | Required/Optional | Description |
---|---|---|
type
boletoBancario
sessionId
The payment session identifier.
owner
An Owner object.
boletoBancario
A Boleto Source Details object.
returnUrl
Required
If you choose to use the full redirect flow, this is where you will redirect your customer to after authorizing or canceling within the Boleto experience.
nationalId
Required
If the shopper is an individual buyer, nationalId
represents their CPF tax ID. If the shopper is a business shopper, nationalId
represents their CNPJ tax ID. Use the DigitalRiver.js Tax Identifier element to collect these from the shopper.