authorize.net

How does Authorize.net work and how to integrate it?


I am a bit confused on how does Authorize.net work and how to integrate it, in my project I am using Angular as frontend and node.js as backend and I have installed Authorize.net via npm install authorizenet also cloned the Node.js sample code and I would like to set Authorize.net like so.

Let's say I have a form on my website where the customer needs to enter their details including the credit card details, my question is when submitting (using HTTP Request Method: POST) does my website need to redirect to Authorize or is there a widget that Authorize uses that I can implement in my website or are the details send directly to Authorize and handled there.

On submitting the details from the website do I simply call let's say the function from the sample codes (modified for my site) charge-credit-card.js ?

After that where do I receive the response, do I need to somehow capture it ?

Do I simply use the Production API Endpoint: https://api.authorize.net/xml/v1/request.apiand use my Api login and transaction key to use Authorize, at least that's the way in the documentation from my understanding - After building the XML object for an API request, submit it to the Authorize.net payment gateway as a standard HTTPS POST to an Authorize.net API endpoint. The exact process for doing this will depend upon the development language that you use.

Thank you in advance.


Solution

  • Your server will never know the customer's credit card details.

    when user first time registers in your site then you will create one customer for authorize.net using this code and you will save the customer id returned to your db for future reference.

    To Update customer's credit card details:

    create one API controller from your node server which will return authenticating token from authorize.net to your frontend. Get token code

    Your front end will make call to above created controller's API and get the authorize.net token.

    Now, your front end will use this token to get the update details form from authorize.

    Then you will use authorize webhook facility to know if user has updated theit payment details or not. Webhooks to be tracked:

    1. net.authorize.customer.paymentProfile.updated
    2. net.authorize.customer.paymentProfile.created

    On receiving below notifications, your node server will perform the whatever task required.

    Refer this doc for more details.