Biftpaydocs

Test helpers

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

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)"

Responses

  • 200
    The successful payment intentPaymentIntent
    Fields
    idstring (uuid)required
    object"payment_intent"required
    livemodebooleanrequired
    amountintegerrequired

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USDrequired
    statuscreated | processing | successful | failed | abandoned | canceledrequired

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

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

    up to 20 keys

    feesobjectrequired

    An estimate (at the card price) until the payment succeeds; then final, at the price for the channel and provider that took it. fee + vat + net = amount.

    Fields of fees
    feeintegerrequired

    Minor units (kobo, cents).

    at least 0

    vatintegerrequired

    Minor units (kobo, cents).

    at least 0

    netintegerrequired

    Minor units (kobo, cents).

    at least 0

    failure_codestring | null
    created_atstring (date-time)required
    updated_atstring (date-time)required
    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.

    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.

  • 404
    Not found, or not visible to this key
  • 409
    The object is in a state that doesn't allow this

Move all pending money 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

bash
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/balance/release_pending \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"

Responses

  • 200
    How many payments were releasedobject
    Fields
    object"test_helper_result"required
    releasedintegerrequired
  • 404
    Not found, or not visible to this key

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

bash
curl -X POST https://sandbox.api.biftpay.com/v1/test_helpers/settlements/run \
  -H "Authorization: Bearer bp_test_..." \
  -H "Idempotency-Key: $(uuidgen)"

Responses

  • 200
    OKobject
    Fields
    object"test_helper_result"
    releasedinteger
    payoutsarray of string (uuid)

Pretend money arrived in a virtual account (test only)

post/v1/test_helpers/virtual_accounts/{id}/simulate_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

Body

amountintegerrequired

at least 1

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
  }'

Responses

  • 200
    OKobject
    Fields
    object"test_helper_result"
    webhookstring
    provider_referencestring