With User Interface

Requirements:

1. Create a Deposit

It must be a deposit for a credit or debit card payment method and within the OneShot Experience, therefore all the required payer information should be included in the request. Additionally, merchants opting to use our Cards SDK should send the parameter token_requested with value true.

Example request

{
    "invoice_id" : "1000000001",
    "amount": "1000",
    "country": "MX",
    "currency": "MXN",
    "payer": {
        "id": "11",
        "document": "CURP4321TEST",
        "first_name": "Ricardo",
        "last_name": "Carlos",
        "email": "juanCarlos@hotmail.com"
    },
    "payment_method": "VI",
    "client_ip": "123.123.123.123",
    "back_url": "https://www.d24.com/deposit_cancelled",
    "success_url": "https://www.d24.com/deposit_completed",
    "error_url": "https://www.d24.com/deposit_error",
    "notification_url": "https://www.d24.com/d24/notify",
    "token_requested":true
}

Example response

{
    "checkout_type": "ONE_SHOT",
    "redirect_url": "https://pay.depositcheckout.com/validate/4BmNaZNydAokLUzAg2jbCrzqBsyyBTVV",
    "deposit_id": 981624749,
    "user_id": "11",
    "merchant_invoice_id": "1000000001",
    "payment_info": {
        "type": "CREDIT_CARD",
        "payment_method": "VI",
        "payment_method_name": "Visa",
        "amount": 1000.0,
        "currency": "MXN",
        "expiration_date": "2024-04-11 18:11:11",
        "created_at": "2024-04-11 18:01:11"
    },
    "checkout_token":"4BmNaZNydAokLUzAg2jbCrzqBsyyBTVV"
}

The checkout_token contains the information within the context of the generated deposit. This information will be decrypted and consumed by the SDK in order to adequate the checkout experience.

2. Instantiate Cards SDK

Now you need to instantiate the already installed Cards SDK. Here you will find all the technical aspects within instantiation. Remember to retrieve your publicKey from the Merchant Panel, and define the proper environment.

3. Display the Cards SDK component

Now you can display the CreditCardForm. In order to do so, you need to send in the authToken parameter, the value obtained in the checkout_token of the first step alongside the rest of the parameters (country, onTokenGenerationError and onBack).

The component will take care of the deposit creation by collecting the payer's credit card, and then processing the transaction with the acquirer.

4. Retrieve the Deposit final status

Everytime that the deposit changes it's status, you will receive a webhook notification with the deposit_id for you to retrieve the Status.

Once the user clicks in the Complete button, we will process the transaction and you will receive such webhook.

Last updated