Documentation

Aimtoget Payment Integration

Aimtoget's modal payment gateway makes it easy and faster to receive airtime payments from your website using airtime. If you have any issues after going through this documentation, join us on our slack channel or contact us via developer@aimtoget.com.

Step 1.

Load the Aimotget javascript library.
            
    <script src="https://aimtoget.com/assets/webpay/inline.js"></script>
            

Step 2.

Initialize A Payment.
Create a button to pop payment modal
        
    <button onclick="callAtgPay()"></button>

The javascript function to pop payment modal
function callAtgPay(e) {
    AtgPayment.pay({
        //customer's email address
        email: 'developer@aimtoget.com',

        //Customer's phone number (Optional)
        phone: '+2349061668519',

        //customer's description
        description: 'Pay for house rent',

        // Amount to pay in naira
        amount: 5000,

        //Payment reference
        //If not specified, a reference will be generated for you
        reference: 'rof565565tktj5oi',

        // Merchant's aimotget PUBLIC KEY
        key:'AIMTO123',

        //Url to the logo you want displayed on the payment modal
        logo_url: 'https://example.com/logo.png';

        onclose: function () {
            //do something when modal is closed
        },

        onerror: function (data) {
            let reference = data.reference
            //payment failed, do something with reference
        },

        onsuccess: function (data) {
            let reference = data.reference
            //get reference and verify payment before awarding value
        }

        e.preventDefault()
    })
}

The payment flow can be experienced here