Skip to main content
Solved

ICC Hosted payment form processor


Forum|alt.badge.img

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?

Best answer by 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.

View original
Did this topic help you find an answer to your question?

8 replies

Nilkanth Dipak
Jr Varsity III
Forum|alt.badge.img+7

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.


Forum|alt.badge.img
  • Author
  • 41 replies
  • June 30, 2024

yes it didnt work even when i created a new order


Forum|alt.badge.img
  • Author
  • 41 replies
  • June 30, 2024

When i tried with another i got this error 

 


Forum|alt.badge.img
  • Author
  • 41 replies
  • July 5, 2024

@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.Session["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;

    }


 

}


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+6
  • Acumatica Moderator
  • 595 replies
  • July 5, 2024

 @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


Forum|alt.badge.img
  • Author
  • 41 replies
  • July 9, 2024

@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?)


Forum|alt.badge.img
  • Author
  • 41 replies
  • July 11, 2024

Evgeny Afanasiev
Acumatica Moderator
Forum|alt.badge.img

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings