简体   繁体   English

试用期的贝宝定期付款

[英]PayPal recurring payments with Trial period

I'm trying to implement PayPal subscriptions system with following features: 我正在尝试使用以下功能实现PayPal订阅系统:

  • 1st month of service on the application would be completely free after which user will pay monthly amount. 该应用程序的第一个月服务将完全免费,之后用户将按月支付费用。

I have written the following code like below: 我已经编写了以下代码,如下所示:

BillingPeriodType periodType = BillingPeriodType.MONTH;
                    switch (subs)
                    {
                        case("Month"):
                            periodType = BillingPeriodType.MONTH;
                            break;
                        case("Year"):
                            periodType = BillingPeriodType.YEAR;
                            break;
                    }
                    BasicAmountType paymentAmount = new BasicAmountType((CurrencyCodeType)EnumUtils.GetValue("USD", typeof(CurrencyCodeType)), subType.Price);
                    BillingPeriodType period = periodType;
                    BillingPeriodDetailsType paymentPeriod = new BillingPeriodDetailsType(period, 1, paymentAmount);
                    ScheduleDetailsType scheduleDetails = new ScheduleDetailsType();

                    /*Free trial period of 1 month for monthly sub*/
                    if (periodType == BillingPeriodType.MONTH)
                    {
                        scheduleDetails.TrialPeriod = new BillingPeriodDetailsType(BillingPeriodType.MONTH,1, new BasicAmountType((CurrencyCodeType)EnumUtils.GetValue("USD", typeof(CurrencyCodeType)), "0.01"));
                        scheduleDetails.TrialPeriod.TotalBillingCycles = 1;
                    }
                    else if (periodType == BillingPeriodType.YEAR)
                    {
                        scheduleDetails.TrialPeriod = new BillingPeriodDetailsType(BillingPeriodType.YEAR, 1, new BasicAmountType((CurrencyCodeType)EnumUtils.GetValue("USD", typeof(CurrencyCodeType)), "0.01"));

                    }

                    scheduleDetails.Description = "//Some description"
                    scheduleDetails.PaymentPeriod = paymentPeriod;
                    createRPProfileRequest.CreateRecurringPaymentsProfileRequestDetails.ScheduleDetails = scheduleDetails;
                    CreateRecurringPaymentsProfileReq createRPProfileReq = new CreateRecurringPaymentsProfileReq();
                    createRPProfileReq.CreateRecurringPaymentsProfileRequest = createRPProfileRequest;

This raises to me a huge security concern... 这给我带来了巨大的安全隐患。

So let's suppose user subscribes for monthly subscription and get 1 month for free... 

This way, nothing stops the user to cancel the subscription the last day and then to re-subscribe once again and re-use the 1 month trial period for free...

Currently of the users's information on PayPal I only store ProfileID information into the DB.... 目前在PayPal上的用户信息中,我仅将ProfileID信息存储到数据库中。

Is there any efficient way to see if the user has used free trial period on my website? 有什么有效的方法来查看用户是否在我的网站上使用了免费试用期?

Also another security concern to me is that user can simply re-register with new account and subscribe once again under completely different ProfileID

How would you guys solve this? 你们将如何解决呢?

I just hope I don't misunderstood your question: 我只是希望我不要误会你的问题:

Why don't you link the users PayPal e-mail address to the registered account? 为什么不将用户的PayPal电子邮件地址链接到注册帐户? In this case the user has to use a different paypal account, so it's much easier to avoid people like this. 在这种情况下,用户必须使用其他Paypal帐户,因此避免这种情况变得容易得多。

And at the users registration, the users should already provide his billing informations. 并且在用户注册时,用户应该已经提供了他的账单信息。 Including his PayPal e-mail address. 包括他的PayPal电子邮件地址。

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

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