When an official SDK ships, it will be announced here and on vestrapay.com. Code written against the raw API will keep working.
Configuration
Read two values from the environment and nothing else. Switching from sandbox to live then means changing configuration, not code. The same secret key verifies webhook signatures; see Webhooks.A thin client
The client below sends the secret key, sets a timeout, unwraps the envelope and raises a typed error that carries the error code and the request ID. It is deliberately small. Copy it, then add logging and metrics for your stack.Initialise
Use the client to create a payment. The reference is generated by Vestrapay, so you save it after the call returns.Verify and fulfil once
This pattern combines verification with idempotent fulfilment. It is the one to copy for both your webhook handler and your callback page.Verify a webhook signature
Signature checking needs the raw request body, so it is covered with the webhook payload and retry behaviour on the Webhooks page, with the same three languages.Handling errors well
Always log the X-Request-Id response header with the error code. See Errors.