PHP code example of arowpay / arowpay-php
1. Go to this page and download the library: Download arowpay/arowpay-php library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arowpay / arowpay-php example snippets
rowPay\IPN;
$ipn=new IPN();
$ipn->setAppkey('1Zf5Q28U2a5gmt367GQcbSCl35')->setAppsecret('nG8Pp15i8eWyE7tpDfpPr2D5326A7JfY8Ds3CqKqf5');
if ($ipn->validate()) {
// validated
$rawData=file_get_contents("php://input");
$post=json_decode($rawData);
$currency=$post['currency']; //USDTERC20
$amount=$post['amount']; //69
$transactionId=$post['txid']; //0xbd31c2c70c67414d1ab5b591e436e318557dc37ca01bb18be8d81e6f83d84f0f
$timestamp=$post['time']; // 1583504556
$address=$post['address']; // 0xc9cb4be4687319a6421dac93df2604b8e309ad04
$myCustomString=$post['custom']; // your custom string
//process it
die("OK");
} else {
//invalid request
}
rowPay\API;
//getCallbackAddress
$api=new API();
$api->setAppkey('1Zf5Q28U2a5gmt367GQcbSCl35')->setAppsecret('nG8Pp15i8eWyE7tpDfpPr2D5326A7JfY8Ds3CqKqf5');
$fields=array('currency'=>'BTC','custom'=>'CustomStrings');
$response=$api->execute("getCallbackAddress",$fields);
if($response['code']="200"){
// successfully get an address
$newAddress=$response['msg'];
echo $newAddress; //1AEgdWjJrEbroURgWmPrXkFdzxGxdF7c4G
}else{
echo $response['code'];
echo $response['msg'];
}