Demonstrates embedding the securepayAPI payment widget on a merchant page.
Enter your keys on the right and click “Load payment form”.
The client secret comes from a payment intent your backend creates with the secret key — never put the secret key in this page.
curl -X POST https://checkout.securepayapi.com/api/v1/payment-intents \
-H "Authorization: Bearer sp_secret_YOURKEY" \
-H "Content-Type: application/json" \
-d '{"amount": 2000, "currency": "USD", "reference": "order_123"}'
# → { "id": "...", "client_secret": "pi_..._secret_...", "amount": 2000, ... }
amount is in minor units (2000 = $20.00).
client_secret (and your sp_client_… publishable key) to the widget — exactly what the fields above do:
<script src="https://checkout.securepayapi.com/sdk/v1/securepay.js"></script>
<div id="securepay-widget"></div>
<script>
SecurePay('sp_client_…').mount('#securepay-widget', {
clientSecret: 'pi_…_secret_…',
onSuccess: function (r) { /* r = { intentId, status } */ },
onError: function (e) { /* e = { message } */ }
});
</script>
productUrl — the widget only accepts it from that origin.