# How to integrate TopChange Pay

[TopChange Pay](https://www.topchange.net/) (TC Pay) can be connected to B2CORE through [PSS](https://docs.b2core.b2broker.com/integrations/payment-systems#payment-system-service-pss), with support for deposits and withdrawals in `USD`, `IRR`, `EUR`, `AED`, `TRY`, `CNY`, `RUB`, and `USDT`.

Follow the instructions below to configure the TC Pay connections and set up the deposit and withdrawal methods in the B2CORE Back Office. These instructions correspond to the [General procedure](https://docs.b2core.b2broker.com/how-to-articles/manage-payment-methods/how-to-add-deposit-and-withdrawal-methods-through-pss) for adding methods for PSS-supported payment systems, but include details specific to TC Pay.

{% hint style="info" %}
Before proceeding with the instructions, you must have signed up for TC Pay and have an active account. You can consult the official [TC Pay documentation](https://topchange1.zendesk.com/) or contact their support in case you have any questions.
{% endhint %}

## Configure connections to TopChange Pay

If you plan to use TC Pay for both deposits and withdrawals, you must configure two separate connections: one for deposits and another for withdrawals.

To configure a connection to TC Pay:

{% stepper %}
{% step %}
In the B2CORE Back Office, navigate to **System** > **External connections**.
{% endstep %}

{% step %}
Click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
On the **Create connection** page, fill in the following fields:

* In the **Name** field, enter a name for the connection. The name must be unique and may only contain Latin letters, numbers, dashes, and underscores (for example, `Deposits_TC_Pay` or `Withdrawals_TC_Pay`).
* In the **Caption** field, enter a caption that will be applied to the connection in the Back Office.
* In the **Provider** dropdown, select:
  * **PaymentSystemDeposit** — to add a connection that will be used for a deposit method.
  * **PaymentSystemWithdrawal** — to add a connection that will be used for a withdrawal method.
    {% endstep %}

{% step %}
In the **Driver** dropdown that appears, select **TC Pay**.
{% endstep %}

{% step %}
In the **Credentials** section that appears, configure the TC Pay-specific settings:

* In the **API base URL** field, specify `https://pg.toppayment.net`.
* In the **Merchant ID** field, enter the Merchant ID assigned to your account by TC Pay.
* Generate a pair of RSA *private* and *public* keys using the **TC RSA Key Generator**.

  You can consult the official [TC Pay documentation](https://topchange1.zendesk.com/) or contact their support in case you have any questions.
* In the **Private RSA key** field, specify the *private* key, and make sure to specify the corresponding *public* key in your TC Pay account.
  {% endstep %}

{% step %}
Click **Save** to create the connection.

The **TC Pay** connection will appear in the list of external connections.
{% endstep %}

{% step %}
Check the connection status.

If the connection is inactive (**No** is displayed in the **Enabled** column), click the **Edit** button to open the connection details and set the **Enabled** dropdown to **Yes**.
{% endstep %}

{% step %}
Click **Save** to apply the changes.
{% endstep %}
{% endstepper %}

If you need to support both deposits and withdrawals via TC Pay, follow the same instruction to create a new connection for the other operation.

## Add a deposit method through TopChange Pay

To add and set up a method for making deposits through TC Pay:

{% stepper %}
{% step %}
In the B2CORE Back Office, navigate to **System** > **Deposit system** > **Deposit methods**.
{% endstep %}

{% step %}
Click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
On the **Create a deposit method** page, fill in the following fields:

* In the **Name** field, enter a name for the method. The name must be unique and may only contain Latin letters, numbers, dashes, and underscores.
* In the **Caption** field, enter a caption for the method. This caption will be assigned to the method in the Back Office and will be visible to clients in the B2CORE UI.
* In the **Provider** dropdown, select **PaymentSystemDeposit**.
  {% endstep %}

{% step %}
After selecting **PaymentSystemDeposit**, the following fields appear:

* In the **Available account currencies** dropdown, select one or more currencies. Deposits through TC Pay will be available to accounts denominated in the selected currencies.
* In the **Driver** dropdown, select **TC Pay**.
* In the **Connection** dropdown, select the previously configured [TC Pay connection for deposits](#configure-connections-to-topchange-pay).
  {% endstep %}

{% step %}
In the **Configuration** section, fill in the **Terminal ID** associated with your TC Pay merchant account. This ensures that transactions are correctly routed and attributed to the appropriate payment terminal. Note that the allowed currency is determined by the specified Terminal ID.
{% endstep %}

{% step %}
Click **Save** to create the deposit method.

The **TC Pay** deposit method will appear in the list of deposit methods.
{% endstep %}

{% step %}
Click **Edit** to enter the method details and complete the following fields:

* On the **Settings** tab, use the **Group** dropdown to select one or more groups where the method should be included.
* In the **Icon** field, specify the URL of an image that will be displayed as the icon for the deposit method in the B2CORE UI.
* Check the method status.

  If the method is inactive (**No** is displayed in the **Enabled** field), activate it by setting the **Enabled** dropdown to **Yes**.
* On the **PS Currencies** tab, add the needed currency. To enable the method to process deposits in a specific currency, ensure it is added on this tab.

{% hint style="warning" %}
For TC Pay, each deposit method can support only one currency under the **PS Currencies** tab. Therefore, if you want to allow your clients to deposit in all supported currencies (`USD`, `IRR`, `EUR`, `AED`, `TRY`, `CNY`, `RUB`, and `USDT`), you must create eight separate deposit methods — one for each currency, corresponding to the specified **Terminal ID**.
{% endhint %}

* If needed, configure commissions for the method on the **Commissions** tab (for details, refer to [How to configure commissions for deposit and withdrawal methods](https://docs.b2core.b2broker.com/how-to-articles/manage-payment-methods/how-to-configure-commissions-for-deposit-and-withdrawal-methods)).

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-73f59fc2c69be3bdeef4fab147fd38e01929bc0b%2Ftopchange-deposit-method-details.png?alt=media" alt="TC Pay deposit method — Settings tab"><figcaption><p>TC Pay deposit method — Settings tab</p></figcaption></figure>
{% endstep %}

{% step %}
Click **Test configuration** to validate the connection settings of the deposit method.

The test result will be displayed on the page.
{% endstep %}

{% step %}
After successfully validating the configuration, click **Save**.
{% endstep %}
{% endstepper %}

The **TC Pay** deposit method is now configured in the B2CORE Back Office.

## Add a withdrawal method through TC Pay

To add and set up a method for making withdrawals through TC Pay:

{% stepper %}
{% step %}
In the B2CORE Back Office, navigate to **System** > **Payout system** > **Payout methods**.
{% endstep %}

{% step %}
Click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
On the **Create a payout method** page, fill in the following fields:

* In the **Name** field, enter a name for the method. The name must be unique and may only contain Latin letters, numbers, dashes, and underscores.
* In the **Caption** field, enter a caption for the method. This caption will be assigned to the method in the Back Office and will be visible to clients in the B2CORE UI.
* In the **Provider** dropdown, select **PaymentSystemWithdrawal**.
  {% endstep %}

{% step %}
After selecting **PaymentSystemWithdrawal**, the following fields appear:

* In the **Available account currencies** dropdown, select one or more currencies. Withdrawals through TC Pay will be available from accounts denominated in the selected currencies.
* In the **Driver** dropdown, select **TC Pay**.
* In the **Connection** dropdown, select the previously configured [TC Pay connection for withdrawals](#configure-connections-to-topchange-pay).
  {% endstep %}

{% step %}
In the **Configuration** section, fill in the **Terminal ID** associated with your TC Pay merchant account. This ensures that transactions are correctly routed and attributed to the appropriate payment terminal. Note that the allowed currency is determined by the specified Terminal ID.
{% endstep %}

{% step %}
Click **Save** to create the withdrawal method.

The **TC Pay** withdrawal method will appear in the list of withdrawal methods.
{% endstep %}

{% step %}
Click **Edit** to enter the method details and complete the following fields:

* On the **Settings** tab, use the **Group** dropdown to select one or more groups where the method should be included.
* In the **Icon** field, specify the URL of an image that will be displayed as the icon for the withdrawal method in the B2CORE UI.
* Check the method status.

  If the method is inactive (**No** is displayed in the **Enabled** field), activate it by setting the **Enabled** dropdown to **Yes**.
* On the **PS Currencies** tab, add the needed currency. To enable the method to process withdrawals in a specific currency, ensure it is added on this tab.

{% hint style="warning" %}
For TC Pay, each withdrawal method can support only one currency under the **PS Currencies** tab. Therefore, if you want to allow your clients to withdraw in all supported currencies (`USD`, `IRR`, `EUR`, `AED`, `TRY`, `CNY`, `RUB`, and `USDT`), you must create eight separate withdrawal methods — one for each currency, corresponding to the specified **Terminal ID**.
{% endhint %}

* If needed, configure commissions for the method on the **Commissions** tab (for details, refer to [How to configure commissions for deposit and withdrawal methods](https://docs.b2core.b2broker.com/how-to-articles/manage-payment-methods/how-to-configure-commissions-for-deposit-and-withdrawal-methods)).

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-7ea6d5ea2c62a87d4e40a854d80496dbc590ab48%2Ftopchange-withdrawal-method-details.png?alt=media" alt="TC Pay withdrawal method — Settings tab"><figcaption><p>TC Pay withdrawal method — Settings tab</p></figcaption></figure>
{% endstep %}

{% step %}
Click **Test configuration** to validate the connection settings of the withdrawal method.

The test result will be displayed on the page.
{% endstep %}

{% step %}
After successfully validating the configuration, click **Save**.
{% endstep %}
{% endstepper %}

The **TC Pay** withdrawal method is now configured in the B2CORE Back Office.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2core.b2broker.com/how-to-articles/manage-payment-methods/how-to-add-deposit-and-withdrawal-methods-through-pss/how-to-integrate-topchange.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
