fx()   Inline Payment


Inline payments allow you to invoice and instantly accept payment on almost every device. It is the easiest and most convenient way of invoicing and accepting payments.

Parameters

key
required
String
API public key
reference_code
required
String
Invoice reference code if already exist
client
required
Array
Client Data
company_name String
Client's company name
first_name
required
String
Client's first name
last_name
required
String
Client's last name
email
required
String
Client's email address
phone
required
String
Client's phone number
address String
Client's address
type String
Client's type Customer, Staff or Vendor
settlement_bank String
Client's settlement bank
account_number String
Client's account number
client_id
required
String
Client ID
due_date
required
String
Invoice due date MM/DD/YYYY
fee_bearer
required
String
Invoice fee bearer account or client
items
required
Array
Invoice items
item
required
String
Item's name
description
required
String
Item's description
unit_cost
required
String
Item's unit cost
quantity
required
String
Item's quantity
tokenize
String
Tokenize Card true or false Defaults to false
payment_methods
Array
Payment Methods to Show on Checkout Can be a combination of card, bank, phone, and qr. Example ["card", "phone"] for Card and Phone Number payments only.

Heads up!

Only one of client or client_id is required per invoice object. The client parameter will allow you to add a new customer while invoicing on the fly in case you don't have a client_id. Client will not be added if already exist. All fields are not required if reference_code is available.

Heads up!

Please ensure that you use the right API endpoint for demo https://api.demo.payant.ng and https://api.payant.ng for LIVE on the script tag.

Example

<form>
  <script src="https://api.payant.ng/assets/js/inline.min.js"></script>
  <button type="button" onclick="payWithPayant()"> Pay </button> 
</form>
 
<script>
  function payWithPayant() {
    var handler = Payant.invoice({
      "key": "e47aa44e4a320ae2a2b6b8804a4d2fa1b74437ab",
      "client": {
            "first_name": "Albert",
            "last_name": "Jane",
            "email": "jane@alberthospital.com",
            "phone": "+2348012345678"
        },
      "due_date": "12/30/2016",
      "fee_bearer": "client",
      "items": [
        {
          "item": ".Com Domain Name Registration",
          "description": "alberthostpital.com",
          "unit_cost": "2500.00",
          "quantity": "1"
        }
      ],
      callback: function(response) {
        console.log(response);
      },
      onClose: function() {
        console.log('Window Closed.');
      }
    });

    handler.openIframe();
  }
</script>