
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
o10r-pp-flow
Advanced tools
`o10r-pp-flow` is a TypeScript library for building payment pages. It provides a single flow object with the methods, data and events required to initialize the payment context, handle user input and finalize the transaction.
o10r-pp-flow
is a TypeScript library for building payment pages. It provides a single flow object with the methods, data and events required to initialize the payment context, handle user input and finalize the transaction.
npm install o10r-pp-flow
Requires Node.js v24+
import PPFlow from 'o10r-pp-flow';
import paymentMethodFactory from '...';
const apiHost = 'https://example.com';
const flow = PPFlow(apiHost, paymentMethodFactory);
flow.on('init', (ctx) => console.log('Initialized', ctx));
flow.on('statusChanged', (ctx) => console.log('Status', ctx.paymentStatus.status));
flow.on('paymentMethodsChanged', () => console.log('Methods', flow.paymentMethods));
flow.on('languageChanged', (lang) => console.log('Language', lang));
const jwtToken = '...';
await flow.init(jwtToken);
init
loads project settings, payment methods and payment status. You may also call flow.init(jwtToken)
without awaiting and react to the init
event.
console.log(flow.context.amount);
console.log(flow.context.currency);
The context object is populated after init
and is emitted with every event handler.
const method = flow.paymentMethods[0];
// Remove a saved payment method
await flow.remove(method);
Listen to paymentMethodsChanged
to track updates to the paymentMethods
array.
import { Language } from 'o10r-pp-core';
await flow.translator.setLanguage(Language.FR);
console.log(flow.translator.t('PAY'));
const method = flow.paymentMethods[0];
// Collect payment data using method's own API if needed
await flow.pay(method);
After pay
, the latest payment status is requested automatically and emitted via statusChanged
.
import { PaymentStatus } from 'o10r-pp-core';
if (flow.context.paymentStatus.status === PaymentStatus.AWAITING_CLARIFICATION) {
await flow.clarify({ code: '123456' });
}
See the exported Flow
, Context
, EventMap
and payment method types for complete type information.
FAQs
`o10r-pp-flow` is a TypeScript library for building payment pages. It provides a single flow object with the methods, data and events required to initialize the payment context, handle user input and finalize the transaction.
We found that o10r-pp-flow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.