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 pathrequired

Body

amountintegerrequired

In 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
bash
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
  }'
response
{}

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 pathrequired
Idempotency-Keystringin headerrequired

A 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"
    livemodeboolean
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    statuscreated | processing | successful | failed | abandoned | canceled

    created not paid yet; processing the customer started paying (entered a card, or was given an account to transfer into); successful the funds arrived; failed the last try failed and the customer may try again; abandoned processing for 30 minutes with no funds (the customer may still pay); canceled canceled by the business. Funds that arrive late always make a payment successful.

    disputeobject | null

    In 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 | lost
    amountinteger

    The disputed amount (held while it's open; back to the customer if lost).

    feeinteger

    The chargeback fee charged (0 unless it was lost).

    fee_vatinteger

    VAT on the chargeback fee.

    referencestring | null
    descriptionstring | null
    customer_emailstring | null
    brandstring (uuid) | null
    customerstring (uuid) | null
    payment_linkstring (uuid) | null
    metadataobject

    up to 20 keys

    fee_bearermerchant | customer

    Who 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_chargedobject

    What the customer pays: the amount, plus fee and VAT when the customer bears the fee (an estimate until paid).

    feesobject

    An 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
    feeinteger

    Minor units (kobo, cents).

    at least 0

    vatinteger

    Minor units (kobo, cents).

    at least 0

    netinteger

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)
    updated_atstring (date-time)
    paid_atstring (date-time) | null

    When the payment became successful.

    canceled_atstring (date-time) | null
    return_urlstring | null

    Where checkout sends the customer after paying.

    checkout_urlstring

    Only 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_secretstring

    Only 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
bash
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/payment_intents/{id}/succeed \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "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 headerrequired

A 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
bash
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/balance/release_pending \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{
  "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 pathrequired
Idempotency-Keystringin headerrequired

A 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
bash
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)"
response
{}

Run automatic settlement for this merchant now (test only)

post/v1/test_helpers/settlements/run

Parameters

Idempotency-Keystringin headerrequired

A 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"
    releasedinteger
    payoutsarray of string (uuid)
bash
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/settlements/run \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"
response
{}