Solved

PayPal IPN

Posted on 2012-03-28
6
647 Views
Last Modified: 2016-03-24
I am creating a consumer 2 consumer website, similar to eBay but for books only. I am using PayPal's sandboxing environment to test the payment functionality.

I was wondering if it was possible to use IPN with both buyers and sellers. Reason being is a user may have a normal account(Non seller account), i want to be able to log in a database all payments from both parties. I am not able to do this with an buyer account.

The reason behind using IPN is just so all information can be logged in the database, would using IPN to do this be the correct way? is there an alternative?

I have successfully managed to get IPN working for a seller account by providing a url listener in PayPal under the relevant user, however i cannot do the same for a buyer.

I would appreciate any help i can get with this.

Thanks in advance.
0
Comment
Question by:MK15
  • 3
  • 3
6 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 37776384
The IPN is triggered by a payment; it is a payment notification.  The IPN is called when money is sent to a seller.  Information about the buyer is present in the data passed to the IPN.  So the answer is "Yes, you get both buyer and seller information in the IPN and you can log this information in your data base."

To see this in action, you might want to use var_dump() or error_log() to capture and present the raw post string that is received in the IPN.
0
 

Author Comment

by:MK15
ID: 37776423
I have been able to get it working by using a seller account, but i wanted the sort of functionality that is achieved when users purchase from eBay, where a user is not a seller but still is able to sell items.  I am able to do this with the email address but i have no way of recording the information, as notification option is not available to buyers in the sandbox environment.
0
 

Author Comment

by:MK15
ID: 37776435
for example

if i use a buyers e-mail address, i.e. buyer123@lala.com.
i would not receive IPN based on this address.

If i use sellers address i.e. seller123@lalal.com.
i would get a response from IPN. Thus can store item number, buyer and seller email etc

I need to achieve notification from both types of users in order for me to store it in a database
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 37776500
a user is not a seller but still is able to sell items
Maybe I am missing a basic definition of the terms here.

The IPN is triggered by payment after a sale.  Each PayPal account can have one IPN.  The IPN has a lot of information passed to it, including the identity of the buyer and the seller, as given by their email addresses.  You can capture the email address of the buyer in the IPN and send an email from the IPN script to the buyer.  In fact, you can send the email anywhere (or make data base updates, or call web services, etc).  One of my clients uses the IPN to do a bill-of-materials explosion and trigger factory orders.  It is really very powerful if it is programmed correctly.

But let me ask an architectural question... Why would any user have a different account from any other user? Why not just make it a peer-to-peer network where all clients are treated the same?  It would seem to me that the entire design and programming would be much easier that way.  Then you would not have to deal with different classes of users.

Some of my friends like this service:
http://bookmooch.com/

And this article is rather old, but it shows some ideas about book exchanges.
http://www.guardian.co.uk/books/2011/feb/16/new-sites-kindle-lendle
0
 

Author Comment

by:MK15
ID: 37776547
yes i totally agree, i shall make all test accounts the same as it would make the process more seamless.


Once again thank you. :)
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 37776638
I think you'll find that design pattern much easier to work with.  Thanks for the points, ~Ray
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Read about how to choose the best possible content marketing agency to suit your needs. Content marketing has become an integral part of running a successful tech business, so it is wise to be informed.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now