【发布时间】:2014-07-12 01:39:30
【问题描述】:
我在自己购物车的最后阶段将 paypal 集成到我的网站中。 我现在只是在沙盒中练习。所以我在我的购物车页面中有一个表格,它将每件商品的价格发送到贝宝,地址为https://www.sandbox.paypal.com/cgi-bin/webscr
这很好用,因为在用户在贝宝上输入他们的付款详细信息后,它会返回带有交易 ID 的返回 URL。现在我被困在我用身份令牌发回事务 id 的部分,因为它返回失败 4020。
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="monk@gmail.com">
<input type="hidden" name="item_name_1" value="Electro">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_number_1" value="1">
<input type="hidden" name="item_name_2" value="Dub">
<input type="hidden" name="amount_2" value="2.00">
<input type="hidden" name="item_number_2" value="2">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" name="submit" alt="">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
所以在我的返回网址中我有这个:
<?php
$transID = $_GET['tx'];
?>
<!DOCTYPE html>
<html lang="en">
<body>
<form target="paypal" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_notify-synch">
<input type="hidden" name="tx" id="tx" value="<?php echo $transID; ?>">
<input type="hidden" name="at" id="at" value="myIdentityNumber">
<input type="submit" value="PDT">
</form>
</body>
</html>
在我的返回 url 中,“MyIdentityNumber”被我的沙盒业务帐户中的身份令牌替换。我已经阅读了很多关于它的信息,但我找不到正确的信息。感谢一米尔的任何建议。 莎拉
【问题讨论】:
标签: post paypal eclipse-pdt