
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Node.js implementation for alphapay
See official doc
npm i -S alphapay
Create an Alphapay instance
const alphapay = new Alphapay(PARTNER_CODE, CREDENTIAL_CODE);
Create a QR Code payment
const resp = await alphapay.createQRCodePayment("your-order-id", {
description: 'Developer Test',
price: Number((total * 100)).toFixed(0), // price should be an integer of the base unit of the currency
currency: CurrencyType.CAD, // CAD or CNY
notify_url: "https://your.domain.backend/api/alphapay-success",
channel: ChannelType.WECHAT // ALIPAY or UNION_PAY, some channel might not be available for different payment gateways
});
Handle alphapay response
if (resp.return_code != 'SUCCESS') {
// handle exception
return;
}
const redirectUrl = alphapay.getQRCodePaymentPageUrl("your-order-id", `https://your.domain.frontend/payment-success?orderId=your-order-id`);
Pass redirectUrl to the frontend
Redirect the page to the url generated in the backend:
window.location.href = redirectUrl;
Alphapay will post SuccessNotification up to 3 times to notify_url when payment succceeds.
const notification: SuccessNotification = req.body;
if (!alphapay.isNotificationValid(notification)) {
// you can ignore validation for some alphapay apis
// https://www.alphapay.com/api/CAD_en.html#PaymentSuccessPage
// handle exception
return;
}
const orderId = notification.partner_order_id; // your-order-id
const alphaOrder = await alphapay.getOrderStatus(orderId);
// IMPORTANT: your backend should be able to handle the repeated success notifications
doSomethingElseInYourBackend(orderId, alphaOrder);
redirectUrlIn redirectUrl you may want to check if SuccessNotification is properly handled in your backend.
FAQs
Node.js implementation for alphapay
We found that alphapay demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.