7 Billing & refund - failure scenarios (redirect)



These tests are only relevant if your integration requires the user to be redirected via a Bango or Payment provider flow. This will be dependent on Payment Provider requirements.


7.1 User cancels during payment redirect

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

Optional: include a notificationUrl in the extensionData section to be notified when the user completes the redirect process.

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "0.99",
                    "taxAmount": "0.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

Cancel payment:

User cancels during the flow and sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_CANCELLED


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_CANCELLED"
}


7.2 Insufficient credit

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900181

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

Confirm payment:

Enter ZIP and confirm payment:

User is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_INSUFFICIENT_CREDIT

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_INSUFFICIENT_CREDIT"
}


7.3 User barred

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900182

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_BARRED

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_BARRED"
}


7.4 User not enabled

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900183

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_NOT_ENABLED

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_NOT_ENABLED"
}


7.5 User suspended

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900184

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_SUSPENDED

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_SUSPENDED"
}


7.6 Spend limit

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900185

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=USER_SPEND_LIMIT

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "USER_SPEND_LIMIT"
}


7.7 Not Available

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


Include the following headers in the request:

  • Prefer:status=202
  • preference-extension:responseCode=NOT_AVAILABLE


An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "NOT_AVAILABLE",
  "responseMessage": "No valid payment methods were found."
}


7.8 Price not supported

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


Option 1: Include the following headers in the request:

  • Prefer:status=202
  • preference-extension:responseCode=PRICE_NOT_SUPPORTED


Option 2: Include a price over the maximum allowed

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "PRICE_NOT_SUPPORTED",
  "responseMessage": "Price not supported on suggested payment methods."
}


7.9 Transaction declined (start)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900189

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=DECLINED

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "DECLINED"
}


7.10 Transaction declined (commit)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900190

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

Confirm payment:

Enter ZIP and confirm payment:

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "DECLINED", 
    "responseMessage": "The billing request was declined",
}


7.11 Transaction declined (cancel)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900191

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "DECLINED", 
    "responseMessage": "The billing request was declined",
}


7.12 Transaction declined (refund)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900192

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
5

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 202 (Accepted) should be returned with the following body:


{ 
    "responseCode": "DECLINED", 
    "responseMessage": "The biller declined the payment request",
}



7.13 Connect error (start)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900193

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=CONNECT_ERROR

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "CONNECT_ERROR"
}


7.14 Connect error (commit)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900194

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 502 (Bad Gateway) should be returned with the following body:

{
    "responseCode": "CONNECT_ERROR", 
    "responseMessage": "Could not connect to the operator",
}


7.15 Connect error (cancel)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900195

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 502 (Bad Gateway) should be returned with the following body:

{
    "responseCode": "CONNECT_ERROR", 
    "responseMessage": "Could not connect to the operator",
}


7.16 Connect error (refund)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900196

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
5

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 502 (Bad Gateway) should be returned with the following body:

{ 
    "responseCode": "CONNECT_ERROR", 
    "responseMessage": "Could not connect to the operator",
}



7.17 Connect timeout (commit)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following header in the request:

  • Prefer:status=504


An HTTP response code 504 (Gateway timeout) should be returned with the following body:

{
    "responseCode": "CONNECT_TIMEOUT", 
    "responseMessage": "Connection timeout submitting the payment request to the biller",
}


7.18 Connect timeout (cancel)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following header in the request:

  • Prefer:status=504


An HTTP response code 504 (Gateway timeout) should be returned with the following body:

{
    "responseCode": "CONNECT_TIMEOUT", 
    "responseMessage": "Connection timeout submitting the payment request to the biller",
}


7.19 Connect timeout (refund)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
5

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following header in the request:


  • Prefer:status=504


An HTTP response code 504 (Gateway timeout) should be returned with the following body:

{
    "responseCode": "CONNECT_TIMEOUT", 
    "responseMessage": "Connection timeout submitting the payment request to the biller",
}



7.20 Billing provider error (start)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900201

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=FAILURE

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "FAILURE"
}


7.21 Billing provider error (commit)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900202

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "FAILURE", 
    "responseMessage": "Error",
}


7.22 Billing provider error (cancel)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900203

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



3

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
4

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 502 (Bad Gateway) should be returned with the following body:

{
    "responseCode": "FAILURE", 
    "responseMessage": "Error",
}


7.23 Billing provider error (refund)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900204

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 202 (Accepted) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 502 (Bad Gateway) should be returned with the following body:


{ 
    "responseCode": "FAILURE", 
    "responseMessage": "Unknown error",
}



7.24 Invalid userId (start)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900205

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

User attempts to confirm payment, is shown error screen and selects Continue. They are then sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId={your-transaction-id}
&transactionId=0&responseCode=INVALID_BANGOUSERID

The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "0",
    "responseCode": "INVALID_BANGOUSERID"
}


7.25 Partial commit invalid amount

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "0.99",
                    "taxAmount": "0.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}



An HTTP response code 202 (Accepted) should be returned with the following body:


{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

Confirm payment:


Enter ZIP and confirm payment:


After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Partially commit the transaction with an invalid amount

Send a PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount or taxAmount higher than the POST

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "1.59",
                    "taxAmount": "0.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 400 (Bad Request) should be returned with the following body:

{
  "responseCode": "BAD_REQUEST",
  "responseMessage": "Price is higher than the one in the original request."
}


7.26 Partial refund invalid amount (1st attempt)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

NOTE: Partial refunds are not supported by all payment providers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "10.99",
                    "taxAmount": "1.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 202 (Accepted) should be returned with the following body:


{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
}
4

Partially refund the transaction with invalid amount

Send a DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount and or taxAmount higher than the POST.


{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "12.59",
                    "taxAmount": "1.20",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "BAD_REQUEST",
  "responseMessage": "Price is higher than the one in the original request."
}


7.27 Partial refund invalid amount (2nd attempt)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

NOTE: Partial refunds are not supported by all payment providers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "10.99",
                    "taxAmount": "1.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 202 (Accepted) should be returned with the following body:


{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}
2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

No body required


An HTTP response code 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
}
4

Partially refund the transaction

Send a DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount and or taxAmount lower than the POST.


{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "2.59",
                    "taxAmount": "0.20",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 200 (OK) should be returned with the following body:

{ 
    "responseCode": "REFUNDED", 
    "responseMessage": "The transaction was refunded successfully." 
}

The requested amount will be refunded to the user.

5

Partially refund the transaction with invalid amount

Send a DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount and or taxAmount lower than the POST but higher than the remaining amount.

{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "8.50",
                    "taxAmount": "0.90",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CANT_REFUND",
  "responseMessage": "It’s not possible to refund this transaction."
}


7.28 Partial refund uncaptured transaction

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


An HTTP response code 202 (Accepted) should be returned with the following body:


{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Refund the transaction

Send a DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount and or taxAmount lower than the POST


{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "8.50",
                    "taxAmount": "0.90",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{your-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}


An HTTP response code 400 (Bad request) should be returned with the following body:

{
  "responseCode": "BAD_REQUEST",
  "responseMessage": "Cannot do partial refund for uncaptured transaction"
}



7.29 Refund not supported

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Make a Delete request for a committed transaction


Include the following headers in the request:

  • Prefer:status=202
  • preference-extension:responseCode=CANT_REFUND


An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CANT_REFUND",
  "responseMessage": "It’s not possible to refund this transaction."
}


7.30 Already refunded (cancel)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


An HTTP response code 200 (OK) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "ALREADY_REFUNDED",
  "responseMessage": "The transaction has already been refunded."
}



7.31 Already refunded (refund)

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


An HTTP response code 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "ALREADY_REFUNDED",
  "responseMessage": "The transaction has already been refunded."
}


5

Attempt to refund the transaction again

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "ALREADY_REFUNDED",
  "responseMessage": "The transaction has already been refunded."
}


7.32 Transaction not found (commit)

Test

Action

Expected result

1

Send a PUT request to https://api.bango.net/v5/transaction/{Invalid-bango-transaction-id} with an invalid bango transaction id

An HTTP response code 404 (Not found) should be returned with the following body:

{ 
  "responseCode": "NOT_FOUND",
  "responseMessage": "Invalid transaction id."
}


7.33 Transaction not found (cancel/refund)

Test

Action

Expected result

1

Cancel the transaction

Send a DELETE request to https://api.bango.net/v5/transaction/{Invalid-bango-transaction-id} with an invalid bango transaction id

An HTTP response code 200 (OK) should be returned with the following body:

{ 
  "responseCode": "NOT_FOUND",
  "responseMessage": "Invalid transaction id."
}


7.34 Unauthorized (start)

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


Include the following headers in the request:

  • Prefer:status=401

An HTTP response code 401 (Unauthorized) should be returned with the following body:

{ 
  "responseCode": "UNAUTHORIZED",
  "responseMessage": "Invalid access credentials."
}


7.35 Unauthorized (commit)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}



Include the following headers in the request:


  • Prefer:status=401


An HTTP response code 401 (Unauthorized) should be returned with the following body:

{ 
  "responseCode": "UNAUTHORIZED",
  "responseMessage": "Invalid access credentials."
}


7.36 Unauthorized (cancel)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=401



An HTTP response code 401 (Unauthorized) should be returned with the following body:

{ 
  "responseCode": "UNAUTHORIZED",
  "responseMessage": "Invalid access credentials."
}


7.37 Unauthorized (refund)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.
https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


An HTTP response code 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:


  • Prefer:status=401


An HTTP response code 401 (Unauthorized) should be returned with the following body:

{
  "responseCode": "UNAUTHORIZED",
  "responseMessage": "Invalid access credentials."
}



7.38 Service unavailable (start)

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


Include the following headers in the request:

  • Prefer:status=503


An HTTP response code 503 (Service unavailable) should be returned with the following body:

{ 
  "responseCode": "SERVICE_UNAVAILABLE",
  "responseMessage": "The server is undergoing maintenance and
is not available. Please, try again later."
}


7.39 Service unavailable (commit)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=503


An HTTP response code 503 (Service unavailable) should be returned with the following body:

{ 
  "responseCode": "SERVICE_UNAVAILABLE",
  "responseMessage": "The server is undergoing maintenance and is not available. 
Please, try again later."
}


7.40 Service unavailable (cancel)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=503



An HTTP response code 503 (Service unavailable) should be returned with the following body:

{
  "responseCode": "SERVICE_UNAVAILABLE",
  "responseMessage": "The server is undergoing maintenance and is not available. 
Please, try again later."
}


7.41 Service unavailable (refund)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


An HTTP response code 200 (OK) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:


  • Prefer:status=503


An HTTP response code 503 (Service unavailable) should be returned with the following body:

{
  "responseCode": "SERVICE_UNAVAILABLE",
  "responseMessage": "The server is undergoing maintenance and is not available. 
Please, try again later."
}



7.42 Internal error (start)

This scenario can be tested using Prefer Headers.

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


Include the following headers in the request:

  • Prefer:status=500


An HTTP response code 500 (Internal error) should be returned with the following body:

{
  "responseCode": "INTERNAL_ERROR",
  "responseMessage": "The server encountered an unexpected condition which 
prevented it from fulfilling the request."
}


7.43 Internal error (commit)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=500


An HTTP response code 500 (Internal error) should be returned with the following body:

{
  "responseCode": "INTERNAL_ERROR",
  "responseMessage": "The server encountered an unexpected condition which 
prevented it from fulfilling the request."
}


7.44 Internal error (cancel)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Cancel the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=500



An HTTP response code 500 (Internal error) should be returned with the following body:

{
  "responseCode": "INTERNAL_ERROR",
  "responseMessage": "The server encountered an unexpected condition which 
prevented it from fulfilling the request."
}


7.45 Internal error (refund)

This scenario can be tested using Prefer Headers.

To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGOREDIRECT
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction

An HTTP response code 202 (Accepted) should be returned with the following body:

{
  "responseCode": "CLIENT_ACTION_REQUIRED",
  "responseMessage": "An action is required in the client.",
  "transactionId": null,
  "parameters": {
    "action": "REDIRECT", 
    "url": "{redirect-the-end-user-to-this-url}"
  }
}



2

Redirect user

Send the user to the URL provided.

After the user has completed any manual actions required they should be sent to your specified "callbackUrl" with externalTransactionId, transactionId and responseCode parameters appended.

https://{callback-url}/?externalTransactionId=
{your-transaction-id}&transactionId={bango-transaction-Id}
&responseCode=OK


The Bango API will also send a POST to the "notificationUrl" if one is provided in the initial request.

{
    "externalTransactionId": "{your-transaction-id}",
    "transactionId": "{bango-transaction-Id}",
    "responseCode": "OK"
}
3

Commit the transaction

Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


An HTTP response code 200 (OK) should be returned with the following body:

{
    "responseCode": "OK", 
    "responseMessage": "Success",
}
4

Refund the transaction

Send a valid DELETE request to https://api.bango.net/v5/transaction/{Bango-transaction-id}


Include the following headers in the request:

  • Prefer:status=500


An HTTP response code 500 (Internal error) should be returned with the following body:

{
  "responseCode": "INTERNAL_ERROR",
  "responseMessage": "The server encountered an unexpected condition which 
prevented it from fulfilling the request."
}



7.46 Invalid SubmerchantReferanceKey

If you have sub-merchants configured on your account, passing in an invalid value will return a Bad Request response.


To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:

identificationMethodKey

GBR_BANGO
MSISDN447710900180

Test

Action

Expected result

1

Start a transaction

Send a valid POST request to https://api.bango.net/v5/transaction


{
    "bangoUserId": "123456789",
    "externalTransactionId": "{your-transaction-id}",
    "paymentMethods": 
    [
        "OPERATORBILLING",
    ],
    "paymentItems":
    [
        {
            "priceList":
            [
                {
                    "grossAmount": "0.99",
                    "taxAmount": "0.00",
                    "currencyIso3": "USD"
                },
            ],
            "itemName": "Item title",
            "itemDescription": "Item description",
            "itemCategory": "1",
            "externalPaymentItemId": "{your-payment-item-id}",
            "submerchantReferenceKey": "{invalid-submerchant-reference-key}"
        }
    ],
    "extensionData":
        {
             "callbackUrl": "https://{callback-url}",
             "notificationUrl": "https://{notification-url}"
        }
}

An HTTP response code 400 (Bad Request) should be returned with the following body:

{ 
    "responseCode": "BAD_REQUEST", 
    "responseMessage": "Invalid request."
}