![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
payrex-node
Advanced tools
PayRex Node library provides Node applications an easy access to the PayRex API. Explore various classes that represents PayRex API resources on object instantiation.
Node 12 or higher.
If you want to use the package, run the following command:
npm install payrex-node
# or
yarn add payrex-node
Simple usage looks like:
const payrex = require('payrex-node')('sk_test_...');
payrex.paymentIntents.retrieve('pi_...')
.then(paymentIntent => console.log(paymentIntent.id))
payrex.paymentIntents.create({
amount: 10000,
currency: 'PHP',
description: 'Dino Treat',
payment_methods: ['gcash', 'card']
})
.then(paymentIntent => console.log(paymentIntent.id))
Or using async/await:
const payrex = require('payrex-node')('sk_test_...');
const paymentIntent = await payrex.paymentIntents.retrieve('pi_...');
console.log(paymentIntent.id);
const payrex = require('payrex-node')('sk_test_...');
payrex.paymentIntents.create({
amount: 10000
})
.then(paymentIntent => console.log(paymentIntent.id))
.catch(error => {
// Handle errors
console.error(error.name);
console.error(error.errors);
});
try {
payload = '{"id":"evt_...","resource":"event","type":"payment_intent.succeeded","data":{...';
signatureHeader = 't=1715236958,te=,li=...';
webhookSecretKey = 'whsk_...';
payrex.webhooks.parseEvent(payload, signatureHeader, webhookSecretKey);
} catch (error) {
// Handle invalid signature
}
[0.1.7] - 2024-07-30
FAQs
PayRex Node JS Library
The npm package payrex-node receives a total of 81 weekly downloads. As such, payrex-node popularity was classified as not popular.
We found that payrex-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.