> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bango.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing overview

> What you need to test to go live with the Bango Reseller API

You must test your code, and Bango must certify your test results, before you can go live.

All development and most testing uses [test credentials](/legacy/platform/connectivity/basic-auth), which Bango supplies to you [when you sign up](/legacy/platform/getting-started/index). These credentials let you use the full capabilities of the Bango Reseller API, with production URLs, but sandboxed to ensure you and your test users can't accidentally work with live merchants and live services.

Bango recommends two stages of testing:

1. **API testing**: with test credentials, making sure your code sends correctly formatted API requests, and handles responses appropriately
2. **Production testing**: real-world testing with production credentials and live merchants

Certification Process Prerequisites

1. Valid Bango Resale API username and password for a Bango test account
2. IP addresses for the reseller systems provided and whitelisted on Bango system
3. [Basic Authentication](/legacy/platform/connectivity/basic-auth)

### Bango Music

Bango Music is a test merchant provided by Bango which simulates a merchant. Bango Music can be used to test against the Bango platform without a live merchant connection.

For all certification tests, the following API parameters should be used:

1. productKey: BangoMusic
2. merchantAccountKey: BANGO (case sensitive)

Before commencing with the testing, the reseller can use the [Service Availability API](/legacy/platform/connectivity/index) to ensure basic network connection is working correctly.

<Steps>
  <Step title="Connectivity Test">
    **Prerequisites:** Refer ‘Certification Process Prerequisites’

    **Action:** Using the Bango Resale method to send a service availability request; `https://resale.api.bango.net/v1/echo/[echoRequestId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    "responseCode": "OK",
    "responseMessage": "Success",
    "echo": "a25100b8-4e0c-4e37-b921-cac9cb1e930f"
    ```
  </Step>
</Steps>

#### Certification

Successful First Time Activation

These steps will certify the reseller can create a pending entitlement for the first time and activate the entitlement. The reseller will certify they can query and cancel an entitlement using the below steps.

<Steps>
  <Step title="Create Entitlement">
    **Prerequisites:** N/A

    **Action:** Using the Bango Resale method to [create a new entitlement](/legacy/resale/reseller/entitlements/create) with appropriate parameters for your integration: 1. customerIdentifier 2. merchantAccountKey 3. productKey 4. notificationUrl

    **Expected Result:** HTTP 202

    ```text theme={null}
    "responseCode": "CLIENT_ACTION_REQUIRED",
    "parameters": {
        "action": "NAVIGATE_TO_URL",
        "url": "https://stubby.bango.net/BangoMusic?entitlementGuid=&automated=false"
    },
    "entitlementId": "___”
    ```
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement created successfully in action 1

    **Action:** Using the Bango Resale method to [query an entitlement](/legacy/resale/reseller/entitlements/read). `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "PENDING",
    ```
  </Step>

  <Step title="Navigate to URL">
    **Prerequisites:** Entitlement created successfully in action 1

    **Action:** Click ‘Activate Subscription Button

    **Expected Result:** Presented with “Premium – Buy now with 1 click!” option. Do not click the button, the presentation of this pages means the entitlement is now active. Activation notification should have been received.
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement activated successfully in action 3

    **Action:** Using the Bango Resale method to [query the entitlement](/legacy/resale/reseller/entitlements/read) from action 1. `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "ACTIVE",
    ```
  </Step>

  <Step title="Cancelling an Entitlement">
    **Prerequisites:** Entitlement activated successfully in action 3

    **Action:** Using the Bango Resale method to [cancel an entitlement](/legacy/resale/reseller/entitlements/cancel) with appropriate parameters for your integration. 1. cancelReasonCategory 2. cancelReasonCode 3. cancelReasonDescription `https://resale.api.bango.net/v1/entitlement/cancel/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "CANCELLED",
    ```
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement cancelled successfully in action 5

    **Action:** Using the Bango Resale method to [query the entitlement](/legacy/resale/reseller/entitlements/read) from action 1. `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "CANCELLED",
    ```
  </Step>
</Steps>

#### Double Activation

The double activation certification is to check the reseller can not activate the same entitlement twice. This is completed by requesting a second entitlement using the same parameters as the first. This reseller will also revoke the entitlement.

<Steps>
  <Step title="Create Entitlement" stepNumber={1}>
    **Prerequisites:** N/A

    **Action:** Using the Bango Resale method to [create a new entitlement](/legacy/resale/reseller/entitlements/create) with appropriate parameters for your integration: 1. customerIdentifier 2. merchantAccountKey 3. productKey 4. notificationUrl

    **Expected Result:** HTTP 202

    ```text theme={null}
    "responseCode": "CLIENT_ACTION_REQUIRED",
    "parameters": {
        "action": "NAVIGATE_TO_URL",
        "url": "https://stubby.bango.net/BangoMusic?entitlementGuid=&automated=false"
    },
    "entitlementId": "___”
    ```
  </Step>

  <Step title="Navigate to URL" stepNumber={2}>
    **Prerequisites:** Entitlement created successfully in action 7

    **Action:** Click ‘Activate Subscription Button

    **Expected Result:** Presented with “Premium – Buy now with 1 click!” option. Do not click the button, the presentation of this pages means the entitlement is now active. Activation notification should have been received.
  </Step>

  <Step title="Create Entitlement">
    **Prerequisites:** Entitlement created successfully in action 7

    **Action:** Using the Bango Resale method to [create a new entitlement](/legacy/resale/reseller/entitlements/create) with the same parameters as action 7.

    **Expected Result:** HTTP 400

    ```text theme={null}
    responseCode": "BAD_REQUEST",
    "responseMessage": "Invalid request or the request contains invalid data.
    Maximum number of subscriptions for user reached",
    ```
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement activated successfully in action 7

    **Action:** Using the Bango Resale method to [query the entitlement](/legacy/resale/reseller/entitlements/read) from action 7. `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "ACTIVE",
    ```
  </Step>

  <Step title="Revoking an Entitlement">
    **Prerequisites:** Entitlement activated successfully in action 7

    **Action:** Using the Bango Resale method to [revoke an entitlement](/legacy/resale/reseller/entitlements/revoke) with appropriate parameters for your integration. 1. cancelReasonCategory 2. cancelReasonCode 3. cancelReasonDescription `https://resale.api.bango.net/v1/entitlement/revoke/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "REVOKED",
    ```
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement revoked successfully in action 11

    **Action:** Using the Bango Resale method to [query the entitlement](/legacy/resale/reseller/entitlements/read) from action 7. `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "REVOKED",
    ```
  </Step>
</Steps>

#### Expiry and Renewals

The reseller will set an expiry date, a notification URL to certify the auto expiry and reseller notification to certify the reseller can consume a cancel notification from Bango. This step will also certify the reseller can request entitlement updates.

<Steps>
  <Step title="Create Entitlement">
    **Prerequisites:** N/A

    **Action:** Using the Bango Resale method to [create a new entitlement](/legacy/resale/reseller/entitlements/create) with appropriate parameters for your integration: 1. customerIdentifier 2. merchantAccountKey 3. productKey 4. notificationUrl 5. dateExpiry

    **Expected Result:** HTTP 202

    ```text theme={null}
    "responseCode": "CLIENT_ACTION_REQUIRED",
    "parameters": {
        "action": "NAVIGATE_TO_URL",
        "url": "https://stubby.bango.net/BangoMusic?entitlementGuid=&automated=false"
    },
    "entitlementId": "___”,
    "dateExpiry": "___"
    ```
  </Step>

  <Step title="Navigate to URL">
    **Prerequisites:** Entitlement created successfully in action 13

    **Action:** Click ‘Activate Subscription Button

    **Expected Result:** Presented with “Premium – Buy now with 1 click!” option. Do not click the button, the presentation of this pages means the entitlement is now active. Activation notification should have been received.
  </Step>

  <Step title="Update Entitlement">
    **Prerequisites:** Entitlement activated successfully in action 13

    **Action:** Using the Bango Resale method to [update an entitlement](/legacy/resale/reseller/entitlements/update) with a new expiry time close to the time now. 1. entitlementId 2. dateExpiry

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "dateExpiry": "___",
    ```
  </Step>

  <Step title="Query Entitlement">
    **Prerequisites:** Entitlement created successfully in step 13

    **Action:** Using the Bango Resale method to [query an entitlement](/legacy/resale/reseller/entitlements/read). Once the time has passed on the expiry date and time set in step 15. Query the entitlement using the entitlement ID provided in action 13. `https://resale.api.bango.net/v1/entitlement/[entitlementId]`

    **Expected Result:** HTTP 200

    ```text theme={null}
    responseCode": "OK",
    "responseMessage": "Success",
    "entitlementId": "___",
    "status": "CANCELLED",
    ```
  </Step>
</Steps>

For more information, contact [Bango Support](/legacy/platform/architecture/support).
