Test helpers
Test mode only — a transfer into a customer's virtual account from the provider's sandbox bank
post/v1/test_helpers/virtual_accounts/{id}/simulate_transfer
The provider's sandbox bank pays in and the provider sends its webhook, so the credit arrives the way it would live. Only where the provider's sandbox supports it (can_simulate on the virtual account).
Parameters
idstring (uuid)in pathrequiredBody
amountintegerrequiredIn kobo.
at least 1
Responses
- 200Sentobject
Show the fields
object"test_helper_result"simulatedboolean - 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/virtual_accounts/{id}/simulate_transfer \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount": 1
}'{}Simulate a successful payment (test keys only)
post/v1/test_helpers/payment_intents/{id}/succeed
Moves the intent to successful and posts the capture to the ledger, as a real provider confirmation would. Returns 404 for live keys.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200The successful payment intentPaymentIntent
Show the fields
idstring (uuid)object"payment_intent"livemodebooleanamountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDstatuscreated | processing | successful | failed | abandoned | canceledcreatednot paid yet;processingthe customer started paying (entered a card, or was given an account to transfer into);successfulthe funds arrived;failedthe last try failed and the customer may try again;abandonedprocessing for 30 minutes with no funds (the customer may still pay);canceledcanceled by the business. Funds that arrive late always make a paymentsuccessful.disputeobject | nullIn GET /v1/payment_intents and GET /v1/payment_intents/{id}: its chargeback, if a customer's bank disputed it (a payment is disputed once).
Fields of dispute
idstring (uuid)statusneeds_response | under_review | won | lostamountintegerThe disputed amount (held while it's open; back to the customer if lost).
feeintegerThe chargeback fee charged (0 unless it was lost).
fee_vatintegerVAT on the chargeback fee.
referencestring | nulldescriptionstring | nullcustomer_emailstring | nullbrandstring (uuid) | nullcustomerstring (uuid) | nullpayment_linkstring (uuid) | nullmetadataobjectup to 20 keys
fee_bearermerchant | customerWho paid the fee on this payment: the merchant (out of the amount) or the customer (on top of it, in amount_charged). Set by your fee setting in the merchant portal when the payment was created.
amount_chargedobjectWhat the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).
feesobjectAn estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. Merchant bears the fee: fee + vat + net = amount. Customer bears it: net = amount, and the customer paid amount + fee + vat.
Fields of fees
feeintegerMinor units (kobo, cents).
at least 0
vatintegerMinor units (kobo, cents).
at least 0
netintegerMinor units (kobo, cents).
at least 0
failure_codestring | nullcreated_atstring (date-time)updated_atstring (date-time)paid_atstring (date-time) | nullWhen the payment became successful.
canceled_atstring (date-time) | nullreturn_urlstring | nullWhere checkout sends the customer after paying.
checkout_urlstringOnly in the response that creates the payment: a short link to Biftpay's hosted checkout for it, to send the customer (WhatsApp, SMS, email). Like client_secret, it opens this one payment only.
client_secretstringOnly in the response that creates the payment. Give it to the customer's checkout page; it can act on this one payment only.
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/payment_intents/{id}/succeed \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"id": "0b6f3f0e-6c1a-4d8e-9b0a-5f1e2d3c4b5a",
"object": "payment_intent",
"livemode": false,
"amount": 0,
"currency": "NGN",
"status": "created",
"metadata": {
"order_id": "10293"
},
"fee_bearer": "merchant",
"amount_charged": {},
"fees": {
"fee": 0,
"vat": 0,
"net": 0
},
"created_at": "…",
"updated_at": "…"
}Move all pending funds to available now (test keys only)
post/v1/test_helpers/balance/release_pending
Skips the settlement delay for this merchant's captured test payments.
Parameters
Idempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200How many payments were releasedobject
Show the fields
object"test_helper_result"releasedinteger - 404Not found, or not visible to this key
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/balance/release_pending \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{
"object": "test_helper_result",
"released": 1000
}Pretend the customer paid into the payment's bank transfer account (test only)
post/v1/test_helpers/payment_intents/{id}/simulate_transfer
Test-mode transfer accounts are Biftpay's own test accounts: this pays the one the payment shows, for exactly the amount it asked for. The payment completes straight away and its webhook follows, as for a real transfer.
Parameters
idstring (uuid)in pathrequiredIdempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200Paid; the payment is now successfulobject
Show the fields
object"test_helper_result"simulatedboolean - 409The object is in a state that doesn't allow this
- 502The provider's sandbox refused it
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/payment_intents/{id}/simulate_transfer \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{}Run automatic settlement for this merchant now (test only)
post/v1/test_helpers/settlements/run
Parameters
Idempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Responses
- 200OKobject
Show the fields
object"test_helper_result"releasedintegerpayoutsarray of string (uuid)
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/settlements/run \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)"{}