PayPal Express Checkout for nopCommerce 3.0 & 3.10

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 yıl önce
Is there a way to change the plugin's out of box payment button to the newer one that PayPal prefers (found at https://www.paypalobjects.com/webstatic/mktg/merchant/images/express-checkout-hero.png ) because the button included in the plugin has the tagline "the safer, easier way to pay" underneath it and this gives false implications that my other payment methods are not safe.

Thank you! ;)
10 yıl önce
[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;
            }
        }
10 yıl önce
[Recurring Payment Error(2)]

I think that the following "GetSetExpressCheckoutRequestDetails" must return "BillingAgreementDetailsType" fields such as BillingType (RecurringPayments) and BillingAgreementDescription when using recurring payments.

----------------------------------------------------------
Nop.Plugin.Payments.PayPalExpressCheckout.Services.PayPalRequestService.cs

        public SetExpressCheckoutRequestDetailsType GetSetExpressCheckoutRequestDetails(IList<ShoppingCartItem> cart)
        {
            var setExpressCheckoutRequestDetailsType =
                new SetExpressCheckoutRequestDetailsType
                    {
                        ReturnURL = _payPalUrlService.GetReturnURL(),
                        CancelURL = _payPalUrlService.GetCancelURL(),
                        ReqConfirmShipping = _payPalShippingService.GetRequireConfirmedShippingAddress(cart),
                        NoShipping = _payPalShippingService.GetNoShipping(cart),
                        LocaleCode = _payPalExpressCheckoutPaymentSettings.LocaleCode,
                        cppheaderimage = _payPalExpressCheckoutPaymentSettings.LogoImageURL,
                        cppcartbordercolor = _payPalExpressCheckoutPaymentSettings.CartBorderColor,
                        PaymentDetails = _payPalOrderService.GetPaymentDetails(cart),
                        BuyerEmail = _payPalOrderService.GetBuyerEmail(),
                        MaxAmount = _payPalOrderService.GetMaxAmount(cart)
                    };

            return setExpressCheckoutRequestDetailsType;
        }
--------------------------------------------------------------
10 yıl önce
[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.
10 yıl önce
mattbrummett wrote:
Is there a way to change the plugin's out of box payment button to the newer one that PayPal prefers (found at https://www.paypalobjects.com/webstatic/mktg/merchant/images/express-checkout-hero.png ) because the button included in the plugin has the tagline "the safer, easier way to pay" underneath it and this gives false implications that my other payment methods are not safe.

Thank you! ;)


Its a PayPal Tagline/slogan bulit into the image.
10 yıl önce
Challenge 1:
- User selects items to buy.
- If user hoover the "Shopping Cart", only normal Checkout is showed.
- Paypas Express is not an option for payment once Sheckout i selected.
Is there a way that PayPal Express Checkout could be a choice in the ordinary Checkout path?

Challenge 2:
Is it possible to NOT obtain address information from CC/PayPal.

regards
10 yıl önce
I have installed the PayPal Express Checkout plugin and done configuration, but it is giving following error while payment processing:

"The given key was not present in the dictionary."

Is it related to merchant configuration or error in plugin or code?

Please help.

Regards,
Sachin
10 yıl önce
Hi guys,

I'm getting the error - 10413: The totals of the cart item amounts do not match order amounts. This only occurs intermittently, depending on what items are in the cart.

I think the problem is caused by rounding when calculating prices of items without tax (our prices include a 10% tax), when multiple items are in the cart.

This is my example case. I have a product worth $124.99 (Inc tax). I add 2 of this product to the cart. In the PayPalOrderService.GetPaymentDetails the itemTotalWithDiscount, which excludes tax, is calculated at $227.25 but the 2 cart items are calculated at $113.63 each. So when these are added together they equal $227.26. A 1 cent difference due to rounding.

Just wondering if there is something wrong with my configuration or if there is a small bug here? Any help would be much appreciated.

Cheers
10 yıl önce
m@t32 wrote:
Hi guys,

I'm getting the error - 10413: The totals of the cart item amounts do not match order amounts. This only occurs intermittently, depending on what items are in the cart.

I think the problem is caused by rounding when calculating prices of items without tax (our prices include a 10% tax), when multiple items are in the cart.

This is my example case. I have a product worth $124.99 (Inc tax). I add 2 of this product to the cart. In the PayPalOrderService.GetPaymentDetails the itemTotalWithDiscount, which excludes tax, is calculated at $227.25 but the 2 cart items are calculated at $113.63 each. So when these are added together they equal $227.26. A 1 cent difference due to rounding.

Just wondering if there is something wrong with my configuration or if there is a small bug here? Any help would be much appreciated.

Cheers


This is a bug in nopCommerce - they know about it. For now you have to fix the code to sort the rounding out. I will try free up a developer to share the code we used to fix this.

Apologies for the lack of replies here, we are a little swamped at the moment. We have been made aware of the multiple currency issue. Just to re-iterate, the code is open source on Codeplex. We are encouraging people to join in and submit bug fixes and feature enhancements. https://paypalexpressnopcommerce.codeplex.com/
10 yıl önce
garethjnic wrote:
Is there a way to change the plugin's out of box payment button to the newer one that PayPal prefers (found at https://www.paypalobjects.com/webstatic/mktg/merchant/images/express-checkout-hero.png ) because the button included in the plugin has the tagline "the safer, easier way to pay" underneath it and this gives false implications that my other payment methods are not safe.

Thank you! ;)

Its a PayPal Tagline/slogan bulit into the image.


Thanks for the response. I understand that it's a tagline paypal added to that particular (old) button, which is why I'd like to see an option to change the paypal express button to the newer button at the link in my original post. I imagine I can change this via Visual Studio though if at all possible, it would be nice if this could be changed via the plugin's content/img folder or anything along that line.

Thanks :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.