Accept Payment (Inline)
Monicredit's Inline JS allows you to easily integrate our payment functionality into your websites, empowering your customers to make payments directly on your platform.
Parameter
Type
Required
Description
Parameter
Type
Required
Description
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Monicredit Dev</title>
<script src="https://demo.monicredit.com/js/demo.js"></script>
<script>
function payWithMonicredit() {
var handler = PayDirect.invoice({
"public_key": "PUB_DEMO_Test",
"order_id" : "transaction_id"
"customer": {
"first_name": 'Test',
"last_name": 'Test',
"email": 'test@test.com',
"phone": '99000000000'
},
"fee_bearer": "client",
"items": [
{
"item": "Demo Payment",
"unit_cost": '500',
"revenue_head_code": 'Rev_000000',
"split_details": [
{
"sub_account_code": 'SB_000000',
"fee_percentage": 100,
"fee_flat": 0
}
]
},
],
callback: function(response) {
console.log(response);
location.href ='/callback.php?reference='+response.reference_code;
},
onClose: function() {
console.log('Window Closed.');
location.href ='/index.php';
}
});
handler.openIframe();
}
</script>
</head>
<body onload="payWithMonicredit()">
</body>
</html>Last updated