Reply
Highlighted
Contributor
Posts: 11
Registered: ‎06-29-2018

Accept Hosted iFrame userFields error

I'm trying to use "userFields" in createTransactionRequest of Accept hosted iFrame form to send and recieve data back after the transaction is completed. I keep getting "Unexpected Error. Please try again" message when I submit the form.

 

{"resultCode":"Error","messageCode":"E00001","messageText":"Unexpected error. Please try again.","token":null,"transactionData":null,"userFields":null,"createPaymentProfileResponse":null}

 

Below is the code snipet from my java code.

        UserFields userFields = new UserFields();
        UserField usField = new UserField();
        usField.setName("TestUserFieldName");
        usField.setValue("TestUserFieldValus");
        userFields.getUserField().add(usField);

TransactionRequestType txnRequest = new TransactionRequestType();
txnRequest.setUserFields(userFields);

Am I missing something?

 

Highlighted
Administrator
Posts: 149
Registered: ‎03-28-2014

Re: Accept Hosted iFrame userFields error

Does it work when you do not include the user fields?  I just tested same (not in java) and worked fine.

 

Highlighted
Contributor
Posts: 11
Registered: ‎06-29-2018

Re: Accept Hosted iFrame userFields error

Yes, it works correctly when I do not include userFields in my transactionRequest.

Highlighted
Contributor
Posts: 51
Registered: ‎10-28-2015

Re: Accept Hosted iFrame userFields error

[ Edited ]

Hi @ashish1871,

 

Even though the SDK includes methods to set and get custom User fields, also known as Merchant Defined fields, the new API does not handle them. (see this thread)

 

It is interesting that attempting to include them now produces an error. That is better than what was happening previously, which is that the fields and their values simply disappeared into the ether, never to return, leading to some serious head scratching.