# SDK Libraries

We have prepared some language libraries SDK so you can integrate CCPayment as quickly as possible in your system. The libraries focus on being as abstracted as possible for faster integration into your system's language. Below is the list and link to the repository of all supported languages:

<details>

<summary>Java SDK</summary>

[CCPayment Java SDK](https://github.com/cctip/ccpayment-sdk/tree/master/java)

Referencing the Jar Package:

```
<dependency> 
    <groupId>com.ccpayment</groupId> 
    <artifactId>ccpayment</artifactId> 
    <version>1.0.0</version> 
</dependency>
```

Usage:

```
import com.ccpayment.apis;
import com.ccpayment.beans.*;

.....

CCPaymentApis ccpaymentApi = CCPaymentApis.getInstance("ccpament appid from platform", "ccpayment app secret from platform");

// Create order
CreateOrderParam param = new CreateOrderParam();
param.setProductPrice("0.07");
param.setTokenId("2e6cfa7d-f658-455d-89cd-31ebbcfdfa2c");
param.setRemark("order remark");
param.setMerchantOrderId("your order id");
param.setDenominatedCurrency("TOKEN");
param.setNotifyUrl("https://xxxxxxxx.com/notify.url");
param.setOrderValidPeriod(1800);
param.setCustomValue("custom value");
CreateOrderResponse resp = ccpaymentApi.createOrder(param);

// Get checkout URL
CheckoutUrlParam param = new CheckoutUrlParam();
param.setProductPrice("1000");
param.setMerchantOrderId("order no 45");

param.setReturnUrl("https://www.xxxx.com/callback");
param.setProductName("product name");
param.setNotifyUrl("https://xxxxxxxx.com/notify.url");
param.setOrderValidPeriod(1800);
param.setCustomValue("custom value");
CheckoutUrlResponse resp = ccpaymentApi.checkoutUrl(param);

// Get supported coins
GetSupportCoinResponse resp = ccpaymentApi.getSupportCoin();

// Get token balance
AssetsParam param = new AssetsParam();
param.setTokenId("e8f64d3d-df5b-411d-897f-c6d8d30206b7");
AssetsResponse resp = ccpaymentApi.assets(param);

.....
```

See more APIs:   <https://github.com/cctip/ccpayment-sdk-java/blob/master/src/main/java/com/CCPayment/apis/CCPaymentApis.java>

</details>

<details>

<summary>PHP SDK</summary>

[CCPayment PHP SDK](https://packagist.org/packages/ccpayment/php-sdk)

1\. Install composer

2\. composer require ccpayment/php-sdk:dev-master

````
## Example usage
```
<?php

use CCPayment\v1\CCPay;

$resp =  CCPay::CheckUser("9454818","202301310325561620262074393440256","c4600b8125b7ed23b5b7b8ee4acb42f4");
var_dump($resp);

```
````

</details>

<details>

<summary>Golang SDK</summary>

1. Enviorment preparation\
   -Golang&#x20;
2. Import [CCPayment Golang SDK](https://github.com/cctip/ccpayment-sdk/tree/master/golang)

```
import SDK：
go get github.com/cctip/ccpayment-sdk
```

3. Check the test usage example, Call the function in the SDK package.

</details>

<details>

<summary>Node.js SDK</summary>

1. Enviormental preparation\
   Please install the running [environment of Node.js](https://nodejs.org/en/download) to your system.
2. Download SDK\
   [Download the CCPayment Node SDK](https://github.com/cctip/ccpayment-sdk/tree/master/nodejs).
3. Install SDK\
   Open the terminal under the nodejs folder and run the npm install.

Example usage&#x20;

```
const ccpaymentWidgets = require("ccpayment-sdk/nodejs/ccpayment.js")

ccpaymentWidgets.init(appId, appSecret)

ccpaymentWidgets.checkoutURL(
  {
    order_valid_period: 823456,
    product_price: "1",
    merchant_order_id: "20230802175623",
    product_name: "test",
    return_url: "https://app.gitbook.com/xxxxx",
    // ...req
  }, 
  (res) => {
   ...
  }
);
```

Only needs the Callback in some case

```
ccpaymentWidgets.getSupportToken((res) => {
  ...
}
```

</details>

<details>

<summary>Python SDK</summary>

1. Enviormental preparation\
   \- Python 3.9.6+
2. Download and install it: [CCPayment Python SDK](https://github.com/cctip/ccpayment-sdk/tree/master/python)

```
pip3 install --upgrade ccpayment 
```

3. Example usage&#x20;

```
python
import ccpayment

#init
pay = ccpayment.CCPaymentClass(app_id, app_secret) 

#interface called:get_support_coin
data, is_verify = pay.get_support_coin()

if is_verify:
  #Verify signature successfully

else: 
  #Verify signature failed

```

4. The tutorial of the interface called\
   a. Import SDK \
   b. Create the instance of CCPaymentClass, import Merchant app\_id and app\_secret\
   c. Call the specific usage interface, eg. get\_support\_coin\
   d. Verify the signature via the interface: is\_verify\
   e. Verify signature success/ failed<br>

</details>


---

# 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.ccpayment.com/ccpayment-v1.0-api/sdk-libraries.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.
