简体   繁体   English

PayPal捐赠与laravel 5.1集成

[英]PayPal donation integration with laravel 5.1

I've searched over the internet about this problem but still stack with it. 我已经在互联网上搜索了有关此问题的信息,但仍然与之叠加。 I'm trying to create a donation page , where they can enter the amount they want, then after that they will be redirected into the paypal page/website, and works fine. 我正在尝试创建一个donation page ,他们可以在其中输入所需的金额,然后将其重定向到paypal页面/网站,并且可以正常工作。 But how can I test it if it is working or not. 但是我如何测试它是否起作用。 I've created 2 sandbox paypal account which I think it is for testing but whenever I try to pay/login my account using the sandbox account , I can't use it. 我已经创建了2沙箱贝宝帐户,我认为该帐户用于测试,但是每当尝试使用sandbox account付款/登录我的sandbox account ,我都无法使用它。 It seems that the credentials I'm trying to use in login doesn't exists. 我要在登录中使用的凭据似乎不存在。 Why is that? 这是为什么? Please see my code below for code reference. 请在下面查看我的代码以获取代码参考。 What should I do with this? 我该怎么办?

Code: 码:

<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>

Update: 更新:

I've changed this <form method="POST" action="https://www.paypal.com/cgi-bin/webscr" role="form"> to this <form method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr" role="form"> but after the transaction is done, it won't redirect to my page, I think it should be. 我已将此<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">但交易完成后,它不会重定向到我的页面,我认为应该是。

you should add a return back and cancel field. 您应该添加一个“返回并取消”字段。

<input type="hidden" name="return" value="http://your-url-here.com">
<input type="hidden" name="cancel_return" value="http://your-url-here.com">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM