Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-8756

With PayPal Request Details set as Minimal, an error is thrown when a user tries to pay for a cart with more than 1 item

Details

    • Commerce Sprint 08 - Apr/2022

    Description

      Assumptions:

      • A Minium site
      • An account
      • PayPal enabled(Mode: Sandbox, Request Details: Minimal)

      Steps:

      1. Navigate to Minium -> Catalog
      2. Create a new cart with more than 1 item
      3. Checkout using PayPal as payment method

      Expected Behavior:

       The user is redirected to PayPal page and the payment is successfull.

      Actual Behavior:

       The user is not redirected to PayPal page and this error is thrown:

      2022-03-15 15:53:44.422 ERROR [http-nio-8080-exec-10][PayPalCommercePaymentMethod:686] {"name":"UNPROCESSABLE_ENTITY","details":[{"field":"/purchase_units/0/reference_id","issue":"REFERENCE_ID_REQUIRED","description":"Reference id is required for each purchase unit if multiple purchase units are provided."},{"field":"/purchase_units/1/reference_id","issue":"REFERENCE_ID_REQUIRED","description":"Reference id is required for each purchase unit if multiple purchase units are provided."}],"message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"da8134cb59056","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-REFERENCE_ID_REQUIRED","rel":"information_link","method":"GET"}]}
      com.paypal.http.exceptions.HttpException: {"name":"UNPROCESSABLE_ENTITY","details":[{"field":"/purchase_units/0/reference_id","issue":"REFERENCE_ID_REQUIRED","description":"Reference id is required for each purchase unit if multiple purchase units are provided."},{"field":"/purchase_units/1/reference_id","issue":"REFERENCE_ID_REQUIRED","description":"Reference id is required for each purchase unit if multiple purchase units are provided."}],"message":"The requested action could not be performed, semantically incorrect, or failed business validation.","debug_id":"da8134cb59056","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-REFERENCE_ID_REQUIRED","rel":"information_link","method":"GET"}]}
      	at com.paypal.http.HttpClient.parseResponse(HttpClient.java:200) ~[paypalhttp-1.0.1.jar:?]
      	at com.paypal.http.HttpClient.execute(HttpClient.java:98) ~[paypalhttp-1.0.1.jar:?]
      	at com.liferay.commerce.payment.method.paypal.internal.PayPalCommercePaymentMethod.processPayment(PayPalCommercePaymentMethod.java:655) [bundleFile:?]
      	at com.liferay.commerce.payment.internal.engine.CommercePaymentEngineImpl.processPayment(CommercePaymentEngineImpl.java:374) [bundleFile:?]
      	at com.liferay.commerce.payment.internal.servlet.CommercePaymentServlet._startPayment(CommercePaymentServlet.java:239) [bundleFile:?]
      	at com.liferay.commerce.payment.internal.servlet.CommercePaymentServlet.doGet(CommercePaymentServlet.java:109) [bundleFile:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) [servlet-api.jar:4.0.FR]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [servlet-api.jar:4.0.FR]
      	at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153) [bundleFile:?]
      	at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62) [bundleFile:?]
      	at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120) [bundleFile:?]
      	at org.eclipse.equinox.http.servlet.internal.HttpServiceRuntimeImpl.doDispatch(HttpServiceRuntimeImpl.java:372) [bundleFile:?]
      	at org.eclipse.equinox.http.servlet.internal.servlet.ProxyServlet.service(ProxyServlet.java:70) [bundleFile:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [servlet-api.jar:4.0.FR]
      	at com.liferay.portal.module.framework.ModuleFrameworkServletAdapter.service(ModuleFrameworkServletAdapter.java:54) [portal-impl.jar:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [servlet-api.jar:4.0.FR]
      	at com.liferay.shielded.container.internal.proxy.ServletWrapper.service(ServletWrapper.java:113) [com.liferay.shielded.container.impl.jar:?]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.56]
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.56]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.56]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124) [portal-kernel.jar:?]
      	at com.liferay.portal.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:62) [portal-impl.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-kernel.jar:?]
      	at com.liferay.portal.servlet.filters.lockout.LockoutFilter.processFilter(LockoutFilter.java:58) [portal-impl.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147) [portal-kernel.jar:?]
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88) [portal-impl.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147) [portal-kernel.jar:?]
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:244) [portal-impl.jar:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99) [portal-kernel.jar:?]
      	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) [urlrewritefilter-4.0.4.jar:4.0.4]
      	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) [urlrewritefilter-4.0.4.jar:4.0.4]
      	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) [urlrewritefilter-4.0.4.jar:4.0.4]
      	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389) [urlrewritefilter-4.0.4.jar:4.0.4]
      	at com.liferay.portal.url.rewrite.filter.internal.URLRewriteFilter.processFilter(URLRewriteFilter.java:98) [bundleFile:?]
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99) [portal-kernel.jar:?]
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:104) [portal-kernel.jar:?]
      	at com.liferay.shielded.container.internal.proxy.FilterWrapper.doFilter(FilterWrapper.java:79) [com.liferay.shielded.container.impl.jar:?]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [catalina.jar:9.0.56]
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [catalina.jar:9.0.56]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.56]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [catalina.jar:9.0.56]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) [catalina.jar:9.0.56]
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) [tomcat-coyote.jar:9.0.56]
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.56]
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:895) [tomcat-coyote.jar:9.0.56]
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1732) [tomcat-coyote.jar:9.0.56]
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.56]
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-util.jar:9.0.56]
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:9.0.56]
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.56]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221]

       

      Attachments

        Issue Links

          Activity

            People

              lorenzo.lapescara Lorenzo La Pescara
              lorenzo.lapescara Lorenzo La Pescara
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Packages

                  Version Package
                  7.4 DXP U20
                  7.4 DXP U21