<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic NPM Authorize.net 1.0.8 is not returning GetTransactionDetails returns nothing in a Live mode. in cybersource APIs</title>
    <link>https://community.developer.cybersource.com/t5/cybersource-APIs/NPM-Authorize-net-1-0-8-is-not-returning-GetTransactionDetails/m-p/89855#M1643</link>
    <description>&lt;P&gt;I'm passing a settled transaction Id along with my api login id and transaction key details. What's wrong with this?&lt;/P&gt;&lt;P&gt;My code snippet:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;const { APIContracts, APIControllers } = require('authorizenet');

// Replace with your actual API credentials
const apiLoginId = variables.ApiId;
const transactionKey = variables.transactionKey;

// Set up merchant authentication
const merchantAuthenticationType = new APIContracts.MerchantAuthenticationType();
merchantAuthenticationType.setName(apiLoginId);
merchantAuthenticationType.setTransactionKey(transactionKey);

// Replace with the actual transaction ID
const transactionId = input.transactionId;

const getRequest = new APIContracts.GetTransactionDetailsRequest();
getRequest.setMerchantAuthentication(merchantAuthenticationType);
getRequest.setTransId(transactionId);

const ctrl = new APIControllers.GetTransactionDetailsController(getRequest.getJSON());

// Manually set the endpoint for production
ctrl.setEnvironment('https://api2.authorize.net/xml/v1/request.api');


ctrl.execute(() =&amp;gt; {
    const apiResponse = ctrl.getResponse();

    if (apiResponse) {
        if (apiResponse.getMessages().getResultCode() === APIContracts.MessageTypeEnum.OK) {
            const transaction = apiResponse.getTransaction();
            if (transaction.getCustomer()) {
                const customerEmail = transaction.getCustomer().getEmail();
                console.log('Customer Email:', customerEmail);
                // Handle the customer email as needed
            } else {
                console.log('No customer information found for this transaction.');
            }
        } else {
            const errorMessage = apiResponse.getMessages().getMessage()[0];
            console.log('Result Code:', apiResponse.getMessages().getResultCode());
            console.log('Error Code:', errorMessage.getCode());
            console.log('Error Message:', errorMessage.getText());
        }
    } else {
        console.log('Null Response.');
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2024 03:27:26 GMT</pubDate>
    <dc:creator>magazinebrute</dc:creator>
    <dc:date>2024-08-06T03:27:26Z</dc:date>
    <item>
      <title>NPM Authorize.net 1.0.8 is not returning GetTransactionDetails returns nothing in a Live mode.</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/NPM-Authorize-net-1-0-8-is-not-returning-GetTransactionDetails/m-p/89855#M1643</link>
      <description>&lt;P&gt;I'm passing a settled transaction Id along with my api login id and transaction key details. What's wrong with this?&lt;/P&gt;&lt;P&gt;My code snippet:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;const { APIContracts, APIControllers } = require('authorizenet');

// Replace with your actual API credentials
const apiLoginId = variables.ApiId;
const transactionKey = variables.transactionKey;

// Set up merchant authentication
const merchantAuthenticationType = new APIContracts.MerchantAuthenticationType();
merchantAuthenticationType.setName(apiLoginId);
merchantAuthenticationType.setTransactionKey(transactionKey);

// Replace with the actual transaction ID
const transactionId = input.transactionId;

const getRequest = new APIContracts.GetTransactionDetailsRequest();
getRequest.setMerchantAuthentication(merchantAuthenticationType);
getRequest.setTransId(transactionId);

const ctrl = new APIControllers.GetTransactionDetailsController(getRequest.getJSON());

// Manually set the endpoint for production
ctrl.setEnvironment('https://api2.authorize.net/xml/v1/request.api');


ctrl.execute(() =&amp;gt; {
    const apiResponse = ctrl.getResponse();

    if (apiResponse) {
        if (apiResponse.getMessages().getResultCode() === APIContracts.MessageTypeEnum.OK) {
            const transaction = apiResponse.getTransaction();
            if (transaction.getCustomer()) {
                const customerEmail = transaction.getCustomer().getEmail();
                console.log('Customer Email:', customerEmail);
                // Handle the customer email as needed
            } else {
                console.log('No customer information found for this transaction.');
            }
        } else {
            const errorMessage = apiResponse.getMessages().getMessage()[0];
            console.log('Result Code:', apiResponse.getMessages().getResultCode());
            console.log('Error Code:', errorMessage.getCode());
            console.log('Error Message:', errorMessage.getText());
        }
    } else {
        console.log('Null Response.');
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 03:27:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/NPM-Authorize-net-1-0-8-is-not-returning-GetTransactionDetails/m-p/89855#M1643</guid>
      <dc:creator>magazinebrute</dc:creator>
      <dc:date>2024-08-06T03:27:26Z</dc:date>
    </item>
  </channel>
</rss>

