简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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