Appearance
Web (Pop-up)
The Rexel pop-up opens a secure payment modal on your own page. You keep your branding; Rexel handles PCI compliance.
Load the script
Script location
https://cdn.rexel.ng/checkout/rexelpopup.js is the planned location. Confirm it is live before publishing.
html
<script src="https://cdn.rexel.ng/checkout/rexelpopup.js"></script>For Vue / Nuxt, add it to your global script config:
javascript
script: [{ src: 'https://cdn.rexel.ng/checkout/rexelpopup.js' }]Open the pop-up
javascript
const popUp = new RexelPopUp({
amount: 100,
key: "pk_test_xxx",
showPersonalInformation: true,
reference: "ORDER-123",
disableCloseAfterTransaction: true,
channels: ["Card", "PayByTransfer"],
onSuccess: (data) => console.log(data),
onError: (data) => console.log(data),
onClose: () => {}
});
popUp.generatePaymentPopUp();Use your public key
key must be your public key (pk_). Never put a secret key in browser code.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | Number | Yes | Amount to charge in NGN |
key | String | Yes | Your public key |
showPersonalInformation | Boolean | Yes | true: the pop-up collects name and email. false: you pass customerName and customerEmail |
disableCloseAfterTransaction | Boolean | No | true keeps the pop-up open after payment |
customerEmail | String | No | Not needed when showPersonalInformation is true |
customerName | String | No | Not needed when showPersonalInformation is true |
reference | String | No | Your unique transaction reference |
channels | Array | No | Channels to show: ["Card", "PayByTransfer"] |
Callbacks
| Callback | Returns data | Fires when |
|---|---|---|
onSuccess(data) | Yes | Payment succeeds |
onError(data) | Yes | Payment fails |
callback(data) | Yes | Either outcome; can replace the two above |
onClose() | No | The pop-up closes |
javascript
// onSuccess
{ "status": "SUCCESS", "message": "Your payment was successful" }
// onError
{ "status": "ERROR", "message": "Your payment was not successful" }Always confirm with Get Transaction Status on your server before giving value.