<?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 Accept Hosted Embedded IFrame problems in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Embedded-IFrame-problems/m-p/85542#M53811</link>
    <description>&lt;P&gt;I am trying to use Accept Hosted to display the payment form in an embedded iframe on a django website.&amp;nbsp; I have been able to get a form token back using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;headers = {"Content-Type": "application/json"}
return_options = {
    "settingName": "hostedPaymentReturnOptions",
    "settingValue": f"{{\"showReceipt\": false, \"url\": \"{order_complete_url}\"}}"
}
button_options = {
    "settingName": "hostedPaymentButtonOptions",
    "settingValue": '{\"text\": \"Pay\"}',
}
style_options = {"settingName": "hostedPaymentStyleOptions", "settingValue": '{\"bgColor\": \"blue\"}'}
payment_options = {
    "settingName": "hostedPaymentPaymentOptions",
    "settingValue": "{\"cardCodeRequired\": true, \"showCreditCard\": true, \"showBankAccount\": false}"
}
billing_options = {
    "settingName": "hostedPaymentBillingAddressOptions",
    "settingValue": "{\"show\": true, \"required\": false}"
}
iframe_communicator_options = {
    "settingName": "hostedPaymentIFrameCommunicatorUrl",
    "settingValue": f"{{\"url\": \"{communicator_url}\"}}"
}
payload = {
    "getHostedPaymentPageRequest": {
        "merchantAuthentication": self.merchant_auth,
        "transactionRequest": {
            "transactionType": "authCaptureTransaction",
            "amount": str(order.grand_total),
            "customer": {
                "email": order.email_address,
            },
            "billTo": {
                "firstName": order.billing_fname,
                "lastName": order.billing_lname,
                "address": f"{order.billing_address_1}, {order.billing_address_2}",
                "city": order.billing_city,
                "state": order.billing_state,
                "zip": order.billing_zipcode,
                "country": order.billing_country,
            },
        },
        "hostedPaymentSettings": {
            "setting": [return_options, button_options, style_options, payment_options, billing_options, iframe_communicator_options]
        }
    }
}
json_payload = json.dumps(payload)
response = requests.post("https://apitest.authorize.net/xml/v1/request.api", headers=headers, data=json_payload)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm passing the form token to the front end from the view and when the page loads I submit this form to send the form token and get the form which is displayed when a credit card option is selected on the page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form id="send_token" action="https://test.authorize.net/payment/payment" method="post" target="add_payment"&amp;gt;
    &amp;lt;input type="hidden" name="token" value="{{ payment_form_token }}" /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The form that gets displayed looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnraber_0-1674594965232.png" style="width: 400px;"&gt;&lt;img src="https://community.developer.cybersource.com/t5/image/serverpage/image-id/2389i67EF9BEF6F36E5FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnraber_0-1674594965232.png" alt="johnraber_0-1674594965232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So it has the order summary, but no actual inputs for credit card or billing information which should be showing up based on the parameters I am sending in the request for the form token.&amp;nbsp; I have tried to set "showBankAccount" to true, but that didn't change the form at all.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jan 2023 21:31:25 GMT</pubDate>
    <dc:creator>john-raber</dc:creator>
    <dc:date>2023-01-24T21:31:25Z</dc:date>
    <item>
      <title>Accept Hosted Embedded IFrame problems</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Embedded-IFrame-problems/m-p/85542#M53811</link>
      <description>&lt;P&gt;I am trying to use Accept Hosted to display the payment form in an embedded iframe on a django website.&amp;nbsp; I have been able to get a form token back using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;headers = {"Content-Type": "application/json"}
return_options = {
    "settingName": "hostedPaymentReturnOptions",
    "settingValue": f"{{\"showReceipt\": false, \"url\": \"{order_complete_url}\"}}"
}
button_options = {
    "settingName": "hostedPaymentButtonOptions",
    "settingValue": '{\"text\": \"Pay\"}',
}
style_options = {"settingName": "hostedPaymentStyleOptions", "settingValue": '{\"bgColor\": \"blue\"}'}
payment_options = {
    "settingName": "hostedPaymentPaymentOptions",
    "settingValue": "{\"cardCodeRequired\": true, \"showCreditCard\": true, \"showBankAccount\": false}"
}
billing_options = {
    "settingName": "hostedPaymentBillingAddressOptions",
    "settingValue": "{\"show\": true, \"required\": false}"
}
iframe_communicator_options = {
    "settingName": "hostedPaymentIFrameCommunicatorUrl",
    "settingValue": f"{{\"url\": \"{communicator_url}\"}}"
}
payload = {
    "getHostedPaymentPageRequest": {
        "merchantAuthentication": self.merchant_auth,
        "transactionRequest": {
            "transactionType": "authCaptureTransaction",
            "amount": str(order.grand_total),
            "customer": {
                "email": order.email_address,
            },
            "billTo": {
                "firstName": order.billing_fname,
                "lastName": order.billing_lname,
                "address": f"{order.billing_address_1}, {order.billing_address_2}",
                "city": order.billing_city,
                "state": order.billing_state,
                "zip": order.billing_zipcode,
                "country": order.billing_country,
            },
        },
        "hostedPaymentSettings": {
            "setting": [return_options, button_options, style_options, payment_options, billing_options, iframe_communicator_options]
        }
    }
}
json_payload = json.dumps(payload)
response = requests.post("https://apitest.authorize.net/xml/v1/request.api", headers=headers, data=json_payload)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I'm passing the form token to the front end from the view and when the page loads I submit this form to send the form token and get the form which is displayed when a credit card option is selected on the page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form id="send_token" action="https://test.authorize.net/payment/payment" method="post" target="add_payment"&amp;gt;
    &amp;lt;input type="hidden" name="token" value="{{ payment_form_token }}" /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The form that gets displayed looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="johnraber_0-1674594965232.png" style="width: 400px;"&gt;&lt;img src="https://community.developer.cybersource.com/t5/image/serverpage/image-id/2389i67EF9BEF6F36E5FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="johnraber_0-1674594965232.png" alt="johnraber_0-1674594965232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So it has the order summary, but no actual inputs for credit card or billing information which should be showing up based on the parameters I am sending in the request for the form token.&amp;nbsp; I have tried to set "showBankAccount" to true, but that didn't change the form at all.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2023 21:31:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Embedded-IFrame-problems/m-p/85542#M53811</guid>
      <dc:creator>john-raber</dc:creator>
      <dc:date>2023-01-24T21:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Accept Hosted Embedded IFrame problems</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Embedded-IFrame-problems/m-p/85588#M53841</link>
      <description>&lt;P&gt;The issue ended up being that my site was using a different version of bootstrap and jquery than what the examples were using.&amp;nbsp; When I updated my versions to match up with the example app here: &lt;A href="https://github.com/AuthorizeNet/webhooks-sample-app" target="_blank"&gt;https://github.com/AuthorizeNet/webhooks-sample-app&lt;/A&gt;&amp;nbsp;the inputs started to work as expected.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 20:39:09 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Accept-Hosted-Embedded-IFrame-problems/m-p/85588#M53841</guid>
      <dc:creator>john-raber</dc:creator>
      <dc:date>2023-01-30T20:39:09Z</dc:date>
    </item>
  </channel>
</rss>

