0

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.

Blues Clues
  • 1,694
  • 3
  • 31
  • 72

1 Answers1

1

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">
Jordan Lipana
  • 437
  • 2
  • 4
  • 18
  • I tested it, it worked with the ``. But sometimes if I submit the form it return an error says: `Fatal Failure ` then if I refresh the browser it will work. Why is that happening? – Blues Clues Aug 17 '17 at 05:06
  • It's an error in paypal website if I submit the form, the error is `Fatal Failure` – Blues Clues Aug 17 '17 at 05:14
  • Had you try working it on live site? Maybe this is a paypal sandbox issue. – Jordan Lipana Aug 17 '17 at 05:16
  • Not yet, I'm just using `localhost` – Blues Clues Aug 17 '17 at 05:17
  • I will. But one more thing. How can I test it if the donation is increasing/decreasing/sending to the account in sandbox? I have three account, one facilitator, one buyer, and one seller. – Blues Clues Aug 17 '17 at 05:22
  • I had not tested on sandbox, but on live site you will automatically get an email notification whenever you have a successful transaction or donation. The same information will also appear in your Account Transaction History. Vote this if its helpful. – Jordan Lipana Aug 17 '17 at 05:28
  • Oh, great. This is very helpful. – Blues Clues Aug 17 '17 at 05:29