PMT Gateway SDK

The True Web3 Alternative to Stripe

Accept crypto payments with 3 lines of code - No backend, no servers, 100% decentralized

✓ No Backend Required ✓ 100% Client-Side ✓ Direct Payments ✓ Polkadot Asset Hub

🎯 Live Widget Demo

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.

Connecting...

🔐 Connect Wallet

Status Not Connected
Balance -

💳 Payment Details

📜 Activity Log

🚀 Integration Guide

Add web3 payments to your website in minutes. Choose your preferred method below.

1. Install the SDK
npm install @pmt-gateway/asset-hub-sdk
2. Initialize & Create Payment
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);
3. Listen to Events
// 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);
});
Complete HTML Example
<!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>
React Component Example
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>
  );
}