在 php 中集成PayPal沙盒


Integrating paypal sandbox in php

我正在尝试在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的测试商店

阿拉伯数字。转到PayPal帐户概览

我希望当交易成功时,用户应该重定向到本地主机。

请帮我解决这个问题。

您将返回 Dyanesh Business 的测试商店,因为您正在使用他的密钥,通过在沙盒上创建帐户来使用您自己的密钥。