Javascript Integration

The Ippopay Payments plugin allows you to accept credit card, UPI, Netbanking and debit card payments via Ippopay payment gateway.

Configuration

Initialize your object by passing your order id and public key:

Get Order Id from Create order api from next step

<script type="text/javascript" src="https://js.ippopay.com/scripts/ippopay.v1.js"></script>
<script type="text/javascript">
var order_id;
var options = {
"order_id" : order_id, //Get order_id params value from Create Order from next step
"public_key" : "pk_live_xxxxxxxxx"
}
var ipay = new Ippopay(options);

You can get your Public and Secret key from the api dashboard.

post
Create Order

https://public_key:secret_key@api.ippopay.com/v1/order/create
Use this api to create your order on Ippopay to use it for initiating transaction. You can get your keys from the api dashboard.
Request
Response
Request
Body Parameters
amount
required
number
The Order amount to be charged in format ##.##
currency
optional
string
The currency to be charged, Defaults to INR.
payment_modes
optional
string
Payment modes to be enabled for this order, Defaults to Credit, Debit Cards, Netbanking and UPI.
customer
optional
object
Information of the customer, if not provided will be prompted on payment page.
Response
200: OK
{
"success": true,
"message": "Order created",
"data": {
"order": {
"merchant": {
"name": "Demo Merchant",
"id": "TaodSgGa"
},
"customer": {
"phone": {
"country_code": "91",
"national_number": "1234567"
},
"name": "Test",
"email": "test@gmail.com"
},
"currency": "INR",
"paymentModes": "cc,db,nb,upi",
"status": "created",
"amount": 100.00,
"order_id": "order_G@nzg3qBq",
"payment_url": "https://pay.ippopay.com/order/G@nzg3qBq",
}
}
}
{
"amount": 100.00,
"currency": "INR" ,
"payment_modes": "cc,dc,nb,upi" ,
"customer": {
"name": "Test",
"email": "test@gmail.com",
"phone": {
"country_code": "91" ,
"national_number": "1234567"
}
}
}

Open the payment view

Use the below code to open the payment view for the customers to pay.

ipay.open();

Close the payment view

Use the below code to close the payment view.

ipay.close();

Response Handlers

For Success and Error handlers use the below handler function for payment response

ippopayHandler(response, function (e) {
if(e.data.status == 'success'){
console.log(e.data)
}
if(e.data.status == 'failure'){
console.log(e.data)
}
});