-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatepayment.php
32 lines (26 loc) · 1018 Bytes
/
createpayment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
session_start();
$strJsonFileContents = file_get_contents("config_live.json");
$array = json_decode($strJsonFileContents, true);
$amount = $_GET['amount'];
$invoice = time().'-'.mt_rand(); // must be unique
$intent = "sale";
$proxy = $array["proxy"];
$createpaybody=array('amount'=>$amount, 'currency'=>'BDT', 'merchantInvoiceNumber'=>$invoice,'intent'=>$intent);
$url = curl_init($array["createURL"]);
$createpaybodyx = json_encode($createpaybody);
$header=array(
'Content-Type:application/json',
'authorization:'.$array["token"],
'x-app-key:'.$array["app_key"]
);
curl_setopt($url,CURLOPT_HTTPHEADER, $header);
curl_setopt($url,CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($url,CURLOPT_RETURNTRANSFER, true);
curl_setopt($url,CURLOPT_POSTFIELDS, $createpaybodyx);
curl_setopt($url,CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($url, CURLOPT_PROXY, $proxy);
$resultdata = curl_exec($url);
curl_close($url);
echo $resultdata;
?>