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);
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.
fixUse `const WayaPayRestClient = require('wayaquick-payment');` Cannot read properties of undefined (reading 'then')
Calling `initializePayment` without providing an options object or with missing required fields.
fixEnsure 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.
fixDouble-check credentials and payment fields; ensure environment matches (test/live).
Error: Cannot find module 'wayaquick-payment'
Package not installed or not in node_modules.
fixRun `npm install --save wayaquick-payment`
TypeError: wayapay.verifyPayment is not a function
Using an older version or incorrect instance; verifyPayment may be defined differently.
fixCheck package version (>=1.0.0). Ensure wayapay is an instance of WayaPayRestClient.
Audit
Dependencies
No dependency data recorded yet.