Registry / payments / wayaquick-payment

wayaquick-payment

JSON →
library1.0.9jsnpmunverified

A Node.js client library for the WayaQuick payment gateway API, version 1.0.9. It provides methods to initialize and verify payments using a merchant ID and public key. The library is Promise-based and uses CommonJS (require) style. No TypeScript types are provided. It is specific to the WayaPay ecosystem and does not support other gateways. The library has not been updated recently (last release version 1.0.9).

npm install wayaquick-payment
INSTALL
IMPORT
SIG · WAYAQUICK-PAYMENT
W
wayaquick-payment
paymentsjavascriptv1.0.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WayaPayRestClient
const WayaPayRestClient = require('wayaquick-payment');
import WayaPayRestClient from 'wayaquick-payment';
The library uses CommonJS module system; ES import will fail.
new WayaPayRestClient(merchantId, publicKey, environment)
const client = new WayaPayRestClient('MER_ID', 'WAYAPUBK_...', 'development');
const client = new WayaPayRestClient({ merchantId: '...', publicKey: '...' });
Constructor expects three string arguments, not an options object.
client.initializePayment(options)
client.initializePayment({ amount, narration, firstName, lastName, email, phoneNumber, currency }).then(...);
client.initializePayment('amount=157.00&narration=...');
Accepts an object with specific fields; string or other types will fail.

Initializes a payment using WayaPay with merchant credentials and payment details, then logs the result.

const WayaPayRestClient = require('wayaquick-payment'); const merchantId = process.env.MERCHANT_ID ?? 'MER_qZaVZ1645265780823HOaZW'; const publicKey = process.env.PUBLIC_KEY ?? 'WAYAPUBK_TEST_0x3442f06c8fa6454e90c5b1a518758c70'; const environment = process.env.NODE_ENV ?? 'development'; const wayapay = new WayaPayRestClient(merchantId, publicKey, environment); wayapay.initializePayment({ amount: '157.00', narration: 'Airtime Purchase', firstName: 'John', lastName: 'Doe', email: 'johndoe@gmail.com', phoneNumber: '09087654321', currency: 'NGN' }).then(result => { console.log(result); }).catch(error => { console.error(error); }); // Verify payment using transaction ID from response // wayapay.verifyPayment('tranId').then(console.log).catch(console.error);
Debug
Known issues
gotchaThe library does not export TypeScript types, causing potential runtime errors if using TypeScript.
fix
Create custom type definitions or use `@ts-ignore`.
affects: <=1.0.9
gotchaThe `environment` parameter is not validated; passing undefined may lead to unexpected behavior.
fix
Always provide a string like 'development' or 'production'.
affects: <=1.0.9
gotcha`initializePayment` expects specific keys (`firstName`, `lastName`, `phoneNumber`); missing fields cause silent errors.
fix
Ensure all required fields are included in the options object.
affects: <=1.0.9
gotchaThe library uses `require` and does not support ESM import; using `import` will throw an error.
fix
Use `require` or dynamic import as a workaround.
affects: <=1.0.9
Errors
Common errors & fixes
TypeError: WayaPayRestClient is not a constructor
Using ES import syntax `import WayaPayRestClient from 'wayaquick-payment'` which does not work with CommonJS default export.
fix
Use `const WayaPayRestClient = require('wayaquick-payment');`
Cannot read properties of undefined (reading 'then')
Calling `initializePayment` without providing an options object or with missing required fields.
fix
Ensure options object has all required fields: amount, narration, firstName, lastName, email, phoneNumber, currency.
Request failed with status code 400
Invalid merchant ID or public key, or missing/incorrect payment fields.
fix
Double-check credentials and payment fields; ensure environment matches (test/live).
Error: Cannot find module 'wayaquick-payment'
Package not installed or not in node_modules.
fix
Run `npm install --save wayaquick-payment`
TypeError: wayapay.verifyPayment is not a function
Using an older version or incorrect instance; verifyPayment may be defined differently.
fix
Check package version (>=1.0.0). Ensure wayapay is an instance of WayaPayRestClient.
Upgrade
Version history
1.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
42
OpenAI (training)
1
Resources
wayaquick-payment — npm install wayaquick-payment · libregistry