Billing.
1 Success scenarios (API only)
To use Bango's test payment provider 'TestPay' to test these scenarios generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900120 |
1.1 Check for payment options
Test | Action | Expected result |
---|---|---|
1 | [Optional] Check for available payment options before starting a transaction Send a valid OPTIONS request to https://api.bango.net/v5/transaction E.g. { "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": { } } | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", "availablePaymentMethods": [ { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } } ] } |
1.2 Start then commit a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
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.", } |
1.3 Start then cancel a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
3 | 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 200 (OK) should be returned with the following body: { "responseCode": "CANCELLED", "responseMessage": "The transaction was cancelled successfully." } |
1.4 Start, commit then refund a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
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 | Refund the transaction Send a valid DELETE 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": "REFUNDED", "responseMessage": "The transaction was refunded successfully." } |
1.5 Start and partially commit a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
3 | Partially commit the transaction Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount or taxAmount lower than the POST { "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethods": [ "OPERATORBILLING", ], "paymentItems": [ { "priceList": [ { "grossAmount": "0.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 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", } |
1.6 Start and partially commit a transaction then refund
NOTE: Partial commits 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": "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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
3 | Partially commit the transaction Send a valid PUT request to https://api.bango.net/v5/transaction/{Bango-transaction-id} with a grossAmount or taxAmount lower than the POST { "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethods": [ "OPERATORBILLING", ], "paymentItems": [ { "priceList": [ { "grossAmount": "0.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 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} No body required | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "REFUNDED", "responseMessage": "The transaction was refunded successfully." } The committed amount will be refunded to the user. |
1.7 Start and commit a transaction then partial refunds
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "10.99", "taxAmount": "1.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
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 valid 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": "1.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 | Further partial refunds under remaining amount Subsequent partial refunds can be made up to the amount remaining from the original transaction. | 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. |
1.8 Start and partially commit a transaction then partial refunds
NOTE: Partial commits or 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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "10.99", "taxAmount": "1.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
3 | Commit the transaction Send a valid PUT 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": "10.59", "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 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", } |
4 | Partially refund the transaction Send a valid 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": "1.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 | Further partial refunds under remaining amount Subsequent partial refunds can be made up to the amount remaining from the original committed amount. | 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. |
1.9 Key-Value pairs - ordering & additional outputs
As the functionality of the API is expanded additional Key-Value pairs may be sent in a response.
Test that any previously unknown pairs or values received will be ignored/handled and that you can accept Key-Value pairs in any order.
Test | Action | Expected result |
---|---|---|
1 | Receive a response with Key-Value pairs in a random sequence and with one or more additional undocumented pairs. E.g. { "responseMessage": "Success.", "responseCode": "OK", "abcd": "1234", "transactionId": "{Bango-transaction-id}" "abcd": "1234" } | The response should be accepted and processed as normal. |
2. Success scenarios (redirect)
To use Bango's test payment provider 'TestPay' to test these scenarios generate a userId using the following details:
identificationMethodKey | GBR_BANGOREDIRECT |
---|---|
MSISDN | 447710900180 |
2.1 Start, re-identify user via redirect, then complete a transaction
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 400 (Bad request) should be returned with the following body: { "responseCode": "INVALID_BANGOUSERID", "responseMessage": "Invalid bangoUserId." } |
2 | Re-identify the user Send a valid POST request to https://api.bango.net/v5/identity E.g. { "merchantReferenceKey": "{your-appstore-identifier}", "mcc": "234", "mnc": "20", "thirdPartyUserId": "{your-user-id}", "deviceCapabilitySendSms": "true", "callbackUrl": "https://{callback-url}", "notificationUrl": "https://{notification-url}" } | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "CLIENT_ACTION_REQUIRED", "responseMessage": "An action is required in the client.", "sessionId": "{sessionId}", "bangoUserId": null, "parameters": { "action": "REDIRECT", "url": "{redirect-url}" } } |
3 | Send the user to the URL provided. | After the user has completed any manual actions required they should be sent to your specified return URL. |
4 | Send POST request to https://api.bango.net/v5/identity/{sessionId} No body required | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", "sessionId": "{sessionId}", "bangoUserId": "123456789", "parameters": { } } |
5 | 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}" } |
6 | 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.", } |
2.2 Start, redirect user, then commit a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
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://www.paypal.com/?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": "{responseCode-from-available-api-codes}" } |
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 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", } |
2.3 Start, redirect user, commit then refund a transaction
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
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://www.paypal.com/?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": "{responseCode-from-available-api-codes}" } |
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 200 (OK) 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} No body required | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "REFUNDED", "responseMessage": "The transaction was refunded successfully." } |
2.4 Start, re-identify user via redirect, then complete a transaction via redirect
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 400 (Bad request) should be returned with the following body: { "responseCode": "INVALID_BANGOUSERID", "responseMessage": "Invalid bangoUserId." } |
2 | Re-identify the user Send a valid POST request to https://api.bango.net/v5/identity E.g. { "merchantReferenceKey": "{your-appstore-identifier}", "mcc": "234", "mnc": "20", "thirdPartyUserId": "{your-user-id}", "deviceCapabilitySendSms": "true", "callbackUrl": "https://{callback-url}", "notificationUrl": "https://{notification-url}" } | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "CLIENT_ACTION_REQUIRED", "responseMessage": "An action is required in the client.", "sessionId": "{sessionId}", "bangoUserId": null, "parameters": { "action": "REDIRECT", "url": "{redirect-url}" } } |
3 | Send the user to the URL provided. | After the user has completed any manual actions required they should be sent to your specified return URL. |
4 | Send POST request to https://api.bango.net/v5/identity/{sessionId} No body required | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", "sessionId": "{sessionId}", "bangoUserId": "123456789", "parameters": { } } |
5 | Start a transaction Send a valid POST request to https://api.bango.net/v5/transaction with new UserId { "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": "CLIENT_ACTION_REQUIRED", "responseMessage": "An action is required in the client.", "transactionId": null, "parameters": { "action": "REDIRECT", "url": "{redirect-the-end-user-to-this-url}"} } } |
6 | 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://www.paypal.com/?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": "{responseCode-from-available-api-codes}" } |
7 | 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 Failure scenarios (API only)
3.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 |
---|---|
MSISDN | 447710900121 |
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", } |
3.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 |
---|---|
MSISDN | 447710900122 |
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", } |
3.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 |
---|---|
MSISDN | 447710900123 |
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", } |
3.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 |
---|---|
MSISDN | 447710900124 |
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", } |
3.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 |
---|---|
MSISDN | 447710900125 |
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_EXCEEDED_LIMIT", "responseMessage": "User exceeded limit on suggested payment methods.", } |
3.6 Speed limit
This scenario can be tested using the Bango API stub feature.
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:
| 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", } |
3.7 Not Available
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900127 |
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": "NOT_AVAILABLE", "responseMessage": "No valid payment methods were found." } |
3.8 Price not supported
This scenario can be tested using the Bango API stub feature.
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:
| 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." } |
3.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 |
---|---|
MSISDN | 447710900129 |
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", } |
3.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 |
---|---|
MSISDN | 447710900130 |
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", } |
3.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 |
---|---|
MSISDN | 447710900130 |
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", } |
3.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 |
---|---|
MSISDN | 447710900132 |
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", } |
3.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 |
---|---|
MSISDN | 447710900133 |
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": "CONNECT_ERROR", "responseMessage": "Connection error submitting the payment request to the biller", } |
3.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 |
---|---|
MSISDN | 447710900134 |
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": "CONNECT_ERROR", "responseMessage": "Connection error submitting the payment request to the biller", } |
3.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 |
---|---|
MSISDN | 447710900135 |
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": "CONNECT_ERROR", "responseMessage": "Connection error submitting the payment request to the biller", } |
3.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 |
---|---|
MSISDN | 447710900136 |
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": "CONNECT_ERROR", "responseMessage": "Connection error submitting the payment request to the biller", } |
3.17 Connect timeout (auth)
This scenario can be tested using the Bango API stub feature.
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:
| 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", } |
3.18 Connect timeout (commit)
This scenario can be tested using the Bango API stub feature.
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:
| 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", } |
3.19 Connect timeout (cancel)
This scenario can be tested using the Bango API stub feature.
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:
| 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", } |
3.20 Connect timeout (refund)
This scenario can be tested using the Bango API stub feature.
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:
| 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", } |
3.21 Billing provider error (auth)
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900141 |
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", } |
3.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 |
---|---|
MSISDN | 447710900142 |
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", } |
3.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 |
---|---|
MSISDN | 447710900143 |
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", } |
3.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 |
---|---|
MSISDN | 447710900144 |
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", } |
3.25 Invalid userId (auth)
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900145 |
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." } |
3.26 Invalid userId (commit)
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900146 |
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 400 (Bad request) should be returned with the following body: { "responseCode": "INVALID_BANGOUSERID", "responseMessage": "Invalid bangoUserId." } |
3.27 Invalid userId (cancel)
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900147 |
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 400 (Bad request) should be returned with the following body: { "responseCode": "INVALID_BANGOUSERID", "responseMessage": "Invalid bangoUserId." } |
3.28 Invalid userId (refund)
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900148 |
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 400 (Bad request) should be returned with the following body: { "responseCode": "INVALID_BANGOUSERID", "responseMessage": "Invalid bangoUserId." } |
3.29 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 |
---|---|
MSISDN | 447710900120 |
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": "0.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": "Invalid request." } |
3.30 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 |
---|---|
MSISDN | 447710900120 |
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": "CANT_REFUND", "responseMessage": "It’s not possible to refund this transaction." } |
3.31 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 |
---|---|
MSISDN | 447710900120 |
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." } |
3.32 Refund not supported
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900149 |
Test | Action | Expected result |
---|---|---|
1 | Start a transaction Make a Delete request for a committed traansaction for a payment provider that does not support refunds | 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." } |
4 Failure scenarios (redirect)
4.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_BANGO |
---|---|
MSISDN | 447710900160 |
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 | (Optional) Retrieve transaction information Send a GET 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." , "transaction": { "transactionId": "{Bango-transaction-id}", "bangoUserId": "123456789", "externalTransactionId": "{your-transaction-id}", "paymentMethod": { "type": "OPERATORBILLING", "key": "{network-name}", "description": "Direct operator billing", "parameters": { } }, "paymentItems": [ { "price": { "grossAmount": "0.99", "taxAmount": "0.00", "currencyIso3": "USD" }, "itemName": "Item name", "itemDescription": "Item description", "itemCategory": "1", "externalPaymentItemId": "{your-payment-item-id}", "submerchantReferenceKey": "{your-submerchant-reference-key}" } ], "extensionData": { } } } |
3 | 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://www.paypal.com/?externalTransactionId={your-transaction-id} &transactionId=null&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": "null", "responseCode": "USER_CANCELLED" } |
4.2 Insufficient credit
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900161 |
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", } |
4.3 User barred
To use Bango's test payment provider 'TestPay' to test this scenario generate a userId using the following details:
identificationMethodKey | GBR_BANGO |
---|---|
MSISDN | 447710900162 |
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. Idempotency
5.1 Start transaction
Test | Action | Expected result |
---|---|---|
1 | Start a transaction Send a valid POST request to https://api.bango.net/v5/transaction with an externalTransactionId | An HTTP response code 200 (OK) should be returned with the following body: { "responseCode": "OK", "responseMessage": "Success.", "transactionId": "{Bango-transaction-id}" } |
2 | Attempt to start a duplicate transaction Send the same POST request any number of times. | The same response should be received for each request. |
5.2 Commit 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 | 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 | Attempt to commit the same transaction Send the same PUT request any number of times. | The same response should be received for each request. |
5.3 Cancel 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 | 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": "CANCELLED", "responseMessage": "The transaction was cancelled successfully." } |
3 | Attempt to cancel the same transaction Send the same DELETE request any number of times. | The same response should be received for each request. |
5.4 Refund 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 | 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 same transaction Send the same DELETE request any number of times. | The same response should be received for each request. |