Skip to end of banner
Go to start of banner

5 Billing & refund - failure scenarios (API only)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »



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


5.1 Insufficient credit

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

identificationMethodKey

GBR_BANGO
MSISDN447710900121

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": "USER_INSUFFICIENT_CREDIT", 
    "responseMessage": "The user does not have enough credit for this payment"
}


5.2 User barred

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

identificationMethodKey

GBR_BANGO
MSISDN447710900122

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": "USER_BARRED", 
    "responseMessage": "The user is not allowed to use this payment method",
}


5.3 User not enabled

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

identificationMethodKey

GBR_BANGO
MSISDN447710900123

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": "USER_NOT_ENABLED", 
    "responseMessage": "The biller has not enabled this user for payments",
}


5.4 User suspended

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

identificationMethodKey

GBR_BANGO
MSISDN447710900124

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": "USER_SUSPENDED", 
    "responseMessage": "The user is temporarily not allowed to use this payment method",
}


5.5 Spend limit

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

identificationMethodKey

GBR_BANGO
MSISDN447710900125

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": "USER_SPEND_LIMIT",
  "responseMessage": "The user has reached their spend limit"
}


5.6 Speed limit

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=SPEED_LIMIT


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

{ 
    "responseCode": "SPEED_LIMIT", 
    "responseMessage": "The biller has rejected a payment request too soon after the previous one for this user",
}


5.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."
}


5.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."
}


5.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_BANGO
MSISDN447710900129

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": "DECLINED", 
    "responseMessage": "The biller declined the payment request",
}


5.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_BANGO
MSISDN447710900130

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Commit the transaction

Send a valid PUT 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",
}


5.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_BANGO
MSISDN447710900131

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Cancel 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",
}


5.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_BANGO
MSISDN447710900132

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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",
}


5.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_BANGO
MSISDN447710900133

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "CONNECT_ERROR", 
    "responseMessage": "Connection error submitting the payment request to the biller",
}


5.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_BANGO
MSISDN447710900134

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Commit the transaction

Send a valid PUT 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": "Connection error submitting the payment request to the biller",
}



5.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_BANGO
MSISDN447710900135

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Cancel 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": "Connection error submitting the payment request to the biller",
}



5.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_BANGO
MSISDN447710900136

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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": "Connection error submitting the payment request to the biller",
}


5.17 Connect timeout (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 header in the request:

  • Prefer:status=504
  • preference-extension:responseCode=CONNECT_TIMEOUT

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

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


5.18 Connect timeout (commit)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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
  • preference-extension:responseCode=CONNECT_TIMEOUT

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",
}


5.19 Connect timeout (cancel)

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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
  • preference-extension:responseCode=CONNECT_TIMEOUT

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",
}



5.20 Connect timeout (refund)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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
  • preference-extension:responseCode=CONNECT_TIMEOUT

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",
}


5.21 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_BANGO
MSISDN447710900141

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": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


5.22 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_BANGO
MSISDN447710900142

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Commit the transaction

Send a valid PUT 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": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}



5.23 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_BANGO
MSISDN447710900143

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

Cancel 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": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}



5.24 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_BANGO
MSISDN447710900144

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


5.25 Invalid userId (start)

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

identificationMethodKey

GBR_BANGO
MSISDN447710900145

Test

Action

Expected result

1

Start a transaction

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

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

{
  "responseCode": "INVALID_BANGOUSERID",
  "responseMessage": "Invalid bangoUserId."
}


5.26 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_BANGO
MSISDN447710900120

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 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.27 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_BANGO
MSISDN447710900120

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 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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."
}


5.28 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_BANGO
MSISDN447710900120

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 200 (OK) should be returned with the following body:

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

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.

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 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."
}


5.29 Partial refund uncaptured transaction

Test

Action

Expected result

1

Start a transaction

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


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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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



5.30 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."
}


5.31 Already refunded (cancel)

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

Attempt to cancel 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."
}


5.32 Already refunded (refund)

Test

Action

Expected result

1

Start a transaction

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

Refund 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": "REFUNDED",
  "responseMessage": "The transaction was refunded successfully."
}
4

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."
}


5.33 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."
}


5.34 Transaction not found (cancel/refund)

Test

Action

Expected result

1

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."
}


5.35 User exceeded limit

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=USER_EXCEEDED_LIMIT


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

{ 
  "responseCode": "USER_EXCEEDED_LIMIT",
  "responseMessage": "User exceeded limit on suggested payment methods."
}


5.36 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."
}


5.37 Unauthorized (commit)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.38 Unauthorized (cancel)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.39 Unauthorized (refund)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

Refund the transaction

Send a 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."
}


5.40 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."
}


5.41 Service unavailable (commit)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.42 Service unavailable (cancel)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.43 Service unavailable (refund)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

Refund the transaction

Send a 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."
}


5.44 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."
}


5.45 Internal error (commit)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.46 Internal error (cancel)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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."
}


5.47 Internal error (refund)

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

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

{ 
    "responseCode": "OK", 
    "responseMessage": "Success.",
    "transactionId": "{Bango-transaction-id}"
}
2

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.",
}
3

Refund the transaction

Send a 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."
}


5.48 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
MSISDN447710900120

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."
}


  • No labels