2014-08-29 80 views
0

我一直在嘗試用一個簡單的調用腳本通過post方法,但在成功的貝寶沒有返回任何數據像tx,amt,貨幣等東西。通過我可以確認付款並運行更新查詢更新發票狀態付款請.. ..!貝寶沒有返回任何成功的數據?

這是我成功的頁面代碼:

<?php 

$item_no   = $_GET['item_number']; 
$item_transaction = $_GET['tx']; // Paypal transaction ID 
$item_price   = $_GET['amt']; // Paypal received amount 
$item_currency  = $_GET['cc']; // Paypal received currency type 

$price = '10.00'; 
$currency='USD'; 

//Rechecking the product price and currency details 
if($item_price==$price && $item_currency==$currency) 
{ 
echo "<h1>Welcome, Guest</h1>"; 
echo "<h1>Payment Successful</h1>"; 
} 
else 
{ 
echo "<h1>Payment Failed</h1>"; 
} 

?> 

,所以如果你的人可以在我的代碼看看,請..!

回答

-1

這裏有雲:數據一直在後的形式返回,以便它可以通過爲得到:

print_r($_POST);

2
Something is missing in your form here is the form: 
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="payment"> 

    <input type="hidden" name="cmd" value="_cart" /> 

    <input type="hidden" name="upload" value="1" /> 

    <input type="hidden" name="business" value="[email protected]" /> 

     <input type="hidden" name="item_name_1" value="HP LP3065" /> 

    <input type="hidden" name="item_number_1" value="Product 21" /> 

    <input type="hidden" name="amount_1" value="100.00" /> 

    <input type="hidden" name="quantity_1" value="2" /> 

    <input type="hidden" name="weight_1" value="2" /> 

     <input type="hidden" name="on0_1" value="Delivery Date" /> 

    <input type="hidden" name="os0_1" value="2011-04-22" /> 

      <input type="hidden" name="item_name_2" value="Village Cinemas - Adult Vic/Tas Only" /> 

    <input type="hidden" name="item_number_2" value="Village Cinemas - Adult Vic/Tas Only" /> 

    <input type="hidden" name="amount_2" value="10.50" /> 

    <input type="hidden" name="quantity_2" value="1" /> 

    <input type="hidden" name="weight_2" value="0" /> 

      <input type="hidden" name="discount_amount_cart" value="21.05" /> 

    <input type="hidden" name="currency_code" value="USD" /> 

    <input type="hidden" name="first_name" value="First Name" /> 

    <input type="hidden" name="last_name" value="Last Name" /> 

    <input type="hidden" name="address1" value="Address1" /> 

    <input type="hidden" name="address2" value="" /> 

    <input type="hidden" name="city" value="City" /> 

    <input type="hidden" name="zip" value="" /> 

    <input type="hidden" name="country" value="IN" /> 

    <input type="hidden" name="address_override" value="0" /> 

    <input type="hidden" name="email" value="email_address" /> 

    <input type="hidden" name="lc" value="en" /> 

    <input type="hidden" name="rm" value="2" /> 

    <input type="hidden" name="no_note" value="1" /> 

    <input type="hidden" name="charset" value="utf-8" /> 

    <input type="hidden" name="return" value="http://domain.com/success" /> 

    <input type="hidden" name="notify_url" value="http://domain.com/callback" /> 

    <input type="hidden" name="cancel_return" value="http://domain.com/checkout" /> 

    <input type="hidden" name="paymentaction" value="sale" /> 

    <input type="submit" name="custom" value="Submit" /> 

</form>