Skip to main content

Payment lifecycle example

One script ties together payment creation, status, refunds list, and instruments — useful to sanity-check your sandbox credentials end-to-end.
This script shows a typical flow: create a payment, poll state, list refunds, and inspect payment instruments. Copy it into your project and run it with gopay-sdk installed and sandbox credentials in the environment.

Script

Run it

Use the same environment variables as in Basic usage. Run with your TypeScript/Node toolchain of choice.