Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fastuptime/cryptomus_nodejs
A powerful Node.js integration for the Cryptomus payment system, enabling seamless cryptocurrency payments in your applications! ๐
https://github.com/fastuptime/cryptomus_nodejs
cryptomus cryptomus-api
Last synced: 22 days ago
JSON representation
A powerful Node.js integration for the Cryptomus payment system, enabling seamless cryptocurrency payments in your applications! ๐
- Host: GitHub
- URL: https://github.com/fastuptime/cryptomus_nodejs
- Owner: fastuptime
- Created: 2024-12-27T11:33:51.000Z (29 days ago)
- Default Branch: main
- Last Pushed: 2024-12-27T11:36:45.000Z (29 days ago)
- Last Synced: 2024-12-27T12:26:04.871Z (29 days ago)
- Topics: cryptomus, cryptomus-api
- Language: JavaScript
- Homepage: http://speedsmm.com/
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ๐ Cryptomus NodeJS Integration
A powerful Node.js integration for the Cryptomus payment system, enabling seamless cryptocurrency payments in your applications! ๐
## โจ Features
- ๐ณ Create cryptocurrency payments with ease
- ๐ Real-time payment status tracking
- ๐ Secure webhook handling with signature verification
- ๐งช Built-in webhook testing functionality
- ๐ Support for multiple cryptocurrencies and networks## ๐ Installation
```bash
npm install axios crypto express body-parser multer
```## โ๏ธ Configuration
Create a `.env` file in your project root and add your Cryptomus credentials:
```env
MERCHANT_ID=your_merchant_id
PAYMENT_KEY=your_payment_key
```## ๐ Usage
### ๐ Initialize Cryptomus
```javascript
const Cryptomus = require('./cryptomus');
const cryptomus = new Cryptomus(process.env.MERCHANT_ID, process.env.PAYMENT_KEY);
```### ๐ฐ Create a Payment
```javascript
const payment = await cryptomus.createPayment({
orderId: 'unique_order_id',
amount: '100',
currency: 'USD',
network: 'ETH',
callbackUrl: 'https://your-domain.com/webhook',
returnUrl: 'https://your-domain.com/return'
});
```### ๐ Check Payment Status
```javascript
const status = await cryptomus.getPaymentStatus('order_id');
```### ๐ก Handle Webhooks
```javascript
app.post('/webhook', (req, res) => {
const isValid = cryptomus.verifyWebhook(req.body, req.body.sign);
if (isValid) {
// Handle the webhook
console.log('Valid webhook received:', req.body);
res.status(200).send('OK');
}
});
```### ๐งช Test Webhook
```javascript
const webhook = await cryptomus.testWebhook({
uuid: 'test-uuid',
currency: 'ETH',
url_callback: 'https://your-domain.com/webhook',
network: 'eth',
status: 'paid'
});
```## ๐ฆ Webhook Payload Example
```javascript
{
type: 'payment',
uuid: 'payment-uuid',
order_id: 'order-id',
amount: '100',
payment_amount: '100',
payment_amount_usd: '100',
merchant_amount: '98',
commission: '2',
is_final: true,
status: 'paid',
network: 'eth',
currency: 'ETH',
payer_currency: 'ETH',
payer_amount: '0.05',
txid: 'transaction-id',
sign: 'webhook-signature'
}
```## ๐ Security Best Practices
- ๐ก๏ธ Always verify webhook signatures
- ๐ Store credentials in environment variables
- ๐ Use HTTPS for all callback URLs
- โ ๏ธ Implement proper error handling and logging
- ๐ Regularly monitor transaction status## ๐ค Contributing
We love your input! Here's how you can contribute:
1. ๐ด Fork the repository
2. ๐ฟ Create your feature branch (`git checkout -b feature/amazing-feature`)
3. โ๏ธ Commit your changes (`git commit -am 'Add some amazing feature'`)
4. ๐ค Push to the branch (`git push origin feature/amazing-feature`)
5. ๐ Open a Pull Request## ๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
## ๐ Support
Like this project? Give it a โญ๏ธ to show your support!
## ๐ค Questions?
Having troubles? Check out our [issues](https://github.com/fastuptime/Cryptomus_Nodejs/issues) page or create a new issue!
---
Made with โค๏ธ by [FastUptime & SpeedSMM % QuickPos]