e-Wallet
Digital Wallets or e-Wallets are cards repositories and payment data for online customers. The e-wallets allows customers to use a single sign-in to make purchases on the web.
Workflow
-
Customer fills and submits all necessary payment information to the merchant server.
-
The merchant submits to
/transactions
to create the transaction. -
PagSeguro creates an order and returns the Transaction Code and Payment URL to the merchant.
-
The merchant redirects the customer to PagSeguro's Payment URL.
-
The customer accesses the Payment URL and pays the transaction through the payment method website.
-
After the success in the payment flow, the customer will be redirected to Merchant's Success URL. If the customer cancels the process, he/she will be redirected to Merchant's Fail URL.
Creating an e-Wallet Payment
To create an e-wallet payment method, make a POST
request as the example.
Request
Production URL:
https://api.boacompra.com/transactions
Method: POST
Sandbox URL:
https://api.sandbox.boacompra.com/transactions
Method: POST
Example of a request using e-Wallet
{
"transaction": {
"reference": "REF-XXX-1539093014330",
"project-number": 1,
"country": "BR",
"currency": "BRL",
"checkout-type": "direct",
"notification-url": "https://billing.checkout.com/processing",
"language": "pt-BR",
"redirect-urls": {
"success": "https://billing.checkout.com/direct?return=1",
"fail": "https://billing.checkout.com/direct?cancel=1"
}
},
"charge": [
{
"amount": 100.00,
"payment-method": {
"type": "e-wallet",
"sub-type": "pagseguro"
}
}
],
"payer": {
"name": "John Doe",
"email": "[email protected]",
"birth-date": "1988-12-25",
"phone-number": "+5511987654321",
"document": {
"type": "CPF",
"number": "98765432101"
},
"address": {
"street": "Rua Teste",
"number": "1102",
"complement": "AP 302",
"district": "Bairro dos Testes",
"state": "PR",
"city": "Maringá",
"country": "BR",
"zip-code": "87030000"
},
"ip": "200.221.118.80"
},
"shipping": {
"cost": 0,
"address": {
"street": "Rua Teste",
"number": "1102",
"complement": "AP 302",
"district": "Bairro dos Testes",
"state": "PR",
"city": "Maringá",
"country": "BR",
"zip-code": "87030000"
}
},
"cart": [
{
"quantity": 1,
"description": "Calça Jeans",
"category": "Collectibles",
"type": "physical",
"unit-price": 1
}
]
}
Request Parameter List
Parameter | Description | Type | Size | Mandatory |
---|---|---|---|---|
transaction | Set of general transaction's information | Object | - | Yes |
transaction.reference | Merchant transaction identifier | String | Up to 64 | Yes |
transaction.project-number | Merchant project identifier. Default value is 1 | Integer | - | No |
transaction.country | Country of the payment. Accepts only BR | String | 2 | Yes |
transaction.checkout-type | Checkout type of the transaction. Accepts only direct | String | - | Yes |
transaction.notification-url | URL (must bind ports 80 or 443) used to send transaction status changes notifications by HTTP | String | Up to 200 | Yes |
transaction.language | Language used. Accepts pt-BR, en-US, es-ES, pt-PT and tr-TR | String | 5 | Yes |
transaction.redirect-urls | Set of URL used after finishing the payment on e-wallet's page | Object | - | Yes |
transaction.redirect-urls.success | URL used fater finishing the payment on e-wallet's page | String | Up to 200 | Yes |
transaction.redirect-urls.fail | URL used when the customer cancels the process on e-wallet's page | String | Up to 200 | Yes |
charge[] | Set of payments. Currently accepting just one payment | Array | 1 | Yes |
charge[].amount | Amount of the transaction. Separating cents by point, with two decimal places. Amount sum must be equal to shipping.cost plus cart items value | Double | Min of 0.01 | Yes |
charge[].payment-method.type | Payment Method type (credit-card, postpay, e-wallet or eft) | String | - | Yes |
charge[].payment-method.sub-type | Payment Method sub-type. Available payment methods (see more) | String | - | Yes |
payer | Set of customer's information | Object | - | Yes |
payer.name | Customer name | String | Up to 50 | Yes |
payer.email | Customer e-mail | String | Up to 60 | Yes |
payer.birth-date | Customer birth date. ISO-8601 Pattern (YYYY-MM-DD) | String | - | No |
payer.phone-number | Customer phone number. e.g (+5544999884455) | String | - | No |
payer.document.type | Customer document Type. accepts: cpf and cnpj | String | - | Yes |
payer.document.number | Customer identification document. No special characters allowed. | String | - | Yes |
payer.ip | Customer IP. accepts IPv4 or IPv6 | String | - | Yes |
payer.address | Customer address object | Object | - | No[1] |
payer.address.street | Customer address street | String | 1-160 | Yes |
payer.address.number | Customer address number | String | 1-20 | Yes |
payer.address.complement | Customer address complement | String | Up to 40 | No |
payer.address.district | Customer address district | String | 1-60 | Yes |
payer.address.state | Customer address state or province | String | 2 | Yes |
payer.address.city | Customer address city | String | 1-60 | Yes |
payer.address.country | Customer address country (country iso 2) | String | 2 | Yes |
payer.address.zip-code | Customer address zip code | String | 8 | Yes |
shipping | Set of information that will be used to deliver the items in cart (see more) | Object | - | No[1] |
shipping.cost | Shipping cost. Separating cents by dot, with two decimal places | Double | Min of 0.01 | Yes |
shipping.address.street | Shipping address street | String | 3-160 | Yes |
shipping.address.number | Shipping address number | String | 1-20 | Yes |
shipping.address.complement | Shipping address complement | String | 5-40 | No |
shipping.address.district | Shipping address district | String | 4-60 | Yes |
shipping.address.state | Shipping address state or Province | String | 2 | Yes |
shipping.address.city | Shipping address city | String | 3-60 | Yes |
shipping.address.country | Shipping address country (country iso 2) | String | 2 | Yes |
shipping.address.zip-code | Shipping address zip Code | String | 8 | Yes |
cart[] | Set of items (at least one Item) | Array | Min of 1 | Yes |
cart[].quantity | Item quantity | Integer | Min of 1 | Yes |
cart[].description | Item description | String | 1-200 | Yes |
cart[].unit-price | Price per unit. Separating cents by dot, with two decimal places | Double | Min of 0.01 | Yes |
cart[].type | Item type - must be one of the following: digital , physical , service , subscription | String | - | Yes |
cart[].category | Item category | String | 1-64 | No |
[1] Required when cart[].type is physical
Some considerations about the payer name:
- Maximum length of 50 characters
- Minimum two words
- Each word must be separated by ONE space
- The first and last word must have at least 2 characters long
- Middle words can have only one character
- Accepted characters: A to Z, uppercase and/or lowercase letters
- Special characters accepted: éíóúãõâêôàèìòùäëïöüçñÁÉÍÓÚÃÕÂÊÔÀÈÌÒÙÄËÏÖÜÇÑ&/'.-
Some considerations about the payer email:
- On the local-part (before the @), only alphanumeric characters and the special characters - + . _ are allowed.
Some considerations about the payer birth-date and payer phone-number:
- Required parameters for fraud analysis to chargebacks susceptible payment types.
- Payment type susceptible to chargebacks:
- credit-card
- e-wallet
Response
Example of a response using e-Wallet
{
"transaction": {
"code": "111115949",
"reference": "REF-XXX-15390930143123",
"amount": 100.00,
"status": "PENDING",
"currency": "BRL",
"country": "BR",
"payer-email": "[email protected]",
"date-created": "2018-10-09T10:50:09.422046071-03:00",
"payment-url": "https://gateway.boacompra.com/ewallet.php?token=B47818A1788C8DF39ECB"
}
}
Response using e-Wallet
The response body for this request is slighty different from other payment methods. The customer needs to be redirected to the e-wallet's page in order to finish the purchase.
Response Parameter List
Property | Description | Type | Size | Format |
---|---|---|---|---|
transaction.code | PagSeguro´s reference | String | Up to 36 | e.g.: 111181153 |
transaction.reference | Merchant´s reference | String | Up to 64 | XXX-XXX-XX-XXXXXXXXXX |
transaction.amount | Transaction Amount | Number | - | e.g.: 50.0 |
transaction.status | Current status (see more) | String | - | e.g.: PAID |
transaction.currency | Currency transaction | String | 3 | e.g.: BRL |
transaction.country | Country transaction | String | 2 | e.g.: BR |
transaction.payer-email | Payer email | String | Up to 60 | e.g.: [email protected] |
transaction.date-created | Date of creation | String | - | e.g.: 2018-10-10T14:39:32.991217999-03:00 |
transaction.payment-url | e-Wallet's page URL | String | - |
Available Payment Methods
Brazil
PagSeguro
Type: e-wallet
Sub-type:pagseguro
PagSeguro wallet gives your customers a simplified and secure checkout experience that allows them to make payments using credit cards issued in Brazil with installments. The service provide to customer make purchases adding their card of choice, using saved credit cards or available account balance.
PayPal
Type: e-wallet
Sub-type: paypal
PayPal is an e-wallet solution popular worldwide. The service allows the customer to make purchases, add their card of choice, using saved credit cards or available account balance.
PagBank
Type: e-wallet
Sub-type: pagbank
PagBank e-wallet gives your customers a simplified and secure checkout experience by allowing them to make payments using their PagBank account balance through the PagBank mobile application.
There are two user experience scenarios, depending on the user device:
Scenario 1 - User experience via Mobile:
- The user chooses the option "Pagar com PagBank";
- They are redirected to a PagSeguro Payment Page with a PagBank button to complete the payment;
- Once the user clicks on "Pagar com PagBank", they are redirected to the PagBank application, and;
- After logging at the account, the user confirms the payment;
- If there are enough funds, the transaction is completed!
Scenario 2 - User experience via Desktop:
- The user chooses the option "Pagar com PagBank";
- They are redirected to a PagSeguro Payment Page with a QR Code and instructions to complete the payment;
- The user logs in to their PagBank account in the mobile application and choose the option "Pix/QR Code";
- The user selects "Pagar com QR Code";
- They scan the QR Code provided on the Desktop (also sent by email), and;
- Confirms the payment details;
- If there are enough funds, the transaction is completed!
Updated almost 2 years ago