<?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 Regarding the usage of Authorize.net API for Payments in SAPUI5 CAPM application in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Regarding-the-usage-of-Authorize-net-API-for-Payments-in-SAPUI5/m-p/90344#M56834</link>
    <description>&lt;P&gt;I have used below API'S by Authorize.net. One is&amp;nbsp;&lt;A href="https://apitest.authorize.net/xml/v1/request.api" target="_blank"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt;&amp;nbsp;and other one is&amp;nbsp;&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment.&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;First API will generate a token for the rendering of Form for Payments page and using that token I will render the form. So, coming to my application development I have a CAP (Cloud Application Programming Model) service which will fetch the token from the API and returns it. And I have a SAPUI5 Fiori application which will call this service and gets the token and placed inside the form rendering for the second API. This works fine and am able to make payments there. But when payment is completed, I am unable to get the transaction Id and authentication code from the payments completed page. Because it was embedded inside an iframe. So, I can't access this using iframe communication response. Till the I can't get the back the messages after payment through iframe communicator. Can you please help me in this. Iam attaching the required files of my code can you please guide me in how to achieve this.&lt;BR /&gt;&lt;BR /&gt;This is my server code to generate token&amp;nbsp;&lt;/P&gt;&lt;P&gt;const cds = require('@sap/cds');&lt;BR /&gt;const axios = require('axios');&lt;/P&gt;&lt;P&gt;module.exports = cds.service.impl(async function () {&lt;BR /&gt;this.on('POST', 'TransactionDetails', async (req) =&amp;gt; {&lt;BR /&gt;const requestData = req.data;&lt;BR /&gt;if (!requestData.merchantName || !requestData.transactionKey || !requestData.customerProfileId) {&lt;BR /&gt;req.error(400, 'Required fields are missing.');&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;const requestPayload = {&lt;BR /&gt;getHostedPaymentPageRequest: {&lt;BR /&gt;merchantAuthentication: {&lt;BR /&gt;name: requestData.merchantName,&lt;BR /&gt;transactionKey: requestData.transactionKey,&lt;BR /&gt;},&lt;BR /&gt;transactionRequest: {&lt;BR /&gt;transactionType: requestData.transactionType,&lt;BR /&gt;amount: requestData.amount.toFixed(2),&lt;BR /&gt;profile: {&lt;BR /&gt;customerProfileId: requestData.customerProfileId,&lt;BR /&gt;},&lt;BR /&gt;customer: {&lt;BR /&gt;email: requestData.customerEmail,&lt;BR /&gt;},&lt;BR /&gt;billTo: {&lt;BR /&gt;firstName: requestData.firstName,&lt;BR /&gt;lastName: requestData.lastName,&lt;BR /&gt;company: requestData.company,&lt;BR /&gt;address: requestData.address,&lt;BR /&gt;city: requestData.city,&lt;BR /&gt;state: requestData.state,&lt;BR /&gt;zip: requestData.zip,&lt;BR /&gt;country: requestData.country,&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;hostedPaymentSettings: {&lt;BR /&gt;setting: JSON.parse(requestData.paymentSettings),&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;try {&lt;BR /&gt;const response = await axios.post(&lt;BR /&gt;'&lt;A href="https://apitest.authorize.net/xml/v1/request.api" target="_blank"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt;',&lt;BR /&gt;requestPayload,&lt;BR /&gt;{&lt;BR /&gt;headers: {&lt;BR /&gt;'Content-Type': 'application/json',&lt;BR /&gt;},&lt;BR /&gt;}&lt;BR /&gt;);&lt;BR /&gt;if (response.data.token) {&lt;BR /&gt;return { token: response.data.token };&lt;BR /&gt;} else {&lt;BR /&gt;req.error(500, 'Token not received in response.');&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;} catch (error) {&lt;BR /&gt;req.error(500, `Failed to generate payment token: ${error.message}`);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the view code of the app is below&lt;/P&gt;&lt;P&gt;&amp;lt;mvc:View&lt;BR /&gt;xmlns:mvc="sap.ui.core.mvc"&lt;BR /&gt;xmlns:core="sap.ui.core"&lt;BR /&gt;xmlns:m="sap.m"&lt;BR /&gt;controllerName="sap.com.payment.controller.View2"&lt;BR /&gt;displayBlock="true"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;m:Page id="pageid" title="Payment Page"&amp;gt;&lt;BR /&gt;&amp;lt;m:content&amp;gt;&lt;BR /&gt;&amp;lt;core:HTML id="htmlID" /&amp;gt;&lt;BR /&gt;&amp;lt;m:Button id="Success" text="Back" press="onBack" /&amp;gt;&lt;BR /&gt;&amp;lt;/m:content&amp;gt;&lt;BR /&gt;&amp;lt;/m:Page&amp;gt;&lt;BR /&gt;&amp;lt;/mvc:View&amp;gt;&lt;/P&gt;&lt;P&gt;This is the controller of js code&lt;/P&gt;&lt;P&gt;sap.ui.define([&lt;BR /&gt;"sap/ui/core/mvc/Controller",&lt;BR /&gt;"sap/m/MessageToast"&lt;BR /&gt;], function (Controller, MessageToast) {&lt;BR /&gt;"use strict";&lt;BR /&gt;return Controller.extend("sap.com.payment.controller.View2", {&lt;BR /&gt;onInit: function () {&lt;BR /&gt;this.oRouter = sap.ui.core.UIComponent.getRouterFor(this);&lt;BR /&gt;this.oRouter.getRoute("View2").attachPatternMatched(this._onObjectMatched, this);&lt;BR /&gt;window.addEventListener("message", this.onMessage.bind(this), false);&lt;BR /&gt;console.log("Message listener added and waiting for iframe messages");&lt;BR /&gt;},&lt;BR /&gt;_onObjectMatched: function (oEvent) {&lt;BR /&gt;var oDetails = JSON.parse(oEvent.getParameter("arguments").Details);&lt;BR /&gt;const requestData = {&lt;BR /&gt;merchantName: oDetails.merchantName,&lt;BR /&gt;transactionKey: oDetails.transactionKey,&lt;BR /&gt;transactionType: oDetails.transactionType,&lt;BR /&gt;amount: parseFloat(oDetails.amount),&lt;BR /&gt;customerProfileId: oDetails.customerProfileId,&lt;BR /&gt;customerEmail: oDetails.customerEmail,&lt;BR /&gt;firstName: oDetails.firstname,&lt;BR /&gt;lastName: oDetails.lastname,&lt;BR /&gt;company: oDetails.company,&lt;BR /&gt;address: oDetails.address,&lt;BR /&gt;city: oDetails.city,&lt;BR /&gt;state: oDetails.state,&lt;BR /&gt;zip: oDetails.zip,&lt;BR /&gt;country: oDetails.country,&lt;BR /&gt;paymentSettings: JSON.stringify([{&lt;BR /&gt;settingName: "hostedPaymentReturnOptions",&lt;BR /&gt;settingValue: "{\"showReceipt\": true, \"url\": \"&lt;A href="https://mysite.com/receipt\" target="_blank"&gt;https://mysite.com/receipt\&lt;/A&gt;", \"cancelUrl\": \"&lt;A href="https://mysite.com/cancel\" target="_blank"&gt;https://mysite.com/cancel\&lt;/A&gt;"}"&lt;BR /&gt;}])&lt;BR /&gt;};&lt;BR /&gt;fetch("/catalog/TransactionDetails", {&lt;BR /&gt;method: "POST",&lt;BR /&gt;headers: {&lt;BR /&gt;"Content-Type": "application/json"&lt;BR /&gt;},&lt;BR /&gt;body: JSON.stringify(requestData)&lt;BR /&gt;})&lt;BR /&gt;.then(response =&amp;gt; response.json())&lt;BR /&gt;.then(data =&amp;gt; {&lt;BR /&gt;if (data.token) {&lt;BR /&gt;this._setFormInIframe(data.token);&lt;BR /&gt;} else {&lt;BR /&gt;MessageToast.show("Token not found in response");&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;.catch(error =&amp;gt; {&lt;BR /&gt;MessageToast.show("Error: " + error.message);&lt;BR /&gt;});&lt;BR /&gt;},&lt;BR /&gt;_setFormInIframe: function (sToken) {&lt;BR /&gt;var oIframe = this.byId("htmlID");&lt;BR /&gt;var sFormHtml = `&lt;BR /&gt;&amp;lt;form method="post" action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage"&amp;gt;&lt;BR /&gt;&amp;lt;input type="hidden" name="token" value="${sToken}" /&amp;gt;&lt;BR /&gt;&amp;lt;button type="submit" style="display:none;"&amp;gt;Submit&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;document.getElementById('formAuthorizeNetTestPage').submit();&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;window.addEventListener('DOMContentLoaded', function(event) {&lt;BR /&gt;const transactionId = document.getElementById("receiptTransactionId")?.innerText;&lt;BR /&gt;const authCode = document.getElementById("receiptAuth")?.innerText;&lt;BR /&gt;console.log(transactionId);&lt;BR /&gt;console.log(authCode);&lt;BR /&gt;if (transactionId &amp;amp;&amp;amp; authCode) {&lt;BR /&gt;const message = \`action=transactResponse&amp;amp;transactionId=\${transactionId}&amp;amp;authCode=\${authCode}\`;&lt;BR /&gt;parent.postMessage(message, '*');&lt;BR /&gt;console.log(message)&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;`;&lt;BR /&gt;oIframe.setContent(`&lt;BR /&gt;&amp;lt;iframe&lt;BR /&gt;referrerpolicy="no-referrer-when-downgrade"&lt;BR /&gt;frameborder="0"&lt;BR /&gt;width="100%"&lt;BR /&gt;height="95%"&lt;BR /&gt;srcdoc="${sFormHtml.replace(/"/g, '&amp;amp;quot;')}"&amp;gt;&lt;BR /&gt;&amp;lt;/iframe&amp;gt;&lt;BR /&gt;`);&lt;BR /&gt;},&lt;BR /&gt;onMessage: function (event) {&lt;BR /&gt;console.log("Message received: ", event.data);&lt;BR /&gt;const params = this._parseQueryString(event.data);&lt;BR /&gt;if (params.action === "transactResponse") {&lt;BR /&gt;const transactionId = params.transactionId;&lt;BR /&gt;const authCode = params.authCode;&lt;BR /&gt;console.log(`Transaction ID: ${transactionId}, Auth Code: ${authCode}`);&lt;BR /&gt;MessageToast.show(`Transaction ID: ${transactionId}, Auth Code: ${authCode}`);&lt;BR /&gt;} else {&lt;BR /&gt;console.log("Unknown action received from iframe");&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;_parseQueryString: function (str) {&lt;BR /&gt;var params = {};&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;arr.forEach(function (pair) {&lt;BR /&gt;var [key, value] = pair.split('=');&lt;BR /&gt;params[key] = decodeURIComponent(value);&lt;BR /&gt;});&lt;BR /&gt;return params;&lt;BR /&gt;},&lt;BR /&gt;onBack: function () {&lt;BR /&gt;history.go(-1);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2024 13:20:25 GMT</pubDate>
    <dc:creator>Sunil</dc:creator>
    <dc:date>2024-09-27T13:20:25Z</dc:date>
    <item>
      <title>Regarding the usage of Authorize.net API for Payments in SAPUI5 CAPM application</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Regarding-the-usage-of-Authorize-net-API-for-Payments-in-SAPUI5/m-p/90344#M56834</link>
      <description>&lt;P&gt;I have used below API'S by Authorize.net. One is&amp;nbsp;&lt;A href="https://apitest.authorize.net/xml/v1/request.api" target="_blank"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt;&amp;nbsp;and other one is&amp;nbsp;&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment.&amp;nbsp;&lt;/A&gt;&lt;BR /&gt;First API will generate a token for the rendering of Form for Payments page and using that token I will render the form. So, coming to my application development I have a CAP (Cloud Application Programming Model) service which will fetch the token from the API and returns it. And I have a SAPUI5 Fiori application which will call this service and gets the token and placed inside the form rendering for the second API. This works fine and am able to make payments there. But when payment is completed, I am unable to get the transaction Id and authentication code from the payments completed page. Because it was embedded inside an iframe. So, I can't access this using iframe communication response. Till the I can't get the back the messages after payment through iframe communicator. Can you please help me in this. Iam attaching the required files of my code can you please guide me in how to achieve this.&lt;BR /&gt;&lt;BR /&gt;This is my server code to generate token&amp;nbsp;&lt;/P&gt;&lt;P&gt;const cds = require('@sap/cds');&lt;BR /&gt;const axios = require('axios');&lt;/P&gt;&lt;P&gt;module.exports = cds.service.impl(async function () {&lt;BR /&gt;this.on('POST', 'TransactionDetails', async (req) =&amp;gt; {&lt;BR /&gt;const requestData = req.data;&lt;BR /&gt;if (!requestData.merchantName || !requestData.transactionKey || !requestData.customerProfileId) {&lt;BR /&gt;req.error(400, 'Required fields are missing.');&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;const requestPayload = {&lt;BR /&gt;getHostedPaymentPageRequest: {&lt;BR /&gt;merchantAuthentication: {&lt;BR /&gt;name: requestData.merchantName,&lt;BR /&gt;transactionKey: requestData.transactionKey,&lt;BR /&gt;},&lt;BR /&gt;transactionRequest: {&lt;BR /&gt;transactionType: requestData.transactionType,&lt;BR /&gt;amount: requestData.amount.toFixed(2),&lt;BR /&gt;profile: {&lt;BR /&gt;customerProfileId: requestData.customerProfileId,&lt;BR /&gt;},&lt;BR /&gt;customer: {&lt;BR /&gt;email: requestData.customerEmail,&lt;BR /&gt;},&lt;BR /&gt;billTo: {&lt;BR /&gt;firstName: requestData.firstName,&lt;BR /&gt;lastName: requestData.lastName,&lt;BR /&gt;company: requestData.company,&lt;BR /&gt;address: requestData.address,&lt;BR /&gt;city: requestData.city,&lt;BR /&gt;state: requestData.state,&lt;BR /&gt;zip: requestData.zip,&lt;BR /&gt;country: requestData.country,&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;hostedPaymentSettings: {&lt;BR /&gt;setting: JSON.parse(requestData.paymentSettings),&lt;BR /&gt;},&lt;BR /&gt;},&lt;BR /&gt;};&lt;BR /&gt;try {&lt;BR /&gt;const response = await axios.post(&lt;BR /&gt;'&lt;A href="https://apitest.authorize.net/xml/v1/request.api" target="_blank"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt;',&lt;BR /&gt;requestPayload,&lt;BR /&gt;{&lt;BR /&gt;headers: {&lt;BR /&gt;'Content-Type': 'application/json',&lt;BR /&gt;},&lt;BR /&gt;}&lt;BR /&gt;);&lt;BR /&gt;if (response.data.token) {&lt;BR /&gt;return { token: response.data.token };&lt;BR /&gt;} else {&lt;BR /&gt;req.error(500, 'Token not received in response.');&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;} catch (error) {&lt;BR /&gt;req.error(500, `Failed to generate payment token: ${error.message}`);&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the view code of the app is below&lt;/P&gt;&lt;P&gt;&amp;lt;mvc:View&lt;BR /&gt;xmlns:mvc="sap.ui.core.mvc"&lt;BR /&gt;xmlns:core="sap.ui.core"&lt;BR /&gt;xmlns:m="sap.m"&lt;BR /&gt;controllerName="sap.com.payment.controller.View2"&lt;BR /&gt;displayBlock="true"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;m:Page id="pageid" title="Payment Page"&amp;gt;&lt;BR /&gt;&amp;lt;m:content&amp;gt;&lt;BR /&gt;&amp;lt;core:HTML id="htmlID" /&amp;gt;&lt;BR /&gt;&amp;lt;m:Button id="Success" text="Back" press="onBack" /&amp;gt;&lt;BR /&gt;&amp;lt;/m:content&amp;gt;&lt;BR /&gt;&amp;lt;/m:Page&amp;gt;&lt;BR /&gt;&amp;lt;/mvc:View&amp;gt;&lt;/P&gt;&lt;P&gt;This is the controller of js code&lt;/P&gt;&lt;P&gt;sap.ui.define([&lt;BR /&gt;"sap/ui/core/mvc/Controller",&lt;BR /&gt;"sap/m/MessageToast"&lt;BR /&gt;], function (Controller, MessageToast) {&lt;BR /&gt;"use strict";&lt;BR /&gt;return Controller.extend("sap.com.payment.controller.View2", {&lt;BR /&gt;onInit: function () {&lt;BR /&gt;this.oRouter = sap.ui.core.UIComponent.getRouterFor(this);&lt;BR /&gt;this.oRouter.getRoute("View2").attachPatternMatched(this._onObjectMatched, this);&lt;BR /&gt;window.addEventListener("message", this.onMessage.bind(this), false);&lt;BR /&gt;console.log("Message listener added and waiting for iframe messages");&lt;BR /&gt;},&lt;BR /&gt;_onObjectMatched: function (oEvent) {&lt;BR /&gt;var oDetails = JSON.parse(oEvent.getParameter("arguments").Details);&lt;BR /&gt;const requestData = {&lt;BR /&gt;merchantName: oDetails.merchantName,&lt;BR /&gt;transactionKey: oDetails.transactionKey,&lt;BR /&gt;transactionType: oDetails.transactionType,&lt;BR /&gt;amount: parseFloat(oDetails.amount),&lt;BR /&gt;customerProfileId: oDetails.customerProfileId,&lt;BR /&gt;customerEmail: oDetails.customerEmail,&lt;BR /&gt;firstName: oDetails.firstname,&lt;BR /&gt;lastName: oDetails.lastname,&lt;BR /&gt;company: oDetails.company,&lt;BR /&gt;address: oDetails.address,&lt;BR /&gt;city: oDetails.city,&lt;BR /&gt;state: oDetails.state,&lt;BR /&gt;zip: oDetails.zip,&lt;BR /&gt;country: oDetails.country,&lt;BR /&gt;paymentSettings: JSON.stringify([{&lt;BR /&gt;settingName: "hostedPaymentReturnOptions",&lt;BR /&gt;settingValue: "{\"showReceipt\": true, \"url\": \"&lt;A href="https://mysite.com/receipt\" target="_blank"&gt;https://mysite.com/receipt\&lt;/A&gt;", \"cancelUrl\": \"&lt;A href="https://mysite.com/cancel\" target="_blank"&gt;https://mysite.com/cancel\&lt;/A&gt;"}"&lt;BR /&gt;}])&lt;BR /&gt;};&lt;BR /&gt;fetch("/catalog/TransactionDetails", {&lt;BR /&gt;method: "POST",&lt;BR /&gt;headers: {&lt;BR /&gt;"Content-Type": "application/json"&lt;BR /&gt;},&lt;BR /&gt;body: JSON.stringify(requestData)&lt;BR /&gt;})&lt;BR /&gt;.then(response =&amp;gt; response.json())&lt;BR /&gt;.then(data =&amp;gt; {&lt;BR /&gt;if (data.token) {&lt;BR /&gt;this._setFormInIframe(data.token);&lt;BR /&gt;} else {&lt;BR /&gt;MessageToast.show("Token not found in response");&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;.catch(error =&amp;gt; {&lt;BR /&gt;MessageToast.show("Error: " + error.message);&lt;BR /&gt;});&lt;BR /&gt;},&lt;BR /&gt;_setFormInIframe: function (sToken) {&lt;BR /&gt;var oIframe = this.byId("htmlID");&lt;BR /&gt;var sFormHtml = `&lt;BR /&gt;&amp;lt;form method="post" action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;" id="formAuthorizeNetTestPage"&amp;gt;&lt;BR /&gt;&amp;lt;input type="hidden" name="token" value="${sToken}" /&amp;gt;&lt;BR /&gt;&amp;lt;button type="submit" style="display:none;"&amp;gt;Submit&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;document.getElementById('formAuthorizeNetTestPage').submit();&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;window.addEventListener('DOMContentLoaded', function(event) {&lt;BR /&gt;const transactionId = document.getElementById("receiptTransactionId")?.innerText;&lt;BR /&gt;const authCode = document.getElementById("receiptAuth")?.innerText;&lt;BR /&gt;console.log(transactionId);&lt;BR /&gt;console.log(authCode);&lt;BR /&gt;if (transactionId &amp;amp;&amp;amp; authCode) {&lt;BR /&gt;const message = \`action=transactResponse&amp;amp;transactionId=\${transactionId}&amp;amp;authCode=\${authCode}\`;&lt;BR /&gt;parent.postMessage(message, '*');&lt;BR /&gt;console.log(message)&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;`;&lt;BR /&gt;oIframe.setContent(`&lt;BR /&gt;&amp;lt;iframe&lt;BR /&gt;referrerpolicy="no-referrer-when-downgrade"&lt;BR /&gt;frameborder="0"&lt;BR /&gt;width="100%"&lt;BR /&gt;height="95%"&lt;BR /&gt;srcdoc="${sFormHtml.replace(/"/g, '&amp;amp;quot;')}"&amp;gt;&lt;BR /&gt;&amp;lt;/iframe&amp;gt;&lt;BR /&gt;`);&lt;BR /&gt;},&lt;BR /&gt;onMessage: function (event) {&lt;BR /&gt;console.log("Message received: ", event.data);&lt;BR /&gt;const params = this._parseQueryString(event.data);&lt;BR /&gt;if (params.action === "transactResponse") {&lt;BR /&gt;const transactionId = params.transactionId;&lt;BR /&gt;const authCode = params.authCode;&lt;BR /&gt;console.log(`Transaction ID: ${transactionId}, Auth Code: ${authCode}`);&lt;BR /&gt;MessageToast.show(`Transaction ID: ${transactionId}, Auth Code: ${authCode}`);&lt;BR /&gt;} else {&lt;BR /&gt;console.log("Unknown action received from iframe");&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;_parseQueryString: function (str) {&lt;BR /&gt;var params = {};&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;arr.forEach(function (pair) {&lt;BR /&gt;var [key, value] = pair.split('=');&lt;BR /&gt;params[key] = decodeURIComponent(value);&lt;BR /&gt;});&lt;BR /&gt;return params;&lt;BR /&gt;},&lt;BR /&gt;onBack: function () {&lt;BR /&gt;history.go(-1);&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 13:20:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Regarding-the-usage-of-Authorize-net-API-for-Payments-in-SAPUI5/m-p/90344#M56834</guid>
      <dc:creator>Sunil</dc:creator>
      <dc:date>2024-09-27T13:20:25Z</dc:date>
    </item>
  </channel>
</rss>

