Simulating a webhook
Introducing our Sandbox environment
In the Paag Sandbox environment it is possible to simulate webhook events to test integration without using real values. This allows you to verify how your application behaves when receiving successful payments, failed payments, refund, and other scenarios, without waiting for real events or spending real BRL during testing.
Base URL: http://gateway.uat.paag.dev
In the Sandbox, the test account generates QR Codes that are not valid for real payments. Instead, the response returns a URL that, when accessed in a browser, simulates the corresponding event.
Simulating a succesful payment
- Make the deposit request normally:
// POST http://gateway.uat.paag.dev/api/pix/charge
{
"amount": 40,
"merchant_transaction_id": "paag-dev-team-01",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"document_number": "8989898989",
"message": "Test transaction",
"ip_address": "123.123.124.123",
"phone_number": "+553634182141"
}- In the response, locate the
qrcodefield insideevents[]. It contains the simulation URL:
{
"transaction": {
"id": "5dd728f4-e3bb-4e58-980a-3fabf33b74f7",
"merchant_id": "ea6b792b-ccb4-4d32-ba46-b7076c5acc42",
"user_id": "402c797e-25a8-478b-884c-45b52d0c1a9f",
"processor_id": "38eab077-c11d-4ffd-bef2-158fd082c8a7",
"merchant_transaction_id": "paag-dev-team-01",
"transaction_type": "pix",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
"events": [
{
"id": "19ab7283-cfc3-4353-af24-b646a0502582",
"success": true,
"event_type": "auth",
"amount": "40.00",
"ip_address": "123.123.124.123",
"processor_transaction_id": "f48003eb-5ea2-491b-9b34-6d1761aa9256",
"batch_id": null,
"qrcode": "http://gateway.uat.paag.dev/api/transactions/f48003eb-5ea2-491b-9b34-6d1761aa9256/pay",
"qrcode_image": "data:image/png;base64,...",
"pix_key_type": null,
"pix_key_value": null,
"pix_message": "Test transaction",
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
}
],
"document_number": "08476407602",
"status": "pending",
"flow_type": "cashin",
"error": null,
"e2e_id": null,
"source": "player"
}
}-
Open the
qrcodeURL in your browser.Example:
http://gateway.uat.paag.dev/api/transactions/f48003eb-5ea2-491b-9b34-6d1761aa9256/payThis simulates a successful payment.
-
Check the webhook event received in your application.
Simulating a successful withdrawal
- Make the withdrawal request normally:
// POST http://gateway.uat.paag.dev/api/pix/pay
{
"merchant_transaction_id": "paag-dev-team-04",
"amount": 120.00,
"pix_key_type": "email",
"pix_key_value": "[email protected]",
"pix_message": "This is a test",
"first_name": "John",
"last_name": "Doe",
"document_number": "88377748827281"
}- In the response, locate the
qrcodefield. It will contain the URL to simulate the withdrawal:
{
"transaction": {
"id": "23ff136f-afe9-402e-904f-50b8547704d1",
"merchant_id": "ea6b792b-ccb4-4d32-ba46-b7076c5acc42",
"user_id": "402c797e-25a8-478b-884c-45b52d0c1a9f",
"processor_id": "38eab077-c11d-4ffd-bef2-158fd082c8a7",
"merchant_transaction_id": "paag-dev-team-04",
"transaction_type": "pix",
"first_name": "John",
"last_name": "Doe",
"email": null,
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
"events": [
{
"id": "8aec44f1-f538-460e-873b-c82228b65d9b",
"success": true,
"event_type": "payment",
"amount": "120.00",
"ip_address": null,
"batch_id": null,
"qrcode": "http://gateway.uat.paag.dev/api/transactions/63f8c555-6b9e-41e9-97ac-53c6363de373/receive",
"qrcode_image": "data:image/png;base64,...",
"pix_key_type": "email",
"pix_key_value": "[email protected]",
"pix_message": "This is a test",
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
}
],
"document_number": "08476407602",
"status": "pending",
"flow_type": "cashout",
"error": null,
"e2e_id": null,
"source": "player"
}
}-
Open the
qrcodeURL in your browser.Example:
http://gateway.uat.paag.dev/api/transactions/63f8c555-6b9e-41e9-97ac-53c6363de373/receiveThis simulates a successful withdrawal.
-
Check the webhook event received in your application.
Simulating a failed withdrawal
- Make the usual request for withdrawal:
//POST http://gateway.uat.paag.dev/api/pix/pay
{
"merchant_transaction_id": "paag-dev-team-04",
"amount": 120.00,
"pix_key_type": "email",
"pix_key_value": "[email protected]",
"pix_message": "This is a test",
"first_name": "John",
"last_name": "Doe",
"document_number": "88377748827281"
}- In the response, locate the
qrcodefield.
{
"transaction": {
"id": "23ff136f-afe9-402e-904f-50b8547704d1",
"merchant_id": "ea6b792b-ccb4-4d32-ba46-b7076c5acc42",
"user_id": "402c797e-25a8-478b-884c-45b52d0c1a9f",
"processor_id": "38eab077-c11d-4ffd-bef2-158fd082c8a7",
"merchant_transaction_id": "paag-dev-team-04",
"transaction_type": "pix",
"first_name": "John",
"last_name": "Doe",
"email": null,
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
"events": [
{
"id": "8aec44f1-f538-460e-873b-c82228b65d9b",
"success": true,
"event_type": "payment",
"amount": "120.00",
"ip_address": null,
"batch_id": null,
"qrcode": "http://gateway.uat.paag.dev/api/transactions/63f8c555-6b9e-41e9-97ac-53c6363de373/receive",
"qrcode_image": "data:image/png;base64,...",
"pix_key_type": "email",
"pix_key_value": "[email protected]",
"pix_message": "This is a test",
"updated_at": "2023-11-13T02:35:53+0000",
"created_at": "2023-11-13T02:35:53+0000"
}
],
"document_number": "08476407602",
"status": "pending",
"flow_type": "cashout",
"error": null,
"e2e_id": null,
"source": "player"
}
}-
The
qrcodeURL simulates success, that is not what we want here.To test the asynchronous withdrawal failure, use the same URL but replace the final endpoint with
/refund.Example:
http://gateway.uat.paag.dev/api/transactions/63f8c555-6b9e-41e9-97ac-53c6363de373/refund -
Check the webhook event received in your application.
Updated about 1 month ago
