Integration and Testing

Authorize.Net API questions and help with your payment integration.

Posts: 2
Registered: ‎09-08-2017

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 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 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

Posts: 492
Topics: 0
Kudos: 99
Blog Posts: 0
Ideas: 0
Solutions: 42
Registered: ‎04-28-2017

Re: Accept Hosted Redirect Method Not get Transaction details



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.

    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']);
            if (transResponse.transId > 0) {
           $('#demo').html("Thank you. Your Transaction Id is:  "+transResponse.transId);





Powered by -
Certified developers
All Star
Posts: 699
Registered: ‎11-03-2016

Re: Accept Hosted Redirect Method Not get Transaction details

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.

Posts: 2
Registered: ‎09-08-2017

Re: Accept Hosted Redirect Method Not get Transaction details

Thanks for your reply. I will check the above.