Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Table of Contents
indent25px

...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "responseCode": "USER_INSUFFICIENT_CREDIT", 
    "responseMessage": "The user does not have enough credit for this payment"
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "responseCode": "USER_BARRED", 
    "responseMessage": "The user is not allowed to use this payment method",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "responseCode": "USER_NOT_ENABLED", 
    "responseMessage": "The biller has not enabled this user for payments",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "responseCode": "USER_SUSPENDED", 
    "responseMessage": "The user is temporarily not allowed to use this payment method",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
  "responseCode": "USER_SPEND_LIMIT",
  "responseMessage": "The user has reached their spend 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:

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


...

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:

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


...

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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:


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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:


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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:


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


...

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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:


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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "responseCode": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

Code Block
{ 
    "responseCode": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

Code Block
{ 
    "responseCode": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:


Code Block
{ 
    "responseCode": "FAILURE", 
    "responseMessage": "The biller returned an unspecified failure",
}


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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

Code Block
{
    "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:

Code Block
{ 
    "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

Code Block
{
    "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:

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


...

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

identificationMethodKey

GBR_BANGO
MSISDN447710900120

...

Info

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

Code Block
{
    "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:

Code Block
{ 
    "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}

Code Block
No body required


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

Code Block
{ 
    "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.


Code Block
{
    "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:

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


...

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

identificationMethodKey

GBR_BANGO
MSISDN447710900120

...

Info

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

Code Block
{
    "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:

Code Block
{ 
    "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}

Code Block
No body required


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

Code Block
{ 
    "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.


Code Block
{
    "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:

Code Block
{ 
    "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.

Code Block
{
    "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:

Code Block
{
  "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:

Code Block
{ 
    "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


Code Block
{
    "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:

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


...

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:

Code Block
{
  "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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:

Code Block
{
  "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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:

Code Block
{
  "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:


Code Block
{
  "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:

Code Block
{ 
  "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:

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


...

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:

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


...

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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:

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


...

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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

Code Block
{ 
    "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:

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


...

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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

Code Block
{ 
    "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:

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


...

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:

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


2

Commit the transaction

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

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

Code Block
{ 
    "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:

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


...

To use Bango's test payment provider 'TestPay' to test this scenario scenario generate a userId using  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




Code Block
{
    "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:

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


...