You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: Authorize.Net API Integration - E00001 Error
Hello, I have the following code for creating a transaction request to Authorize.Net using their SDK:
constmerchantAuthenticationType=newAPIContracts.MerchantAuthenticationType();merchantAuthenticationType.setName(process.env.AUTHORIZE_NET_API_LOGIN_ID||'');merchantAuthenticationType.setTransactionKey(process.env.AUTHORIZE_NET_TRANSACTION_KEY||'');console.log('Merchant Authentication setup complete.');constcreditCard=newAPIContracts.CreditCardType();creditCard.setCardNumber('4242424242424242');creditCard.setExpirationDate('0842');creditCard.setCardCode('999');console.log('Credit Card setup complete.',creditCard);constpaymentType=newAPIContracts.PaymentType();paymentType.setCreditCard(creditCard);consttransactionRequestType=newAPIContracts.TransactionRequestType();transactionRequestType.setTransactionType(APIContracts.TransactionTypeEnum.AUTHCAPTURETRANSACTION);transactionRequestType.setAmount(100);// Test amount (nxAmount used if needed)transactionRequestType.setPayment(paymentType);console.log('Transaction request setup complete.');constcreateRequest=newAPIContracts.CreateTransactionRequest();createRequest.setMerchantAuthentication(merchantAuthenticationType);createRequest.setTransactionRequest(transactionRequestType);console.log('Transaction request created. Ready for API call.');// Clean up null or undefined fields to prevent XML serialization issuescleanRequest(createRequest);// Log the cleaned request objectconsole.log('Cleaned Transaction Request Object:',createRequest);constctrl=newAPIControllers.CreateTransactionController(createRequest);// Wrap API call in Promise for async handlingconstresult=awaitnewPromise((resolve,reject)=>{console.log('Calling Authorize.Net API...');ctrl.execute(()=>{constapiResponse=ctrl.getResponse();console.log('Received API response:',apiResponse);constresponse=newAPIContracts.CreateTransactionResponse(apiResponse);constresponseMessages=response.getMessages().getMessage();console.log('Response Messages:',responseMessages);if(response.getMessages().getResultCode()===APIContracts.MessageTypeEnum.OK){console.log('Transaction successful, returning transaction ID.');resolve(NextResponse.json({message: response.getTransactionResponse().getTransId()},{status: 200}));}else{console.log('Transaction failed with error:',response.getMessages().getMessage()[0].getText());reject(NextResponse.json({message: response.getMessages().getMessage()[0].getText()},{status: 400}));}});});
and I get the following error:
Error:E00001 - "JSON root object has multiple properties."
Issue: Authorize.Net API Integration -
E00001
ErrorHello, I have the following code for creating a transaction request to Authorize.Net using their SDK:
and I get the following error:
Error:
E00001
- "JSON root object has multiple properties."logs as follows:
I appreciate any help.
Thanks!
The text was updated successfully, but these errors were encountered: