2013-03-11 127 views
0

我的应用程序允许订阅服务,我使用paypal的定期付款。根据那里的手册,我使用的订单是 SetExperssCheckOut - > GetExppressCheckOut - > DoExpressCheckOut-> CreateRecurringPayment配置文件。贝宝定期付款问题

在DoExpressCheckOut事件中,我自己进行了第一次付款,之后在创建定期付款资料时创建了下一笔付款,即如果我有日常订阅,则在第三天结束时,没有付款= 4 3次来自定期付款,1次来自快速结账)。第三天结束时我只需要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 
} 

如何在定期付款部分进行所有付款?

回答

1

使用周期性付款时,不需要执行DoExpressCheckoutPayment API调用。当客户被重定向到PayPal进行身份验证时,他们将协议提交给定期付款。

尝试跳过DoExpressCheckoutPayment API调用,这应该照顾额外付款。

让我知道你是否遇到过任何问题。

+1

如果我跳过DoExpressCheckoutPayment调用,我可以在哪里创建定期付款资料,还可以为交易进行初始付款? – BonDaviD 2013-03-14 06:34:21

+0

创建可以在执行GetExpressCheckoutDetails之后发生,因为客户在访问PayPal时已同意配置文件,因此不需要进行DoExpressCheckoutPayment调用。 根据您提供的信息,CreateRecurringPaymentsProfile API调用已具有创建日期的开始日期或具有初始付款。如果没有,您可以通过在创建期间添加“INITAMT”来收取初始付款。如果我遗漏了任何东西,请告诉我。 – 2013-03-14 21:00:43

+0

我给了Iniitial金额并跳过了DoExpressCheckoutPayment部分。在付款之后,我的个人资料状态仍处于等待状态。何时该更改为活动状态,并且我还从定期付款响应对象中获取任何交易ID – BonDaviD 2013-03-25 11:54:13