我已经在互联网上搜索过这个问题,但仍然与它有关。我正在尝试创建一个 donation page
,在那里他们可以输入他们想要的数量,然后他们将被重定向到 paypal
页面/网站,并且工作正常。但是我该如何测试它是否有效。我创建了 2
我认为这是用于测试的沙盒 paypal 帐户,但每当我尝试使用 sandbox account
支付/登录我的帐户时,我无法使用它。似乎我尝试在登录中使用的凭据不存在。这是为什么?请参阅下面的代码以获取代码引用。我该怎么办?
代码:
<form method="POST" action="https://www.paypal.com/cgi-bin/webscr" role="form">
<div class="form-group">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="KOWG3LKOLPR32">
<input type="hidden" name="amount" value="{{ $value }}" class="pure-number">
</div>
<div class="form-group">
<input type="submit" class="btn btn-info" value="Proceed to PayPal">
</div>
</form>
更新:
我已经改变了这个<form method="POST" action="https://www.paypal.com/cgi-bin/webscr" role="form">
对此 <form method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr" role="form">
但是交易完成后,它不会重定向到我的页面,我认为应该是。
最佳答案
您应该添加返回和取消字段。
<input type="hidden" name="return" value="http://your-url-here.com">
<input type="hidden" name="cancel_return" value="http://your-url-here.com">
关于php - PayPal 捐赠与 laravel 5.1 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45724846/