簡體   English   中英

在PHP中集成Paypal沙箱

[英]Integrating paypal sandbox in php

我正在嘗試將Paypal沙箱集成到php中。

我下面有代碼

<?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。 轉到貝寶帳戶概述

我希望當交易成功的用戶應該重定向到本地主機。

請幫我解決這個問題。

您要返回Dyanesh Business的測試商店,是因為您正在使用他的密鑰,所以請在沙箱上創建帳戶以使用自己的密鑰。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM