0
votes

My application allows subscription services and i am using paypal's recurring payment for this. There according to there manual, the order i used is SetExperssCheckOut-->GetExppressCheckOut-->DoExpressCheckOut->CreateRecurringPayment Profile.

On DoExpressCheckOut event iteself my first payment is made and after that on creating the recurring payment profile the next payment is made, ie if I have a daily subscription , on the end of 3rd day, no of payments made =4 (3 from the recurring payment and 1 from the get express checkout). I want only 3 payments at the end of 3rdday. The code I used is:

    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
}

How can I make all payments under the recurring payment section ?

1

1 Answers

1
votes

When using Recurring Payments the DoExpressCheckoutPayment API call isn't required. When the customer is redirected to PayPal for authentication they submit their agreement to the scheduled payments.

Try skipping the DoExpressCheckoutPayment API call and this should take care of the extra payment.

Let me know if you run into any issues.