2014-03-31 21 views
-1
<form method="post" action="https://api-3t.sandbox.paypal.com/nvp"> 
     <input type="hidden" name="USER" value="ram.fobess_api1.gmail.com"> 
     <input type="hidden" name="PWD" value="1395047802"> 
     <input type="hidden" name="SIGNATURE" value="A5sBito4n5-BXuCBOs3GVB4hSd3CAMOtrfhtX7gYJ8IRalRwwoRJEyJQ"> 
     <input type="hidden" name="VERSION" value="98.0"> 
     <input type="hidden" name="PAYMENTREQUEST_0_PAYMENTACTION" 
     <input type="hidden" name="PAYMENTREQUEST_0_CURRENCYCODE " 
      value="USD"> 
     <input name="PAYMENTREQUEST_0_AMT" value="19.95"> 
     <input type="hidden" name="RETURNURL" 
      value="https://www.YourReturnURL.com"> 
     <input type="hidden" name="CANCELURL" value="https://www.YourReturnURL.com"> 
     <input type="hidden" name="TOKEN" 
      value="EC-1CX69969Y0329883A"> 
    <input type="submit" name="METHOD" value="GetExpressCheckoutDetails"> 
     <!-- <input type="submit" name="METHOD" value="SetExpressCheckout"> --> 

    </form> 

,這是我的代碼,我想這個數值崗位作爲重定向到結帳頁面... ..怎麼樣?我需要貝寶肥皂值重定向結賬頁面

回答

0
<?php 
session_start(); 
$desc = 'hidsdsf';//set to the order description to be appear on the PayPal website; 
$orderno = '1001';//set to unique order number; 
$nettotal = '12';//set to productTotal + shipmentFee + tax; 
$_SESSION["ss_last_orderno"] = $orderno; 

//Save order information to database using the unique order number with status set as Pending... 


$url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; //Test 
//$url = "https://www.paypal.com/cgi-bin/webscr"; //Live 
//$ppAcc = "[email protected]"; //PayPal account email 
$ppAcc = "[email protected]"; //PayPal account email 
$cancelURL = "http://localhost/final/paypal_cancel.php"; 
//$returnURL = "http://localhost/final/return.php"; 
$returnURL = "http://localhost/final/lunch.php"; 
//$notiesURL = "http://localhost/final/returnfinal.php"; "<input type='hidden' name='notify_url' value='$notiesURL'>\n". 

$buffer = 
"<form action='$url' method='post' name='frmPayPal'>\n". 
"<input type='hidden' name='business' value='$ppAcc'>\n". 
"<input type='hidden' name='cmd' value='_xclick'>\n". 
"<input type='hidden' display='1' value='permonth'>\n". 
"<input type='hidden' name='item_name' value='$desc'>\n". 
"<input type='hidden' name='item_number' value='$orderno'>\n". 
"<input type='hidden' name='amount' alt='per month' value='$nettotal'>\n". 
"<input type='hidden' name='no_shipping' value='1'>\n". 
"<input type='hidden' name='currency_code' value='USD'>\n". 
"<input type='hidden' name='handling' value='0'>\n". 
"<input type='hidden' name='cancel_return' value='$cancelURL'>\n". 
"<input type='hidden' name='return' value='$returnURL'>\n". 

"</form>\n". 
"<script language='javascript'>document.frmPayPal.submit();</script>\n"; 

echo($buffer); 
?> 

返回頁

/* Part - 3 */ $parameter_value_array = explode("\n", $ipnresult); $value_array =array(); foreach ($ parameter_value_array爲$密鑰=> $值){$ key_values = 爆炸( 「=」,$值); $ value_array [$ key_values [0]] = $ key_values [1]; }
if(array_key_exists("status", $value_array) && 
$ value_array [ '狀態'] == '成功'){ 回波utf8_decode(urldecode($ value_array [ 'ITEM_NAME'])); echo'
'; echo utf8_decode(urldecode($ value_array ['quantity'])); echo'
'; echo utf8_decode(urldecode($ value_array ['payer_email'])); echo'
'; foreach($ value_array as $ key => $ nm){// $ ram。= print_r($ value_array); $ ram。= $ key。' = '.utf8_decode(urldecode($ nm))。「
」; }} echo $ ram; ?>
1

你需要在這裏給你結帳頁面網址:

<input type="hidden" name="RETURNURL" value="https://www.YourReturnURL.com"> 
在值部分

給你的網址。