Skip to main content

My processor works on the payment and transaction screen but on the Salesorder screen i am getting this error.

Would someone be able to advise?

Hi @Merch ,

Have you tried with another sales order? As seeing the trace, the issue because of it is not matching order type with order number you are trying.


yes it didnt work even when i created a new order


When i tried with another i got this error 

 


@Dmitrii Naumov 

would you be able to advise? 

see attached code :

public HostedFormData GetDataForPaymentForm(ProcessingInput inputData)

    {

        HostedFormData hostFormData = new HostedFormData();

        string baseUrl;

        string hostedFormURL = "";

 

       

        baseUrl = PXContext.Sessions"CCPaymentConnectorUrl"] as string;  

        if (string.IsNullOrEmpty(baseUrl)) {

            baseUrl = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority);

            var baseUrl2 = VirtualPathUtility.ToAbsolute("~/");

            hostedFormURL = baseUrl + baseUrl2 + "Frames/usaepaypaymentconnector.html";

        }

         if (string.IsNullOrEmpty(baseUrl))

         {

              baseUrl = PX.CCProcessingBase.CCPaymentProcessingHelper.GetPaymentConnectorUrl(HttpContext.Current);   //Case for Hosted Payment Form called fom Sales Order Screen for Acumatica ERP version >= 2022 R2

         }

        if (string.IsNullOrEmpty(hostedFormURL)) {

            hostedFormURL = baseUrl.Replace("PaymentConnector.html", "usaepaypaymentconnector.html");

        }

       

        hostFormData.Caption = "Transaction Form";

        PXTrace.WriteInformation("hosted form url " + hostedFormURL);

        hostFormData.Url = hostedFormURL + "?UMamount=" + inputData.Amount;

        if (inputData.TranType == CCTranType.AuthorizeOnly)

        {

            hostFormData.Url += "&UMcommand=AuthorizeOnly&UMrefNum=" + inputData.OrigTranID;

        }

        hostFormData.UseGetMethod = true;

        hostFormData.Token = "CLTokenHostedPaymentForm";

 

        return hostFormData;

    }


 

}


 @Merch I don’t really think the issue is with this method here. 

Could you describe the exact steps you are doing and the error you are getting? Currently I see two different errors in the thread and they do not seem related. 

 

So, having the exact steps (with values of the SO and specifying what features you have active and what settings you have for order Type) would be helpful


@Dmitrii Naumov 

The first error was when i used an existing sales order. The second error was when i created a new SO and then tried to make a payment. What do you mean by features active and settings for order type?)


@Dmitrii Naumov @Evgeny Afanasiev 


Hi @Merch,

It looks like in the second scenario, you’re getting NRE in GetDataForPaymentForm() or straight after, before Hosted Payment Form is opened. I suggest to walk through the code of this method with debugger ensuring that all the assessments and resulting HostedFormData object are correct.


Reply