Sendbit hosted page (payment button)


<form action="https://sendbit.io/page/checkout" method="POST">
<input type="text" hidden name="amount"  value="1.00">
<input type="text" hidden value="https://website.com?ipn=xxxx" name="ipn_url">
<input type="text" hidden value="SendBit, LTD." name="website_name">
<input type="text" hidden value="Demo 1 dollar transaction" name="item_description">
<input type="text" hidden value="[email protected]" name="email">
<input value="Checkout With sendbit" type="submit">
</form>

The following details will be sent to your call-back URL upon receiving payments. Payment notifications are sent every minute up until the transaction gets three confirmations.

$address = $_POST["address"];
$amount = $_POST["amount"];
$confirmations = $_POST["confirmations"];
$hash = $_POST["hash"];
$auth_hmac = $_POST["auth_hmac"]; 
To handle call-backs we have made a small useful code to log payments into your database‚Ä®

include_once("sendbit.inc.php"); //libaray

define("API_KEY", "YOUR_API_KEY");
define("API_SECRET", "YOUR_API_SECRET");

$transaction_id = $_POST["transaction_id"];
$address = $_POST["address"];
$amount = $_POST["amount"];
$confirmations = $_POST["confirmations"];
$hash = $_POST["hash"];
$auth_hmac = $_POST["auth_hmac"]; 

$api_client = new SendBitApi(API_KEY, API_SECRET);
$valid = $api_client->validatePayment($hash, $auth_hmac);

if($valid == true) {

// Process the payment.

// We recommend you add a parameter here to check if payment record exists
// so you dont log the same payment each time you get a callback notification.
// callback notifications are sent every minute up until three confirmations.


} else {

exit("Could not verify the payment.");

// Log for manual verification

}

Send Payments via API

Use our API to send payments using your API key and API secret. This can be modified to your needs and is great for mass payments.

include_once("sendbit.inc.php"); //libaray

define("API_KEY", "YOUR_API_KEY");
define("API_SECRET", "YOUR_API_SECRET");
$hash = "$2y$12$SeCkgzINScl2DWSzs2ofYO2604UO6U.kI3mCWfoGYuCpvvbpzp9HG"; //Do not change this hash, or else API becomes invalid.

$address = "1tkh8ENwHr8Uoo6PWFM31T5ub2cQiFGbm";
$amount = 0.00000000; // amount to send (amount in selected coin)
$fee = 0.000055; // total fee for your transaction (amount in selected coin)

$api_client = new SendBitApi(API_KEY, API_SECRET);
$api_client->setCoin("BTC"); // set coin (BTC, LTC, BCH, DASH) https://www.sendbit.io/page/coins_accepted
$api_client->setField("recipient", $address);
$api_client->setField("amount", $amount);
$api_client->setField("fee", $fee);
$api_client->setField("akhami_hash", $hash);
$api_client->setMethod("send-payment");
$response = $api_client->process();

if($response["response_code"] != 200) {

exit($response["response_message"]);

} else {

$transaction_id = $response["transaction_id"]; //Shows TXN

}


Response codes

Response codes

500 - Unknown internal error

401 - Invalid API details

403 - You do not have permissions to access used API

404 - Wrong coin abbreviation used

200 - Success, check other parameters

17 - API limit reached, please upgrade API plan

19 - Invalid callback or success URL used

21 - Amount too small

30 - Fee too small

28 - Amount exceeds your balance


It's easy as that! Thank you for using sendbit.io. If you don't understand something or if you have any questions, you can always email us at support[at]sendbit.io. To upgrade your API plan please click here