Skip to content

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 ​

ParameterTypeRequiredDescription
amountNumberYesAmount to charge in NGN
keyStringYesYour public key
showPersonalInformationBooleanYestrue: the pop-up collects name and email. false: you pass customerName and customerEmail
disableCloseAfterTransactionBooleanNotrue keeps the pop-up open after payment
customerEmailStringNoNot needed when showPersonalInformation is true
customerNameStringNoNot needed when showPersonalInformation is true
referenceStringNoYour unique transaction reference
channelsArrayNoChannels to show: ["Card", "PayByTransfer"]

Callbacks ​

CallbackReturns dataFires when
onSuccess(data)YesPayment succeeds
onError(data)YesPayment fails
callback(data)YesEither outcome; can replace the two above
onClose()NoThe 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.

Rexel Limited