[英]PayPal recurring payments with Trial period
我正在尝试使用以下功能实现PayPal订阅系统:
我已经编写了以下代码,如下所示:
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电子邮件地址。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.