Connecting a form with PayPal pay-button to MySQL database? - php

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.

Related

Submit subscription request to PayPal from PHP form

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.

keep a track of paypal payment made online

My question may seem to be very basic and view dependent but i wish to know every aspect of it.
I have created a mobile app where the users need to register themselves in order to use the app, but my client wishes to have the admin panel in the form of a website, where the user can register themselves by paying a specific amount through paypal and then they can use the mobile app version.
I have completed the main page and have created the paypal button on the user page, but for the admin page i wish to show a list of all users who have successfully paid for the product.
Is it possible to do so, can i keep a track of user details and their payments on the website??? if yes then can anyone guide me with it, would appreciate some help
use Paypal IPN to save the paypal transaction information to your database.
Use a database. Save each payment record after payment maybe.

Collecting user data before PayPal purchase

I've ran into a problem. Basically, I have a website that users can hire someone to tutor them. Each tutor has a small profile with a video, bio and rating. The user fills out a form with information such as their name, email and the most important one which is the date and timeslot (Dropdown) they want. When they fill out this information they can then click "Buy Now" which is a PayPal button I've setup. There are no variables here, each time slot is the same price all round.
The problem I'm having is I don't know how to collect the user information when the PayPal button is clicked. Can I pass this timeslot to PayPal who then return it to me? I can set up simple form that will send this information to me in an email, however I don't know how I can trigger that PHP script when the PayPal buy now button is pressed.
Any help? I've been Googling for a while, I can't seem to find anything! Maybe I'm wording it wrong. Anyway, hope you guys can assist.
I would save all of the info in your database prior to sending the user over to PayPal. That way you can include the invoice number (or record ID) in the invoice parameter in payment requests.
If you're working with Payments Standard the parameter is called invoice. If you're working with the Express Checkout API it's called INVNUM.
Hi you can use Ajax in this situation. The ajax will prevent the redirect of the form to paypal for awhile but executes another process in which you will save and capture the information of the form to your database. After the process the redirection to paypal payment method will continue.
You can view this good tutorial in here.
http://anytch.com/save-html-form-post-to-database-before-redirect-to-paypal/

how to send and retrieve custom form info through paypal IPN?

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.

click pay now in paypal page update my database too

I have a table to store my credit from user has been paid.
credit
+id
+amount
My goal is when you user click on button pay now in paypal page I have abiltity to update my table the amount field.
Anybody know the ways to do this,
thanks
EDIT: look at this code
http://www.micahcarrick.com/04-19-2005/php-paypal-ipn-integration-class.html
If the button goes off to PayPal, you'll need to intercept the request first, either with AJAX, or send to a PHP script, and then send on through to PayPal.
PayPal's Instant Payment Notification protocol is usually what's used to do this.

Categories