<?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 Re: Accept Hosted help with IFrame/Lightbox asp.net in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69094#M42182</link>
    <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1262"&gt;@emlinney&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should be doable. What you do is have your form API call programmed to execute with no button press.&amp;nbsp; &amp;nbsp;As soon as the page loads, you will have a token. The customer then presses the button which submits that token as a POST request to get the form.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Sep 2019 09:02:59 GMT</pubDate>
    <dc:creator>Renaissance</dc:creator>
    <dc:date>2019-09-15T09:02:59Z</dc:date>
    <item>
      <title>Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69085#M42175</link>
      <description>&lt;P&gt;I currently have a SIM style asp.net page that opens the old school Authorize.net hosted page.&amp;nbsp; Currently the page collects transaction details, then posts the collected information to the old Authorize.net hosted page via a single button click. I have been looking at the new Accept Hosted implementations and am trying to get the IFRAME/Lightbox up and running as it is the only scenario that appears to support custom reciepts and redirecting (we email our own receipt and redirect to a confirmation page).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So modifying the IFrame/Lightbox code shown on&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/features/accept_hosted.html#Displaying_the_Form " target="_self"&gt;https://developer.authorize.net/api/reference/features/accept_hosted.html#Displaying_the_Form &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to obtain a token when the button is clicked, however, I have not been able to display the hosted form in the IFrame/Lightbox.&amp;nbsp; I obtain the token in the asp.net codebehind the page, but can't seem to pass it back out to the AuthorizeNetPopup.openPopup or alternately execute the AuthorizeNetPopup.openPopup script from the codebehind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, what I am wanting to do is obtain the token and display the accept hosted page in an IFrame/Lightbox with a single button click in an asp.net page and I can't seem to figure out how to make that happen, or if it is even possible.&amp;nbsp; Any thoughts/samples would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 19:25:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69085#M42175</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-13T19:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69094#M42182</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1262"&gt;@emlinney&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It should be doable. What you do is have your form API call programmed to execute with no button press.&amp;nbsp; &amp;nbsp;As soon as the page loads, you will have a token. The customer then presses the button which submits that token as a POST request to get the form.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2019 09:02:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69094#M42182</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-15T09:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69109#M42196</link>
      <description>&lt;P&gt;This is my .aspx proof of concept page that is mostly made up of the sample page I linked to in my original post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%@ Page Language="vb" AutoEventWireup="false" Codebehind="testaccepthosted.aspx.vb" Inherits="Adv.FoundationWebPages.Website.accepthosted"%&amp;gt;&lt;BR /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;BR /&gt;&amp;lt;HTML&amp;gt;&lt;BR /&gt;&amp;lt;HEAD&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;accept hosted test&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="vs_defaultClientScript" content="JavaScript"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="vs_targetSchema" content="&lt;A href="http://schemas.microsoft.com/intellisense/ie5" target="_blank"&gt;http://schemas.microsoft.com/intellisense/ie5&lt;/A&gt;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;meta name="vs_defaultClientScript" content="JavaScript" /&amp;gt;&lt;BR /&gt;&amp;lt;meta name="vs_targetSchema" content="&lt;A href="http://schemas.microsoft.com/intellisense/ie5" target="_blank"&gt;http://schemas.microsoft.com/intellisense/ie5&lt;/A&gt;" /&amp;gt;&lt;BR /&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript" src="Scripts/jquery-1.12.2.js"&amp;gt;&amp;lt;/script&amp;gt;--&amp;gt;&lt;BR /&gt;&amp;lt;script type="text/javascript" src="Scripts/jquery.unobtrusive-ajax.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script type="text/javascript" src="Scripts/bootstrap.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script type="text/javascript" src="Scripts/jquery-3.4.1.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script type="text/javascript" src="Scripts/jquery-3.4.1.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style type="text/css"&amp;gt;&lt;/P&gt;&lt;P&gt;body {&lt;BR /&gt;margin: 0px;&lt;BR /&gt;padding: 0px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#divAuthorizeNetPopupScreen {&lt;BR /&gt;left: 0px;&lt;BR /&gt;top: 0px;&lt;BR /&gt;width: 100%;&lt;BR /&gt;height: 100%;&lt;BR /&gt;z-index: 1;&lt;BR /&gt;background-color: #808080;&lt;BR /&gt;opacity: 0.5;&lt;BR /&gt;-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=50)';&lt;BR /&gt;filter: alpha(opacity=50);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#divAuthorizeNetPopup {&lt;BR /&gt;position: absolute;&lt;BR /&gt;left: 50%;&lt;BR /&gt;top: 50%;&lt;BR /&gt;margin-left: -200px;&lt;BR /&gt;margin-top: -200px;&lt;BR /&gt;z-index: 2;&lt;BR /&gt;overflow: visible;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupOuter {&lt;BR /&gt;background-color: #dddddd;&lt;BR /&gt;border-width: 1px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: #a0a0a0 #909090 #909090 #a0a0a0;&lt;BR /&gt;padding: 4px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupTop {&lt;BR /&gt;height: 23px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupClose {&lt;BR /&gt;position: absolute;&lt;BR /&gt;right: 7px;&lt;BR /&gt;top: 7px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupClose a {&lt;BR /&gt;background-image: url('content/closeButton1.png');&lt;BR /&gt;background-repeat: no-repeat;&lt;BR /&gt;height: 16px;&lt;BR /&gt;width: 16px;&lt;BR /&gt;display: inline-block;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupClose a:hover {&lt;BR /&gt;background-image: url('content/closeButton1h.png');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupClose a:active {&lt;BR /&gt;background-image: url('content/closeButton1a.png');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupInner {&lt;BR /&gt;background-color: #ffffff;&lt;BR /&gt;border-width: 2px;&lt;BR /&gt;border-style: solid;&lt;BR /&gt;border-color: #cfcfcf #ebebeb #ebebeb #cfcfcf;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupBottom {&lt;BR /&gt;height: 30px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupGrayFrameTheme .AuthorizeNetPopupLogo {&lt;BR /&gt;position: absolute;&lt;BR /&gt;right: 9px;&lt;BR /&gt;bottom: 4px;&lt;BR /&gt;width: 200px;&lt;BR /&gt;height: 25px;&lt;BR /&gt;background-image: url('content/powered_simple.png');&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.AuthorizeNetPopupSimpleTheme .AuthorizeNetPopupOuter {&lt;BR /&gt;border: 1px solid #585858;&lt;BR /&gt;background-color: #ffffff;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&amp;lt;/HEAD&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;body MS_POSITIONING="FlowLayout" &amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;form id="Form1" method="post" runat="server"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;asp:Button ID="button1" Runat="server" Text="Process Credit Card" &amp;gt;&amp;lt;/asp:Button&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/form&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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="formAuthorizeNetPopup" name="formAuthorizeNetPopup" target="iframeAuthorizeNet" style="display:none;"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;input type="hidden" id="popupToken" name="token" value="" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/form&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;br /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;div id="divAuthorizeNetPopup" style="display:none;" class="AuthorizeNetPopupGrayFrameTheme"&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupOuter"&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupTop"&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupClose"&amp;gt;&lt;BR /&gt;&amp;lt;a href="javascript&amp;amp;colon;;" onclick="AuthorizeNetPopup.closePopup();" title="Close"&amp;gt; &amp;lt;/a&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupInner"&amp;gt;&lt;BR /&gt;&amp;lt;iframe name="iframeAuthorizeNet" id="iframeAuthorizeNet" src="empty.html" frameborder="0" scrolling="no" width="100%" height="650px"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupBottom"&amp;gt;&lt;BR /&gt;&amp;lt;div class="AuthorizeNetPopupLogo" title="Powered by Authorize.Net"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;div id="divAuthorizeNetPopupScreen" style="display:none;"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt;(function () {&lt;BR /&gt;if (!window.AuthorizeNetPopup) window.AuthorizeNetPopup = {};&lt;BR /&gt;if (!AuthorizeNetPopup.options) AuthorizeNetPopup.options = {&lt;BR /&gt;onPopupClosed: null&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;AuthorizeNetPopup.closePopup = function () {&lt;BR /&gt;document.getElementById("divAuthorizeNetPopupScreen").style.display = "none";&lt;BR /&gt;document.getElementById("divAuthorizeNetPopup").style.display = "none";&lt;BR /&gt;document.getElementById("iframeAuthorizeNet").src="empty.html";&lt;BR /&gt;document.getElementById("btnOpenAuthorizeNetPopup").disabled = false;&lt;BR /&gt;if (AuthorizeNetPopup.options.onPopupClosed) AuthorizeNetPopup.options.onPopupClosed();&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;AuthorizeNetPopup.openPopup = function () {&lt;BR /&gt;alert('you are in popup!');&lt;BR /&gt;var popup = document.getElementById("divAuthorizeNetPopup");&lt;BR /&gt;var popupScreen = document.getElementById("divAuthorizeNetPopupScreen");&lt;BR /&gt;var ifrm = document.getElementById("iframeAuthorizeNet");&lt;BR /&gt;var form = document.forms["formAuthorizeNetPopup"];&lt;BR /&gt;$("#popupToken").val($("&amp;lt;% = thetoken %&amp;gt;").val());&lt;BR /&gt;form.action = "&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;";&lt;BR /&gt;ifrm.style.width = "442px";&lt;BR /&gt;ifrm.style.height = "578px";&lt;/P&gt;&lt;P&gt;form.submit();&lt;/P&gt;&lt;P&gt;popup.style.display = "";&lt;BR /&gt;popupScreen.style.display = "";&lt;BR /&gt;centerPopup();&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;AuthorizeNetPopup.onReceiveCommunication = function (querystr) {&lt;BR /&gt;var params = parseQueryString(querystr);&lt;BR /&gt;switch (params["action"]) {&lt;BR /&gt;case "successfulSave":&lt;BR /&gt;AuthorizeNetPopup.closePopup();&lt;BR /&gt;break;&lt;BR /&gt;case "cancel":&lt;BR /&gt;AuthorizeNetPopup.closePopup();&lt;BR /&gt;break;&lt;BR /&gt;case "transactResponse":&lt;BR /&gt;var response = params["response"];&lt;BR /&gt;document.getElementById("token").value = response;&lt;BR /&gt;AuthorizeNetPopup.closePopup();&lt;BR /&gt;break;&lt;BR /&gt;case "resizeWindow":&lt;BR /&gt;var w = parseInt(params["width"]);&lt;BR /&gt;var h = parseInt(params["height"]);&lt;BR /&gt;var ifrm = document.getElementById("iframeAuthorizeNet");&lt;BR /&gt;ifrm.style.width = w.toString() + "px";&lt;BR /&gt;ifrm.style.height = h.toString() + "px";&lt;BR /&gt;centerPopup();&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function centerPopup() {&lt;BR /&gt;var d = document.getElementById("divAuthorizeNetPopup");&lt;BR /&gt;d.style.left = "50%";&lt;BR /&gt;d.style.top = "50%";&lt;BR /&gt;var left = -Math.floor(d.clientWidth / 2);&lt;BR /&gt;var top = -Math.floor(d.clientHeight / 2);&lt;BR /&gt;d.style.marginLeft = left.toString() + "px";&lt;BR /&gt;d.style.marginTop = top.toString() + "px";&lt;BR /&gt;d.style.zIndex = "2";&lt;BR /&gt;if (d.offsetLeft &amp;lt; 16) {&lt;BR /&gt;d.style.left = "16px";&lt;BR /&gt;d.style.marginLeft = "0px";&lt;BR /&gt;}&lt;BR /&gt;if (d.offsetTop &amp;lt; 16) {&lt;BR /&gt;d.style.top = "16px";&lt;BR /&gt;d.style.marginTop = "0px";&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function parseQueryString(str) {&lt;BR /&gt;var vars = [];&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;var pair;&lt;BR /&gt;for (var i = 0; i &amp;lt; arr.length; i++) {&lt;BR /&gt;pair = arr[i].split('=');&lt;BR /&gt;vars.push(pair[0]);&lt;BR /&gt;vars[pair[0]] = unescape(pair[1]);&lt;BR /&gt;}&lt;BR /&gt;return vars;&lt;BR /&gt;}&lt;BR /&gt;}());&lt;/P&gt;&lt;P&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/HTML&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, I'm trying to develop a proof of concept for the page that I need to incorporate this into.&amp;nbsp; That page is just a form that donors to our foundation fill out noting how much they would like to donate. They would then click a button which should generate the token and display the credit card payment. page.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 18:54:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69109#M42196</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-16T18:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69110#M42197</link>
      <description>&lt;P&gt;And the codebehind page...there is extra code in here from stuff that I have tried which did not seem to work...hopefully someone will see something that can get me going in the right direction.&amp;nbsp; I can generate the token, but can't seem to display the accept hosted form in the lightbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Imports plg = Adv.FoundationWebPages.Forms.Business&lt;BR /&gt;Imports Adv.FoundationWebPages.Security.Business&lt;BR /&gt;Imports System.Net&lt;BR /&gt;Imports System.Web.Services&lt;BR /&gt;Imports System.Text&lt;BR /&gt;Imports System.IO&lt;BR /&gt;Imports System.Data&lt;BR /&gt;Imports System.Linq&lt;BR /&gt;Imports System.IO.TextReader&lt;BR /&gt;Imports Newtonsoft.Json&lt;/P&gt;&lt;P&gt;Partial Class accepthosted&lt;BR /&gt;Inherits BasePage&lt;/P&gt;&lt;P&gt;Dim solicitation As String&lt;BR /&gt;Dim systemsolic As String&lt;BR /&gt;Dim millid As String&lt;BR /&gt;Dim college As String&lt;BR /&gt;Dim department As String&lt;BR /&gt;Dim project As String&lt;BR /&gt;Public myidnumber As String&lt;BR /&gt;Dim x As Integer&lt;BR /&gt;Dim myURL As String&lt;/P&gt;&lt;P&gt;Dim otherrowcount As Integer&lt;BR /&gt;Dim rowcount As Integer&lt;BR /&gt;Dim itemcount As Integer&lt;BR /&gt;Dim dataitemcount As Integer&lt;BR /&gt;Dim TotalDonation As Double = 0&lt;BR /&gt;Dim SubTotal As Double = 0&lt;BR /&gt;Dim activeProtocol As SecurityProtocolType = ServicePointManager.SecurityProtocol 'TLS 1.2 support&lt;BR /&gt;Public mytoken As String '8/30/19&lt;BR /&gt;Public thetoken As String '9/09/19&lt;BR /&gt;Public myreturnURL As String '8/30/19&lt;BR /&gt;Dim x_login As String&lt;BR /&gt;Dim x_tran_key As String&lt;BR /&gt;Dim x_signature_key As String 'signature key is not an actual NVP for Auth.net just wanted the variable to follow the convention&lt;BR /&gt;Dim myPaymentFormUri As New Uri("&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;") '8/30/19&lt;BR /&gt;Dim myTokenUri As New Uri("&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;") '8/30/19&lt;BR /&gt;Dim addsettings As String&lt;/P&gt;&lt;P&gt;Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;/P&gt;&lt;P&gt;Dim objAuth As New AuthCode(True, "S") ' Change to S for sandbox acct F for foundation&lt;BR /&gt;x_login = objAuth.AuthLogin&lt;BR /&gt;x_tran_key = objAuth.AuthTransKey&lt;BR /&gt;x_signature_key = objAuth.AuthSigKey&lt;/P&gt;&lt;P&gt;' set up fingerprint&lt;BR /&gt;Dim random As New Random&lt;BR /&gt;Dim x_fp_sequence = random.Next(0, 1000)&lt;BR /&gt;Dim x_fp_timestamp = CInt(DateDiff(DateInterval.Second, DateTime.UtcNow, New DateTime(1970, 1, 1)) * -1)&lt;BR /&gt;Dim x_fp_hash = GetAuthorizeNetHMACSHA512(x_signature_key, x_login &amp;amp; "^" &amp;amp; x_fp_sequence &amp;amp; "^" &amp;amp; x_fp_timestamp &amp;amp; "^" &amp;amp; Request.Form("x_amount") &amp;amp; "^")&lt;/P&gt;&lt;P&gt;'Put user code to initialize the page here&lt;BR /&gt;If Not Page.IsPostBack Then&lt;BR /&gt;Try&lt;/P&gt;&lt;P&gt;Catch ex As ExecutionEngineException&lt;BR /&gt;'add redirect to error page&lt;BR /&gt;End Try&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;BR /&gt;Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click&lt;BR /&gt;Dim CCFrequency, PaymentType As String&lt;BR /&gt;Dim PrintFlg As Boolean&lt;BR /&gt;PrintFlg = False&lt;BR /&gt;PaymentType = "O"&lt;BR /&gt;PosttoProcessingCenter("0000", PrintFlg, PaymentType, 5.82, "IA")&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Sub PosttoProcessingCenter(ByVal pledgeid As Integer, ByVal PrintFlg As Boolean, ByVal PaymentType As String, ByVal ChargeAmt As Double, ByVal State As String)&lt;BR /&gt;Dim testrequest As String&lt;BR /&gt;Dim e As EventArgs&lt;BR /&gt;testrequest = System.Configuration.ConfigurationSettings.AppSettings("ccTestSupportUNI")&lt;/P&gt;&lt;P&gt;Dim myremotepost As RemotePostwTarget = New RemotePostwTarget&lt;BR /&gt;'Dim myremotepost As RemotePost = New RemotePost&lt;/P&gt;&lt;P&gt;Dim cust_id As String&lt;/P&gt;&lt;P&gt;If Request("m") &amp;gt; 0 Then&lt;BR /&gt;cust_id = Request("m")&lt;BR /&gt;Else&lt;BR /&gt;cust_id = "0"&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;Dim x_source = "Sandbox"&lt;BR /&gt;Dim x_source_key = pledgeid&lt;BR /&gt;Dim x_cust_id = "0"&lt;BR /&gt;Dim x_amount = ChargeAmt&lt;BR /&gt;Dim x_first_name = "TEST"&lt;BR /&gt;Dim x_last_name = "AcceptHostedTESTING"&lt;BR /&gt;Dim x_address1 = "zzz Commons"&lt;BR /&gt;Dim x_address2 = ""&lt;BR /&gt;Dim x_address3 = ""&lt;BR /&gt;Dim x_city = "CF"&lt;BR /&gt;Dim x_state = State&lt;BR /&gt;Dim x_zip = "50000"&lt;BR /&gt;Dim x_country = "United States"&lt;BR /&gt;Dim x_phone = "1234567890"&lt;BR /&gt;Dim x_email = "test.accepthosted@test.com"&lt;BR /&gt;Dim x_URL = "&lt;A href="https://www.adv.uni.edu/foundation/pledgeConfirm.aspx?PK=" target="_blank"&gt;https://www.adv.uni.edu/foundation/pledgeConfirm.aspx?PK=&lt;/A&gt;" &amp;amp; pledgeid &amp;amp; "&amp;amp;PrntFlg=" &amp;amp; PrintFlg &amp;amp; "&amp;amp;PayType=" &amp;amp; PaymentType&lt;BR /&gt;Dim x_test_request = testrequest&lt;BR /&gt;Dim token = ""&lt;/P&gt;&lt;P&gt;Dim mytransaction As New Transaction&lt;BR /&gt;mytransaction.apiloginid = x_login&lt;BR /&gt;mytransaction.apitransactionkey = x_tran_key&lt;BR /&gt;mytransaction.firstname = x_first_name&lt;BR /&gt;mytransaction.lastname = x_last_name&lt;BR /&gt;mytransaction.address = x_address1 + " " + x_address2 + " " + x_address3&lt;BR /&gt;mytransaction.city = x_city&lt;BR /&gt;mytransaction.state = x_state&lt;BR /&gt;mytransaction.zip = x_zip&lt;BR /&gt;mytransaction.amount = x_amount&lt;BR /&gt;mytransaction.source = x_source&lt;BR /&gt;mytransaction.cust_id = x_cust_id&lt;BR /&gt;mytransaction.phone = x_phone&lt;BR /&gt;mytransaction.email = x_email&lt;BR /&gt;mytransaction.return_url = x_URL&lt;BR /&gt;myreturnURL = mytransaction.return_url + "\"&lt;/P&gt;&lt;P&gt;Dim invoiceNum As String&lt;BR /&gt;invoiceNum = mytransaction.source + "_" + mytransaction.source&lt;/P&gt;&lt;P&gt;Dim JSONtokenstring&lt;BR /&gt;Dim JSONpformstring&lt;BR /&gt;JSONtokenstring = "{ ""getHostedPaymentPageRequest"": { ""merchantAuthentication"": { ""name"": """ + x_login + """,""transactionKey"": """ + x_tran_key + """ } ,""transactionRequest"": { ""transactionType"": ""authCaptureTransaction"",""amount"": """ + mytransaction.amount + """,""order"":{""invoiceNumber"": """ + invoiceNum + """, ""description"": ""AF gift""},""customer"":{""email"":""" + mytransaction.email + """},""billTo"":{""firstName"":""" + mytransaction.firstname + """,""lastName"":""" + mytransaction.lastname + """,""address"":""" + mytransaction.address + """,""city"":""" + mytransaction.city + """,""state"":""" + mytransaction.state + """,""zip"":""" + mytransaction.zip + """,""country"":""" + mytransaction.country + """,""phoneNumber"":""" + mytransaction.phone + """} }, " ' ""hostedPaymentSettings"": { ""setting"": [{""settingName"": ""hostedPaymentButtonOptions"",""settingValue"": ""{\""text\"":\""Pay\"" }"" }] } }"&lt;BR /&gt;addsettings = PaymentFormSettings()&lt;BR /&gt;JSONtokenstring = JSONtokenstring + addsettings + "] } }"&lt;/P&gt;&lt;P&gt;Dim tokendata As Byte() = Encoding.UTF8.GetBytes(JSONtokenstring)&lt;/P&gt;&lt;P&gt;Dim result_post = SendRequest(myTokenUri, tokendata, "application/json", "POST")&lt;/P&gt;&lt;P&gt;Dim mymessage = JsonConvert.DeserializeObject(result_post)&lt;BR /&gt;If mymessage("messages")("message")(0)("code").ToString = "I00001" Then&lt;/P&gt;&lt;P&gt;JSONpformstring = """token"""":""" &amp;amp; mymessage("token").ToString &amp;amp; """"&lt;/P&gt;&lt;P&gt;Dim pformdata As Byte() = Encoding.UTF8.GetBytes(JSONpformstring)&lt;BR /&gt;Dim payment_form_result = SendRequest(myPaymentFormUri, pformdata, "application/text", "POST")&lt;BR /&gt;thetoken = mymessage("token").ToString&lt;/P&gt;&lt;P&gt;Else&lt;BR /&gt;Response.Write("&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;You failed!")&lt;BR /&gt;Response.Write("&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Result Code: " &amp;amp; mymessage("messages")("resultCode").ToString)&lt;BR /&gt;Response.Write("&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Result Message Code: " &amp;amp; mymessage("messages")("message")(0)("code").ToString)&lt;BR /&gt;Response.Write("&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;Result Message Code text: " &amp;amp; mymessage("messages")("message")(0)("text").ToString)&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Shared Function GetAuthorizeNetHMACSHA512(ByVal key As String, ByVal textToHash As String)&lt;/P&gt;&lt;P&gt;If String.IsNullOrEmpty(key) Then Return ""&lt;BR /&gt;If String.IsNullOrEmpty(textToHash) Then Return ""&lt;/P&gt;&lt;P&gt;If key.Length Mod 2 &amp;lt;&amp;gt; 0 OrElse key.Trim().Length &amp;lt; 2 Then&lt;BR /&gt;Return ""&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;Try&lt;BR /&gt;Dim k As Byte() = Enumerable.Range(0, key.Length).Where(Function(x) x Mod 2 = 0).[Select](Function(x) Convert.ToByte(key.Substring(x, 2), 16)).ToArray()&lt;BR /&gt;Dim hmac As System.Security.Cryptography.HMACSHA512 = New System.Security.Cryptography.HMACSHA512(k)&lt;BR /&gt;Dim HashedValue As Byte() = hmac.ComputeHash((New System.Text.ASCIIEncoding()).GetBytes(textToHash))&lt;BR /&gt;Return BitConverter.ToString(HashedValue).Replace("-", String.Empty)&lt;BR /&gt;Catch ex As Exception&lt;BR /&gt;Return ""&lt;BR /&gt;End Try&lt;/P&gt;&lt;P&gt;End Function&lt;BR /&gt;Class Transaction&lt;BR /&gt;Public apiloginid As String&lt;BR /&gt;Public apitransactionkey As String&lt;BR /&gt;Public firstname As String&lt;BR /&gt;Public lastname As String&lt;BR /&gt;Public amount As String&lt;BR /&gt;Public address As String&lt;BR /&gt;Public city As String&lt;BR /&gt;Public state As String&lt;BR /&gt;Public zip As String&lt;BR /&gt;Public source As String&lt;BR /&gt;Public source_key As String&lt;BR /&gt;Public cust_id As String&lt;BR /&gt;Public country As String&lt;BR /&gt;Public phone As String&lt;BR /&gt;Public email As String&lt;BR /&gt;Public return_url As String&lt;BR /&gt;Public test_req As String&lt;/P&gt;&lt;P&gt;End Class&lt;BR /&gt;&lt;BR /&gt;Private Function PaymentFormSettings()&lt;BR /&gt;Dim settings As String&lt;BR /&gt;Dim style As String&lt;BR /&gt;Dim paybutton As String&lt;BR /&gt;Dim showaddress As String&lt;BR /&gt;Dim showbankaccount As String&lt;BR /&gt;Dim showemail As String&lt;BR /&gt;Dim orderoptions As String&lt;BR /&gt;Dim returnoptions As String&lt;BR /&gt;Dim bgcolor As String&lt;BR /&gt;Dim iframecommunicator As String&lt;/P&gt;&lt;P&gt;settings = """hostedPaymentSettings"" : { ""setting"" : [{"&lt;BR /&gt;style = """settingName"" : ""hostedPaymentStyleOptions"",""settingValue"" : ""{\""bgColor\"":\""#4B116F\"" }"" },"&lt;BR /&gt;paybutton = "{""settingName"" : ""hostedPaymentButtonOptions"",""settingValue"" : ""{\""text\"":\""Complete Donation\"" }"" },"&lt;BR /&gt;showaddress = "{""settingName"" : ""hostedPaymentBillingAddressOptions"",""settingValue"" : ""{\""show\"":true }"" },"&lt;BR /&gt;showbankaccount = "{""settingName"" : ""hostedPaymentPaymentOptions"",""settingValue"" : ""{\""showBankAccount\"":false }"" },"&lt;BR /&gt;showemail = "{""settingName"" : ""hostedPaymentCustomerOptions"",""settingValue"" : ""{\""showEmail\"":true }"" },"&lt;BR /&gt;orderoptions = "{""settingName"" : ""hostedPaymentOrderOptions"",""settingValue"" : ""{\""show\"":true,\""merchantName\"":\""Foundation\"" }"" },"&lt;BR /&gt;iframecommunicator = "{""settingName"" : ""hostedPaymentIFrameCommunicatorUrl"",""settingValue"" : ""{\""url\"":\""https://localhost/foundation/IFrameCommunicator.html\"" }"" },"&lt;BR /&gt;returnoptions = "{""settingName"" : ""hostedPaymentReturnOptions"",""settingValue"" : ""{\""showReceipt\"":false,\""cancelUrl\"": \""https://localhost/foundation/pledgeform.aspx\"",\""cancelUrlText\"":\""Cancel\"" }"" }"&lt;BR /&gt;settings = settings + style + paybutton + showaddress + showbankaccount + showemail + orderoptions + iframecommunicator + returnoptions&lt;BR /&gt;Return settings&lt;BR /&gt;End Function&lt;BR /&gt;&lt;BR /&gt;Private Function SendRequest(uri As Uri, jsonDataBytes As Byte(), contentType As String, method As String) As String&lt;BR /&gt;Dim req As WebRequest = WebRequest.Create(uri)&lt;BR /&gt;req.ContentType = contentType&lt;BR /&gt;req.Method = method&lt;BR /&gt;req.ContentLength = jsonDataBytes.Length&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim stream = req.GetRequestStream()&lt;BR /&gt;stream.Write(jsonDataBytes, 0, jsonDataBytes.Length)&lt;BR /&gt;stream.Close()&lt;/P&gt;&lt;P&gt;Dim response As Stream = req.GetResponse().GetResponseStream()&lt;/P&gt;&lt;P&gt;'Dim reader As New StreamReader(response, Encoding.UTF8)&lt;BR /&gt;Dim reader As New StreamReader(response, Encoding.ASCII)&lt;BR /&gt;Dim res = reader.ReadToEnd()&lt;BR /&gt;reader.Close()&lt;BR /&gt;response.Close()&lt;/P&gt;&lt;P&gt;Return res&lt;BR /&gt;End Function&lt;BR /&gt;&lt;BR /&gt;Private Function GetPaymentForm(ByVal JsonData As String) As HttpWebRequest&lt;BR /&gt;Dim objhttpWebRequest As HttpWebRequest&lt;BR /&gt;Try&lt;BR /&gt;Dim httpWebRequest = DirectCast(WebRequest.Create("&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;"), HttpWebRequest)&lt;BR /&gt;httpWebRequest.ContentType = "application/json"&lt;BR /&gt;httpWebRequest.Method = "POST"&lt;/P&gt;&lt;P&gt;Using streamWriter = New StreamWriter(httpWebRequest.GetRequestStream().ToString)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;streamWriter.Write(JsonData)&lt;BR /&gt;streamWriter.Flush()&lt;BR /&gt;streamWriter.Close()&lt;BR /&gt;End Using&lt;/P&gt;&lt;P&gt;objhttpWebRequest = httpWebRequest&lt;/P&gt;&lt;P&gt;Catch ex As Exception&lt;BR /&gt;Response.Write("Send Request Error[{0}]" + ex.Message)&lt;/P&gt;&lt;P&gt;Return Nothing&lt;BR /&gt;End Try&lt;/P&gt;&lt;P&gt;Return objhttpWebRequest&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End Class&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 18:57:18 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69110#M42197</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-16T18:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69111#M42198</link>
      <description>&lt;P&gt;Thank you for the reply and the suggestion.&amp;nbsp; I'm just not sure how to do what you propose.&amp;nbsp; Our current form takes in an amount and uses the button click to initiate the "get token" process. It is at that point that I can't figure out how to launch the accept hosted form in an iframe/lightbox.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 19:00:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69111#M42198</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-16T19:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69123#M42208</link>
      <description>&lt;P&gt;Finally got this to work.&amp;nbsp; In the HTML code I removed the following lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$("#popupToken").val($("&amp;lt;% = thetoken %&amp;gt;").val());
form.action = "https://test.authorize.net/payment/payment";&lt;/PRE&gt;&lt;P&gt;and in the&amp;nbsp;Sub PosttoProcessingCenter subroutine of the .aspx code behind I added:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ScriptManager.RegisterClientScriptBlock(Page, GetType(String), "Javascript", "AuthorizeNetPopup.openPopup(); return false;", True)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;just below the line:&lt;/P&gt;&lt;PRE&gt;thetoken = mymessage("token").ToString&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:22:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69123#M42208</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-17T19:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69125#M42210</link>
      <description>&lt;P&gt;Glad you found your solution. There are many ways to go about this. I am building an iframe integration right now and I have my token generated entirely with values that are pulled from the customers records in the database.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:38:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69125#M42210</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-17T19:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69126#M42211</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Glad you found your solution. There are many ways to go about this. I am building an iframe integration right now and I have my token generated entirely with values that are pulled from the customers records in the database.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Interesting.&amp;nbsp; If you have some time, would you be able to briefly explain how you are doing that? I thought a token could only be generated if you had an amount to pass along to the API.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2019 19:50:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69126#M42211</guid>
      <dc:creator>emlinney</dc:creator>
      <dc:date>2019-09-17T19:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted help with IFrame/Lightbox asp.net</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69166#M42247</link>
      <description>&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/1262"&gt;@emlinney&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;That is correct. I have a Review Your Order page and then the next button click takes them to the iframe payment page. On the iframe payment page all of the customers info, including the products in their cart, are pulled from the dB and those are used to calculate the amount to make the api call. The api call is made by the server side code and JavaScript loads the iframe on load.</description>
      <pubDate>Thu, 19 Sep 2019 16:27:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-help-with-IFrame-Lightbox-asp-net/m-p/69166#M42247</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-19T16:27:32Z</dc:date>
    </item>
  </channel>
</rss>

