0
我試圖實現具有以下特點的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...
的用戶對貝寶的信息,我只商店目前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帳戶,並將新的更改爲主(這是可能的)? =) – User987
哦,我認爲這是不可能的。 PayPal API是否不提供唯一的用戶信息? –
我相信這樣做,那麼我必須檢查他的姓名和預先存在的訂閱配置文件,看他是否有試用期,否?\ – User987