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, 51.91.80.241, 138.68.137.53. The current list of IP can be obtained in text format via the URL: https://paykassa.pro/ips.txt or in JSON format: https://paykassa.pro/ips.php

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 "ripple" => 22, // supported currencies XRP "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM "binancecoin" => 29, // supported currencies BNB "tron_trc20" => 30, // supported currencies USDT "binancesmartchain_bep20" => 31, // supported currencies USDT, BUSD, USDC, ADA, EOS, BTC, ETH, DOGE "ethereum_erc20" => 32, // supported currencies USDT ]; $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 echo 'Send funds to this address '.$wallet . ( !empty($tag) ? ' Tag: ' . $tag : '' ) . ' Balance will be updated automatically.'; //Send funds 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 = [ "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 "ripple" => 22, // supported currencies XRP "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM "binancecoin" => 29, // supported currencies BNB "tron_trc20" => 30, // supported currencies USDT "binancesmartchain_bep20" => 31, // supported currencies USDT, BUSD, USDC, ADA, EOS, BTC, ETH, DOGE "ethereum_erc20" => 32, // supported currencies USDT ]; $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 { // actions in case of success $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 $tag = $res["data"]["tag"]; // Tag for Ripple and Stellar $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 } ?>

Processing notifications for incoming transactions

Don't forget. Connect SCI class that you specify "Merchant ID" and "Merchant Password". Also process errors and check the payment status and the number of notifications.

<?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_transaction_notification(); 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 { // actions in case of success $transaction = $res["data"]["transaction"]; // transaction number in the system paykassa: 2431548 $txid = $res["data"]["txid"]; // A transaction in a cryptocurrency network, an example: 0xb97189db3555015c46f2805a43ed3d700a706b42fb9b00506fbe6d086416b602 $shop_id = $res["data"]["shop_id"]; // Your merchant's number, example: 138 $id = $res["data"]["order_id"]; // unique numeric identifier of the payment in your system, example: 150800 $amount = (float)$res["data"]["amount"]; // received amount, example: 1.0000000 $fee = (float)$res["data"]["fee"]; // payment processing fee: 0.0000000 $currency = $res["data"]["currency"]; // the currency of payment, for example: DASH $system = $res["data"]["system"]; // system, example: Dash $address_from = $res["data"]["address_from"]; // address of the payer's cryptocurrency wallet, example: 0x5d9fe07813a260857cf60639dac710ebb9531a20 $address = $res["data"]["address"]; // a cryptocurrency wallet address, for example: Xybb9RNvdMx8vq7z24srfr1FQCAFbFGWLg $tag = $res["data"]["tag"]; // Tag for Ripple and Stellar is an integer $confirmations = $res["data"]["confirmations"]; // Current number of network confirmations $required_confirmations = $res["data"]["required_confirmations"]; // Required number of network confirmations for crediting $status = $res["data"]["status"]; // yes - if the payment is credited $static = $res["data"]["static"]; // Always yes $date_update = $res["data"]["date_update"]; // last updated information, example: "2018-07-23 16:03:08" $explorer_address_link = $res["data"]["explorer_address_link"]; // A link to view information about the address $explorer_transaction_link = $res["data"]["explorer_transaction_link"]; // Link to view transaction information if ($status !== 'yes') { //the payment has not been credited yet // your code... echo $id.'|success'; // confirm receipt of the request } else { //the payment is credited // 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, ETH $priority = "high"; // low - slowly, medium - medium, high - quickly $paykassa = new PayKassaAPI( $paykassa_api_id, // ID api $paykassa_api_password // password api ); $system_id = [ "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 "ripple" => 22, // supported currencies XRP "tron" => 27, // supported currencies TRX "stellar" => 28, // supported currencies XLM "binancecoin" => 29, // supported currencies BNB "tron_trc20" => 30, // supported currencies USDT "binancesmartchain_bep20" => 31, // supported currencies USDT, BUSD, USDC, ADA, EOS, BTC, ETH, DOGE "ethereum_erc20" => 32, // supported currencies USDT ]; $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, // deprecated parameter, always set to true $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 , may be empty, // in this case, the transaction information can be obtained using a universal link from the explorer_transaction_link field, see below $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 $explorer_address_link = $res["data"]["explorer_address_link"]; // A link to view information about the address $explorer_transaction_link = $res["data"]["explorer_transaction_link"]; // Link to view transaction information } ?> <!-- /.Payment -->