views:

49

answers:

2

So I have a basic form for the users Name, Email, Address, and Gender. At the end is a normal Submit button and the Form's action is a file called register.php which uses POST. It then does a standard check to see whether the information entered was correct. But now I want to integrate PayPal payment into it.

Now, if you can head over to https://btguard.com/join?service=socks, the site works pretty much just like how I want mine. Enter your info, it checks if it's legit, then it sends you to a payment page Example of Payment Page.

When PayPal comes up, it should charge $99 if it's before Oct. 8, $129 afterwards. Then, if they do complete payment, it would add them our database (but how would PayPal let you know if they paid or not? Through POST/GET data?)

I've never used an API before but if someone can provide information on the PayPal API I should use, I'm a quick learner. Thanks for the help.

-Daniel

+1  A: 

Basically you would have your server-side code do the total. You could even default the total to $129 and if the date is prior to Oct. 8th, send it to PayPal with a discount of $30. If it is past the 8th, omit the discount. Paypal should have a discount field you can use to POST to it with, see the Paypal Variables page for more information on these variables and their proper names / usages.

EDIT

For more information with the Paypal API, you can head over to the Paypals Developer Center. Where you can set up a sandbox account to test your code etc. There are also examples of how to use Paypal API's with different codes, such as PHP / ASP etc. Great resource for anyone working with the Paypal API!

Brad F Jacobs
Thanks, gonna test out how to use everything and I'll get back here to choose the best answer.
NessDan
Your answer had a lot of info so thank you.
NessDan
+1  A: 

https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted

Anil
Straight to the point eh? Gonna read up on this.
NessDan
I'm not a fan of just links but hey, it was exactly the page I needed to go to. Thanks!
NessDan