我的应用程序允许订阅服务,我正在使用paypal的定期付款。根据手册,我使用的顺序是 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
}
如何在定期付款部分下支付所有款项?
答案 0 :(得分:1)
使用定期付款时,不需要DoExpressCheckoutPayment API调用。当客户被重定向到PayPal进行身份验证时,他们会将协议提交给预定付款。
尝试跳过DoExpressCheckoutPayment API调用,这应该负责额外付款。
如果您遇到任何问题,请告诉我。