admin 4f5d7fd291 feat: expose paid_amount, retryable, code, receiver_source, sandbox
The API returns five fields the SDKs were dropping, so a caller could not
act on any of them:

  retryable        TRUE means we could not reach the bank. In that case
                   verified=false is NOT a verdict on the payment -- it is
                   "not checked yet". Retry, or fall back to manual review.
                   Never reject an order on it. Check it BEFORE acting on
                   verified=false.
  code             Stable machine-readable reason; branch on this instead of
                   parsing the human-readable error string. Empty/null on
                   success. RECEIPT_NOT_FOUND, AMOUNT_MISMATCH,
                   RECEIVER_MISMATCH, RECEIPT_EXPIRED, RECEIPT_UNREADABLE,
                   REFERENCE_INVALID, RECEIVER_ACCOUNT_REQUIRED,
                   UNSUPPORTED_INPUT, VERIFICATION_FAILED,
                   DUPLICATE_REFERENCE, UPSTREAM_UNAVAILABLE (retryable).
  paid_amount      What the receipt ACTUALLY shows, so a short payment can be
                   compared to the expected figure rather than only described
                   in prose.
  receiver_source  Which receiver identity was actually checked: 'settings'
                   (your saved dashboard account -- strongest), 'request' (the
                   receiver_name/account you sent), or 'none' (NOTHING was
                   checked: verified=true with 'none' means the reference
                   exists and the amount matches, but says nothing about who
                   received the money).
  sandbox          True only on TEST-... responses.

Additive only. Defaults are filled in on the way out so a caller never sees a
missing value, including against an API build that predates these fields.
2026-10-01 00:44:06 +03:00
2026-07-17 16:42:32 +02:00

qbirr-go

Go client for the qbirr Ethiopian bank verification API.

Install

go get github.com/qbirr/sdk-go

Quick start

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/qbirr/sdk-go"
)

func main() {
	qb := qbirr.New(os.Getenv("QBIRR_API_KEY"))

	r, err := qb.Verify(context.Background(), qbirr.VerifyRequest{
		Provider:        qbirr.ProviderCBE,
		Ref:             "FT23001234ABC",
		Amount:          500,
		ReceiverName:    "YOUR NAME",
		ReceiverAccount: "1000017692643",
	})
	if err != nil {
		fmt.Println("API error:", err)
		return
	}
	if r.Verified {
		fmt.Printf("✓ Paid by %s, amount: %.2f\n", r.Payer, r.Amount)
	} else {
		fmt.Println("✗", r.Error)
	}
}

Errors

Network and HTTP errors return as Go error. Verification failures (wrong amount, wrong receiver, etc.) are NOT errors — they're returned as VerifyResult{Verified: false, Error: "..."}.

var apiErr *qbirr.APIError
if errors.As(err, &apiErr) {
    fmt.Println("HTTP status:", apiErr.Status)
}

License

MIT

S
Description
qbirr SDK - sdk-go
Readme 42 KiB
Languages
Go 100%