It seems that Paypal limits what what information can be retrieved by the paypal IPN php file after the user pays. I want users to be able to make an username and password that they will use to log in to my website before they click the paypal checkout button. After they pay, my paypal IPN php file will retrieve their username and password and place them into my mysql database. Is this possible? I want to make registration as easy as possible for the users.
Thanks in advance
there are a couple of custom fields that you can add to your form that paypal will return no matter what you sue them. however i would recommend saving the data locally, before sending the rest of to paypal, to do this you either nee to use AJAX to submit part of the form to a php script or pre-possessing the form data before sending to paypal via curl.
Related
I want to create a page that lists class, allows the user to choose a course + fill out their name and email, lets the user pay with paypal and if they paid the form writes the data to a database.
I know how to make an HTML and PHP form with the required fields, I know how to write data to a database, I researhed how to create a paypal business account to accept payments, but how do I write the form data to the database AFTER the paypal page? The browser is redirected to paypal's site for the payment isn't it?.
https://i.stack.imgur.com/KK34c.jpg
how can I keep variables from page 1 and use them on page 3 to write to the database?
I would recommend implementing this server-side checkout pattern: https://developer.paypal.com/demo/checkout/#/pattern/server
API calls happen on your server to set up and capture the transaction: https://developer.paypal.com/docs/checkout/reference/server-integration/
When the API call to capture returns success, that is when you can immediately write the successful registration record in your database, and show the confirmation to the user.
The documentation is very vague everywhere on this issue, and so are the questions online (including this site):
I have a form that the user must fill out with a few fields. For example, a username and password. Then, they have to purchase something through PayPal. I've created a business account. When the user submits my form it simply queries and adds them to a local database through the PHP at the present. I want to first verify payment through PayPal and then add them to the database. I've also tried adding them to the database with a "paid=0" by default and then trying to get PayPal to send me a success token or something that I can then flip the value to 1, but I'm at a loss for where to start.
First of all i advice you to use PHP Paypal offical SDK with offical subscription's example.
It is be a good idea to store transaction before any Paypal Request, because you can track errors.
Use a "status" field to store transaction status. after that you can do Paypal Payment.
After, you change the status depending on Paypal response.
Hope this helps.
I am wondering how to connect my form with a PayPal's pay button to a MySQL database?
I have a form with username and e-mail address which my customers must fill in and then click a PayPal's pay button. After they fill in the information and click the pay-button, they will be directed to PayPal's payment site. What I want to happen is that when the payment is completed, the information they filled in gets stored on my database.
I hope it was understandable. Does anyone know how I should proceed? Any help is highly appreciated. Thanks!
I would recommend using Instant Payment Notification (IPN) for this. This template will get your data saved in MySQL very quickly and easily.
All you gotta do is edit the config file with your db credentials and then run the installer to create all of the tables/fields.
Then set up IPN in your PayPal account to point to the ipn-listener.php file that comes with the template. From that point on, any transaction that hits your PayPal account will end up saved in your database.
I have a membership application form that collects basic demographic data. Once the form is submitted, I use PHP to insert the data into a database and then redirect the user to Paypal for membership payment. I would like to add a field to each user record that indicates whether or not a payment has been posted. Is there a way Paypal can pass back a confirmation that I can use to update each membership record?
Yes, check this out is called IPN is provided by paypal, this is how it works
I am creating a PHP form which takes the customer's information and the amount they want to spend and when the submit button is hit the details are sent to my email address.
This is where I have the problem. I want to then send them a link to the PayPal account to complete the purchase. However I want the amount to be pre-populated based on the amount they selected from the forum.
Simply, can this be done?
You need to change the action parameter of the form from https://www.paypal.com/cgi-bin/webscr to www.someurl.com/page-that-you-can-edit.php
You then need to code your script to email you whatever information you want, and then silently redirect the buyer to PayPal (you do this by setting the header) with the appropriate paypal variables: cmd=_donations&business=yourpaypal#email.com&amount=xx.xx&item_name=your items name&[any other website payment standard variables ]