- You put a form (hidden or with bits visible) that POSTs data to Paypal
- This brings the user to Paypal where they can pay using either a credit card or their Paypal account
- As part of processing the user's payment, Paypal takes key information about the user's payment e.g. transaction id, amount, and other sundry details and POSTs them to a custom instant payment notification URL (as it happens to be called) on your site
- This URL is hopefully hosts a script or other form of code that can pick up all the POSTed IPN variables and POSTs back the information with one extra variable to validate the information
- Once this POST back to Paypal returns with a success status the application can record the user's payment and credit them appropriately.
Friday, January 16, 2009
Paypal IPN and mc_fee
I encountered an interesting problem today with accepting payments for an online registration solution I wrote for a non-profit organization. The application accepts payments using Paypal's Instant Payment Notification feature. IPN works as follows:
Labels:
application,
IPN,
online,
payment,
Paypal,
problem,
programming,
web
Subscribe to:
Post Comments (Atom)
Well... what was the trouble with mc_fee? :)
ReplyDeleteHaha it's been a while since I've looked back at it. I don't recall any more except that perhaps the POSTs where mc_fee is null aren't the final resolved transactions.
ReplyDeleteMy solution to the problem was to make the mc_fee field not null with a default of 0.00. Your comment made me look at the data I've collected so far in that application. Here's what I see as a result of the following query:
select distinct payment_status, mc_fee from paypal_detail where mc_fee = 0.00
payment_status | mc_fee
----------------+--------
Failed | 0.00
Pending | 0.00
Reversed | 0.00
It looks like mc_fee was null for all transactions where the payment_status was not "Completed" or "Refunded"
The output of:
select distinct payment_status from paypal_detail
payment_status
----------------
Completed
Pending
Reversed
Refunded
Failed
Hi Shahbaz,
ReplyDeleteQuite recently I started a simple webshop, using a similar technicque as descriped above. But for me the mc_fee was a surprice, do you know if this is required and if its possible to manupulate this? Because on a order of 7 dollars they charge almost 1 dollar... :( there go's my profit? Any ideas?
Kind Regards