DreamPay API - Web Integration 

Integrate DreamPay  with your website to start accepting online payments from your customers holders of Brazilian credit cards. Our standard checkout provides all the essential features for integrating DreamPay Checkout with the client-side of your application. This is available only for web-based integrations.

1. Pre-requisites

a.      In order to use the DreamPay API for web integration of DreamPay you need to have a partner account. If you still don’t have one, please register at https://linkgenerator.dreampay.com.br


2. API URL’s

a.       You can find the DreamPay API at https://api.dreampay.com.br/

b.       You can find the DreamPay API Open Api at https://api.dreampay.com.br/docs/

3. API authentication

a.       The authentication is made by sending in the header of all requests the key “ApiKey” where the value is found on your account profile   page.

 

4. Flow steps

a.    Generate payment link

                               i.      As a first step to integrate DreamPay payments in your checkout flow you need to generate a payment link by making a POST                  request to /api/PaymentLinks

				
					{
  "establishmentID": 1001
  "customerName": "Your customer name",
  "customerEmail": "customer-email@gmail.com",
  "customerPhoneNumber": "+351919191919 - optional",
  "orderNumber": "136",
  "value": 29.99,
  "currencyCode": "EUR",
  "observations": "Some description - optional",
  "callbackUrl": "https://calbackurl.pt/endpoint - optional",
  "returnUrl": "https://return.url - optional"
}
				
			

                                                               

                                   ii.      The establishmentID it’s the 4 digit number that can be found in your contract, by checking the Terms and Conditions in your profile page.

 

b.       Send customer to payment page

                                                               i.      As a second step you should forward your customer to the payment link received in the previous step. You can open it in a modal window, an iframe or in a new window.

 

c.       Display result of payment

                                                               i.      The result of the payment is displayed in the DreamPay payment page. You can provide a returnUrl to forward the customer to a “Thank you” page or “My account” page to achieve a better user experience.

                                   ii.  You can check the status of the payment by making a GET request to /api/PaymentLinks/{id} 

                                                              iii. You can provide a callbackUrl to receive a confirmation of the payment.                          

				
					interface CallbackMessage {
    apiKey: string;
    paymentLink: string;
    status: string;
    message: string;
    integrationId string;
} 
				
			

 

                                                               iv.  You can get a list of all payment links that you generated by making a GET request to /api/PaymentLinks/establishment/{establishmentId}

 

5. Other methods available

a.    List of payment links

                                                               i.      You can get a list of all payment links that you generated by making a GET request to /api/PaymentLinks/establishment/{establishmentId}

b.       Check payment link status

                                                               i.      You can check the status of the payment by making a GET request to /api/PaymentLinks/{id}

6. Tests and Sandbox

a.       You can find the DreamPay API test environment at https://dev-api.dreampay.com.br

b.       You can find the DreamPay API test environment Open Api at https://dev-api.dreampay.com.br/docs/

c.         You can find the DreamPay Linkgenerator test environment at https://dev-linkgenerator.dreampay.com.br

Before accepting live payments, you can use the following test card numbers to test your integration.

These card numbers are only valid on our test platform, and will not result in a real transaction or transfer of funds.

                 Flag                                            Type                                                           Card Number                                       Expire Date                CID         
MastercardDébito5277696455399733jan/35123
MastercardCrédito5448280000000007jan/35123
Mastercard (BIN 2)Débito2223000148400010jan/35123
Mastercard (BIN 2)Crédito2223020000000005jan/35123
VisaDébito4761120000000148jan/35123
VisaCrédito4235647728025682jan/35123
HipercardCrédito6062825624254001jan/35123
HiperCrédito6370950847866501jan/35123
DinersCrédito36490101441625jan/35123
JCBCrédito3569990012290937jan/35123
JCB (19 dig)Crédito3572000100200142753jan/35123
CredzCrédito6367600001405019jan/35123
EloCrédito4389351648020055jan/35123
AmexCrédito371341553758128jan/351234
CabalCrédito6042034400069940jan/35123
SorocredCrédito6364142000000122jan/35123
CredsystemCrédito6280281038975334jan/35123
BanescardCrédito6031828795629272jan/35123
 Flag     Type                Card Number              Expire Date       CID         tokenCode          tokenCryptogram
VisaCrédito4895370010000005jan/351234830442035272279
ou
4830447374649789
ou
4894093711004024
AgAAAAAAAIR8CQrXSohbQAAAAAA=
VisaDébito4824810010000006jan/351234894092622280160
ou
4894096020766258
ou
4894094167345770
AAABAkkREQAAAAAAAAAAAAAAAAA=
Mastercard (BIN 2)Crédito2223000250000004jan/35123*ANbuvvxnDbK2AAEShHMWGgADFA==
Mastercard (BIN 2)Débito5204970000000007jan/35123*AOPAIMgflr8UAAIShHMWGgADFA==

Card Number                        Expiry Date      CID

4110110043597521             03/2030           123

370000000000002               03/2030           7373

4003550000000003             03/2030           737

4360000001000005             03/2030           737

4166676667666746             03/2030           737

4000620000000007             03/2030           737

4293189100000008             03/2030           737

6703444444444449             03/2030           797 

To simulate error codes, simply send transactions with the values ​​corresponding to the error codes, as shown in the table below::

Error CodeAmountReturn Message
5353Transaction not allowed for the issuer. Contact Rede.
5656Error in reported data. Try again.
5757affiliation: Invalid merchant.
5858Unauthorized. Contact issuer.
6969Transaction not allowed for this product or service.
7272Contact issuer.
7474Communication failure. Try again.
7979Expired card. Transaction cannot be resubmitted. Contact issuer.
8080Unauthorized. Contact issuer. (Insufficient funds).
8383Unauthorized. Contact issuer.
8484Unauthorized. Transaction cannot be resubmitted. Contact issuer.
100100Please contact issuer.
101101Unauthorized. Problems on the card, contact the issuer.
102102Unauthorized. Check the situation of the store with the issuer.
103103Unauthorized. Please try again.
104104Unauthorized. Please try again.
105105Unauthorized. Restricted card.
106106Error in issuer processing. Please try again.
108108Unauthorized. Value not allowed for this type of card.
109109Unauthorized. Nonexistent card.
110110Unauthorized. Transaction type not allowed for this card.
111111Unauthorized. Insufficient funds.
112112Unauthorized. Expiry date expired.
113113Unauthorized. Identified moderate risk by the issuer.
114114Unauthorized. The card does not belong to the payment network.
115115Unauthorized. Exceeded the limit of transactions allowed in the period.
116116Unauthorized. Please contact the Card Issuer.
117117Transaction not found.
118118Unauthorized. Card locked.
119119Unauthorized. Invalid security code.
121121Error processing. Please try again.
122122Transaction previously sent.
123123Unauthorized. Bearer requested the end of the recurrences in the issuer.
124124Unauthorized. Contact Rede.
204204Cardholder not registered in the issuer’s authentication program.
899899Unsuccessful. Please contact Rede.
30253025Deny Category 01: This card should not be used
30263026Deny Category 02: This card should not be used in this PV
30273027Deny Category 03: No cards must be used in this PV
RETURN MESSAGE

The following table shows the Transaction Statuses, that  are defined by the FINAL NUMBER of each card, and the ReturnCode:

END OF CARD
TRANSACTION STATUS
RETURN MESSAGE
XXXX.XXXX.XXXX.XXX0
200
Payment made successfully
XXXX.XXXX.XXXX.XXX1
200
Payment made successfully
XXXX.XXXX.XXXX.XXX4
200
Payment made successfully
XXXX.XXXX.XXXX.XXX2
400
Not Allowed
XXXX.XXXX.XXXX.XXX3
400
Expire Card
XXXX.XXXX.XXXX.XXX5
400
Blocked Card
XXXX.XXXX.XXXX.XXX6
400
Time Out
XXXX.XXXX.XXXX.XXX7
400
Card Canceled
XXXX.XXXX.XXXX.XXX8
400
Credit Card Problems

Test card Card 4110.1100.4359.7521 , for example, will simulate “Payment made successfully”.

Attention:

The sandbox environment evaluates the format and the end of the card.

If a real card is sent, the result of the operation will be identical to that described in the above table.

Add Your Heading Text Here

xxxx.xxxx.xxx0

xxxx.xxxx.xxx0

xxxx.xxxx.xxx0

Add Your Heading Text Here

Add Your Heading Text Here

Rolar para cima
× Como podemos ajudar?