Am having a lot of trouble getting my head around this paypal payment stuff...
How can i confirm that the user has successfully signed up for my subscription?
I know 0 about IPN but for example : If a user signs up to my website with example#e.com but uses the paypal account sample#s.com to pay then how to i match up the user.
I read that PDT do not send out a transaction ID (tx) for recurring (subscription) payments is that true ?
Just need help with it all... honest and easy :)
Thanks.
Yeah sometimes is hard to understand Paypal and all their documentation but for any kind of subscription i would recommend Paypal IPN. You set IPN URL in your paypal account for example: http://www.domain.com/ipn.php. Then you create a subscription button in paypal account where you can set the price, recurring price etc.
More about Paypal IPN you can read here:
https://www.paypal.com/ipn
When creating Paypal button you can also add some custom fields which can help you determine which customer really pays. So for example you have a database of users and there is user with userid=100, username=Nickname and registered_email=xxx#gmail.com. Now you can decide to add userid=100 as a custom field and add this to paypal button. For example CUSTOM=100.
ipn.php in this case is a script which handles all the logic. When user pay, Paypal send any status to http://www.domain.com/ipn.php (you set this in your paypal account as IPN URL). So ipn.php in this case needs to check if payment is complete and status is ok. Then retrieve a CUSTOM field ($_POST['custom']) which is in this case 100 (userid). And then update your database with users and somehow mark that this user payed of course if status is Completed.
Hope this helps a little. But in this case it's not really important from which paypal account user pays and which is registered in your database. All you need is that you somehow link it together. In this case with userid or something like that.
If you want to implement Paypal IPN and your customers don't use same email from my experience you can use a form to authenticate the user
user login on your website with xxx#example.org
user clicks on your item and pays with yyy#example.org
after he pays you can redirect him to a form where they can merge Paypal account with website account
every time that user pays then your IPN will be covered by the information he provided
you should save his payment information for later use.
Related
On my website, I want to set up a "pay to remove ads" feature, and I want to collect payments for it through PayPal. The setup that I want for this is quite simple:
User pays
Payment is verified
The entry in the MySQL database containing the user's information is updated to disable ads on the site for that user
To do this, I want to use PayPal's IPN service. I understand the basics of it, but I am not quite sure how to implement it, nor do I understand how I can trigger the script to update the database for the correct user. I would imagine that to do this, I need to include some means of user identification whenever they begin the payment process, but I am not sure how to do that either. I am trying to implement this in PHP.
The process would be:
The user has an ID
When he pays, you attach this ID as the custom parameter in the PayPal request
You also define what url you want to call for the IPN
Once the payment is complete, PayPal sends the IPN
You verify that the actual status of the payment is "Completed"
You retrieve the user'ID from the custom parameter
You update your table
I hope it's clear :)
My sent data to paypal is
"https://www.paypal.com/cgi-bin/webscr/cmd=_cart&upload=1&business=seller.email#something.com¤cy_code=USD&bn=BusinessName&return=http://www.sellersite.com&item_number_1=55&item_name_1=battery&amount_1=55&quantity_1=2&item_number_2=52&item_name_2=bat&amount_2=5&quantity_2=3"
And I want to show those sent data(item number, item name,amount,quantity) and the paypal transaction id to the buyer on "http://www.sellersite.com" after successful payment. (Suppose, the seller has the merchant account with paypal and he would enter that paypal id into database from admin section of the website. So,I would not think about his paypal account settings, my job is just to create the environment for paypal payment for the seller.)
If I write a script like
$T_ID=$_REQUEST['tx']; // or $T_ID=$_GET['tx']; **ref(tx):- "https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_paymentdatatransfer"
$item=$_REQUEST['item_number_1']; // or $item=$_GET['item_number_1'];
Then would I get those data from paypal ?
Please tell me.
-Thanks.
It's not going to be quite that simple. You'll need to setup Payment Data Transfer (PDT) in order to get details sent back to your return URL after the buyer completes the payment.
This is useful if you're simply going to display details back to the user, but it's not recommended for updating your own database, sending out email notifications, etc. because there is no guarantee this page will ever be reached so the code won't always run.
For that sort of thing you'll want to use Instant Payment Notification (IPN). This works very similar to PDT except that it will always POST data to your IPN listener on your server regardless of whether or not the user makes it back to your return URL, and it happens outside of your checkout system all together.
I have a recurring payment solution set up via PayPal's IPN service, basically the user fills in a form, pays the money and via IPN my system gets a ping to grand the user access to the system.
Everything technically works fine, but occasionally on the last day of a user's cycle they forget that it is a recurring payment and complete the form again. PayPal doesn't seem to mind this and creates a second recurring payment profile.
Currently I go in, refund the money and cancel this new payment profile, but obviously this isn't ideal - is there any way I can configure PayPal to not accept new profiles from people with currently active profiles? Or will I need to catch this at my website's end and do some form of lookup before allowing the payment?
Paypal did not recognize the a transaction is a duplicate one, It tackles the transaction as a new transaction. You will have to tackle it from your system.
When implementing payment gateways, It is good approach to save the billing with a status pending or something in your system before sending to payment gateway.
Also in the form user is filling you can implement a field to uniquely identify the user like his email address and you can also save the expiry or second recurring date against the user unique field in your system. Now when the user enter the same unique field and want to submit a form again you can validate that the same user is paying again but its expiry of second billing date is not yet reached, so prompt and restrict him for paying again.
Hope it will help you.
I want package sales, when user click on purchase want to send user on paypal site, after success payment back to my site, I will update payment status if payed other wise will not update the payment status. 2nd question how will i know user payed?
PayPal IPN allows the PayPal servers to interact with yours, telling them statuses about if they've paid, missed payment or it failed etc.
https://www.paypal.com/ipn
For example, if you're using the Website Payments Standard (https://www.paypal-business.co.uk/accept-online-payments-with-paypal/index.htm) you send them to the PayPal site by sending hidden information in a form, they do their thing on PayPal and then get sent back. PayPal will then notify the server using the IPN details that were either sent or are in the account, letting the server know if it was successful or if anything else happened. Then your application that picks up the IPN, does its security checks, and then does the appropriate action (e.g. allows the item to be sent or them to login etc).
However - if you're doing subscriptions, I highly recommend not using PayPal. They suck for subscriptions.
visit the following link
http://www.evoluted.net/thinktank/web-development/paypal-php-integration
and follow the step by step guide.
If not work then ask question here.
The situation is as follows: there's a website that connects sellers and buyers, like Ebay.
Among other things the owner of the website needs to know the details of each transaction initialized from there. Essentially I am looking for a payment method that returns a digital receipt.
Is it possible to do something like that with PayPal?
Of course you can do it like this.
Couple of things that you will have to do:
Have sellers register their PayPal information with. Lets say in "sellers" table, with merchant email/ merchant id as primary key.
Sellers will have to setup IPN URL on their PayPal accounts. There url will have to point to the IPN handler that you will create
Handle the IPN, check this out http://boolcast.com/joomla/3-development/13-joomla-custom-paypal-ipn. I wrote that PayPal IPN handler for Joomla a while back, you can eaily modify it and use it for what you need (you will have to remove merchant info from config). Also here is a list of IPN vars that you will receive https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNReference
If IPN is good, While handling the IPN check the receiver_email and/or receiver_id to determine who is the seller. You can retrieve the seller information from "sellers" table by the email/merchange_id. At this point you can generate all kinds of notifications to seller/buyer/yourself/etc...
Things to note:
You will not be able to use merchant ID if non primary PayPal user will be creating PayPal button.
List of IPN variables will depend on the type of payment and how it is submitted
ALWAYS use PayPal Sandbox
This has nothing to do with PayPal. Your notification of this "market website" needs to be done in your own code.
So yes, it is possible.