@foxses/pay-cryptomus
v1.0.0
Published
Cryptomus crypto payment provider for foxses-pay
Readme
@foxses/pay-cryptomus
Cryptomus crypto payment provider for foxses-pay.
Accept 100+ cryptocurrencies with a simple hosted checkout page.
Install
npm install @foxses/pay-core @foxses/pay-cryptomusOr use the all-in-one package:
npm install @foxses/payUsage
import { PaymentGateway } from "@foxses/pay-core";
import "@foxses/pay-cryptomus";
const gateway = new PaymentGateway();
gateway.use("cryptomus", {
merchantId: "YOUR_MERCHANT_UUID",
apiKey: "YOUR_PAYMENT_API_KEY",
successUrl: "https://yoursite.com/success",
failureUrl: "https://yoursite.com/cancel",
});
// Step 1: Create invoice
const payment = await gateway.createPayment("cryptomus", {
amount: 50,
currency: "USD",
orderId: "ORDER-001",
});
// Redirect user to:
console.log(payment.checkoutUrl);
// Step 2: Verify after payment
const result = await gateway.verifyPayment("cryptomus", {
transactionId: payment.transactionId, // uuid
});
console.log(result.status); // "completed" | "pending" | "failed"Getting Credentials
- Go to cryptomus.com → Dashboard
- Settings → API keys → Payment API key
- Copy your Merchant UUID and Payment API key
Documentation
paydoc.foxses.com/docs/providers/cryptomus
License
MIT © Foxses Studio
