) * @website https://ohari5336.in/ * @facebbok https://www.facebook.com/ohari5333 * @twitter https://twitter.com/ohari5333 * @linkedin https://www.linkedin.com/in/ohari5336/ */ function httpPost($url,$params) { $postData = ''; //create name value pairs seperated by & foreach($params as $k => $v) { $postData .= $k . '='.$v.'&'; } $postData = rtrim($postData, '&'); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_USERPWD, 'your key'); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); $output=curl_exec($ch); curl_close($ch); return $output; } if (isset($_POST,$_POST['amt'],$_POST['email'],$_POST['phone'],$_POST['des'])) { $params = array( "amount" => $_POST['amt'], "order_id" => "ohari_ord_".rand(), "customer_id" => "ohari_user_".rand(), "customer_email" => $_POST['email'], "customer_phone" => $_POST["phone"], "product_id" => "ohari_demo", "description" => $_POST['des'] ); $data = json_encode($params); file_put_contents('./payment_submits.log', "Status Update:\n{$data}\n\n", FILE_APPEND); $json_res = httpPost("https://axisbank.juspay.in/orders",$params); $json_res_decode = json_decode($json_res, true); $iframe_link = $json_res_decode['payment_links']["iframe"]; } ?>