| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hkosl.com/imusiccircle/paypal_testing/ |
Upload File : |
<?php
//paypal reference link https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
$order_id = 1;
$shipping_price = 0;
$amount = 100;
$invoiceNo = "ORDER_0001";
//$paypal_url = "https://www.paypal.com/row/cgi-bin/webscr"; //production
//$paypal_business = ""; //production
$paypal_url = "https://www.sandbox.paypal.com/row/cgi-bin/webscr"; //uat
$paypal_business = "gsell_1323239795_biz@onesolution.com.hk"; //uat
$paypal_array = array('cmd' => '_xclick',
'upload' => '1',
'custom' => "{order_id:1}", //can pass a json string
'invoice' => $invoiceNo,
'business' => $paypal_business,
'item_name' => 123,
'item_number' => 1001,
'amount' => $amount,
'currency_code' => 'HKD',
'shipping' => $shipping_price,
'no_shipping' => 1,
'return' => 'http://' . $_SERVER['HTTP_HOST'] . '/webadmin/order_form.php?id=' . $order_id,
'notify_url' => 'http://' . $_SERVER['HTTP_HOST'] . '/paypal_notify.php',
'cancel_return' => 'http://' . $_SERVER['HTTP_HOST'] . '/webadmin/order_form.php?id=' . $order_id
);
$array = array();
foreach ($paypal_array as $name => $data) {
$array[] = $name . '=' . urlencode($data);
}
$path = $paypal_url . '?' . implode('&', $array);
?>
<html>
<body>
<a href="<?= $path ?>" target="_blank">
<img src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_buynow_107x26.png" alt="Buy Now"/> </a>
</body>
</html>