views:

22

answers:

1

hello Guys,
i have included the payment system in my site using paypal.

in paypal, i have choose the payment message service as IPN.

Now i have some question about the flow my site, i don't how to handle it.

1) Now If the user name called "A" had paid for some service and at the same time user name called "B" is also making payment, How about I came to know that which user had paid for the service? [ means what should i include in my payment flow to know about the user? should i add the user id with my item name and then get that id from that item name in IPN message url]

2) What time is taken by IPN message, bcz last time when i was checking my payment module then i don't know when my message was sent by paypal, but it was certainly taken time say more 3 - 5 min, now what should i do to get the payment status immediately bcz in my site i want that, as soon as user had paid then that service should start immediately.

EDIT: Can i include any custom data with my payment. Bcz in IPN message sent by paypal, their is one filed called "custom" sent by the paypal so to add that if i have to include that file in my payment form.

A: 

1.) there are custom HTML transaction variables that can be set for things like this and you will have to name the input tag accordingly. There would be two input elements for each custom field that you want to save. One for the field name and one for the field value.

These tags are on0, on1, or on2 for the custom field names and os0, os1, and os2 for the custom field values.

I would send on0 with a value of "UserID" and os0 the actual ID.

These values will be represented in the IPN as follows:

os0 is represented as option_selection1

on0 is represented as option_name1

Here's the info on PayPal's Parameters

2.) They are almost always within 5 minutes, but I have heard that from time to time there can be periods where this might be significantly more. You can always create a PDT success page that digests the same info that would be in the IPN message. This would be your return page from the paypal site and all your data would be included in the request. Just make sure you keep track of you still use the IPN in case the transaction succeeds but the user never makes it back to your site. I like using both methods so you can customize the welcome back to your site for the user based on their transaction. And if you doing that and have all the info you need, might as well process the order as well.

jumpdart