所以我有一个包含用户姓名、电子邮件、地址和性别的基本表单。最后是一个普通的提交按钮,表单的操作是一个名为 register.php 的文件,该文件使用 POST。然后它会进行标准检查以查看输入的信息是否正确。但现在我想把PayPal支付整合进去。
现在,如果您可以前往 https://btguard.com/join?service=socks,该网站的工作原理与我想要的非常相似。输入您的信息,它会检查其是否合法,然后将您发送到付款页面 付款页面示例。
当 PayPal 上线时,如果在 10 月 8 日之前收费,则收费为 99 美元,之后则收费 129 美元。然后,如果他们完成付款,它会将他们添加到我们的数据库中(但 PayPal 如何让您知道他们是否付款?通过 POST/GET 数据?)
我以前从未使用过 API,但如果有人可以提供以下信息我应该使用 PayPal API,我学得很快。感谢您的帮助。
-丹尼尔
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
发布评论
评论(2)
https://cms.paypal.com /us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted
基本上,您可以让服务器端代码完成总计。您甚至可以将总额默认为 129 美元,如果日期在 10 月 8 日之前,则将其发送至 PayPal,享受 30 美元的折扣。如果超过 8 号,则忽略折扣。 Paypal 应该有一个折扣字段,您可以使用它来发布,请参阅 Paypal 变量页面,了解有关这些变量及其正确名称/用法的更多信息。
编辑
有关 Paypal API 的更多信息,您可以前往 Paypal 开发者中心。您可以在其中设置沙箱帐户来测试您的代码等。还有如何使用 Paypal API 与不同代码的示例,例如 PHP / ASP 等。对于使用 Paypal API 的任何人来说都是很棒的资源!
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!