在Capture Api电话

时间:2018-02-05 13:37:42

标签: c# paypal paypal-rest-sdk paypal-subscriptions

在我的应用程序中需要的功能,如创建paypal重复与一些初始数量。   对于exa。

  Initial Payment          : $300.00 AUD  
  Regular Recurring Payment: $300.00 AUD 

我创建了CreateRecurringPaymentsProfile,其中包含初始付款和我的代码的具体细节。

private void populateRequest(CreateRecurringPaymentsProfileRequestType request, string token)
{
            CurrencyCodeType currency = (CurrencyCodeType)
               Enum.Parse(typeof(CurrencyCodeType), "AUD");
            CreateRecurringPaymentsProfileRequestDetailsType profileDetails =
                new CreateRecurringPaymentsProfileRequestDetailsType();
            request.CreateRecurringPaymentsProfileRequestDetails = profileDetails;
            profileDetails.Token = token;

            var startDate = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd") + "T00:00:00:000Z";
            RecurringPaymentsProfileDetailsType rpProfileDetails = new RecurringPaymentsProfileDetailsType(startDate); //MMDDYYYY
            profileDetails.RecurringPaymentsProfileDetails = rpProfileDetails;
            rpProfileDetails.SubscriberName = "Lalji Dhameliya";
            ScheduleDetailsType scheduleDetails = new ScheduleDetailsType();
            scheduleDetails.Description = "Recurring Payment Description";
            int frequency = 1;
            BasicAmountType paymentAmount = new BasicAmountType(currency, "300.00");
            BillingPeriodType period = BillingPeriodType.MONTH;
            int numCycles = 3;
            BillingPeriodDetailsType paymentPeriod = new BillingPeriodDetailsType(period, frequency, paymentAmount);
            paymentPeriod.TotalBillingCycles = numCycles;

            var activationDetails = new ActivationDetailsType();
            activationDetails.InitialAmount = new BasicAmountType(currency, "300.00");
            scheduleDetails.ActivationDetails = activationDetails;
            scheduleDetails.PaymentPeriod = paymentPeriod;
            profileDetails.ScheduleDetails = scheduleDetails;
 }

我已经设置了

 var paymentDetails = new PaymentDetailsType();
 paymentDetails.PaymentAction = PaymentActionCodeType.AUTHORIZATION;

该基本授权需要通过PayPal授权和捕获进行结算。

当我成功创建CreateRecurringPaymentsProfile但初始付款是在创建个人资料时捕获的。

有没有办法

  

当我调用paypal的capture api时捕获初始付款。

我在google上搜索并查找,但所有解决方案都不会在某个时间后捕获初始付款。

enter image description here

0 个答案:

没有答案