Card Payments

Cards are an incredible way of collecting payment from your customers. You can receive payments from Mastercard, Visa and Verve cards.

Authentication models

Authentication models are used for payment authentication i.e. confirming that a cardholder is actually performing a transaction. These help to prevent fraudulent transactions and build trust with your customers.

Alliance Pay processes card payments using 3DS auth model. With 3DS, the customer is redirected to an authentication page to input a code or password sent to their phone.

In a typical payment flow that utilizes 3DS:

  1. The merchant collects the customers card details and assign an order reference for the payment.
  2. Alliance Pay checks the transaction request and processes the payment.
  3. Where 3DS is
    1. Required, the customer is redirected to their bank's page for authentication.
    2. Not required, because auth_option is set to noauth, the customer is not redirected and the payment is completed automatically. This is also called the 3DS frictionless flow.

Collecting card payments using 3DS

Follow these steps to complete payment using 3DS:

  1. Create a request with the card information. This should include the card number, expiry date and CVV.
  2. Encrypt your request containing the customer's card information. We covered encryption in detail here.
  3. Send your request to the pay order endpoint.
  4. Redirect your customers to payment_detail.redirect_urlto complete the payment.

Here are samples to guide your implementation.

//unencrypted
{
   "reference":"ORD001",
   "payment_option":"C", //pass C as payment_option for card payments
   "country":"NG",
   "card":{
       "cvv":"101",
       "card_number":"5123450000000008",
       "expiry_month":"02",
       "expiry_year":"30"
   }
}
//encrypted
{
  "data": "B9pQJ1HoxybgfjNnEro+26w7lQZ6jriF3AFiUeGH2Ggacn6cF0srUlqiHEXeEncJcMw6ThDobjuS+AsmvhNfvGPGMddjbt5rcK2JrUnUI4cHk0XebJKoNnjEqivcyq0UKEMdYOLd6mYZtvKu5FMlpz0Lo0aMY49pnYvUGLSsCf/wOhlPx9PHgQDXptT+WBJcO3lzeD8O0S4IVSWPCWPLi7GhGlqhZpheEi1FHq39TCHk12hL3sqkkIktZIkkQVAe8AkwZGhy/CMJZrTzU6IXZr2ulT7mJenZljSk66m0pARcUqwMw/+5PEPECDo8SX3IkX2hmym02pGuWZeHE9ONWcaW7h8UIroQ/+kThz/RtP/UMiK3596cij66JcW+RcXKPiqNKysskcnaOlQFIFuhEiAczimLgd320RrQzehaw1C33UGsCzAG1p2EnDthjTF63BZtEhVlu9kN7qtFCz9AvojZeaZFKOxpJJ0usfwl9Hq5oAa56AFt/3IIsvqrAktTOyMgQ/jGQ6uhRYpA6UAH0CcYyv7L99hgVtRTXAxA/rpCtY7aTR9Pjxb5Lt1IV0Q1V8fWxAv0yY+ss07qeiSIsccsdJiN4LaMx3RvmDlu54XF68w51L34hOCDj/NBoPVUZrSaCJK2GPJ6CjOHI8q2/U2TkU+y+a80XCAC/rgqGhw="
}
{
   "data": {
       "card": null,
       "payment_detail": {
           "redirect_url": "https://core-staging.staging-alliancepay.io/ap-mpgs/api/v2/starttx?txref=ALPTDW05735543501704734934171",
           "recipient_account": null,
           "recipient_name": null,
           "payment_reference": "CPEF00BCF9-0FE7-4857-9825-48A8A84D0C06"
       },
       "bank_transfer_details": null,
       "order_payment": {
           "order_id": 463,
           "order_payment_reference": "PA-REF-B640EACF-BCFA-4B89-A984-47CF75A5CCA0",
           "currency": "NGN",
           "status_id": 1,
           "order_payment_response_code": "01",
           "order_payment_response_message": "pending-authenticaion",
           "order_payment_instrument": null,
           "remarks": "Order payment initiated",
           "total_amount": 250.00,
           "fee": 30.00
       }
   },
   "status": "success",
   "message": "Card order created successfully"
}