Sorry for the very basic nature of the question, but I've been searching for two days and I'm still not sure how to do this.
I've got a paypal cart/store set up. How do I leverage either paypal IPN or a third party service to identify one specific item of the three items I have for sale, and send me a notification that a copy has been purchased, and then update a counter on my original website?
Again, just suggestions or a guideline would be greatly appreciated - even to point me in the right direction. Thank you.
A basic guideline for you:
have a sandbox account (I assume you already do)
create there a seller and buyer account
set IPN setting for seller account to your testing URL (where you will be checking for certain data returned)
for the URL mentioned above create a php file with IPN validator
and go here https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables#id08CTB0S055Z to check variables you will be searching for.
I assume you would need to pick num_cart_items and loop throug possible item_nameX variables returned.
You don't need to code anything to validate IPN, use some of these classes:
http://www.micahcarrick.com/php-paypal-ipn-integration-class.html
http://www.phpclasses.org/package/2249-PHP-Process-Paypal-payment-interactions.html
Related
so I need to ask a question, I need to setup a simple paypal express checkout system, that one can allow users to change currencies, and two can then update the page with the updated currencies.
Then I need a way for me to get the order information. As I will be selling website templates so I need a way for me to get their email address, so I can then email them with the link to the template file download.
So my question is what data do I get if I set up an express checkout system. And what code do I need, Do i need to create a database to get the returned data back from paypal? Or do I just get an email or can i see that when i log into my paypal account and check orders and see their details that way, but the main important detail i need is their email address?
Can I also say that this is the first time I have looked into express shopping carts. So I am a complete novice in this field, So I will struggle with the coding aspect. But I think it is the route I need to go down.
Also I want to make it all in php as well. But also I don't want to use ready made systems. I just need the back-end code so that I can then just implement it into my current design. Not sure if paypal give you the code when you click the express shopping cart option in All tool section. I did notice though it redirects to a page that lists many partner sites. I couldn't find anywhere for any implementation advice or tips or code.
EDIT: Also I know I will also need to use either IPN or PDT but the documentation I read is highly confusing and just is making me unsure if I can even set a system up. I also read that you should implement both systems, but I also read that that had a risk of doing the payment twice. So yeah i am kinda a bit unsure how to even go about implementing a system I need.
Thanks in advance.
The paypal IPN simulator "currently" (As in I'm assuming never will) does not have functionality to test the subscr_payment payment option, this is really putting a dead hault in my project. I've read that I can just create a button that simulates this, but I don't have a clue how and after looking I can't find any information on it.
I'm creating a subscription based system for hosting a special type of website, I have everything done besides for the subscription model now and it seems like it's going to be the hardest part.
It is completely possible to test recurring billing with Paypal.
There are multiple ways possible for this.
One is the paypal subscribe button and another way (which i have used) is via a subscription form.
For the subscribe button you can refer this documentation, it contains all the information you need to setup this.
For second method, you need to create a form and place all the required variable in that form.
All the required variables are listed here.
I hope this helps.
Hopefully this workaround will help you. From within the PayPal developer site, you can go to the IPN simulator, select Transaction Type as Web Accept, click Show All Fields. You can then edit txn_type to be subscr_payment, subscr_signup, etc.
It's not perfect, as it doesn't give you all of the variables, but you can put info in other entries, and use a logical to determine whether or not the correct entry exists.
Do one test subscription, so that you have the values, and then work from there.
I'm designing a database system, which sells courses to students. This is all done within PHP. I want to take Paypal payments on my website and having done some research I need IPN.
I've been reading docs/guides on how to achieve this from www.x.com but its quite confusing to find info I need as there seems to be more than one way of doing something. The IPN stuff looks pretty straight forward, paypal just needs the unique Invoice number, which the notify script uses to retrieve the record and post the appropriate response into a database and if all goes well, redirect page to a thank you.
The thing is which method do I initially send my values across to Paypal, I don't really want to pass on quantity and shipping data as all of these pieces of data are irrelevant I don't want my end user to see. Do I have to start looking at using the paypal api?
Thanks for the advice
Since your question seems to be "where should i start looking for a good paypal integration with php" i'll give you some general "advice". I had the same problem just a couple of months ago.
Yes you've to read paypal docs, and unfortunatly they don't have the gift of clarity.. very complete but i didn't find them very clear.
However this php class has been very helpful for my similar project: https://github.com/Quixotix/PHP-PayPal-IPN hope can help you too.
Also these articles/classes/docs has been helpful (but at the end i'm not using them) to clear my mind about PP integration:
http://drewjoh.com/wiki/code/classes/phppaypal
http://www.geekality.net/2011/05/28/php-tutorial-paypal-instant-payment-notification-ipn/
set up a sandbox account https://developer.paypal.com/
then go through some of the tutorials
you will also need to set up some test accounts, pay attention to the nav on the left (from the developers page). It has everything you need
I see many examples of how to display transaction information to a user with PDT. I cannot find a way to associate a Paypal payment with a specified ID so that when the transaction is completed, I can update that ID in the database as paid.
How am I supposed to get an ID that I specify back from Paypal so I know what the payment is for? I cannot use the email address or name or anything else. It must be an ID that I specify.
I see some people using item_number, but I am using a Paypal encrypted button so I cannot add on form variables to post to Paypal when the user clicks the pay now button.
I see this on websites all the time, so I know there must be some way to do this. I just can't find it anywhere...
Thank you
Most often people encrypt their own buttons and use either the custom field which gets sent pack to you, or the item number field. Look into how to encrypt your own buttons with PHP.
PayPal offers a sample in their SDK which can be found here.
I stumbled upon this excellent piece that succinctly lays out how to make dynamic encrypted paypal buttons. It is just what I needed. Thanks for pointing me in the right direction!
http://www.stellarwebsolutions.com/en/articles/paypal_button_encryption_php.php
I've been looking all over the internet, played with ipn a bit, but can't figure out how to get paypal to work with subscriptions (monthly). Any advice on how to get monthly subscriptions to work, and update the database if they paid, or cancelled? Thanks for any help.
here is some sample code from paypal. Paypal gives you a return after the completion of the request. So you need a file on your webserver and paypal gives you automaticly a return to this file. Then you can insert it to your database.
And from your database you can generate reports. when you don't understand the example you should look more on php first.
I hop this was your question.
Look at the txn_type's provided in https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables and https://www.paypalobjects.com/en_US/ebook/subscriptions/Appx-ipn_subscription_variables.html and code the IPN script accordingly. You should see these txn_type's in your subscription IPN's as well.
E.g.
if($_POST['txn_type'] == "recurring_payment") {
// update database
}
Of course, you'll still need to POST the data back to PayPal in order to validate it. But checking the txn_type should give you enough granularity to update your database accordingly.
Keep in mind that 'subscriptions' starting with I- are actually 'recurring payments'. Subscriptions start with S-. These are legacy and thus you shouldn't see these any longer, but it's good to keep this in the back of your mind anyway.