CCPayment
Have Questions?TwitterMediumBlog
  • CCPayment - For Merchant
    • What is CCPayment
    • CCPayment API Introduction
    • Fees
    • Invoice
    • Contact Us
  • CCPayment v1.0 API
    • SDK Libraries
    • To Get Started
      • Signature
      • API Specification Common Rules
    • Payment API - CCPayment
      • Hosted Checkout Page Integration
      • Native Checkout Integration
      • API Deposit Order Information Interface
    • Wallet API - CCPayment
      • Get permanent deposit address for users
    • Withdrawal API Integration
      • Create a withdrawal order
      • Withdrawal Order Information Interface
    • Resources Document
      • Token ID Interface
      • Current Token Rate Interface
      • Asset Balance Interface
      • Network Fee Interface
      • Block Height Information Retrieval API
      • Check the Validity of Cwallet ID
      • List of Supported Coins
      • List of Denominated Currency for API Payment
      • Error Code
    • Webhook Notification
      • Webhook Notification Tutorial
      • API Deposit Webhook Notification
      • Direct Deposit to Permanent Address Webhook Notification
      • Invocie Webhook Notification
      • Withdraw Webhook Notification
      • Refund Webhook Notification
      • Resend Webhook Notification
  • Changes
    • Change Record
    • Upcoming Changes
  • FAQ
    • FAQ
    • Webhook Notification
      • How to receive the transaction notification
      • Why do some deposit transactions not include the “from address” in the webhook notification?
    • Payment
      • Why hasn't my transactions been confirmed?
      • Why hasn't my withdrawal arrived
      • Minimum amount of withdrawal and deposit
      • How to find out withdrawal fees for each cryptocurrency?
      • How does CCPayment charge the service fee
      • After payment has been paid, why does the order status not appear successful
      • What types of tokens do we accept for payment
      • How long does it take for a withdrawal to be processed
      • When a payment is not sufficiently made, can the user make it again and have it credited correctly
      • Is it possible to pay by credit card
      • What is token aggregation fee?
    • Security & Privacy
      • How to Secure My CCPayment Account
      • What information do you collect about my customers
      • Is my website required to be reviewed when using CCPayment API
      • Why can’t I get the email verification code?
      • Verify your site ownership
        • Verify your site ownership with HTML file
        • Verify your site ownership with HTML tag
    • Refund
      • How to cancel a pending refund request
      • How does the merchant issue a refund to the customer
      • What should you do if you entered a wrong memo/tag?
      • What should you do if you credited to CCPayment's unsupported tokens?
    • Others & Academy
      • How to manage multiple merchant account
      • How does the lock exchange rate of an order work and what happens when it is locked
      • What is the transaction under the category Other in the transaction records
      • Are there any regional restrictions on API use
      • What is a referral program?
      • CCPayment ETH Testnet Tutorial
      • What is auto-swap for deposit?
  • CCPAYMENT POLICY
    • CCPayment Privacy Policy
    • Disclaimer for Purchasers
    • Terms of Use
    • AML/CTF Policy
Powered by GitBook
On this page
  1. CCPayment v1.0 API

SDK Libraries

PreviousContact UsNextTo Get Started

Last updated 1 year ago

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:

Java SDK

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

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);

```
Golang SDK
  1. Enviorment preparation -Golang

  1. Import

import SDK:
go get github.com/cctip/ccpayment-sdk
  1. Check the test usage example, Call the function in the SDK package.

Node.js SDK
  1. Enviormental preparation Please install the running to your system.

  1. Download SDK .

  1. Install SDK Open the terminal under the nodejs folder and run the npm install.

Example usage

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) => {
  ...
}
Python SDK
  1. Enviormental preparation - Python 3.9.6+

  1. Download and install it:

pip3 install --upgrade ccpayment 
  1. Example usage

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
  1. 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

CCPayment Java SDK
CCPayment PHP SDK
CCPayment Golang SDK
environment of Node.js
Download the CCPayment Node SDK
CCPayment Python SDK