@foxses/pay-nowpayments
v1.0.0
Published
NOWPayments crypto payment provider for foxses-pay
Downloads
9
Readme
@foxses/pay-nowpayments
NOWPayments crypto payment provider for foxses-pay.
Supports 150+ cryptocurrencies including BTC, ETH, USDT, BNB, and more.
Install
npm install @foxses/pay-core @foxses/pay-nowpaymentsOr use the all-in-one package:
npm install @foxses/payUsage
import { PaymentGateway } from "@foxses/pay-core";
import "@foxses/pay-nowpayments";
const gateway = new PaymentGateway();
gateway.use("nowpayments", {
apiKey: "YOUR_NOWPAYMENTS_API_KEY",
successUrl: "https://yoursite.com/success",
failureUrl: "https://yoursite.com/cancel",
ipnSecretKey: "YOUR_IPN_SECRET", // optional, for webhook verification
sandbox: true, // use sandbox for testing
});
// Step 1: Create invoice
const payment = await gateway.createPayment("nowpayments", {
amount: 100,
currency: "USD",
orderId: "ORDER-001",
});
// Redirect user to:
console.log(payment.checkoutUrl);
// Step 2: Verify after payment
const result = await gateway.verifyPayment("nowpayments", {
transactionId: paymentId,
});
console.log(result.status); // "completed" | "pending" | "failed"Getting API Key
- Go to nowpayments.io
- Dashboard → Store Settings → API Keys
Sandbox: sandbox.nowpayments.io
Documentation
paydoc.foxses.com/docs/providers/nowpayments
License
MIT © Foxses Studio
