The CryptoCore API will provide access to our services and information to our sellers.
API calls are implemented as standard HTTP POST (application/x-www-form-urlencoded) calls to
https://gateway.ccore.online/
with JSON parameter
php: https://github.com/cryptocore-jim/gateway-php-api
The only setup needed is to go to the Account settings page and receive Secret key and User ID.
Every API call has a SHA hash generated with your Secret key.
Our server generates it's own SHA hash and compares it with the API caller's.
If they don't match the API call is discarded.
The SHA hash is sent as a HTTP parameter called 'usersignature'.
The SHA hash is created from the POST data of your request.
/order/payment/new
{
"user_id": 3,
"order_id": "c0d5971fc0654d798210e5ab07fdf15a",
"currency_code": "BTC",
"amount": 0.001,
"user_return_url": "https://merchant_site/user_return_url",
"result_url": "https://merchant_site/result_url",
"usersignature": "signature"
}
| Field | Description |
|---|---|
| user_id | your gateway User ID, Taken from Account settings page |
| order_id | Your order id |
| currency_code | Payment currency code (BTC, LTC, BCH etc..) |
| amount | Payment amount (with dot in decimals) |
| user_return_url | Full URL. When first payment is ok - User can return to merchan website from gateway payment page (optional) |
| result_url | Full URL. When payment is confirmed result_url will be called by gateway (See: Order Status Push Notification). May be empty |
| usersignature | Your user signature |
String to generate SHA:
currency_code + order_id + result_url + user_return_url + user_id + amount + YOUR_SECRET_KEY
Cenerate hash of your signature:
PHP:
sha1('string')
Node JS:
const crypto = require('crypto');
let digest = crypto.createHash('string');
{
"payment_id":
"GMWDKIXXFCI92ALQXCXW9ZI7G8PLXU4SXKPDX1V7KJLVNTXVDK"
}
Redirect user to payment gateway page:
https://gateway.ccore.online/gateway?payment_id=RESPONSE_OF_NEW_ORDER
In case of some error occured status 500 will be sent to user.
/order/payment/getpayment
{
"payment_id":"0SD0DU6W8UISVXCV55JXTAIT4N711VNMFNNNSS71QACMIPFG6",
"user_id":3,
"usersignature":"usersignature"
}
| Field | Description |
|---|---|
| payment_id | Payment id received from payment gateway |
| user_id | Your user id (Taken from account settings) |
| usersignature | Your user signature |
String to generate SHA:
payment_id + user_id + YOUR_SECRET_KEY
Cenerate hash of your signature:
PHP:
sha1('string')
Node JS:
const crypto = require('crypto');
let digest = crypto.createHash('string');
{
"payment_id": "0SD0DU6W8UISVXCV52JXTAIT4N71ETVNMFNNNSS71QACMIPFG6",
"order_id": "85965ec24e2a4212b559bf85ee71a3b0",
"wallet_address": "DQVrEzFRE2HVX8HStms98JjiRbG1jVFQJg",
"currency_code": "PIVX",
"payment_status": "PAID",
"order_status": "SUCCESS_COMPLETED",
"amount": 0.001,
"transactionresponse":
[
{
"tx": "0e527d3d68c2cc439827268818c91cd0011eff34703938a427aaa84b5e0885",
"amount": 0.001,
"currency_code": "PIVX"
}
]
}
| Field | Description |
|---|---|
| payment_id | Payment id |
| order_id | order id of the payment |
| wallet_address | Wallet Address of payment to receive |
| currency_code | Currency what was paid order |
| payment_status | Status of payment (See: Payment Statuses) |
| order_status | Status of order (See: Order Statuses) |
| amount | Amount of currency |
| transactionresponse | Array of transactions to complete payment (Customer can do multiple payments to complete order amount) |
| transactionresponse tx | transaction hash ob blockchain to complete order |
| transactionresponse amount | Amount of transaction |
| transactionresponse currency_code | Currency code to complete transaction |
In case of some error occured status 500 will be sent to user.
| Status | Description |
|---|---|
| NEW_PAYMENT | New payment |
| WALLET_CREATED | Wallet was created from payment |
| PAID | Order fully paid |
| TIMEOUT | Timeout to paid for order |
| USER_NOT_FOUND | Payment merchant not found |
| AWAIT_CONFIRMATION | Awaiting confirmations for transaction in blockhain |
| Status | Description |
|---|---|
| PENDING | New order created. pending for payment |
| PROCESSING | Processing order |
| SUCCESS_COMPLETED | order completed succes |
| FAIL_COMPLETED | Fail to complete order. |
In case of valid URL is provided in new order "result_url" field. Push notification will be sent to this URL
{
"result":"success",
"order_id":3,
"signature":"usersignature"
}
| Status | Description |
|---|---|
| SUCCESS | Order is success proceed. Payment done |
| FAIL | Order is failed to complete. |
In order to secure Push Notification message verification of push notification message is required.
Verification string:
result + order_id + usersignature
must be equal to "signature" received from push notification