我正在尝试在PayPal开发人员沙箱中进行测试。
当我使用以下代码时,它将带我到正确的页面。
<!-- SPECIFY the type of button - THIS CODE WORKS
<input type="hidden" NAME="cmd" value="_donations">
<input type="hidden" NAME="hosted_button_id" value="QNTJ7MSKQXP58">
<input type="hidden" NAME="no_shipping" value="1">
当我尝试以下代码时,它将带我进入PayPal登录页面。
<!-- SPECIFY the type of button - THIS CODE DOES NOT WORK -->
IT BRINGS ME TO PAYPAL LOG-IN PAGE
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" NAME="no_shipping" value="1">
当我尝试“立即购买”按钮代码时,它不起作用。它带我到错误页面。
检测到错误 错误信息 由于卖家网站存在问题,PayPal无法处理此交易。请直接与卖家联系以解决此问题。
<!-- SPECIFY the type of button - THIS CODE DOES NOT WORK -->
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZZE242VSVCF8S">
<input type="hidden" NAME="no_shipping" value="1">
这是完整的代码供审阅。我必须忽略一些简单的事情。任何帮助将不胜感激。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test-PayPal</title>
<script>
function init(){
document.forms['book_order'].submit();
}
window.onload = init;
</script>
</head>
<body>
<!-- START: DONATION ONE-TIME -->
<form name="book_order" id="book_order" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" id="p1_business" NAME="business" value="donations-facilitator@pjwfglobal.org">
<!-- SPECIFY the type of button - THIS CODE WORKS
<input type="hidden" NAME="cmd" value="_donations">
<input type="hidden" NAME="hosted_button_id" value="QNTJ7MSKQXP58">
<input type="hidden" NAME="no_shipping" value="1">
-->
<!-- SPECIFY the type of button - THIS CODE DOES NOT WORK
IT BRINGS ME TO PAYPAL LOG-IN PAGE
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" NAME="no_shipping" value="1">
-->
<!-- SPECIFY the type of button - THIS CODE DOES NOT WORK -->
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZZE242VSVCF8S">
<input type="hidden" NAME="no_shipping" value="1">
<!-- SPECIFY redirect details if they cancel payment checkout. -->
<input type="hidden" NAME="cancel_return" value="http://pjwfglobal.org/projects.html">
<!-- Specify redirect details after payment success. -->
<input type="hidden" NAME="return" value="http://pjwfglobal.org/thank-you.html">
<!-- SPECIFY Customer Data -->
<INPUT TYPE="hidden" id="p1_first_name" NAME="first_name" VALUE="John">
<INPUT TYPE="hidden" id="p1_last_name" NAME="last_name" VALUE="Doe">
<INPUT TYPE="hidden" id="p1_address1" NAME="address1" VALUE="123 Easy Street">
<INPUT TYPE="hidden" id="p1_address2" NAME="address2" VALUE="">
<INPUT TYPE="hidden" id="p1_city" NAME="city" VALUE="My City">
<INPUT TYPE="hidden" id="p1_state" NAME="state" VALUE="MyState">
<INPUT TYPE="hidden" id="p1_zip" NAME="zip" VALUE="12345">
<INPUT TYPE="hidden" NAME="lc" VALUE="US">
<INPUT TYPE="hidden" id="p1_email" NAME="email" VALUE="myemail@email.com">
<INPUT TYPE="hidden" id="p1_night_phone_a" NAME="night_phone_a" VALUE="123">
<INPUT TYPE="hidden" id="p1_night_phone_b" NAME="night_phone_b" VALUE="456">
<INPUT TYPE="hidden" id="p1_night_phone_c" NAME="night_phone_c" VALUE="7890">
<!-- SPECIFY Donation Amount -->
<INPUT TYPE="hidden" id="p1_item_name" NAME="item_name" VALUE="My Item">
<INPUT TYPE="hidden" id="p1_amount" NAME="amount" VALUE="20.00">
<input type="hidden" id="bo_quantity" NAME="quantity" value="1">
</form>
</body>
</html>