Pay With Pocket

Pay with Pocket enables seamless online payments via Pocket tags. Integrate via SDK or direct API.

How To Use (SDK)

Webhooks notify of events in real-time. Configure your webhook URL in your dashboard.

Add script: <script src="https://pocket-checkout-sdk.netlify.app/checkout-sdk.js"></script>

1
Initialize:
(JavaScript)
const payWithPocket = new Pocket({
key: 'MERCHANT_PUBLIC_KEY',
amount: 500000 // 5000
//Other options...
});
payWithPocket.show();

Options:

NameTypeRequiredDescription
keystringYesPublic key.
amountnumberYesIn kobo.
wallet_idstringNoTarget wallet.
referencestringYesYour reference.
product_namestringNoProduct name.
metaobjectNoCustom data.
business_idstringNoBusiness ID.
narrationstringNoDescription.
viewstringNo"popup" (default) or "redirect".
redirect_urlstringNoSuccess redirect.
onSuccessfunctionNoSuccess callback.
onClosefunctionNoClose callback.
onPendingfunctionNoPending callback.
onOpenfunctionNoOpen callback.
onErrorfunctionNoError callback.

Checkout Process Flow

1
Initialize SDK.
2
User selects payment method (default: Pocket).
3
Enter Pocket tag.
4
QR code (desktop) or app open (mobile).
5
Confirm payment.
6
Success modal

For bank transfer flow, see video link in original.

Additional Information

Immediate show: new Pocket({...}).show()

Trigger element: new Pocket({...}).trigger('#button')

Custom element: PVB_BASE{pay-with-pocket: .../*pay-with-pocket*/}_URL

Update status: payWithPocket.updatePaymentStatus('success')