So I have a website that uses PayPal smart buttons and I have a code that sends a the buyer the product when he buys the it. It uses a PHP file to send the product.
I have javascript code that calls PHP when the onApprove function runs.
I know that it is not the safest way to do but I found it really hard to use the API and it would be a lot of time to do it so I decided to do it this way.
But I ran into a problem when I don't receive the money on PayPal, but the program send the product to them. It sometimes works and sometimes not.
I am sure that the PHP code can only run when the onApprove runs so that is not the problem.
Is there any way that onApprove runs without the payment having completed?