cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Accept Hosted Redirect Method Not get Transaction details

Our Payment Integration Need :

- Customer wount enter any card details in our (Merchant) site . We will send the price and other info to authorize.net server adn the user enters the card details and we have to get the success/failure status and transaction details.

-To satisfy the above need we found the Accept Hosted Redirect Method will works as the same.
-As per the api and documentation for the first step, we formed the refId,price,url,cancel url details and got the token.
- The along with the token we posted the form to authorize.net server. There once we entered the card details and other things, after receipt page we come back to our success url.
- At the time when we navigate to our server we cant get any transaction details like transId etc.
- As per the api references, to get any transaction details we need transId to get the details.


Please guide us the procedure we need to process our need in authorize.net

3 REPLIES 3

Hello,

 

In order to obtain transaction details, like Transaction Id, you would need to use the iframe method and specify a hostedPaymentIFrameCommunicatorUrl in your hostedPaymentSettings, through which you would be able to receive some of the transaction details with Javascript like the following in your parent page.

<script>
    window.CommunicationHandler = {};
    function parseQueryString(str) {
        var vars = [];
        var arr = str.split('&');
        var pair;
        for (var i = 0; i < arr.length; i++) {
            pair = arr[i].split('=');
            vars[pair[0]] = unescape(pair[1]);
        }
        return vars;
    }
    window.CommunicationHandler.onReceiveCommunication = function (argument) {
        params = parseQueryString(argument.qstr)
        parentFrame = argument.parent.split('/')[4];
        switch (params['action']) {
            case "transactResponse":
           var transResponse = JSON.parse(params['response']);
           console.log(transResponse);
            if (transResponse.transId > 0) {
             $('#load_payment').hide();  
           $('#demo').html("Thank you. Your Transaction Id is:  "+transResponse.transId);

                 
                }
              
        }

    }

</script>

  

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Hi @tresellesys123,

 

If you can't use the redirect method for some reason, the other way to get transaction details is by listening for Webhook notifications of the transactions. There's more detail in our Webhooks documentation.

Thanks for your reply. I will check the above.