This commit is contained in:
wangjinlei
2025-02-27 15:50:46 +08:00
parent f2af816d6a
commit f3d3ae04ca
4 changed files with 87 additions and 19 deletions

View File

@@ -929,6 +929,27 @@ function aliemail($email,$title,$content,$has_hb=1){
return $res;
}
function paystationLookup($transactionId){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.paystation.co.nz/v1/transactions/'.$transactionId,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer '.createPayStationToken()
)
));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
function createPayStationToken(){
$bodyParams = [
'client_id' => Env::get("paystation.client_id"),