PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
You need a notify URL. Can be the same as return URL, but I don't think it can be empty. PayPal used to use a3, p3, and t3. Didn't realize they still did. a3 is the amount, p3 the period (D, M, Y, etc), and t3 the period count. a1/p1/t1 should be your free month values, though I'd confirm with PayPal docs.
That notify URL - does PayPal use that URL to check if the price somewhere on there, is the same as what is posted (like in some ajax way)...?? Bit lost there.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis wrote:What am I still missing?
I get the same error.
The error said you were missing a3, p3, and t3 values. I still don't see them. See my previous post. You need to replace period with a combination of t and p, and replace mc_amount with a.
I'm having trouble working this code out. I keep getting the errors.
So I went to use the PayPal Create Button option as this is for just one sort of product.
I can enter the notify_url option in the advanced variables, but I have a question about it.
The way I think it works, is that PayPal runs it "behind the scenes", so I have put in the session start, and queried if there is a Session active. If there is, it gets the session userid, and then updates the database and sets the pending value to "paid".
Would this work? Or does the backend notify script not identify the user is in a session, since it doesn't work or get triggered on their PC ??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
I wouldn't rely on sessions. Add the user ID to the order if you can, as a custom variable. If not, generate an actual order on your end to store the relevant information in and pass that order ID to the form.
Poss easier then to just slap the userid on the end of the notify_url and use that to trigger it.
So the Return URL is /cart&success=y, but the notify_url secretly updates their pending field to "ready".
I assume therefore that the notify_url php file needs to run via PayPal, and without any local site logins. Because the user's browser isn't actually running it.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
PayPal sends a POST request to your notify_url so definitely don't expect or require a login to reach that route. I'd still recommend keeping an orders table to record outgoing orders and a transactions table to record incoming PayPal transactions.