SteadFast Merchant Payment Gateway

Accept SteadFast app payments on any website with a QR code or a steadfast:// link. · www.mysteadfast.eu

Links

1 · Create a session on your server

curl -X POST $GATEWAY/api/v1/payments/create \
  -H "X-Client-Id: cli_demo_store" -H "X-Api-Key: sk_test_demo_store_key" \
  -H "Content-Type: application/json" -H "Idempotency-Key: ORD-1" \
  -d '{"order_details":{"order_number":"ORD-1","amount":20.50,"currency":"GBP"},
       "callback_url":"https://shop.example/webhooks/steadfast"}'

2 · Add the button to your checkout

<div id="steadfast-button"></div>
<script src="$GATEWAY/sdk/v1/steadfast.js"></script>
<script>
  SteadFast.Buttons({
    createPayment: () => fetch('/checkout/steadfast', { method: 'POST' }).then(r => r.json()),
    onSuccess: (p) => location.href = '/thank-you?order=' + p.order_number,
  }).render('#steadfast-button');
</script>

3 · Verify the webhook

Header SteadFast-Signature: t=<unix>,v1=<hex> where v1 = HMAC-SHA256(webhook_secret, t + "." + rawBody). Reject if older than 5 minutes. Answer 2xx; anything else is retried.