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