Payments (Payment Gateway)

Glade payment gateway allows you to accept payments from your customers using any of the following methods

  • card
  • bank transfer
  • USSD
  • QR Pay
  • Mobile Money

Integration

The Glade inline checkout is the simplest and easiest way to start accepting payments on your platform. This payment solution provides a secure and convenient flow for users. Payments are processed on the go without having to navigate customers to another page to complete their transactions.

454454

The Inline Checkout solution provides quick access the API into any website, CMS, App or Platform. It requires an addon embed script.

🚧

Note

We recommend you don't cache the script in your project to avoid breaking changes when an update is introduced.

Inline Scripts

Demo Inline Script

<script type="text/javascript" src="http://demo.api.glade.ng/checkout.js"></script>

Live Inline Script

<script type="text/javascript" src="https://api.glade.ng/checkout.js"></script>

Demo

Click on this link to interact with the demo on codepen.

Initialize a transaction

To initialize a transaction you will need to pass the following details MID, amount, currency, country, email, firstname, lastname, phone, title, description, meta_data e.t.c.

The table below explains parameters that can be passed.

ParametersMeaningOption
MIDMerchant IDRequired
amountAmount to charge the customer.Required
currencydefault is NGN.Optional
countrydefault is NG.Optional
emailthis is requiredRequired
firstnameFirst name of the customer.Optional
lastnameLast name of the customer.Optional
phonePhone number of the customer.Optional
titleText to be displayed as the title of the payment modal.Required
descriptionText to be displayed as a short modal description.Required
meta_dataWhen you need to pass extra data to the API. The value should be a string, stringify the value if its a JSON value.Optional

Recurring Payments

You can schedule payments to be made by your customers without having them enter their card details for each recurring payment. Once a customer has made the first successful payment with their card, Glade stores the customer's card authorization and use it for subsequent transactions.

Every recurring payment will be carried out automatically by our system and send the results back to your webhook as payment notification.

To use the recurring feature within the inline checkout simply add these configuration options to the embedded inline checkout configurations.

🚧

Note

The recurring payments feature is only enabled for payments with card.

Recurrent Payment Parameters

ParametersMeaningOption
is_recurringThe is_recurring field default value is false, setting it to true will make the transaction recurrent and will generate a token which can charge the card at the required time.
The subsequent parameters will be considered only when this value is true
Required
recurrentJSON object which holds the config of the recurrent setupRequired
frequencyThe frequency at which the recurring payment should occurs options available are daily or weekly or monthlyRequired
valueThe value will determine when the charge should occur based on the frequency that has been set.
Daily (Hours): 0 - 23
Weekly (Day): 1 - 7 (starts from Monday)
Monthly (Day): 1 - 30
Required

Sample Configuration

This configuration setup will charge the user every first day of the week the amount that has been set.

initPayment({
    MID:"GP_9695a6071e26433f929b490d7128ecbb",
    email: "[email protected]",
    firstname:"John",
    lastname:"Doe",
    description: "This is the payment for a weekly subscription",
    title: "Weekly subscription",
    amount: 100,
    country: "NG",
    currency: "NGN",
    recurrent: {
        frequency: "weekly",
        value: "1"
    },
    onclose: function() {
            console.log('checkout closed');
    },
    callback: function(response) {
            console.log(response);
    }
});