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

# Test your payment integration

Before you start accepting payments, test your Rocka integration to make sure everything's working as intended.

## Test your integration

<Steps>
  <Step title="Make a test API call">
    1. Go to your [Rocka Hub](https://hub.rocka.live/) > **Integration**. You'll find your test API key under **Test credentials**.
    2. To verify your site is connected to Rocka, make a test API call with your sandbox key. For example, you can try the Get the list of top banks endpoint.
  </Step>

  <Step title="Create your first payment in sandbox mode">
    Try creating your first payment with your test API key using the [POST /api/payments endpoint](/api-reference/create-open-banking-payments).

    The response will include the `url` parameter, which is the payment link:

    ```json Sample response theme={null}
    {
      "id": "d620b186-f3fd-41cf-afa2-35d290002c87",
      "url": "https://stage.checkout.rocka.live/?id=d620b186-f3fd-41cf-afa2-35d290002c87&country=EU&info_isNew=true",
      "qrCode": null,
      "token": "v4.local.nfh1xPxnY6ekBQYmMaEOF7_sivOdy6WPrXW1eZJGVEeIiL8BXZep_P7lJS02KAjRqOWVabXvebTK8hVccovmxQ6SFLttc80lPvEjN2hvOgjAx20bJxQD07I5gp8X-EHoiIrit4ANEEvSM5iYOhnkobrB6yLC-tD8YQO8K_pCmOTyTPjx261JwZ5BNLoB_Klg27nPRRpJE400_9VQIbWR95s4dnH2NM2NRFJQ83LZCDJ07gTimjEHkpfDYXrU1F7-9Jb9JhylqETRTevCwOlWBUex-agzobgMLxG4dNU6frGM6uMI0RpKZcYjbWcp5lwdqiLhtBJ4ZTPicDDm0tNh_JCA5UbXyxx1GxPe76Eh1RYHhP3S-BOJ-yk1EI0eHkC0bPQw-IMQ_AHohhZR2-Qu8nk2lQ",
      "threeDsData": null,
      "status": "New"
    }
    ```
  </Step>

  <Step title="Place the test payment">
    To make a test payment, follow the steps below. This payment flow will be the same for your customers.

    1. Open the link in the `url` parameter. If you're located in one of the supported locales, Rocka will automatically detect your country and offer local banks. You can also change the country using the dropdown list in the top-right.
    2. For most locales, you will be prompted for a local IBAN. You can  use one of the test IBANs provided below. Once you enter the IBAN, click **Proceed to payment** → **Go to bank**.
           <Accordion title="Test IBANs for each country">
             | Country     | Test IBAN                      |
             | ----------- | ------------------------------ |
             | Austria     | `AT442060462969882667`         |
             | Belgium     | `BE86548395218350`             |
             | Bulgaria    | `BG11UNCR70002357555869`       |
             | Czechia     | `CZ3950512253883481546422`     |
             | Denmark     | `DK0350517819194565`           |
             | Estonia     | `EE241288345534195171`         |
             | Finland     | `FI6096556523142496`           |
             | France      | `FR2017569000305334518641U14`  |
             | Germany     | `DE28500105175177352381`       |
             | Greece      | `GR8001017482782598767712723`  |
             | Hungary     | `HU47109180019139163433933895` |
             | Ireland     | `IE13BOFI900017196892`         |
             | Italy       | `IT41G0300203280631633853611`  |
             | Latvia      | `LV47BFTO78HL1E44S557U`        |
             | Lithuania   | `LT531333837574574518`         |
             | Luxembourg  | `LU970101299639351982`         |
             | Netherlands | `NL06RABO3605998615`           |
             | Norway      | `NO4643439454116`              |
             | Poland      | `PL92109024024223477881477127` |
             | Portugal    | `PT36003506517684676992475`    |
             | Romania     | `RO48PORL2287771354415982`     |
             | Slovakia    | `SK8937262781847381589252`     |
             | Slovenia    | `SI37131411574212932`          |
             | Spain       | `ES6221001524961942163622`     |
             | Sweden      | `SE6131639725357863517336`     |
           </Accordion>
       \
       For some banks, you can also ignore the prompt and click **Don't remember your IBAN?** at the bottom of the form. Next, click **Connect to your bank account** → **Go to Bank Europe**, which will send you directly to the test bank website.
    3. On the test bank login form, you can enter these usernames to trigger a specific payment status. Once you enter the username, click **Continue** → **Yes, I agree**.
       | **Username** | Payment status                                                                                                                             |
       | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
       | `done`       | <Badge color="green" stroke>Done</Badge>. You will also receive [callbacks](/api-reference/callbacks) from the sender and recipient banks. |
       | `failed`     | <Badge color="red" stroke>Failed</Badge>. You will receive a callback from the sender bank.                                                |
       | `processing` | <Badge>Awaiting confirmation</Badge>. You will not receive any callbacks.                                                                  |
    4. Select any of the test bank accounts. Click Go to bank and log in to the test bank website again. For real payments, your customers will be redirected to their bank app to confirm the payment on this step.
  </Step>

  <Step title="Process the callback">
    Once the payment goes through, you will receive a callback to the `webhookUrl` you specified in your request. You will also see the payment in the **Transactions** section in your Rocka Hub.

    To see other callbacks you can potentially receive for other payment statuses, see [Callbacks](/api-reference/callbacks).

    ```json theme={null}

    {
     "PaymentId":"bc973098-3dfb-4700-af20-28ca4fdb583a",
     "Status":"Done",
     "Signature":"b2e286bfc7b94ab2342342341881c85b50f286b23462436432d7dfc5fcd05ca2r234r231",
     "MerchantPaymentId":"12345678-1234-1234-1234-12345678910",
     "Reference":"12345678 PAYMENT",
     "Amount":50.0,
     "Currency":"EUR",
     "CardId":null,
     "Remitter":{
        "Name":"User Testing",
        "Iban":"TT123456789HFE112345",
        "SortCode":null,
        "AccountNumber":null
     },
     "AdditionalData":null,
     "DetailedInfo":null,
     "Method":"open-banking",
     "BankId":"sparkasse_de",
     "IsSenderBank":false,
     "BankTransactionId":"BANKTRANSACTIONID",
     "Settled":"Yes",
     "SettlementDate":"2024-10-01T07:18:56.316302Z"
    }

    ```
  </Step>
</Steps>
