# How to integrate ChipPay

[ChipPay](https://www.chippay.com/) 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.

ChipPay processes payments in `CNY`, which serves as its settlement currency, while the B2CORE PPS sends and receives amounts to and from ChipPay in `USDT`. For this reason, `USDT` must be added as a PS currency in the deposit and withdrawal methods configured in B2CORE.

Follow the instructions below to configure the ChipPay 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 ChipPay.

{% hint style="info" %}
Before proceeding with the instructions, you must have signed up for ChipPay and have an active account. If you have any questions, consult the official [ChipPay Help Center](https://chippayhelp.zendesk.com/hc/en-gb) or contact their support team.
{% endhint %}

## Configure connections to ChipPay

If you plan to use ChipPay for both deposits and withdrawals, you must configure separate connections, each dedicated to a specific deposit or withdrawal method.

Each connection must be configured with the appropriate driver to ensure the correct operation of the respective deposit or withdrawal method.

To configure a connection to ChipPay:

{% 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_ChipPay` or `Withdrawals_ChipPay`).
* 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:

* **ChipPay P2P buying order** — for deposits processed through ChipPay payment orders. Clients can pay using one of the available methods configured in your ChipPay merchant account, such as bank cards, **AliPay**, or **WeChat Pay**, if those options are enabled.
* **ChipPay express buying order** — for deposits via bank card payments.
* **ChipPay** — for withdrawals via bank card payments.
  {% endstep %}

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

* In the **API base URL** field, specify `https://open-v2.chippay.com/`.
* In the **Merchant ID** field, enter your ChipPay Merchant ID.
* Generate a pair of 4096-bit RSA *private* and *public* keys using a secure tool, such as **OpenSSL** or another trusted method.

{% hint style="info" %}
For security reasons, it isn't recommended to use online tools to generate the keys.
{% endhint %}

* In the **Private key** field, specify the *private* key, and make sure to specify the corresponding *public* key in your ChipPay account.
  {% endstep %}

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

The **ChipPay** connection for deposits or withdrawals 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 additional ChipPay connections for other payment methods, follow the same instruction to create a new connection with a different driver.

The image below displays three configured ChipPay connections: one for the withdrawal method and two for deposit methods.

<figure><img src="https://514898401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGoRxAprhHu1goANW7FXt%2Fuploads%2Fgit-blob-427e429a3747f548a76f0336b2631855daad7066%2Fchippay-external-connections.png?alt=media" alt="External connections to ChipPay"><figcaption><p>External connections to ChipPay</p></figcaption></figure>

## Add a deposit method through ChipPay

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

{% 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 ChipPay will be available to accounts denominated in the selected currencies.
* In the **Driver** dropdown, select **ChipPay P2P buying order** or **ChipPay express buying order**.
* In the **Connection** dropdown, select the previously configured [ChipPay connection for deposits](#configure-connections-to-chippay).
  {% endstep %}

{% step %}
If you selected the **ChipPay P2P buying order** driver, skip the **Configuration** section, as no settings are required for this deposit method.

If you selected the **ChipPay express buying order** driver, in the **Configuration** section that appears, fill in the following fields:

* In the **Exchange rate adjustment** dropdown, select:
  * **Yes** — to adjust the exchange rate provided by ChipPay when converting deposited funds into `CNY`, which is the settlement currency used by ChipPay for processing payments.
  * **No** — to use the default rate provided by ChipPay.
* If you selected **Yes**, specify the adjustment value (as a percentage) in the **Adjustment value** field. The rate can only be adjusted within a ±3% range. For example, entering `3` increases the exchange rate by 3%, while `-3` decreases it by 3%.

The adjusted rate will appear in the details of the ChipPay P2P buying order created to process the deposit.
{% endstep %}

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

The **ChipPay** 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 `paymethod-chippay` to display the [predefined icon](https://docs.b2core.b2broker.com/integrations/payment-systems) for the ChipPay deposit method in the B2CORE UI. To use a custom icon, specify the URL of the image to be displayed.
* 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 `USDT`.
* 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-b1a34abb7d73b22ff966fc91e7a01ba85f4dc43d%2Fchippay-deposit-method-details.png?alt=media" alt="ChipPay deposit method — Settings tab"><figcaption><p>ChipPay deposit method — Settings tab</p></figcaption></figure>
{% endstep %}

{% step %}
Click **Test configuration** to validate the connection settings of the deposit method. The test is performed based on the settings specified in the method form and the data provided in the selected external connection.

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

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

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

If you want to support both deposit methods offered by ChipPay, add and set up another deposit method that uses a different driver and connection.

## Add a withdrawal method through ChipPay

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

{% 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 ChipPay will be available from accounts denominated in the selected currencies.
* In the **Driver** dropdown, select **ChipPay**.
* In the **Connection** dropdown, select the previously configured [ChipPay connection for withdrawals](#configure-connections-to-chippay).
  {% endstep %}

{% step %}
Skip the **Configuration** section, as no settings are required for ChipPay withdrawals.
{% endstep %}

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

The **ChipPay** 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 `paymethod-chippay` to display the [predefined icon](https://docs.b2core.b2broker.com/integrations/payment-systems) for the ChipPay withdrawal method in the B2CORE UI. To use a custom icon, specify the URL of the image to be displayed.
* 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 `USDT`.
* 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-e280bcdcea2af685387faef30475b2eeb7ced704%2Fchippay-withdrawal-method-details.png?alt=media" alt="ChipPay withdrawal method — Settings tab"><figcaption><p>ChipPay withdrawal method — Settings tab</p></figcaption></figure>
{% endstep %}

{% step %}
Click **Test configuration** to validate the connection settings of the withdrawal method. The test is performed based on the settings specified in the method form and the data provided in the selected external connection.

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

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

The **ChipPay** 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-chippay.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.
