authorizenet nodejs for payment button

Hello,

I am trying to implement some donation functionalities with authorizeNet sdk in nodejs thanks to the possibility to install node-modules. I created a function in the backend that processed the form informations from the front-end however when it comes to the request towards authorize.net

import { APIContracts, APIControllers, APIOperationBase } from 'authorizenet';

[...]

let createRequest = new APIContracts.CreateTransactionRequest();
createRequest.setMerchantAuthentication(merchantAuthenticationType);
createRequest.setTransactionRequest(transactionRequestType);

console.log(JSON.stringify(createRequest.getJSON(), null, 2));

 let ctrl = new APIOperationBase.CreateTransactionController(createRequest.getJSON());
    
ctrl.execute(callback(){
  let apiResponse = ctrl.getResponse();
  let response = new  APIContracts.CreateTransactionResponse(apiResponse);
  console.log(response);
})

,the method execute is never executed and it’s is null if I try console.log it. However, I checked my code locally outside of wix and it’s working. I used the sample.code from the module to write the function so I am wondering if it’s related to authorize.net/Moolah plugin not being usable anymore ? or if the module isn’t properly used please let met know.

Thanks

1 Like

Did you install the authorizenet library with the Wix Package Manager ?

hi,
Thanks for the quick answer, yes It’s installed

Did you ever get this to work? Were you using ‘Accept Hosted’?