c# - 带试用期的 PayPal 定期付款

标签 c# asp.net security paypal trial

我正在尝试实现具有以下功能的 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

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

最佳答案

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

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

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

关于c# - 带试用期的 PayPal 定期付款,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42297819/

相关文章:

c# - .NET 语言中的 GINA 替代品?

asp.net - ISAPI 重写(在 IIS 和 ASP.NET 上使用 Helicon)和动态查询字符串追加?

asp.net 3.5 设置自定义 web 控件中控件的样式

Java EE 6 程序安全性、glassfish 和 JDBC 领域

.net - 安全密码哈希

security - 简单的 session cookie 身份验证系统有多安全?

c# - .net core docker centos HttpRequest错误: (Socket Exception) Resource temporarily unavailable

c# - 扩展器控件可能无法在 PreRender 之前注册

c# - 是否有用于 C# 的 CSS 解析器?

c# - 如何在不混淆 Razor 引擎的情况下正确呈现变量?