1

Am I correct in my understanding that I can only pass-through one custom variable from a form I create to PayPal using IPN?

I have my IPN script up and running with no issues. However, upon payment notification I need to store information input by the user from a form on my site into a MySQL database.

In this specific case its for a sports league registration form. The user fills out info regarding their team (i.e. Team name, League, ect..) then pays the league fee via PayPal. Upon verification I'd like to store their team name, the league they're signing up for and other info I need to collect in my database. But since I can only pass-through one custom variable from my form through the PayPal IPN process, I'm a bit stumped.

I've read other posts about storing the info immediately in the database, then marking it 'paid' upon verification. However, how could I accomplish this since when the user clicks Pay Now, the form action performed is the PayPal payment process (as opposed to an insert statement I create). Where would I perform a database INSERT with the posted form information?

Tips or advice would be appreciated!

1 Answer 1

1

However, how could I accomplish this since when the user clicks Pay Now, the form action performed is the PayPal payment process (as opposed to an insert statement I create). Where would I perform a database INSERT with the posted form information?

Perform the INSERT before sending the customer to PayPal. Before that, define a unique random key for the transaction. Put that key

  1. into the database record that's being inserted and
  2. pass it to PayPal's IPN.

Once notification comes back from PayPal, you can use the key to identify the record (with all the info already in it) and mark it paid.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your reply! Sorry if this is a naive follow up question, but once the form is submitted, isn't the form's action (action="wwww.paypal.com/cgi-.....") carried out immediately? Would I perform my own action first, then post again to the PayPal action? Is that possible? I'm just a little confused on the workflow after the user clicks Pay Now. Thanks again!
@bar you would have to split it up into two form submissions: The first for you to store the data; the second for the user to click the "Pay now" button.
Okay, that was something I had considered. Thanks very much for your answer, I think I've got my solution!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.