简体   繁体   English

PayPal订阅PDT / IPN-请

[英]PayPal subscriptions PDT / IPN - PLEASE

Am having a lot of trouble getting my head around this paypal payment stuff... 使我无法解决这种Paypal付款问题时遇到很多麻烦...

How can i confirm that the user has successfully signed up for my subscription? 我如何确认用户已成功注册我的订阅?

I know 0 about IPN but for example : If a user signs up to my website with example@e.com but uses the paypal account sample@s.com to pay then how to i match up the user. 我对IPN知道0,但例如:如果用户使用example@e.com登录到我的网站,但使用贝宝帐户sample@s.com进行支付,那么我如何与该用户匹配。

I read that PDT do not send out a transaction ID (tx) for recurring (subscription) payments is that true ? 我了解到,PDT不会发出用于重复(订阅)付款的交易ID(tx),这是真的吗?

Just need help with it all... honest and easy :) 只需要这一切的帮助...诚实而简单:)

Thanks. 谢谢。

Yeah sometimes is hard to understand Paypal and all their documentation but for any kind of subscription i would recommend Paypal IPN. 是的,有时候很难理解Paypal及其所有文档,但是对于任何订阅,我都会推荐Paypal IPN。 You set IPN URL in your paypal account for example: http://www.domain.com/ipn.php . 您可以在贝宝帐户中设置IPN URL,例如: http : //www.domain.com/ipn.php Then you create a subscription button in paypal account where you can set the price, recurring price etc. 然后,您在贝宝帐户中创建一个订阅按钮,您可以在其中设置价格,循环价格等。

More about Paypal IPN you can read here: https://www.paypal.com/ipn 有关Paypal IPN的更多信息,您可以在这里阅读: https : //www.paypal.com/ipn

When creating Paypal button you can also add some custom fields which can help you determine which customer really pays. 创建Paypal按钮时,您还可以添加一些自定义字段,以帮助您确定哪个客户真正付款。 So for example you have a database of users and there is user with userid=100, username=Nickname and registered_email=xxx@gmail.com. 因此,例如,您有一个用户数据库,并且有一个用户,其用户ID = 100,用户名=昵称,并且registered_email=xxx@gmail.com。 Now you can decide to add userid=100 as a custom field and add this to paypal button. 现在,您可以决定将userid = 100添加为自定义字段,并将其添加到Paypal按钮。 For example CUSTOM=100. 例如CUSTOM = 100。

ipn.php in this case is a script which handles all the logic. ipn.php是处理所有逻辑的脚本。 When user pay, Paypal send any status to http://www.domain.com/ipn.php (you set this in your paypal account as IPN URL). 当用户付款时,贝宝将任何状态发送到http://www.domain.com/ipn.php (您在贝宝帐户中将其设置为IPN URL)。 So ipn.php in this case needs to check if payment is complete and status is ok. 因此,在这种情况下,ipn.php需要检查付款是否完成并且状态是否正常。 Then retrieve a CUSTOM field ($_POST['custom']) which is in this case 100 (userid). 然后检索一个CUSTOM字段($ _POST ['custom']),在这种情况下为100(用户ID)。 And then update your database with users and somehow mark that this user payed of course if status is Completed. 然后使用用户更新您的数据库,并在状态为“完成”时以某种方式标记该用户当然已经付款。

Hope this helps a little. 希望这有所帮助。 But in this case it's not really important from which paypal account user pays and which is registered in your database. 但是在这种情况下,用户从哪个贝宝帐户付款以及在数据库中注册哪个并不重要。 All you need is that you somehow link it together. 您所需要的只是以某种方式将其链接在一起。 In this case with userid or something like that. 在这种情况下,请使用userid或类似的名称。

If you want to implement Paypal IPN and your customers don't use same email from my experience you can use a form to authenticate the user 如果您要实施Paypal IPN,并且您的客户不使用我的经验中的同一封电子邮件,则可以使用表格对用户进行身份验证

  • user login on your website with xxx@example.org 用户使用xxx@example.org登录您的网站
  • user clicks on your item and pays with yyy@example.org 用户点击您的商品并使用yyy@example.org付款
  • after he pays you can redirect him to a form where they can merge Paypal account with website account 在他付款之后,您可以将他重定向到一种表格,在该表格中他们可以将Paypal帐户与网站帐户合并
  • every time that user pays then your IPN will be covered by the information he provided 用户每次付款时,他提供的信息将覆盖您的IPN
  • you should save his payment information for later use. 您应该保存他的付款信息以备后用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM