[Recurring Payment Error(3)]
(1) I think that "GetCreateRecurringPaymentProfileRequestDetails" in Nop.Plugin.Payments.PayPalExpressCheckout.Services.PayPalRecurringPaymentsService.cs must include "PaymentDetailsItem" field (cf.p.192
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_api_reference.pdf).
--------- PayPalRecurringPaymentsService.cs --------------------------------------
public CreateRecurringPaymentsProfileRequestDetailsType GetCreateRecurringPaymentProfileRequestDetails(
ProcessPaymentRequest processPaymentRequest)
{ .......
----------------------------------------------------------------------------------
I added the following program to the source for testing. It succeeded.
List<PaymentDetailsItemType> paymentDetailsItemList = new List<PaymentDetailsItemType>();
PaymentDetailsItemType paymentDetailsItem = new PaymentDetailsItemType();
paymentDetailsItem.ItemCategory = ItemCategoryType.Digital;
paymentDetailsItem.Name = "XXX Monthly Magazine";
paymentDetailsItem.Amount = GetBasicAmountType(orderTotal, currencyId);
paymentDetailsItem.Quantity = "1";
paymentDetailsItemList.Add(paymentDetailsItem);
details.PaymentDetailsItem = paymentDetailsItemList.ToArray();
(2) GetExpressCheckoutDetails method doesn't return "Credit Card Info" such as credit card number, expiration date for security. So enum errors occur in programs like "CreditCardType = GetPaypalCreditCardType(processPaymentRequest.CreditCardType)" . I tried to use Token instead. It was OK. I tried to set CreditCardDetailsType field as null. It was OK. I am afraid that
PayPal Direct Plugin may have the same problem.
(3) I found often "ERROR CODE 11581 --- Invalid Data --- Profile description is invalid" and I couldn't understand the meaning for a long time. Finally I reached the explanation of "SOAP API Developer Reference (cf.p.191
https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_api_reference.pdf)" as follows.
--------------------------------------------------------------------------------------------------
To associate a recurring payments profile with its billing agreement, you must ensure that the description in the recurring payments profile matches the description of a billing agreement. For version 54.0 and later, use SetExpressCheckout to initiate creation of a billing agreement.
--------------------------------------------------------------------------------------------------
So I reset the description like this in "CreateRecurringPaymentProfileRequestDetails".
-----------------------------------------
//schedule
details.ScheduleDetails = new ScheduleDetailsType();
details.ScheduleDetails.Description = BILLING_AGREEMENT_DESCRIPTION; <-- same string in BillingAgreementDetailsType field in "SetExpressCheckout" method.
------------------------------------------
It finally succeeded and got "ProfileID" of recurring payment. I recognized the importance of "BillingAgreementDescription" of BillingAgreementDetailsType in SetExpressCheckout.