Overview

Authorize.Net connector is an Integration to payment gateway which enables users to automatically charge their customers and accepts ACH and Credit card payments.It is a visual integration to have Credit card or ACH payment received from the UI. This visual component triggers an integration. It is used for storing the connection properties which we will leverage during a transaction triggered from Salesforce.

Process Summary

Steps to Follow

Requirements:

  1. Connect Salesforce with Authorize.net for payment processing gateway

  2. Compatibility to connect with any Salesforce custom object or standard object to process payments from 

  3. Save card details within Salesforce with PCI compliance 

  4. Login to DBSync Workflow Instance

  5. Click on Development Studio

  6. Salesforce setup-

            Configure Authorize.Net DBSyn package.

            Verify,  click and process payment in visual force page of Salesforce Instance

  1. Create a workflow with Console Adapter as reader & Salesforce as writer.

  2. Create and setup  Authorize.net connector & save. 

  3. Use the predefined sample JSON in Advance Query Builder as given below.


                                                         Fig : Advance Query

To use ACH for transaction instead of Credit Card, the predefined sample JSON for query builder in workflow & apex code for Visualforce Page is given below.

There are 3 sections of JSON query necessary while setup - Call, Request , Response

Section 1 : 

This section is internally created by DBSync and is specifically designed to run an API call as mentioned below. A project and  respective processes are triggered asynchronously.

{

    "call": {

    "process": "process-xxxx",

    "session": [

    {

    "value": "xxxxxx",

    "key": "xxxxxx"

    },

    {

    "value": "xxxxxx",

    "key": "xxxx"

    }

    ],

    "project": "project-xxxx",

    "run": "async"  

  },

Section 2:

This section is the payload which can be coded on the basis of Authorize.Net Specification.. This is a JSON object. User needs to provide the information for the payload dynamically on the query builder and post the below set of information as required. For example, Bill to, amount, translation type and CC information are provided. The user can construct the below information as per requirement.

     "request": {

    "transactionType": "authCaptureTransaction",

    "amount": "1",

    "billTo": {

    "zip": "xxxxxx",

    "firstName": "xxxxx",

    "lastName": "xxxxxx",

    "country": "XXX",

    "address": "xxxxx",

    "city": "xxxxxxx",

    "state": "xx"

    },

    "payment": {

    "creditCard": {

    "cardCode": "XXX",

    "cardNumber": "000XXXXXXX",

    "expirationDate": "0000-XX"

    }

    }

Section 3:

Based on the information sent by Authorize.Net there is a response automatically generated which has all the information from the transaction. 

This information can come from any application such as a Salesforce, Database, etc representing the transaction that is taking place

    },

    "response": {

    "transactionResponse": {

    "cvvResultCode": "M",

    "SupplementalDataQualificationIndicator": 0,

    "transHashSha2": "",

    "authCode": "EPDAYO",

    "cavvResultCode": "2",

    "transId": "60163622801",

    "transHash": "",

    "accountType": "Visa",

    "accountNumber": "XXXX1111",

    "networkTransId": "43UZUTCVIGA9D8HRVZ5JWQT",

    "responseCode": "1",

    "avsResultCode": "A",

    "testRequest": "0",

    "messages": [

    {

    "code": "1",

    "description": "This transaction has been approved."

    }

    ],

    "refTransID": ""

    },

    "messages": {

    "resultCode": "Ok",

    "message": [

    {

    "code": "I00001",

    "text": "Successful."

    }

    ]

    }

    }

}

Note:

The encryption type is the Card number, and the 3 components of  CALL, REQUEST AND RESPONSE, and map the values for what is entered (input) into the target system such as Salesforce, QuickBooks etc 

                                                                   Fig : Mapping

                                                             Fig : Salesforce Visualforce Page

<apex:page standardController="Opportunity" showHeader="false" standardStylesheets="false">

    <head lang="en">

      <meta charset="utf-8"/>

      <meta name="viewport" content="width=device-width,initial-scale=1.0"/>

      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

        <script src="https://qa.mydbsync.com/cw/scripts/dbsync-cc.js"></script>

    </head>

     <body>

        <div id="cc"></div>

    </body> 

    <apex:iframe src="" scrolling="true" id="cardFrame"/>

    <form id="formCardFrame" method="post"

            action="https://qa.mydbsync.com/cw/c/pages/card_payment" style="display:none;">

        <input name="json" value="" id="json" />

        <input type="submit"/>

    </form>

<script>

    $(document).ready(() => {

        const jsonRequest = {

        baseURL: "https://qa.mydbsync.com/DBSync",

            dbsyncAuth: {

                key: "xxxxx@xxxx.com",       

Note: 

Provide the user name and password for the DBsync 

Cloud Workflow instance.(Key and Token)

                token: "xxxxxx"

            },

            salesforce_session: "23234324243",

            paymentInstance: "AuthorizeNet",

            transactionRequest: {

                amount: "1",

                payment: {

                    creditCard: {

                        cardNumber: "5424000000000015",     

Note:

                        expirationDate: "2021-12",

                        cardCode: "900"

                    }

                },

                billTo: {

                    firstName: "Ellen",

                    lastName: "Johnson",

                    company: "Souveniropolis",

                    address: "14 Main Street",

                    city: "Pecan Springs",

                    state: "TX",

                    zip: "46201",

                    country: "USA"

                }

            },

            call: {

                project:"AuthorizeNetPayment",

                process:"ProcessAuthNetPayment_Copy",

                session: [

                          {"key":"opportunityId","value":"{!Opportunity.Id}"},

                          {"key":"object","value":"Opportunity"},

                ]

            }

        };

                      // $('#cc').acceptCC(jsonRequest);

                      

        $('#json').val(JSON.stringify(jsonRequest));

        $('#formCardFrame').submit();

    })

</script>

</apex:page>

Note:

                       Fig : Auto-filled Display of CC details

                                             Fig : Transaction Successful

                                             Fig : Transaction Failed

                                             Fig : ACH Visual View