Server IP : 162.214.80.37 / Your IP : 216.73.216.173 Web Server : Apache System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : imyrqtmy ( 2189) PHP Version : 8.2.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home2/imyrqtmy/public_html/skyispatudyog/sym/Users/0-imyrqtmy/leadriding/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php // PGTESTPAYUAT $apiKey = '099eb0cd-02cf-4e2a-8aca-3e6c6aff0399'; $merchantId = 'PGTESTPAYUAT'; $keyIndex =1; // $apiKey = '71289d59-9ce8-427d-975b-61f752d67218'; // $merchantId = 'M22VVI7PSI8GA'; // $keyIndex =3; $userid = "23"; $amt = "10"; $oid = rand(000000,999999); $TransactionID= "PAYMENTLEADRIDE".rand(000000,999999); $paymentData = array( 'merchantId' => $merchantId, 'merchantTransactionId' =>$TransactionID, "merchantUserId"=>"LEADRIDEUSER_".$userid, "userid"=>$userid, 'amount' => $amt*100, // Amount in paisa (10 INR) 'redirectUrl'=>"https://leadriding.com/sucess.php", 'redirectMode'=>"POST", 'callbackUrl'=>"https://leadriding.com/sucess.php", "mobileNumber"=>"9909129515", "paymentInstrument"=> array( "type"=> "PAY_PAGE", ) ); $jsonencode = json_encode($paymentData); $payloadMain = base64_encode($jsonencode); $payload = $payloadMain . "/pg/v1/pay" . $apiKey; $sha256 = hash("sha256", $payload); $final_x_header = $sha256 . '###' . $keyIndex; $request = json_encode(array('request'=>$payloadMain)); // echo $request.'<br>'.$final_x_header; $curl = curl_init(); curl_setopt_array($curl, [ // CURLOPT_URL => "https://api.phonepe.com/apis/hermes/pg/v1/pay", CURLOPT_URL => "https://api-preprod.phonepe.com/apis/pg-sandbox/pg/v1/pay", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $request, CURLOPT_HTTPHEADER => [ "Content-Type: application/json", "X-VERIFY: " . $final_x_header, "accept: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { $res = json_decode($response); echo "<pre>"; print_r($res); echo "<pre>"; if(isset($res->success) && $res->success=='1'){ $paymentCode=$res->code; $paymentMsg=$res->message; $payUrl=$res->data->instrumentResponse->redirectInfo->url; echo "<a href='".$payUrl."'>pay now</a>"; } } ?>