Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Edgar Rasquin 326 posts 925 karma points
    Aug 11, 2021 @ 09:46
    Edgar Rasquin
    0

    Call failed with status code 422 (Unprocessable Entity): POST https://api.paypal.com/v2/checkout/orders

    Hi Matt,

    I get the following error when trying to checkout using PayPal:

    Call failed with status code 422 (Unprocessable Entity): POST https://api.paypal.com/v2/checkout/orders

    Line 9:  @Html.VendrCheckoutPartial("VendrCheckoutOrderInfo", 
    currentOrder)
    Line 10: 
    Line 11: @using (Html.BeginPaymentForm(currentOrder))
    Line 12: {
    Line 13:     @Html.AntiForgeryToken();
    

    Source File: C:\Inetpub\vhosts\mountaincard.it\httpdocs\App_Plugins\VendrCheckout\Views\VendrCheckoutReviewPage.cshtml Line: 11

    Installed Version Vendr v1.8.1

    Do you know what is going wrong?

    Thanks

  • Edgar Rasquin 326 posts 925 karma points
    Aug 11, 2021 @ 10:07
    Edgar Rasquin
    0

    Stack Trace:

    [FlurlHttpException: Call failed with status code 422 (Unprocessable Entity): POST https://api.paypal.com/v2/checkout/orders]
       Flurl.Http.<HandleExceptionAsync>d__23.MoveNext() +687
       System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
       Flurl.Http.<SendAsync>d__19.MoveNext() +2144
       System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
       Flurl.Http.<SendAsync>d__19.MoveNext() +2865
       System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
       System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
       Flurl.Http.<ReceiveJson>d__0`1.MoveNext() +391
    
    [AggregateException: One or more errors occurred.]
       Vendr.Core.Web.HtmlHelperExtensions.RenderPaymentForm(HtmlHelper htmlHelper, OrderReadOnly order, IDictionary`2 htmlAttributes, IOrderService orderService, IPaymentMethodService paymentMethodService, IPaymentProviderService paymentProviderService, ITranslationService translationService, IPaymentProviderUriResolver uriResolver, IOrderNumberGenerator orderNumberGenerator, IHashProvider hashProvider, IUnitOfWorkProvider uowProvider, IMembershipHelper membershipHelper) +7315
       Vendr.Core.Web.HtmlHelperExtensions.BeginPaymentForm(HtmlHelper htmlHelper, OrderReadOnly order, IDictionary`2 htmlAttributes) +351
       Vendr.Core.Web.HtmlHelperExtensions.BeginPaymentForm(HtmlHelper htmlHelper, OrderReadOnly order) +87
       ASP._Page_App_Plugins_VendrCheckout_Views_VendrCheckoutReviewPage_cshtml.Execute() in C:\Inetpub\vhosts\mountaincard.it\httpdocs\App_Plugins\VendrCheckout\Views\VendrCheckoutReviewPage.cshtml:11
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
       Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +174
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +775
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
       System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
       System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +26
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
       System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +40
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +648
       System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131
    
  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Aug 11, 2021 @ 10:20
    Matt Brailsford
    0

    Hey Edgar,

    Hmmm, searching online it suggests this could be to do with your account not being able to handle the currency.

    It looks like details about why it failed do get passed in the response body but we don’t seem to be handling that. You might need to pull the provider source code from GitHub and debug into the provider to see what the actual details of the bug is.

    I’ll try and take a look what we can do to show the error details.

  • Edgar Rasquin 326 posts 925 karma points
    Aug 11, 2021 @ 12:30
    Edgar Rasquin
    0

    Thank you Matt,

    in the meantime I found out, that the error only occurs in live mode. Switching to sandbox mode accepts the payment without any errors.

    Searching online I found a couple of entries suggesting it might be related to the PayPal account itself.

    https://docs.affiliatewp.com/article/1407-paypal-payouts-error-codes

    Error: 422 Unprocessable Entity

    This error means one of two things:

    Your PayPal account must have an adequate balance to cover the payouts it is attempting to process. Unlike personal PayPal accounts that withdraw from a bank or credit card source, you must have a sufficient existing PayPal balance to cover the referrals you are attempting to pay out, or you will receive this error. Also, know that your PayPal sandbox account has a separate balance than your live account, so make sure it is adequately funded as well prior to testing with a sandbox account. The currency code the funds are being sent in cannot be received by the recipient due to country or account regulations.

    Have you experienced a similar behaviour before?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Aug 11, 2021 @ 12:49
    Matt Brailsford
    0

    Hi Edgar,

    I've not no, but they are the same posts I was finding.

    Out of interest, what currency is the target payout paypal account set up in? And what currency are the payments on the website?

    Matt

  • Edgar Rasquin 326 posts 925 karma points
    Aug 11, 2021 @ 14:12
    Edgar Rasquin
    0

    Hi Matt,

    I'm not quite sure because I don't have access to the PayPal account. But I'm pretty sure it's set as Euro currency on both sides.

    The customer has now contacted PayPal. As it looks at the moment, PayPal is missing some documents. Therefore they have restricted the account. It's just strange that the account has been accepted without any problems so far. Several payments have already been made through it.

    I have now temporarily hidden PayPal as a payment method in the shop. As soon as the account-related problems are solved, I will test again and let you know.

    In any case, thanks for the feedback.

    Edi

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Aug 11, 2021 @ 14:19
    Matt Brailsford
    0

    Hmmm, very weird.

    Do let me know if problems continue once the account is sorted 👍

  • George Logan 36 posts 168 karma points
    Jan 17, 2022 @ 15:01
    George Logan
    0

    Hi folks,

    Sorry for jumping on an old issue. But does anyone have any further info?

    Or website this morning starting getting '422 unprocessable entity' from PayPal.

    We've actually been getting 422 intermittently from Opayo for over a week now too. Intermittent proving more difficult to debug.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 17, 2022 @ 15:53
    Matt Brailsford
    0

    Hi George,

    I don't have any further info, but maybe it's worth checking the PayPal forums for anything that might shed some light on the issue for example I just found this one https://www.paypal-community.com/t5/REST-APIs/v2-checkout-orders-returned-status-422/td-p/2018363

    Not sure that should be the problem here though as we don't send individual order lines through, but still, might be worth seeing what other things cause the 422.

    Matt

  • George Logan 36 posts 168 karma points
    Jan 17, 2022 @ 20:46
    George Logan
    0

    Hi Matt,

    Thanks for the response.

    Some good info there.

    Still struggling to identify what the 'entity' is that's causing the issue. Will need to keep digging.

    Cheers again,

    George

Please Sign in or register to post replies

Write your reply to:

Draft