this is a follow up on my question on paypal integration. I'm working ona membership site for racing fans. My membership site has 3 membership levels - free, gold and premium. When a user signs up he/she can gets a free membership on the spot but has the option to upgrade to a gold membership for 4 Dollars a month or a premium membership for 10 Dollars a month.
这是关于paypal集成的问题的后续跟进。我正在为赛车迷做一个会员网站。我的会员网站有3个会员级别 - 免费,黄金和高级。当用户注册时,他/她可以在现场获得免费会员资格,但可以选择以每月4美元或每月10美元的高级会员资格升级为金会员资格。
I've gone through the paypal integration guide a few times though and have a vague understanding of how to get this to work. I think the recurring payments option would be fine enough - however I don't know how do I implement this in my system.
我已经完成了几次paypal集成指南,并对如何使其工作有一个模糊的理解。我认为定期付款选项足够好 - 但我不知道如何在我的系统中实现这一点。
Like when a user decides to go for a paid account i.e. Gold or premium from basic - what should I do on both my code side and on the paypal account side - I'd really appreciate if anyone would outline what I'd have to do here.
就像当用户决定使用付费帐户,即基本的黄金或溢价 - 我应该在我的代码方和paypal帐户方面做什么 - 我真的很感激,如果有人会概述我必须做的事情这里。
Plus when a user decides to upgrade from lets say a Gold to a premium account - there is the issue of computing how much should be charged to upgrade his/her account eg: a user has been billed for 4 dollars and the next day opts to go for a premium account so assuming that the surplus for the rest of the month is 5 dollars and further from that all payments would be recurring 10 dollars monthly - how do I implement this?
此外,当用户决定从黄金升级到高级账户时,还存在计算升级他/她的账户应收取多少费用的问题,例如:用户已收取4美元的费用,第二天选择加入去一个高级账户,假设这个月剩余时间的盈余是5美元,而且所有付款将每月重复10美元 - 我该如何实施?
And in case a user decides to downgrade from a premium account of 10 dollars a month to a gold account of 4 dollars a month - how do I handle the surplus which would have to be refunded for that month alone and changing the membership?
如果用户决定从每月10美元的高级帐户降级到每月4美元的黄金帐户 - 我该如何处理仅在该月退还并改变会员资格的盈余?
And like wise if someone wishes to cancel membership and go to having a free account - how do I refund whatever is owed and cancel the subscription.
如果有人希望取消会员资格并获得免费帐户,那么就如此明智 - 如何退还欠款并取消订阅。
I'm sorry if it sounds like I'm asking to be spoon fed :( I'm quite new to this and this is for a client and I would really appreciate all the help here and really have to get this working right.
我很抱歉,如果它听起来像是要求用勺子喂食:(我对此很新,这是给客户的,我非常感谢这里的所有帮助,真的要让这个工作正常。
Thanks again everyone - waiting for all your replies.
再次感谢大家 - 等待所有回复。
4 个解决方案
#1
You need to start reading up on Instant Payment Notification (IPN). This is basically just a callback from PayPal to your site, when some kind of transaction has occurred.
您需要开始阅读即时付款通知(IPN)。当发生某种交易时,这基本上只是从PayPal到您的网站的回调。
What you need is a php-script on your site, which you register in your paypal account. PayPal will invoke this script with information and you send information back to PayPal to let them know if the transaction is ok nor not. While doing this you have all sorts of ways to intercept what has happened.
你需要的是你网站上的一个php脚本,你在paypal帐户中注册。 PayPal将使用信息调用此脚本,并将信息发送回PayPal,以便让他们知道交易是否正常。在这样做的同时,您可以通过各种方式拦截所发生的事情。
If the customer bought product X, where X in your case can be a "gold membership" you can check against your database (assuming you have some php/mysql or similar setup) if this particular customer already had product Y you should refund blabla. That logic is completely up to you. Since it's a php script you have access to anything that php gives you access too, reading/writing from/to databases, files, mail etc.
如果客户购买了产品X,你的情况下X可以是“黄金会员”,你可以检查你的数据库(假设你有一些php / mysql或类似的设置)如果这个特定的客户已经有产品Y你应该退还blabla。这个逻辑完全取决于你。因为它是一个PHP脚本,你可以访问php给你访问的任何东西,从/向数据库,文件,邮件等读/写。
There are also various packages that have support for this IPN. I believe ColdFusion is one of them.
还有各种支持此IPN的软件包。我相信ColdFusion就是其中之一。
Cheers !
Edit:
Good advice - however considering the situation I have I would like to know what is the easiest and most hassle free method to follow i.e. should I go with recurring billing or have the customer pay periodically. I'm open to all options and better yet any code samples that I can use straight on :)
很好的建议 - 但考虑到我所拥有的情况,我想知道什么是最容易和最轻松的方法,即我应该采用定期结算还是让客户定期付款。我对所有选项都开放,更好的是我可以直接使用的任何代码示例:)
I'd personally go for the method the customer finds the easiest way. Using recurring billing is for love and match making sites, that want to exploit on your deepest feelings as a human being. "When the customer forgets about his account we can bill him an extra period" (sitting in a wheel chair in his evil den, laughing out loud muahahaha and pats his white cat).
我个人会找到客户找到最简单方法的方法。使用经常性计费是为了爱情和比赛制作网站,它们希望利用您作为一个人的最深切的感受。 “当顾客忘记他的帐户时,我们可以给他额外的一段时间”(坐在他邪恶的书房的轮椅上,大声笑出muahahaha并轻拍他的白猫)。
Here's a quick php skeleton that you can use as IPN receiver.
这是一个快速的php骨架,你可以用作IPN接收器。
Edit2
Ok so recurring billing isn't such a good idea then :-S - I mean with recurring billing I don't think we would be able to maintain on our website a history of when teh customer has been billing is it?
那么定期结算并不是一个好主意:-S - 我的意思是定期计费我不认为我们能够在我们的网站上维护客户已经开票的历史吗?
Sure you could keep a history of this. You know when the customer first started paying and you could keep track internally whenever the customer should be invoiced/billed again. It's just a periodic check versus the first payment date.
当然你可以保留这个历史。您知道客户何时开始付款,并且您可以在每次应对客户开票/再次开票时进行内部跟踪。这只是对第一个付款日期的定期检查。
Edit3
So in this case I would do best to go with my older idea of allowing the customer to pay in advance for 3,6,12 months and run a check when the time is near to get him/ her to renew. Cool - so in that case I won't be using paypals recurring subscription service but their Buy Now button thingy or sorta :-S are there any free books on how to do this? I seem to have a bad habit of overcomplicating things.
因此,在这种情况下,我最好采用我较早的想法,允许客户提前支付3,6,12个月,并在时间接近时进行检查以让他/她续订。很酷 - 所以在这种情况下,我不会使用paypals定期订阅服务,但他们的立即购买按钮东西或sorta:-S是否有任何免费的书籍如何做到这一点?我似乎养成过度复杂的坏习惯。
Yup. Buy now buttons are very nice to use together with IPN. I think you can have different IPN handlers (e.g. different php pages) for different buttons. Free books? As in those old things made out of paper? ;) There are a lot of information on the web. PayPal has tutorials on how to get started. PayPal also has a "sandbox" site, where you can create test buttons that produce fake transactions against your site. You will need to use this.
对。立即购买按钮非常适合与IPN一起使用。我认为你可以为不同的按钮使用不同的IPN处理程序(例如不同的php页面)。免费书籍?就像那些用纸做的旧东西一样? ;)网上有很多信息。 PayPal有关于如何入门的教程。 PayPal还有一个“沙盒”网站,您可以在其中创建针对您的网站产生虚假交易的测试按钮。你需要使用它。
Edit4
Thanks a lot man for the great advice - figures the simpler I keep it the less issues I'd run into. Would holler again on SO should I need more advice. I had worked once a while back in 2Checkout but that was on code already built so I had a vague idea of what was going on - this is my first project using paypal though - ah well never too late to learn :)
非常感谢你提供了很好的建议 - 数字越简单,我就越少,我遇到的问题就越少。如果我需要更多的建议,我会再次大喊大叫。我曾经在2Checkout工作了一段时间,但那是在已经构建的代码上,所以我对发生的事情有一个模糊的想法 - 这是我使用paypal的第一个项目 - 啊,从来没有太晚学习:)
One final thingie. Make sure that you from the beginning setup basic logging abilities, so you can dump data to file and see what's going on, what kind of data PayPal is sending to you. This has helped me tremendously. It doesn't have to be anything advanced, just a simple text file will do fine. Otherwise it can be real pain to "debug" these transactions. "FTW is going on now?" :)
最后一件事。确保您从一开始就设置基本的日志记录功能,这样您就可以将数据转储到文件中,看看发生了什么,PayPal向您发送了哪种数据。这对我帮助很大。它不必是任何高级的,只需一个简单的文本文件就可以了。否则,“调试”这些交易可能会非常痛苦。 “现在FTW还在继续吗?” :)
Good luck !
祝好运 !
#2
I'm fairly certain there are membership modules/add-ons/extensions/etc for various content management systems and community, err.. management systems that add this very functionality.
我非常肯定会有各种内容管理系统和社区的会员模块/附加组件/扩展/等等,这些管理系统增加了这个功能。
If you're basing this on a prefab solution like Wordpress, just google for Wordpress paid membership and you'll find various plug-ins that do 90% of the work for you.
如果你的基础是像Wordpress这样的预制解决方案,只需google for Wordpress支付会员资格,你就会发现各种插件可以为你完成90%的工作。
I should add that considering these are almost always for commercial use, you'll likely have to pay for the best result.
我应该补充一点,考虑到这些几乎总是用于商业用途,你可能需要付出最好的结果。
#3
Maybe you are better off managing subscriptions on your side. Let the customers pay every month by 'invoking' a Paypal-payment for that months subscription. I think that will solve most of your problems ;)
也许你最好管理自己的订阅。让客户每个月通过“调用”Paypal付款来支付该月份的订阅费用。我认为这将解决你的大部分问题;)
update: Sure there are lots of websites which provide excellent information like: http://ezinearticles.com/?PayPal---How-to-Setup-PayPal-on-Your-Website-in-Less-Than-30-Minutes&id=1704708
更新:当然有很多网站提供以下优秀信息:http://ezinearticles.com/?PayPal--- How-to-Setup-PayPal-on-Your-Website-in-Less-Than-30-Minutes&id = 1704708
#4
Ali, If you are new to these types of things, definitely go with a CMS and module. Drupal is the best platform for membership sites these days, and I made a module which integrates a Paypal Subscription system. Check it out and see if it has what you need: http://www.moneyscripts.net/drupal-paypal-subscriptions (Screenshots included)
阿里,如果你是这些类型的新手,肯定会使用CMS和模块。如今,Drupal是会员网站的最佳平台,我制作了一个集成了Paypal订阅系统的模块。看看它是否有你需要的东西:http://www.moneyscripts.net/drupal-paypal-subscriptions(包括截图)
#1
You need to start reading up on Instant Payment Notification (IPN). This is basically just a callback from PayPal to your site, when some kind of transaction has occurred.
您需要开始阅读即时付款通知(IPN)。当发生某种交易时,这基本上只是从PayPal到您的网站的回调。
What you need is a php-script on your site, which you register in your paypal account. PayPal will invoke this script with information and you send information back to PayPal to let them know if the transaction is ok nor not. While doing this you have all sorts of ways to intercept what has happened.
你需要的是你网站上的一个php脚本,你在paypal帐户中注册。 PayPal将使用信息调用此脚本,并将信息发送回PayPal,以便让他们知道交易是否正常。在这样做的同时,您可以通过各种方式拦截所发生的事情。
If the customer bought product X, where X in your case can be a "gold membership" you can check against your database (assuming you have some php/mysql or similar setup) if this particular customer already had product Y you should refund blabla. That logic is completely up to you. Since it's a php script you have access to anything that php gives you access too, reading/writing from/to databases, files, mail etc.
如果客户购买了产品X,你的情况下X可以是“黄金会员”,你可以检查你的数据库(假设你有一些php / mysql或类似的设置)如果这个特定的客户已经有产品Y你应该退还blabla。这个逻辑完全取决于你。因为它是一个PHP脚本,你可以访问php给你访问的任何东西,从/向数据库,文件,邮件等读/写。
There are also various packages that have support for this IPN. I believe ColdFusion is one of them.
还有各种支持此IPN的软件包。我相信ColdFusion就是其中之一。
Cheers !
Edit:
Good advice - however considering the situation I have I would like to know what is the easiest and most hassle free method to follow i.e. should I go with recurring billing or have the customer pay periodically. I'm open to all options and better yet any code samples that I can use straight on :)
很好的建议 - 但考虑到我所拥有的情况,我想知道什么是最容易和最轻松的方法,即我应该采用定期结算还是让客户定期付款。我对所有选项都开放,更好的是我可以直接使用的任何代码示例:)
I'd personally go for the method the customer finds the easiest way. Using recurring billing is for love and match making sites, that want to exploit on your deepest feelings as a human being. "When the customer forgets about his account we can bill him an extra period" (sitting in a wheel chair in his evil den, laughing out loud muahahaha and pats his white cat).
我个人会找到客户找到最简单方法的方法。使用经常性计费是为了爱情和比赛制作网站,它们希望利用您作为一个人的最深切的感受。 “当顾客忘记他的帐户时,我们可以给他额外的一段时间”(坐在他邪恶的书房的轮椅上,大声笑出muahahaha并轻拍他的白猫)。
Here's a quick php skeleton that you can use as IPN receiver.
这是一个快速的php骨架,你可以用作IPN接收器。
Edit2
Ok so recurring billing isn't such a good idea then :-S - I mean with recurring billing I don't think we would be able to maintain on our website a history of when teh customer has been billing is it?
那么定期结算并不是一个好主意:-S - 我的意思是定期计费我不认为我们能够在我们的网站上维护客户已经开票的历史吗?
Sure you could keep a history of this. You know when the customer first started paying and you could keep track internally whenever the customer should be invoiced/billed again. It's just a periodic check versus the first payment date.
当然你可以保留这个历史。您知道客户何时开始付款,并且您可以在每次应对客户开票/再次开票时进行内部跟踪。这只是对第一个付款日期的定期检查。
Edit3
So in this case I would do best to go with my older idea of allowing the customer to pay in advance for 3,6,12 months and run a check when the time is near to get him/ her to renew. Cool - so in that case I won't be using paypals recurring subscription service but their Buy Now button thingy or sorta :-S are there any free books on how to do this? I seem to have a bad habit of overcomplicating things.
因此,在这种情况下,我最好采用我较早的想法,允许客户提前支付3,6,12个月,并在时间接近时进行检查以让他/她续订。很酷 - 所以在这种情况下,我不会使用paypals定期订阅服务,但他们的立即购买按钮东西或sorta:-S是否有任何免费的书籍如何做到这一点?我似乎养成过度复杂的坏习惯。
Yup. Buy now buttons are very nice to use together with IPN. I think you can have different IPN handlers (e.g. different php pages) for different buttons. Free books? As in those old things made out of paper? ;) There are a lot of information on the web. PayPal has tutorials on how to get started. PayPal also has a "sandbox" site, where you can create test buttons that produce fake transactions against your site. You will need to use this.
对。立即购买按钮非常适合与IPN一起使用。我认为你可以为不同的按钮使用不同的IPN处理程序(例如不同的php页面)。免费书籍?就像那些用纸做的旧东西一样? ;)网上有很多信息。 PayPal有关于如何入门的教程。 PayPal还有一个“沙盒”网站,您可以在其中创建针对您的网站产生虚假交易的测试按钮。你需要使用它。
Edit4
Thanks a lot man for the great advice - figures the simpler I keep it the less issues I'd run into. Would holler again on SO should I need more advice. I had worked once a while back in 2Checkout but that was on code already built so I had a vague idea of what was going on - this is my first project using paypal though - ah well never too late to learn :)
非常感谢你提供了很好的建议 - 数字越简单,我就越少,我遇到的问题就越少。如果我需要更多的建议,我会再次大喊大叫。我曾经在2Checkout工作了一段时间,但那是在已经构建的代码上,所以我对发生的事情有一个模糊的想法 - 这是我使用paypal的第一个项目 - 啊,从来没有太晚学习:)
One final thingie. Make sure that you from the beginning setup basic logging abilities, so you can dump data to file and see what's going on, what kind of data PayPal is sending to you. This has helped me tremendously. It doesn't have to be anything advanced, just a simple text file will do fine. Otherwise it can be real pain to "debug" these transactions. "FTW is going on now?" :)
最后一件事。确保您从一开始就设置基本的日志记录功能,这样您就可以将数据转储到文件中,看看发生了什么,PayPal向您发送了哪种数据。这对我帮助很大。它不必是任何高级的,只需一个简单的文本文件就可以了。否则,“调试”这些交易可能会非常痛苦。 “现在FTW还在继续吗?” :)
Good luck !
祝好运 !
#2
I'm fairly certain there are membership modules/add-ons/extensions/etc for various content management systems and community, err.. management systems that add this very functionality.
我非常肯定会有各种内容管理系统和社区的会员模块/附加组件/扩展/等等,这些管理系统增加了这个功能。
If you're basing this on a prefab solution like Wordpress, just google for Wordpress paid membership and you'll find various plug-ins that do 90% of the work for you.
如果你的基础是像Wordpress这样的预制解决方案,只需google for Wordpress支付会员资格,你就会发现各种插件可以为你完成90%的工作。
I should add that considering these are almost always for commercial use, you'll likely have to pay for the best result.
我应该补充一点,考虑到这些几乎总是用于商业用途,你可能需要付出最好的结果。
#3
Maybe you are better off managing subscriptions on your side. Let the customers pay every month by 'invoking' a Paypal-payment for that months subscription. I think that will solve most of your problems ;)
也许你最好管理自己的订阅。让客户每个月通过“调用”Paypal付款来支付该月份的订阅费用。我认为这将解决你的大部分问题;)
update: Sure there are lots of websites which provide excellent information like: http://ezinearticles.com/?PayPal---How-to-Setup-PayPal-on-Your-Website-in-Less-Than-30-Minutes&id=1704708
更新:当然有很多网站提供以下优秀信息:http://ezinearticles.com/?PayPal--- How-to-Setup-PayPal-on-Your-Website-in-Less-Than-30-Minutes&id = 1704708
#4
Ali, If you are new to these types of things, definitely go with a CMS and module. Drupal is the best platform for membership sites these days, and I made a module which integrates a Paypal Subscription system. Check it out and see if it has what you need: http://www.moneyscripts.net/drupal-paypal-subscriptions (Screenshots included)
阿里,如果你是这些类型的新手,肯定会使用CMS和模块。如今,Drupal是会员网站的最佳平台,我制作了一个集成了Paypal订阅系统的模块。看看它是否有你需要的东西:http://www.moneyscripts.net/drupal-paypal-subscriptions(包括截图)