我正试图在PHP中整合paypal沙盒。
我的代码如下
<?php
$paypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypalID = 'dnyaneshk8.business@gmail.com'; //Business Email
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PayPal Standard Payment Gateway Integration by CodexWorld</title>
</head>
<body>
<br/>Name: Movie Kabaali
<br/>Price: 101
<form action="<?php echo $paypalURL; ?>" method="post">
<input type="hidden" name="business" value="<?php echo $paypalID; ?>">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Kabali movie ticket">
<input type="hidden" name="item_number" value="2">
<input type="hidden" name="amount" value="101">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="quantity" value="2">
<!-- Specify URLs -->
<input type='hidden' name='cancel_return' value='http://localhost/paypal_jatin/cancel.php'>
<input type='hidden' name='return' value='http://localhost/paypal_jatin/success.php'>
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
</form>
</body>
</html>
此代码有效,但付款成功后,不会立即返回我的网站。
它给出了像
这样的信息 you've just completed your payment.
然后在下面有两个链接
1。返回Dyanesh Business的测试商店
2。转到PayPal帐户概述
我希望当事务成功用户重定向到localhost时。
请帮我解决这个问题。