So here's the setup, It's taken me over a year on and off to get to the point I'm at, and I have to admit.... there have been tears. BUT I've persevered and read pretty much every tutorial, post and youtube that I could find (I don't admit to understanding it all).
I have a form which visitors can fill in to book our services. They have the option to either pay on receipt of an invoice from us, or they can pay online - using the full PayPal redirect. If they pay online, they have the option to pay a deposit or the full amount - and all of that (eventually) works very well. It even stores the record in a database table.
Because some people do just pay a deposit, I had to create a second form that allows them to pay any outstanding balance, and I'm ALMOST there, but I have a couple of problems I could REALLY do with some help in sorting. I've currently got it set up so that I would email the client with a link to their form - this is basically the URL of the form with their unique ID passed as a parameter. The form has a DB Read action which works - so when the user clicks on the link in the email, it brings up the details of their booking in the form. All the fields are disabled, as I don't want the user being able to change anything at this stage. I also have two of the fields duplicated and hidden - these are the item and amount fields. I've had to do that as I don't think you can pass disabled field values to PayPal. So far, so good,when you click on "Submit" it transfers the user to the PayPal screen with the item data and amount completed as you would expect - and they can complete the payment normally.
Now this is where I have the problems. There are two things that I need to happen, but only if the IPN is verified. There is an IPN listener set up for the form, and it works (I set up the email to send the post form data to me, and that shows what came back from PayPal as you would expect), but what I need is for the record in the database to be updated with the PayPal transaction ID, and also for the record to be updated with a flag that says the booking has been paid in full (I plan to check the flag in the future if someone clicks on the link in the email again, so it should (eventually) say that the booking is already paid in full - and not take them to the form.
I have added a field to the database called txn_id which seems to be what is in the post data from the IPN, and there is a DB Save action in the 'on verified' section of the IPN listener, but it doesn't update the field with the transaction id. Also, I'm setting that 'paid in full' flag in a field on the form which has the same name as the field in the database table (PaidInFull), and I'm not loading the value of that field in the DB Read -( otherwise it wipes out the vale I have set for the PaidInFull field in the form, as to start with, the field in the database is blank). I've not used the Model ID - as when I tried, it didn't load any data to the form on the DB Read.
I'm now at a big loss as to what to do next - there was a post from someone who had a similar problem about a year ago, but unhelpfully, he posted that he'd sorted it with a DB Read and some custom code - but didn't share the custom code :-(
All help gratefully appreciated, and thank you for taking the time to read all the way down.
Regards,
Rob.
I have a form which visitors can fill in to book our services. They have the option to either pay on receipt of an invoice from us, or they can pay online - using the full PayPal redirect. If they pay online, they have the option to pay a deposit or the full amount - and all of that (eventually) works very well. It even stores the record in a database table.
Because some people do just pay a deposit, I had to create a second form that allows them to pay any outstanding balance, and I'm ALMOST there, but I have a couple of problems I could REALLY do with some help in sorting. I've currently got it set up so that I would email the client with a link to their form - this is basically the URL of the form with their unique ID passed as a parameter. The form has a DB Read action which works - so when the user clicks on the link in the email, it brings up the details of their booking in the form. All the fields are disabled, as I don't want the user being able to change anything at this stage. I also have two of the fields duplicated and hidden - these are the item and amount fields. I've had to do that as I don't think you can pass disabled field values to PayPal. So far, so good,when you click on "Submit" it transfers the user to the PayPal screen with the item data and amount completed as you would expect - and they can complete the payment normally.
Now this is where I have the problems. There are two things that I need to happen, but only if the IPN is verified. There is an IPN listener set up for the form, and it works (I set up the email to send the post form data to me, and that shows what came back from PayPal as you would expect), but what I need is for the record in the database to be updated with the PayPal transaction ID, and also for the record to be updated with a flag that says the booking has been paid in full (I plan to check the flag in the future if someone clicks on the link in the email again, so it should (eventually) say that the booking is already paid in full - and not take them to the form.
I have added a field to the database called txn_id which seems to be what is in the post data from the IPN, and there is a DB Save action in the 'on verified' section of the IPN listener, but it doesn't update the field with the transaction id. Also, I'm setting that 'paid in full' flag in a field on the form which has the same name as the field in the database table (PaidInFull), and I'm not loading the value of that field in the DB Read -( otherwise it wipes out the vale I have set for the PaidInFull field in the form, as to start with, the field in the database is blank). I've not used the Model ID - as when I tried, it didn't load any data to the form on the DB Read.
I'm now at a big loss as to what to do next - there was a post from someone who had a similar problem about a year ago, but unhelpfully, he posted that he'd sorted it with a DB Read and some custom code - but didn't share the custom code :-(
All help gratefully appreciated, and thank you for taking the time to read all the way down.
Regards,
Rob.