本人自己做一個B2C商城,打算用html api(及form)實現了支付,沒有用網上的一些類。但是支付成功後沒有返回信息。代碼如下:
<?php
echo "以下是get<br>";
if(isset($_POST['order_id'])){
$f = fopen('test.txt',"w");
fwrite($f,extract($_POST));
}
?>
付款:
<form name="checkout_confirmation" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="checkout_confirmation" target="_blank">
<input type="hidden" name="charset" value="UTF-8" />
<input type="hidden" name="amount" value="10" /><!--单价-->
<input type="hidden" name="lc" value="CN" /><!--設置用戶打開paypal的語言-->
<input type="hidden" name="page_style" value="Primary" /><!--付款结帐页的页面样式-->
<input type="hidden" name="business" value="paypal帐号" /><!--paypal帐号-->
<input type="hidden" name="custom" value="zenid=f618c58b81edcf2a58b71ca1f7973d55" />
<input type="hidden" name="add" value="2"><!--在购物车中的位置-->
<input type="hidden" name="cmd" value="_xclick"><!--付款-->
<input type="hidden" name="item_name" value="123123"><!--商品名称 用tour name-->
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="item_number" value="1"><!--物品号,用tour id-->
<input type="hidden" name="currency_code" value="USD"><!--货币类型-->
<input type="hidden" name="quantity" value="1"><!--数量-->
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but5.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="notify_url" value="http://localhost/test.php?order_id=23876412"><!--这里告诉paypal付款的通信url,即当客户付款后调用这个url通知系统,这个id可以告知系统用户买的是哪个产品。-->
</form>順便問一個,如何在支付完後的頁面顯示一個return之類的東西,讓用戶返回我的網站?加哪個參數?
<?php
echo "以下是get<br>";
if(isset($_POST['order_id'])){
$f = fopen('test.txt',"w");
fwrite($f,extract($_POST));
}
?>
付款:
<form name="checkout_confirmation" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="checkout_confirmation" target="_blank">
<input type="hidden" name="charset" value="UTF-8" />
<input type="hidden" name="amount" value="10" /><!--单价-->
<input type="hidden" name="lc" value="CN" /><!--設置用戶打開paypal的語言-->
<input type="hidden" name="page_style" value="Primary" /><!--付款结帐页的页面样式-->
<input type="hidden" name="business" value="paypal帐号" /><!--paypal帐号-->
<input type="hidden" name="custom" value="zenid=f618c58b81edcf2a58b71ca1f7973d55" />
<input type="hidden" name="add" value="2"><!--在购物车中的位置-->
<input type="hidden" name="cmd" value="_xclick"><!--付款-->
<input type="hidden" name="item_name" value="123123"><!--商品名称 用tour name-->
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="item_number" value="1"><!--物品号,用tour id-->
<input type="hidden" name="currency_code" value="USD"><!--货币类型-->
<input type="hidden" name="quantity" value="1"><!--数量-->
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but5.gif"
border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="notify_url" value="http://localhost/test.php?order_id=23876412"><!--这里告诉paypal付款的通信url,即当客户付款后调用这个url通知系统,这个id可以告知系统用户买的是哪个产品。-->
</form>順便問一個,如何在支付完後的頁面顯示一個return之類的東西,讓用戶返回我的網站?加哪個參數?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货