ohtsu wrote:[Recurring Payment Processing Error]
When I tried to use this plugin for recurring payments, I found an error :"Value cannot be null. Parameter name: value".
This error occurred when I clicked "Confirm button" after redirecting from PayPal checkout window.
The log message is as follows.
-------------------------------------------------------------------------------------------------
Error
The log entry message.Short message: Value cannot be null. Parameter name: value
The details for the log entry.Full message: System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at System.Enum.Parse(Type enumType, String value) at Nop.Plugin.Payments.PayPalExpressCheckout.Services.PayPalRecurringPaymentsService.GetPaypalCreditCardType(String creditCardType) at Nop.Plugin.Payments.PayPalExpressCheckout.Services.PayPalRecurringPaymentsService.GetCreateRecurringPaymentProfileRequestDetails(ProcessPaymentRequest processPaymentRequest) at Nop.Plugin.Payments.PayPalExpressCheckout.Services.PayPalRequestService.GetCreateRecurringPaymentsProfileRequest(ProcessPaymentRequest processPaymentRequest) at Nop.Plugin.Payments.PayPalExpressCheckout.PayPalExpressCheckoutPaymentProcessor.ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) at Nop.Services.Payments.PaymentService.ProcessRecurringPayment(ProcessPaymentRequest processPaymentRequest) in c:\Users\ohtsu\Documents\Visual Studio 2012\Projects\Csharp\__Mvc\nopCommerce_3.10_Source\Libraries\Nop.Services\Payments\PaymentService.cs:line 314 at Nop.Services.Orders.OrderProcessingService.PlaceOrder(ProcessPaymentRequest processPaymentRequest) in c:\Users\ohtsu\Documents\Visual Studio 2012\Projects\Csharp\__Mvc\nopCommerce_3.10_Source\Libraries\Nop.Services\Orders\OrderProcessingService.cs:line 878
---------------------------------------------------------------------------------------------------------------
I think that the cause is related with the following function in PayPalExpressCheckout.Services.PayPalRedirectionServices.cs. Because variable "details"'s properties are like these.
paymentDetailsField[0].Recurring : Y
paymentDetailsField[0].recurringField : Y
paymentDetailsField[0].recurringFieldSpecified : false
paymentDetailsField[0].RecurringSpecified : false
So variable "request"'s Recurring fields are set like these.
InitialOrderId : 0
IsRecurring Paymnet : false
RecurringCycleLength : 0
RecurringCyclePeriod : Days
RecurringTotalCycles : 0
----------------------------------------------------
public bool ProcessReturn(string token)
{
using (var payPalApiaaInterfaceClient = _payPalInterfaceService.GetAAService())
{
var customSecurityHeaderType = _payPalSecurityService.GetRequesterCredentials();
var details = payPalApiaaInterfaceClient.GetExpressCheckoutDetails(ref customSecurityHeaderType,
_payPalRequestService
.GetGetExpressCheckoutDetailsRequest
(token));
details.LogResponse(Guid.Empty);
if (details.Ack == AckCodeType.Success || details.Ack == AckCodeType.SuccessWithWarning)
{
var request =
_payPalCheckoutDetailsService.SetCheckoutDetails(
details.GetExpressCheckoutDetailsResponseDetails);
_session["OrderPaymentInfo"] = request;
var customer = _customerService.GetCustomerById(request.CustomerId);
_workContext.CurrentCustomer = customer;
_customerService.UpdateCustomer(_workContext.CurrentCustomer);
return true;
}
return false;
}
}
Have you solved?