2025-03-24 19:02:58 +03:00

99 lines
2.9 KiB
PHP

<?php
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, 'https://secure.clickpay.com.sa/payment/request');
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_POST, 1);
// $postjson = array(
// "profile_id" => "43340",
// "tran_type" => "sale", // "(sale, auth ..etc)"
// "tran_class" => "ecom", // "(ecom, moto, cont)",
// "cart_id" => "4244b9fd-c7e9-4f16-8d3c-4fe7bf6c48ca",
// "cart_description" => "Dummy Order 35925502061445345",
// "cart_currency" => "SAR",
// "cart_amount" => 1500,
// "callback" => "https://aqdamy.com.sa/cp/test?m=16",
// "return" => "https://aqdamy.com.sa/cp/test?m=16",
// "hide_shipping" => true,
// "paypage_lang" => "ar",
// "customer_details" => array(
// "name" => "first name",
// "email" => "sales@aqdamy.com",
// "phone" => "0508997755",
// "street1" => "aqdamy",
// "city" => "Riyadh",
// "state" => "Riyadh",
// "country" => "SA",
// "zip" => "12345",
// // "ip" => "172.16.1.1"
// )
// );
// $postjson = json_encode($postjson);
// curl_setopt($ch, CURLOPT_POSTFIELDS, $postjson);
// $headers = array();
// $headers[] = 'Authorization: SNJNL9LTM9-J6NRT9WM2T-RTLW2WH6R9';
// $headers[] = 'Content-Type: application/json';
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// $result = curl_exec($ch);
// if (curl_errno($ch)) {
// echo 'Error:' . curl_error($ch);
// }
// curl_close($ch);
// print_r($result);
?>
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://secure.clickpay.com.sa/payment/request');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$postjson = array(
"profile_id" => "43253",
"tran_type" => "sale", // "(sale, auth ..etc)"
"tran_class" => "ecom", // "(ecom, moto, cont)",
"cart_id" => "4244b9fd-c7e9-4f16-8d3c-4fe7bf6c48ca",
"cart_description" => "Dummy Order 35925502061445345",
"cart_currency" => "SAR",
"cart_amount" => 1500,
"callback" => "https://aqdamy.com.sa/cp/test?m=16",
"return" => "https://aqdamy.com.sa/cp/test?m=16",
"hide_shipping" => true,
"paypage_lang" => "ar",
"customer_details" => array(
"name" => "first name",
"email" => "sales@aqdamy.com",
"phone" => "0508997755",
"street1" => "aqdamy",
"city" => "Riyadh",
"state" => "Riyadh",
"country" => "SA",
"zip" => "12345",
// "ip" => "172.16.1.1"
)
);
$postjson = json_encode($postjson);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postjson);
$headers = array();
$headers[] = 'Authorization: SLJNL9LTGK-J69HHJTDBZ-9BGG9B6HHK';
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
print_r($result);
?>