【问题标题】:PayPal recurring payments with Trial period带有试用期的 PayPal 定期付款
【发布时间】:2017-07-06 23:21:25
【问题描述】:

我正在尝试实现具有以下功能的 PayPal 订阅系统:

  • 应用程序的第 1 个月服务将完全免费,之后用户将按月支付费用。

我写了如下代码:

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;

这给我带来了巨大的安全问题......

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...

目前在 PayPal 上的用户信息我只将 ProfileID 信息存储到数据库中......

有没有什么有效的方法可以查看用户是否在我的网站上使用了免费试用期?

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

你们会如何解决这个问题?

【问题讨论】:

    标签: c# asp.net security paypal trial


    【解决方案1】:

    我只是希望我没有误解你的问题:

    为什么不将用户的 PayPal 电子邮件地址链接到注册帐户?在这种情况下,用户必须使用不同的 paypal 帐户,因此避免这样的人要容易得多。

    并且在用户注册时,用户应该已经提供了他的账单信息。包括他的 PayPal 电子邮件地址。

    【讨论】:

    • 菲利普,好点子,但如果用户将多个电子邮件地址添加到他的贝宝帐户并将新的电子邮件地址更改为主要地址(这是可能的)? =)
    • 哦,我认为这是不可能的。 PayPal API 是否不提供唯一的用户信息?
    • 我相信有,然后我必须检查他的名字和姓氏以及预先存在的订阅资料,看看他是否有试用期,不是吗?\
    • 如果您有唯一的用户标识,您可以轻松避免他创建另一个帐户,并且在同一个帐户下当然不可能进行第二次试用。应该只有一个帐户具有相同的 paypal 用户标识。
    • 查看我的 IPN 日志,我看到了 payer_id,这是我认为无法更改的 13 位 paypal ID,除非创建一个新的 paypal 帐户。如果他们要为您的免费试用创建一个新的贝宝帐户,那么,我想您可以放心地知道您的服务非常好:)
    猜你喜欢
    • 2016-04-24
    • 1970-01-01
    • 2020-01-03
    • 2014-11-01
    • 2013-02-15
    • 2013-03-04
    • 2015-08-11
    • 2012-04-05
    相关资源
    最近更新 更多