AuthorizeNet/sample-code-node

Example for calling getAnAcceptPaymentPage(callback)?

JonathanJamesRasmussen opened this issue · 1 comments

Hi all, I've gotten the getAnAcceptPayment(callback); function working properly with console.log(response.getToken()); within the function itself, but does anyone have any idea how to actually return the response.getToken(); value on calling the function? I'm really struggling on trying to return this value, and don't know if I'm missing something really simple.

Never mind on the question. I've figured out that I need to assign the token value to a global variable within the callback definition within the file that I'm calling the getAnAcceptPayment() function from. I'm still getting used to asynchronous JavaScript, so this misunderstanding's on me.