Test and go live
In test mode the SDK sends every request to the Buckaroo test environment.
No real money is moved, and you can simulate each outcome a payment method supports.
Use test mode
$buckaroo = new \Buckaroo\BuckarooClient($storeKey, $secretKey, 'test');Test mode is the default. Check that BPE_MODE is not set to something else in your environment, because it takes precedence over the constructor. See Configuration.
Test data
Test card numbers, test accounts and the way to trigger a specific outcome are listed per payment method on the Test transactions page. Testing explains how the test environment works.
What to test
The successful payment proves the least. These scenarios find the bugs:
| Scenario | What it proves |
|---|---|
| A failed payment | The order is not marked as paid, and the customer sees a usable page |
| The customer cancels | The order is released and the customer can choose another method |
| The customer closes the browser before returning | Your push handler works without the return page |
| The same push message twice | Your handler is idempotent and does not process the order twice |
| A push message with a changed body | Signature validation rejects it |
| A full and a partial refund | The refund reaches Buckaroo and its own push message is handled |
| A reused invoice number | Your error handling shows the reason |
The closed browser test is the important one. It is the only test that proves your integration does not depend on the customer coming back.
Run the examples
The repository has a runnable example for each payment method. The scripts read your credentials from a .env file:
git clone https://github.com/buckaroo-it/BuckarooSDK_PHP.git
cd BuckarooSDK_PHP
composer install
cp .env.example .env # then fill in BPE_WEBSITE_KEY and BPE_SECRET_KEY
cd example/transactions
php ideal.phpBPE_WEBSITE_KEY is your store key.
Go live
Before you switch to production:
- The full flow works in test mode, including the return page, the push handler and refunds
- Your push URL is the production URL, is reachable from the internet over HTTPS and returns HTTP
200 - Buckaroo's push IP addresses and ports are on your allow list. See Push messages
- The payment methods you need are active for your store in Plaza
- The keys are loaded from the environment, not from your code
- Request and response logging is switched off or does not write customer data to shared logs
Then switch the mode to live:
$buckaroo = new \Buckaroo\BuckarooClient($storeKey, $secretKey, 'live');Place one real payment for a small amount, check that it appears in Plaza and that your order is updated, then refund it.
Updated about 3 hours ago