Accept Your First Payment
A step-by-step guide to accepting your first cryptocurrency payment with ZenPay.
Payment Integration Options
ZenPay offers multiple ways to accept cryptocurrency payments, depending on your business needs and technical capabilities. Let's explore each option:
Payment Buttons
The easiest way to start accepting payments. No coding required.
Checkout Links
Generate payment links to share with customers.
Custom Checkout
Seamless checkout integrated into your existing flow.
API Integration
Direct API calls for complete control.
Option 1: Creating a Payment Button
Let's start with the easiest method: creating a payment button that you can embed on your website.
Navigate to Payment Buttons
From your ZenPay dashboard, go to Payments → Payment Buttons → Create New Button.
Configure Button Settings
Fill in the following details:
- Button name (for your reference)
- Product or service name
- Price and currency
- Accepted cryptocurrencies
- Button appearance (colors, text, size)
Copy the Button Code
After saving, you'll receive HTML code for your button. Copy this code to use on your website.
<script src="https://js.zenpay.io/v1/button.js"></script>
<div class="zenpay-button"
data-button-id="btn_1234567890"
data-price="25.00"
data-currency="USD"
data-name="Premium Subscription"
data-color="#4F46E5"
data-text="Pay with Crypto">
</div>
Add to Your Website
Paste the code into your website where you want the button to appear. The script automatically handles the payment flow.
Option 2: Creating a Checkout Link
Checkout links are perfect when you don't have a website or want to send payment requests via email, messaging apps, or social media.
- Navigate to Checkout Links: From your dashboard, go to Payments → Checkout Links → Create New Link.
- Configure Link Settings: Enter product details, price, currency, and payment options.
- Generate Link: Click "Create Link" to generate a unique payment URL.
- Share Your Link: Copy and share the link with your customers via email, social media, or messaging apps. You can also download a QR code for the link.
Example Checkout Link:
https://pay.zenpay.io/c/ZP_checkout_123456abcdef
Option 3: Custom Checkout Integration
For a seamless checkout experience that matches your website design, the ZenPay Custom Checkout is the ideal solution.
// 1. Add ZenPay.js to your website
<script src="https://js.zenpay.io/v1/zenpay.js"></script>
// 2. Initialize ZenPay with your API key
<script>
const zenpay = new ZenPay('pk_test_YourPublicKey');
document.getElementById('payment-form').addEventListener('submit', async (e) => {
e.preventDefault();
try {
// Create a payment session
const session = await zenpay.createPaymentSession({
amount: 50.00,
currency: 'USD',
product_name: 'Premium Plan',
customer_email: document.getElementById('email').value,
redirect_url: 'https://yourwebsite.com/thank-you'
});
// Open the checkout modal
zenpay.openCheckout(session.id);
} catch (error) {
console.error('Error creating payment session:', error);
}
});
</script>
// 3. Add a form to your website
<form id="payment-form">
<input type="email" id="email" placeholder="Your email" required />
<button type="submit">Checkout</button>
</form>
Option 4: API Integration
For maximum flexibility and control, you can integrate directly with our API. This is ideal for custom applications and e-commerce platforms.
// Using the ZenPay Node.js SDK
const ZenPay = require('@zenpay/node');
const zenpay = new ZenPay('sk_test_YourSecretKey');
// Create an Express route handler for payments
app.post('/create-payment', async (req, res) => {
try {
// Create a payment
const payment = await zenpay.payments.create({
amount: req.body.amount,
currency: req.body.currency,
product_name: req.body.product_name,
customer_email: req.body.email,
metadata: {
order_id: req.body.order_id,
},
webhook_url: 'https://yourwebsite.com/webhooks/zenpay',
success_url: 'https://yourwebsite.com/thank-you',
cancel_url: 'https://yourwebsite.com/cart',
});
// Return the payment data to the client
res.json({
paymentId: payment.id,
checkoutUrl: payment.checkout_url
});
} catch (error) {
console.error('Payment creation failed:', error);
res.status(500).json({ error: error.message });
}
});
Testing Your Integration
Before accepting real payments, test your integration using ZenPay's test mode:
- 1
Toggle to Test Mode in your dashboard settings.
- 2
Use test API keys that start with
pk_test_
andsk_test_
. - 3
Use the following test wallet addresses for payments:
- BTC: tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0g
- ETH: 0xb794f5ea0ba39494ce839613fffba74279579268
Monitoring Your First Payment
After setting up your payment method, you can monitor payments in real-time from your ZenPay dashboard:
Payment Initiated
When a customer clicks your payment button or link, they'll see a checkout page with cryptocurrency options.
Payment Pending
The payment appears in your dashboard with a "Pending" status while waiting for blockchain confirmations.
Payment Completed
Once confirmed, the status changes to "Completed" and you'll receive an email notification.
Settlement
Funds are settled to your ZenPay account and can be withdrawn to your connected bank account or crypto wallet.
Next steps
Now that you've set up your first payment, explore more features and tools in the ZenPay dashboard: