Proqram API
Ödəniş sistemi
Ödəniş sistemi API biznes sahiblərinə Paracoin ilə ödəniş qəbul etməyə kömək edir..
- Sign in to your account.
- Go to the Checkout Settings.
- Set Redirect and Callback URLs
- Copy private token, you will use this private token to connect Paracoin API.
- After that there will be 2 steps:
1. Create a form and send POST request as below:
<?php
// This is an HTML & PHP example
$paraData = base64_encode(json_encode([
"receiver" => "YOUR_PARA_ADDRESS",
"orderToken" => "UNIQUE_ORDER_TOKEN",
"info" => "PRODUCT_INFO",
"amount" => 10,
"customAmount" => 0,
]));
echo "<a href='https://paracoin.network/checkout/$paraData'>Submit Payment</a>";
?>
Properties:
- receiver - Your Paracoin address.
- orderToken - The unique identifier for the order
- info - Transaction info
- amount - Payment amount
- customAmount - Set 1 to allow customers to edit and enter a custom amount. Default is 0 and prevents amount editing.
2. Receive callback and process the order:
<?php
// This is a PHP callback example
$receiver = "YOUR_PARA_ADDRESS";
$privateToken = "YOUR_PRIVATE_TOKEN";
$orderToken = $_POST["orderToken"];
$receiver = $_POST["receiver"];
$amount = $_POST["amount"];
$orderHash = $_POST["orderHash"];
$debugMode = $_POST["debugMode"];
$hash = md5($orderToken.$receiver.$amount.$privateToken);
if ( $hash != $orderHash || $debugMode) return 0;
// You can add more filters and security checks depending on your needs.
// Process the order here.
return 1;
?>
Properties:
- receiver - Your Paracoin address.
- privateToken - You can find your private token on the checkout settings.
- orderToken - The unique identifier for the order
- amount - Payment amount
- orderHash - MD5 hash of order token, receiver, amount and private token.
- debugMode - If you turn on debug Mode on the checkout settings, debugMode will be true, otherwise false.