A Vendure plugin that integrates NOWPayments cryptocurrency payment processing into your e-commerce store.
- Cryptocurrency Payments: Accept Bitcoin, Ethereum, and 1000+ other cryptocurrencies
- IPN (Instant Payment Notification): Real-time payment status updates
- Secure Payment Processing: Built-in signature verification for webhook security
- Vendure Integration: Seamless integration with Vendure's payment system
- TypeScript Support: Full TypeScript support with type safety
npm install vendure-plugin-nowpaymentsimport { VendureConfig } from '@vendure/core';
import { NOWPaymentsPlugin } from 'vendure-plugin-nowpayments';
export const config: VendureConfig = {
plugins: [
NOWPaymentsPlugin.init({
apiKey: 'your-nowpayments-api-key',
ipnSecret: 'your-ipn-secret-key',
sandbox: false, // Set to true for testing
}),
],
// ... rest of your config
};# Required
NOWPAYMENTS_API_KEY=your-api-key-here
NOWPAYMENTS_IPN_SECRET=your-ipn-secret-here
# Optional
NOWPAYMENTS_SANDBOX=true # Set to true for testing- Create a Payment Method in your Vendure admin
- Configure NOWPayments with your API credentials
- Set up IPN endpoint at
/nowpayments/ipn
The plugin handles the following NOWPayments payment statuses:
- finished β PaymentSettled (Payment completed successfully)
- partially_paid β PaymentAuthorized (Partial payment received)
- confirming β PaymentAuthorized (Payment is being confirmed)
- confirmed β PaymentAuthorized (Payment confirmed on blockchain)
- sending β PaymentAuthorized (Payment is being sent)
- waiting β PaymentAuthorized (Payment is waiting for user action)
- expired β PaymentDeclined (Payment has expired)
- failed β PaymentDeclined (Payment failed)
POST /nowpayments/ipn
The plugin automatically handles IPN (Instant Payment Notification) from NOWPayments to update order status.
- Signature Verification: All IPN requests are verified using HMAC-SHA256
- Request Validation: Comprehensive validation of payment data
- Error Handling: Secure error responses without exposing sensitive information
- Node.js 18+
- npm/yarn/pnpm
- Vendure 3.0+
# Clone the repository
git clone https://github.com/psychomet/vendure-nowpayments.git
cd vendure-nowpayments
# Install dependencies
npm install
# Build the plugin
npx nx build vendure-plugin-nowpayments
# Run tests
npx nx test vendure-plugin-nowpaymentspackages/vendure-plugin-nowpayments/
βββ src/
β βββ lib/
β β βββ constants.ts # Plugin constants
β β βββ nowpayments.controller.ts # IPN endpoint
β β βββ nowpayments.service.ts # Core business logic
β β βββ nowpayments.plugin.ts # Plugin definition
β β βββ types.ts # TypeScript types
β βββ index.ts # Main entry point
βββ package.json
βββ tsconfig.json
# Run unit tests
npx nx test vendure-plugin-nowpayments
# Run with coverage
npx nx test vendure-plugin-nowpayments --coverage# Build the plugin
npx nx build vendure-plugin-nowpayments
# Build with type checking
npx nx typecheck vendure-plugin-nowpaymentsThe project uses Nx Release for automated versioning and publishing.
The plugin automatically releases when you push conventional commits to the main branch:
# Minor version bump
git commit -m "feat: add new payment method"
# Patch version bump
git commit -m "fix: resolve authentication issue"
# No version bump
git commit -m "docs: update README"# Preview release
npx nx release vendure-plugin-nowpayments --dry-run
# Create release
npx nx release vendure-plugin-nowpayments --yesNOWPayments supports 1000+ cryptocurrencies including:
- Bitcoin (BTC)
- Ethereum (ETH)
- Litecoin (LTC)
- Bitcoin Cash (BCH)
- And many more...
See the NOWPayments supported currencies for the complete list.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Conventional Commits for commit messages
- Write tests for new features
- Update documentation as needed
- Ensure TypeScript compilation passes
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Vendure Docs
- Issues: GitHub Issues
- Discord: Vendure Community
- Vendure - The amazing e-commerce framework
- NOWPayments - Cryptocurrency payment processing
- Nx - Monorepo tooling
Made with β€οΈ by the Vendure community