JSFiddle - React, Tailwind, and code Playground
HTML
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CargoWallet Integration</title>
<!-- Include CargoWallet SDK -->
<script src="https://js.dev.wallet.cargoai.co/v1.0.js"></script>
</head>
<body>
<!-- Wallet Button Container -->
<div id="cargoai-wallet"></div>
<!-- Initialize SDK and Prepare Payment -->
<script>
// Initialize the SDK
CargoWallet.init({
api_key: "iV2wtULQz03a7JnH1F0Bd2N0YWhqhvUk20jDg0yp", // Replace with your API key
webhook_url: "https://api.dev.cargo-wallet.com/test-callback", // Replace with your webhook URL
})
// Prepare the payment details
CargoWallet.pay({
destination_pay_to: "344d3eff-c597-11ee-97a7-da4909313d65", // Payer wallet
transaction_category: "INVOICE_NUMBER", // Transaction category
transaction_reference: "INV123456", // Invoice number
currency: "USD", // Currency code
amount: 100.0, // Amount to be paid
notes: "Random notes", // Note (optional)
instant_payment_only: true // optional
})
</script>
</body>
</html>