Checkout - flow

The Standard Checkout for card payments allows you to quickly accept secure, 3D Secure (3DS) card transactions via a hosted Alexpay payment page. This is the fastest integration method, requiring minimal backend logic while ensuring PCI‑compliant card processing.

  1. Initialize the Payment: Your backend sends a POST request to the Payment Initialization endpoint with card as the selected payment method.

  2. Redirect the Customer: Upon a successful request, we’ll return a unique link for the payment page. Redirect your customer to this page to complete their payment.

  3. Customer Completes 3DS Authentication: The customer is guided through their issuer’s authentication flow (OTP, PIN, push approval, etc.).

  4. Customer Redirect After Payment:Alexpay redirects the customer to your redirect_url after the transaction is completed.

  5. Verify Payment Status: Your backend should query the Payment Status endpoint and/or confirm the result via webhook.

Step 1: Initialize the Payment

Send a server‑side POST request to the payment initialization endpoint.

POST /v1/payment/init

Name
Type
Description

secret-key

string

Your Alexpay secret key

public-key

string

Your Alexpay public-key

{
    "amount":120,
    "country":"GH",
    "currency":"GHS",
    "method":"card",
    "narration":"Test Narration",
    "operator":"mpgs",
    "redirect_success_url":"https://alexpay-mpgs.vercel.app/api/confirm",
    "redirect_failed_url":"https://alexpay-mpgs.vercel.app/api/failed",
    "webhook_url":"{{webhook_url}}",
    "integration_type":"DIRECT_API"
}

Request body

  • amount (number): The amount of the payment.

  • country (string): The country for the payment.

  • currency (string): The currency for the payment

  • method (string): The payment method to be used.

  • operator (string): mpgs — Mastercard Payment Gateway Services.

  • narration (string): Description or reason for the payment.

  • redirect_success_url / redirect_failed_url(string): Customers are redirected here after payment.

  • integration_type(string): DIRECT_API — tells the system this is a backend-driven integration, not a hosted checkout-only flow.

Step 2: Redirect the Customer

Upon a successful request, we’ll return a paymentLink for the payment page. Redirect the customer to this URL in your browser or mobile app.

Response

On this page, Alexpay handles:

  • Card input

    • 3D Secure authentication

    • Fraud checks

    • Payment processing

Step 3: After the Payment

Once the customer finishes the card payment:

  1. Customer Redirect: The customer is sent back to your redirect_url with the relevant identifiers (e.g., redirect_success_url).

  2. Query Payment Status: Your server should call the Payment Status endpoint to confirm the final state of the transaction (e.g., success, failed, pending).

  3. Receive Webhook Notification: Alexpay automatically sends a webhook to your configured webhook URL whenever the transaction status changes.

Last updated