PHP code example of hshafiei374 / bitrah
1. Go to this page and download the library: Download hshafiei374/bitrah 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/ */
hshafiei374 / bitrah example snippets
$result = Bitrah::submitRequest(orderId '1',rialValue '270000000', callbackurl 'http://your-domain.com/bitrah_call_back', webhookkurl 'http://your-domain.com/bitrah_webhook');
/*
$result is :
[
'data'=>[
'token'=>'0d0cd5a0445647asdasdcff2c48ad69e7',
'redirectUrl'=>https://www.bitrah.ir/en/BitrahTestAccount?token=0d0cd5a044564783asc48ad69e7&mode=off&coin=BTC&amount=25000'',
'multiCoinRedirectUrl'=>'https://www.bitrah.ir/en/BitrahTestAccount?token=0d0cd5asdcccff2c48ad69e7&mode=on&coin=BTC&amount=25000',
'refId'=>'2547'
],
'message'=>'Successfully done!',
'timesatmp'=>'2020-11-14T06:56:43.646+0000',
'success'=>'true'
];
*/
$result = Bitrah::getTransactionStatus($refId);
/*
$result is:
array:4 [▼
"data" => array:5 [▼
"status" => 2
"orderId" => "1"
"refId" => "4805"
"coin" => "TRX"
"value" => "3.293901000"
]
"message" => "Successfully done!"
"timestamp" => "2020-11-22T07:16:15.936+0000"
"success" => true
]
*/