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

PayPal error while checking subscription validity

    Details

      Description

      The scheduled job that checks if any subscription needs to be renewed is throwing this exception:

      Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=null, values={GROUP_NAME=com.liferay.commerce.internal.messaging.CheckCommerceSubscriptionEntryMessageListener, companyId=0, groupId=0, DESTINATION_NAME=liferay/scheduler_dispatch, EXCEPTIONS_MAX_SIZE=0, [email protected], STORAGE_TYPE=MEMORY_CLUSTERED, JOB_NAME=com.liferay.commerce.internal.messaging.CheckCommerceSubscriptionEntryMessageListener}}
      com.liferay.portal.kernel.messaging.MessageListenerException: response-code: 405 details: name: MALFORMED_REQUEST message: Method type not supported for this operation details: null debug-id: fa43e4622b7b1 information-link: https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST
      at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
      at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper._processMessage(SchedulerEventMessageListenerWrapper.java:143)
      at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:98)
      at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
      at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
      at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: response-code: 405 details: name: MALFORMED_REQUEST message: Method type not supported for this operation details: null debug-id: fa43e4622b7b1 information-link: https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST
      at com.paypal.base.rest.PayPalRESTException.createFromHttpErrorException(PayPalRESTException.java:72)
      at com.paypal.base.rest.PayPalResource.execute(PayPalResource.java:431)
      at com.paypal.base.rest.PayPalResource.configureAndExecute(PayPalResource.java:295)
      at com.paypal.base.rest.PayPalResource.configureAndExecute(PayPalResource.java:228)
      at com.paypal.api.payments.Agreement.get(Agreement.java:240)
      at com.liferay.commerce.payment.method.paypal.internal.PayPalCommercePaymentMethod.getSubscriptionValidity(PayPalCommercePaymentMethod.java:409)
      at com.liferay.commerce.payment.internal.engine.CommerceSubscriptionEngineImpl.getSubscriptionValidity(CommerceSubscriptionEngineImpl.java:215)
      at com.liferay.commerce.internal.subscription.CommerceSubscriptionEntryHelperImpl.checkSubscriptionStatus(CommerceSubscriptionEntryHelperImpl.java:105)
      at com.liferay.commerce.internal.subscription.CommerceSubscriptionEntryHelperImpl.checkSubscriptionEntriesStatus(CommerceSubscriptionEntryHelperImpl.java:85)
      at com.liferay.commerce.internal.messaging.CheckCommerceSubscriptionEntryMessageListener.doReceive(CheckCommerceSubscriptionEntryMessageListener.java:79)
      at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      ... 7 more
      Caused by: com.paypal.base.exception.HttpErrorException: Response code: 405 Error response: {"name":"MALFORMED_REQUEST","message":"Method type not supported for this operation","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST","debug_id":"fa43e4622b7b1"}
      at com.paypal.base.HttpConnection.executeWithStream(HttpConnection.java:162)
      at com.paypal.base.HttpConnection.execute(HttpConnection.java:65)
      at com.paypal.base.rest.PayPalResource.execute(PayPalResource.java:417)
      ... 16 more
      Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: https://api.sandbox.paypal.com/v1/payments/billing-agreements/
      at sun.reflect.GeneratedConstructorAccessor324.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1944)
      at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1939)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1938)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1508)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
      at com.paypal.base.HttpConnection.executeWithStream(HttpConnection.java:132)
      ... 18 more
      Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: https://api.sandbox.paypal.com/v1/payments/billing-agreements/
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
      at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
      at com.paypal.base.HttpConnection.executeWithStream(HttpConnection.java:117)
      ... 18 more

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marco.leo Marco Leo
              Reporter:
              luca.pellizzon Luca Pellizzon
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  2.1.0