API payment gateway Paykassa

API Paykassa – stop solution for online payments in the cryptocurrency.

The IP address of the server sending notification to SCI: 54.37.60.196 and 79.137.67.141.

Quick start for those who
too lazy to study the detailed documentation

Get the address for payment in cryptocurrency

Don't forget. Connect SCI class that you specify "Merchant ID" and "Merchant Password".

<!-- Invoicing for payment address for payment --> <?php require_once('paykassa_sci.class.php'); //the plug-in class to work with SCI, you can download it at the link $paykassa_merchant_id = 'your_merchant_id'; // the ID of the merchant $paykassa_merchant_password = 'your_merchant_password'; // merchant password $amount = 0.350; $system = 'bitcoin'; $currency = 'BTC'; $order_id = 'shop_377'; $comment = 'comment'; $paykassa = new PayKassaSCI( $paykassa_merchant_id, $paykassa_merchant_password ); $system_id = [ "bitcoin" => 11, // supported currencies BTC "ethereum" => 12, // supported currencies ETH "litecoin" => 14, // supported currencies LTC "dogecoin" => 15, // supported currencies DOGE "dash" => 16, // supported currencies DASH "bitcoincash" => 18, // supported currencies BCH "zcash" => 19, // supported currencies ZEC "monero" => 20, // supported currencies XMR "ethereumclassic" => 21, // supported currencies ETC "ripple" => 22, // supported currencies XRP "neo" => 23, // supported currencies NEO "gas" => 24, // supported currencies GAS "bitcoinsv" => 25, // supported currencies BSV "waves" => 26, // supported currencies WAVES "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM ]; $res = $paykassa->sci_create_order_get_data( $amount, // required parameter the payment amount example: 1.0433 $currency, // mandatory parameter, currency, example: BTC $order_id, // mandatory parameter, the unique numeric identifier of the payment in your system, example: 150800 $comment, // mandatory parameter, text commentary of payment example: service Order #150800 $system_id[$system] // a required parameter, for example: 12 - Ethereum ); if ($res['error']) { // $res['error'] - true if the error echo $res['message']; // $res['message'] - the text of the error message // actions in case of an error } else { $invoice = $res['data']['invoice']; // The operation number in the system Paykassa.pro $order_id = $res['data']['order_id']; // The order in the merchant $wallet = $res['data']['wallet']; // Address for payment $amount = $res['data']['amount']; // The amount to be paid may change if the Board is translated into a client $system = $res['data']['system']; // A system in which the billed $url = $res['data']['url']; // The link to proceed for payment $tag = $res['data']['tag']; // Tag to indicate the translation to ripple if (!empty($tag)) { echo 'Send '.$amount.' '.$currency.' to this address '.$wallet.'. Tag: '.$tag.'. Balance will be updated automatically.'; } else { echo 'Send '.$amount.' '.$currency.' to this address '.$wallet.'. Balance will be updated automatically.'; } //Send 0.35000000 BTC to this address 32e6LAW8Nps9GJMSQK4Busm6UUUkUc4tzE. Balance will be updated automatically. } ?> <!-- /.Invoicing for payment address for payment -->

Invoicing for payment

Don't forget. Connect SCI class that you specify "Merchant ID" and "Merchant Password". Also, write the action on error and process the payment.

<!-- Invoicing --> <?php require_once('paykassa_sci.class.php'); //the plug-in class to work with SCI, you can download it at the link $paykassa_merchant_id = 'your_merchant_id'; $paykassa_merchant_password = 'your_merchant_password'; $amount = 0.350; $system = 'bitcoin'; $currency = 'BTC'; $order_id = 'shop_377'; $comment = 'comment'; $paykassa = new PayKassaSCI( $paykassa_merchant_id, // the ID of the merchant $paykassa_merchant_password // merchant password ); $system_id = [ "payeer" => 1, // supported currencies RUB, USD "advcash" => 4, // supported currencies RUB, USD "perfectmoney" => 2, // supported currencies USD "berty" => 7, // supported currencies RUB, USD "bitcoin" => 11, // supported currencies BTC "ethereum" => 12, // supported currencies ETH "litecoin" => 14, // supported currencies LTC "dogecoin" => 15, // supported currencies DOGE "dash" => 16, // supported currencies DASH "bitcoincash" => 18, // supported currencies BCH "zcash" => 19, // supported currencies ZEC "monero" => 20, // supported currencies XMR "ethereumclassic" => 21, // supported currencies ETC "ripple" => 22, // supported currencies XRP "neo" => 23, // supported currencies NEO "gas" => 24, // supported currencies GAS "bitcoinsv" => 25, // supported currencies BSV "waves" => 26, // supported currencies WAVES "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM ]; $res = $paykassa->sci_create_order( $amount, // required parameter the payment amount example: 1.0433 $currency, // mandatory parameter, currency, example: BTC $order_id, // mandatory parameter, the unique numeric identifier of the payment in your system, example: 150800 $comment, // mandatory parameter, text commentary of payment example: service Order #150800 $system_id[$system] // mandatory parameter, specifying it You bypassing the merchant forwards the payment system, for example: 12 - Ethereum ); if ($res['error']) { // $res['error'] - true if the error echo $res['message']; // $res['message'] - the text of the error message //actions in case of an error } else { // the formation of the form of payment ?> <form action="<?php echo $res["data"]["url"]; ?>" method="POST"> <button>To pay</button> </form> <?php } ?> <!-- /.Invoicing -->

Check payment

Don't forget. Connect SCI class that you specify "Merchant ID" and "Merchant Password". Also handle the error in the validation of payment and prescribe actions for overpayment and underpayment per payment.

<?php require_once('paykassa_sci.class.php'); // the plug-in class to work with SCI, you can download it at the link $paykassa_merchant_id = 'your_merchant_id'; $paykassa_merchant_password = 'your_merchant_password'; $paykassa = new PayKassaSCI( $paykassa_merchant_id, // the ID of the merchant $paykassa_merchant_password // merchant password ); $res = $paykassa->sci_confirm_order(); if ($res['error']) { // $res['error'] - true if the error die($res['message']); // $res['message'] - the text of the error message // actions in case of an error } else { // действия в случае успеха $id = $res["data"]["order_id"]; // unique numeric identifier of the payment in your system, example: 150800 $transaction = $res["data"]["transaction"]; // transaction number in the system paykassa: 96401 $hash = $res["data"]["hash"]; // hash, example: bde834a2f48143f733fcc9684e4ae0212b370d015cf6d3f769c9bc695ab078d1 $currency = $res["data"]["currency"]; // the currency of payment, for example: DASH $system = $res["data"]["system"]; // system, example: Dash $address = $res["data"]["address"]; // a cryptocurrency wallet address, for example: Xybb9RNvdMx8vq7z24srfr1FQCAFbFGWLg $partial = $res["data"]["partial"]; // set up underpayments or overpayments 'yes' to accept, 'no' - do not take $amount = (float)$res["data"]["amount"]; // invoice amount example: 1.0000000 if ($partial === 'yes') { // the amount of application may differ from the amount received, if the mode of partial payment // relevant only for cryptocurrencies, default is 'no' } // your code... echo $id.'|success'; // be sure to confirm the payment has been received } ?>

Instant payments

Don't forget. To connect to the API class that you specify "API ID", "API Password" and "Merchant ID". And process steps in case of successful payment or error.

<!-- Payment --> <?php require_once('paykassa_api.class.php'); // the plug-in class to access the API, you can download it at the link $paykassa_api_id = 'your_api_id'; $paykassa_api_password = 'your_api_password'; $paykassa_merchant_id = 'your_merchant_id'; $amount = 0.25; $system = "bitcoin"; $currency = 'BTC'; $wallet = '3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r'; $comment = 'comment'; $paid_commission = ''; $tag = ''; $real_fee = true; // supported - BTC, LTC, DOGE, DASH, BSV, BCH, ZEC $priority = "high"; // low - slowly, medium - medium, high - quickly $paykassa = new PayKassaAPI( $paykassa_api_id, // ID api $paykassa_api_password // password api ); $system_id = [ "payeer" => 1, // supported currencies RUB, USD "advcash" => 4, // supported currencies RUB, USD "perfectmoney" => 2, // supported currencies USD "berty" => 7, // supported currencies RUB, USD "bitcoin" => 11, // supported currencies BTC "ethereum" => 12, // supported currencies ETH "litecoin" => 14, // supported currencies LTC "dogecoin" => 15, // supported currencies DOGE "dash" => 16, // supported currencies DASH "bitcoincash" => 18, // supported currencies BCH "zcash" => 19, // supported currencies ZEC "monero" => 20, // supported currencies XMR "ethereumclassic" => 21, // supported currencies ETC "ripple" => 22, // supported currencies XRP "neo" => 23, // supported currencies NEO "gas" => 24, // supported currencies GAS "bitcoinsv" => 25, // supported currencies BSV "waves" => 26, // supported currencies WAVES "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM ]; $res = $paykassa->api_payment( $paykassa_merchant_id, // required parameter merchant id from which you want to make a withdrawal $system_id[$system], // mandatory parameter, the id of the payment method $wallet, // mandatory parameter, the number of wallet which sent the money (float)$amount, // required parameter the payment amount, how much to send $currency, // mandatory parameter, the currency of payment $comment, // mandatory parameter, review the payment, you can pass a null $paid_commission, // an optional parameter that who pays the fee for transfer, shop or client $tag, // optional, the tag for payment, you can pass empty $real_fee, // optional parameter(default false) enables the actual cancellation fee taken by the network $priority // optional parameter(default is medium), is used to set // priority inclusion in the unit along with a $real_fee === true ); if ($res['error']) { // $res['error'] - true if the error echo $res['message']; // $res['message'] - the text of the error message //actions in case of an error } else { //actions in case of success $shop_id = $res['data']['shop_id']; // merchant id that you originally made payment, example 122 $transaction = $res['data']['transaction']; // transaction number of the payment, example 130236 $txid = $res['data']['txid']; // txid 70d6dc6841782c6efd8deac4b44d9cc3338fda7af38043dd47d7cbad7e84d5dd $amount = $res['data']['amount']; // the amount of the payment, how much was written off from the balance of the merchant 0.42 $amount_pay = $res['data']['amount_pay']; // the amount of the payment, as it is the user, example: 0.41 $system = $res['data']['system']; // the system of payment, which was made the payment, example: Bitcoin $currency = $res['data']['currency']; // the payment currency, for example: BTC $number = $res['data']['number']; // the address where you sent the funds $comission_percent = $res['data']['shop_comission_percent'];// the transfer fee percentage, example: 1.5 $comission_amount = $res['data']['shop_comission_amount']; // the transfer fee amount, example: 1.00 $paid_commission = $res['data']['paid_commission']; // who paid for the Commission, for example: shop } ?> <!-- /.Payment -->