|
-
Feb 14th, 2011, 12:30 AM
#7
Re: Authenticate Program with paypal Payment?
To able to get notified about a payment made in paypal you must have a merchant account or another one(that it's name doesn't come to me right now).
You can then use the IPN and PDT features.From what i read you don't need the PDT feature(will redirect to a page of your choice when payment is done).
Your first task would be to fill the variables that paypal provide so you can instruct paypal where it will "post" the data after a payment is made(if you only have one return page then you can specify it in paypal's ipn page).
That variable is "notify_url" .
Now about the special code you want.There is a variable in paypal called "custom" that you can put anything in there.So you can create a random code and put it in there before you send your notification.
Have in mind that paypal IPN will redirect to a valid address (it will ask you for a valid address to check inside the site) so you need to have a web page that is Static or get a pseudo-static address from a site that provide that but i can't guarantee that this will work as expected.
Also have in mind that paypal lucks the info and support on asp.net .
Sure they can give you a ready to go button but you have to program all the other features.Also have in mind that there is a problem on having 2 paypal buttons in one page (because the button they give you include <form> and you can only have one <form> in a page.This is solvable but i cannot give the code out cuz it's a pattern i made on a company i support.
Nevertheless it's not an easy task so expect to get dirty 
Now after saying that, what you want cannot be done in the way you specify it.There is no automated way to do payments, the user needs to physically do they payment and IPN can take it from there.
So you give the user a paypal button, you insert a security code inside the "custom" variable (it's actually 'custom' with one ' ), you redirect the user to the paypal site with all important the variables filled, the user pays, IPN hits back to a page you have for paypal, you read back the data from paypal and you e-mail the "custom" variable value to the user.
Of course you need to write the created custom variable to your database first and then to check for the matching variable given back by IPN.
I think i have frighten you enough.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|