API Reference

Web3 USDT Component

This JS component should be shown on USDT(ETH ERC-20) checkout page

This component enables customers to connect his web3 wallet to pay . Customize the attributes as needed to integrate with your checkout flow.

<!-- Include Component JS -->
<script src="https://blockonomics.co/js/web3-payment.js"></script>

<!-- Use the Component in your HTML -->
<web3-payment
    order_amount=10
    receive_address="USDT_RECEIVE_ADDRESS"
    redirect_url="/payment.php?order_id=ORDER_ID"
    testnet=1
></web3-payment>
#web3-payment {
    width: 300px;
    margin: auto;
}
#web3-payment button {
    width: 100%;
    height: 32px;
    background-color: blue;
    color: white;
    cursor: pointer;
    border-radius: 5px;
    border: none;
}

Attributes

  • order_amount: The amount of USDT to pay
  • receive_address: Your USDT receiving address
  • redirect_url: URL to redirect upon payment
  • testnet: The network to use (0 = mainnet, 1 = sepolia testnet)

Once the payment is completed, the user will be redirected to the redirect_url appending the transaction hash (txhash) to the url. redirect_url can be used to display order confirmation screen

Screenshot of web3 USDT component on checkout page