Fatura oluşturma

curl -X POST https://app.grampaybot.com/api/createInvoice \
 -H 'GramPay-API-Token: gp_live_xxx' -H 'Content-Type: application/json' \
 -H 'Idempotency-Key: order_184' -d '{"amount":"10.00","payload":"order_184"}'

Node/Python/Go/PHP istemcilerinde aynı header’ları ve JSON’u gönderin; HTTP ile JSON ok alanını birlikte kontrol edin.

İmza kalıpları

const expected='sha256='+crypto.createHmac('sha256',secret).update(rawBody).digest('hex');
expected = "sha256=" + hmac.new(secret, raw, hashlib.sha256).hexdigest()
hmac.compare_digest(given, expected)
mac := hmac.New(sha256.New, []byte(secret)); mac.Write(raw)
valid := hmac.Equal([]byte(given), []byte("sha256="+hex.EncodeToString(mac.Sum(nil))))
$expected = 'sha256=' . hash_hmac('sha256', $raw, $secret);
$valid = hash_equals($expected, $given);

Prod kontrolü

Her oluşturma isteğinde sabit idempotency anahtarı kullanın; raw body imzasını doğrulayın; geçerli webhook_test için iş mantığı olmadan 2xx dönün; invoice_paid işlemini tekilleştirin; özel 402 account_not_serviceable yanıtına alarm kurun.

Sonraki adım

Onaylanan ilk 50 ödeme bizden.

5$ krediyle başla ↗