const ccpayment = require("ccpayment-sdk/nodejs/ccpayment.js")
ccpayment.init(appId, appSecret)
ccpayment.checkoutURL({
order_valid_period: 823456,
product_price: "1",
merchant_order_id: "20230802175623",
product_name: "test",
return_url: "https://app.gitbook.com/xxxxx",
// ...req
},
(res) => {
...
}
);
$ccpayment = require 'ccpayment'
$createParams = {
amount: 2000,
currency: 'usd',
description: 'My first payment'
}
$paymentIntent = paymentIntentCreate($params);
$paymentParams = {
id: paymentIntent.id,
payment_method: 'pm_card_mastercard'
}
$ccpayment.paymentIntentsConfirm();
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
import "github.com/cctip/ccpayment-sdk"
func main() {
api := ccpayment.NewPaymentApi("api_key")
bill, err :=
api.Create(&ccpayment,CreatePaymentRequest{Amount: "2000",
Currency: "usd", Description: "My first payment"})
if err != nil {
// handle errors
return
}
err :=
api.Confirm(&ccpayment,CreatePaymentRequest{BillId:bill.Id,
PaymentMethod: "pm_card_mastercard"})
if err != nil {
// handle errors
}
}
...
<?php
use CCPayment\v1\CCPay;
$resp = CCPay::CheckUser(
"9454818",
"202301310325561620262074393440256",
"c4600b8125b7ed23b5b7b8ee4acb42f4"
);
var_dump($resp);
...
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);
.....
using ccpayment;
{
var paymentIntent = paymentIntents.create({
amount: 2000,
currency: "usd",
descrition: "My first payment"
})
ccpayment.paymentIntents.confirm({
id: paymentIntent.id,
payment_method: "pm_card_mastercard"
})
}