Charging from your Backend

Send bank details, PIN, OTP etc from your backend

🚧

Important Note

We strongly discourage passing card information directly to the API as it means your integration is directly handling card information. Even if you do not store any cardholder data, we only help simplify PCI compliance for you if you have integrated with Inline, Standard or our mobile SDKs.

If you are PCI-DSS certified and would like to be able to send cardholder information directly to our APIs from your servers, reach out to us! and we'll provide our API endpoints and guide on how to go about this.

WIthout PCI-Compliance, you can send bank or authorization details directly to our API for charging.

Logic

Send email, amount, metadata, or authorization code or bank, pin etc to our Charge endpoint as available to start. Based on the status, take an action as described in the statuses section.

{
  email:"[email protected]",
  amount:"10000",
  metadata:{
    custom_fields:[
      {
        value:"makurdi",
        display_name: "Donation for",
        variable_name: "donation_for"
      }
    ]
  },
 bank:{
      code:"057",
      account_number:"0000000000"
  },
 birthday:"1995-12-23"
}

Endpoints

  1. Tokenize
  2. Charge
  3. Submit PIN
  4. Submit OTP
  5. Submit Phone
  6. Submit Birthday
  7. Check pending charge

Statuses

Any of the endpoints numbered 1-6 can give any of the statuses below. Check the data.status key.

  1. data.status = pending
  1. data.status = timeout
  • action to take: no remedy, you may start a new charge after showing data.message to user
  1. data.status = success
  • action to take: Give value after checking to see that all is in order.
  1. data.status = send_pin
  • response will include data.display_text
  • action to take:
    • show data.display_text to user with input for PIN
    • call Submit PIN with reference and PIN
  1. data.status = send_phone
  • response will include data.display_text
  • action to take:
    • show data.display_text to user with input for Phone
    • call Submit Phone with reference and phone
  1. data.status = send_birthday
  • response will include data.display_text
  • action to take:
    • show data.display_text to user with input for Birthday
    • call Submit Birthday with reference and birthday
  1. data.status = send_otp
  • response will include data.display_text
  • action to take:
    • show data.display_text to user with input for OTP
    • call Submit OTP with reference and otp
  1. data.status = open_url
  • response will include data.url
  • action to take: open data.url in user’s browser.
    • You can specify an optional url to which we should redirect the user after the attempt is complete by adding redirect_to=[url] as a GET query parameter.
  • call Check pending charge at least 5 seconds after user closes browser page or after 5 minutes, whichever comes first.
  1. data.status = pay_offline
  • response will include data.ussd_code
  • action to take: prompt data.ussd_code as a phone string to user.
  • User needs to dial the provided USSD code to complete the transaction offline
  1. data.status = failed
  • response will include data.message
  • action to take: no remedy, start a new charge after showing data.message to user
  1. status = false
  • response will include message
  • action to take: log so you may debug your logic

If your request to any of endpoints 1-9 times out or gives an error, please wait at least 10 seconds, then call Check pending charge.

To tokenize a card before starting the charge flow, call Tokenize with the customer's email and the card details to get an authorization_code. Note that this is optional since you may start the charge with the card.