我的应用程序允许订阅服务,我为此使用贝宝的定期付款。根据那里的手册,我使用的顺序是 SetExperssCheckOut-->GetExppressCheckOut-->DoExpressCheckOut->CreateRecurringPayment Profile。
在 DoExpressCheckOut 事件本身上,我进行了第一笔付款,然后在创建定期付款资料时进行下一笔付款,即如果我有每日订阅,则在第 3 天结束时,没有付款 = 4(来自定期付款的 3付款和 1 从获得快速结帐)。我只想在第 3 天结束时支付 3 笔款项。我使用的代码是:
GetExpressCheckout getExpressCheckout = new GetExpressCheckout();
GetExpressCheckoutDetailsResponseType getExpressCheckoutResponse = getExpressCheckout.ECGetExpressCheckoutCode(token);
if (getExpressCheckoutResponse.Ack == AckCodeType.Success)
{
ExpressCheckout expressCheckout = new ExpressCheckout();
DoExpressCheckoutPaymentResponseType doExpressCheckoutResponse = expressCheckout.DoExpressCheckoutPayment
(
token,
getExpressCheckoutResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.PayerID,
PayPalSettings.OrderAmount,
PaymentActionCodeType.Sale,
CurrencyCodeType.USD
);
if (doExpressCheckoutResponse.Ack == AckCodeType.Success)
{
//create Recurring Payment Profile
CreateRecurringPaymentsProfile createRecurringPaymentsProfile = new CreateRecurringPaymentsProfile();
CreateRecurringPaymentsProfileResponseType recurringPaymentProfileResponse = createRecurringPaymentsProfile.CreateRecurringPaymentsProfileCode(
doExpressCheckoutResponse.DoExpressCheckoutPaymentResponseDetails.Token,
doExpressCheckoutResponse.Timestamp,
PayPalSettings.OrderAmount,
1,
BillingPeriodType.Day,//BillingPeriodType.Month
CurrencyCodeType.USD
);
if (recurringPaymentProfileResponse.Ack == AckCodeType.Success)
{
//Do something
}
如何在定期付款部分下进行所有付款?