The True Web3 Alternative to Stripe
Accept crypto payments with 3 lines of code - No backend, no servers, 100% decentralized
This is what your users will see when making a payment. The widget handles wallet connection, payment creation, and transaction execution - all from the client-side.
Add web3 payments to your website in minutes. Choose your preferred method below.
npm install @pmt-gateway/asset-hub-sdk
import { PMTGatewayAssetHub } from '@pmt-gateway/asset-hub-sdk'; // Initialize the gateway const gateway = new PMTGatewayAssetHub({ assetHub: { network: 'paseo', // or 'polkadot' rpcEndpoint: 'wss://sys.ibp.network/asset-hub-paseo' } }); await gateway.initialize(); // Create a payment const payment = await gateway.createPayment({ merchant: 'YOUR_POLKADOT_ADDRESS', amount: '0.01', description: 'Premium subscription' }); // Execute the payment await gateway.executePayment(payment.id);
// Listen for payment events gateway.on('payment.completed', (event) => { console.log('Payment successful!', event.txHash); }); gateway.on('payment.cancelled', (event) => { console.log('Payment cancelled', event.paymentId); });
<!DOCTYPE html> <html> <head> <title>My Payment Page</title> </head> <body> <button id="pay-btn">Pay with Web3</button> <script type="module"> import { PMTGatewayAssetHub } from './pmt-gateway.js'; const gateway = new PMTGatewayAssetHub({ assetHub: { network: 'paseo', rpcEndpoint: 'wss://sys.ibp.network/asset-hub-paseo' } }); await gateway.initialize(); document.getElementById('pay-btn').addEventListener('click', async () => { const payment = await gateway.createPayment({ merchant: '5GrwvaEF...', amount: '0.01', description: 'Product Purchase' }); await gateway.executePayment(payment.id); alert('Payment successful!'); }); </script> </body> </html>
import { useState, useEffect } from 'react'; import { PMTGatewayAssetHub } from '@pmt-gateway/asset-hub-sdk'; function PaymentButton() { const [gateway, setGateway] = useState(null); useEffect(() => { const init = async () => { const gw = new PMTGatewayAssetHub({ assetHub: { network: 'paseo', rpcEndpoint: 'wss://sys.ibp.network/asset-hub-paseo' } }); await gw.initialize(); setGateway(gw); }; init(); }, []); const handlePayment = async () => { const payment = await gateway.createPayment({ merchant: '5GrwvaEF...', amount: '0.01', description: 'Product Purchase' }); await gateway.executePayment(payment.id); alert('Payment successful!'); }; return ( <button onClick={handlePayment}> Pay with Web3 </button> ); }