Card Payments

Integration Flow (mada, Visa, Mastercard)

Preparation

Insert the Card Library into your project to collect card details and obtain a “Token ID”

Save Card - with an Authorize Transaction

  1. Request for the Token ID from the Card Library
  2. Create an Authorize Request
    1. Pass the “Token ID” in the Source.
    2. Pass a small amount (1 SAR, 0.100 KWD, BHD)
    3. Apply Auto Void after 1 hour - To auto void the amount
    4. Pass 3DS as True - To Authenticate with 3DS
    5. Pass Customer Initiated as True
    6. Pass Save Card as True - To save the card after a successful card 3DS Authentication and Authorization.
    7. Pass the Customer ID - Generated by the customer API in the customer object.
    8. Pass the correct MID related to each country.
    9. Pass the Redirect URL to redirect back after the 3DS Authentication
    10. Pass the Post URL to pass the response after the 3DS Authentication
  3. Save the following details from the Authorize Response for future transactions.
    1. Authorize ID
    2. Authorize Status
    3. Card ID
    4. Customer ID
    5. Payment Agreement ID

Manage Cards - Saved for your Customers

Retrieve the List of Cards under the Customer with the List of Card API using the Customer ID.

Transaction - Charge with a Saved Card

  1. “Create a Token for a Saved Card” using the “Card ID”

    1. Pass Card ID
    2. Pass Customer ID
  2. Step 2 - Create a Charge

    1. Pass “Token ID” in the Source
    2. Pass the amount to Charge
    3. SAR currency is required for Mada
    4. Pass 3DS as False
    5. Pass Customer Initiated as False
    6. Pass Save Card as False
    7. Pass Customer ID
    8. Pass Payment Agreement ID
    9. Pass the correct MID related to each country.
    10. No Post URL is Optional but recommended to push the info to your backend. Note - you will receive an immediate response, since no authentication will be needed with a Saved Card linked to a Payment Agreement.
  3. Save the following details from the Authorize Response for future transactions.

    1. Charge ID
    2. Charge Status

Transaction - Authorize with a Saved Card

  1. “Create a Token for a Saved Card” using the “Card ID”

    1. Pass Card ID
    2. Pass Customer ID
  2. Create an Authorize

    1. Pass “Token ID” in the Source
    2. Pass the amount to Authorize
    3. Apply Auto Charge after X Hours (Recommended to apply “X” as your estimated delivery time plus a buffer,
    4. in order to void if necessary prior to the estimated delivery time. This will avoid the need to perform a Refund)
    5. Pass 3DS as False
    6. Pass Customer Initiated as False
    7. Pass Save Card as False
    8. Pass Customer ID
    9. Pass Payment Agreement ID
    10. Pass the correct MID related to each country.
    11. No Post URL is Optional but recommended to push the info to your backend. Note - you will receive an immediate response, since no authentication will be needed with a Saved Card linked to a Payment Agreement.
  3. Step 3 - Save the following details from the Response

    1. Authorize ID
    2. Authorize Status
  4. Step 4 (Only if you want to Void an Authorize) - Create a Void

    1. Authorize ID