bob-payments/sdk is the recommended way to integrate in PHP: zero dependencies (uses ext-curl and ext-json), PHP >= 8.1, analyzed with PHPStan level 9.
Installation
Client
Create a checkout session (PIX)
Use the hosted checkout when you want Bob to present the payment screen. Today the available method is PIX;credit_card arrives when card is launched:
Create a PIX charge
create sends an Idempotency-Key header automatically (a UUID per call, or your own via ['idempotencyKey' => "pedido-{$orderId}"] in the second argument), which makes the call safe to retry — the SDK retries with backoff on timeout, network failure, 429, and 5xx without risk of a duplicate payment.
Lookups
Hosted checkout
Webhooks
Webhooks::constructEvent verifies the signature (v1 and v2, with hash_equals and anti-replay) and returns the decoded event:
Error handling
Every non-2xx response becomes anApiException with the API’s RFC 7807 fields:
Sandbox
Withsk_test_, the outcome in the sandbox is controlled by the amount’s cents — see Sandbox:
Next steps
Checkout SDK
Frontend layer: mount the checkout on your site with the session created here.
SDK overview
How the server libraries and the frontend SDK fit together.
Source code and releases
github.com/BobPayments/bob-payments-sdk-php — CHANGELOG and versions via semantic-release