Reply
Member
Posts: 6
Registered: ‎10-05-2017

Accept Hosted Form not working on some computers

I have been using the Accept Hosted Form for a couple of months now and I am having some intermittent issues bringing up the payment page.

 

I am using c# and mvc. I get a token and the partial view that uses the token is below:

 

@model Nop.Plugin.Payments.AuthorizeNet.Models.HostedFormResponse
@using Nop.Web.Framework;

<div class="page checkout-page payment-info-page">

<form id="send_hptoken" name="send_hptoken" action="@(Model.orderTokenUrl)" method="post" target="load_payment">
<input type="hidden" name="token" value="@(Model.orderToken)" />
</form>
<iframe id="load_payment" class="embed-responsive-item" name="load_payment" width="100%" height="1200px" frameborder="0" scrolling="no"></iframe>
</div>
<script>
window.onload = function () {
document.getElementById('send_hptoken').submit();
}

// Find all iframes
var $iframes = $("iframe");

// Find &#x26; save the aspect ratio for all iframes
$iframes.each(function () {
$(this).data("width", this.width)
// Remove the hardcoded width &#x26; height attributes
.removeAttr("height");
});

// Resize the iframes when the window is resized
$(window).resize(function () {
$iframes.each(function () {
// Get the parent container&#x27;s width
var width = $(this).parent().width();
$(this).width(width)
.height(width < 800 ? 1400 : 1000);
});
// Resize to fix all iframes on page load.
}).resize();

</script>

 

This view is used to show the Hosted payment form but some computers cannot see the form no matter what they do. The number of computers having this problem is around 1%.

 

The OS in Windows(7.0, 8.1, 10), the browser is either ie11 or firefox 55.0.

 

I am trying to simulate this issue. Of course only my customers are the only users having the problem.

 

Any help here would be appreciated.

 

Thanks in advance!

 

 

 

Member
Posts: 6
Registered: ‎10-05-2017

Re: Accept Hosted Form not working on some computers

I wonder if the issue is cache related. I wonder if the payment page is cached and if so, the token may not get updated.

 

I will try this and let you know.

Highlighted
Member
Posts: 6
Registered: ‎10-05-2017

Re: Accept Hosted Form not working on some computers

I finally got a screenshot from one of our customers that has the problem

 

The customers are getting the payment page but they are unable to enter any data into the payment form.

 

I see no other traffic in the weblogs. It all stops on that page.

 

Please help!

Member
Posts: 6
Registered: ‎10-05-2017

Re: Accept Hosted Form not working on some computers

I found that some of the browsers do not allow iframes so the payment page displays i another window which breaks my communication listener.

 

I guess my only option is to detect if iframes are allowed and display a message not accepting payment.

 

Is there a way for this to work outside of iframes? If so, what is the alternative?

 

Thanks!

Posts: 213
Kudos: 35
Solutions: 22
Registered: ‎03-13-2017

Re: Accept Hosted Form not working on some computers

Hi @gman11980

 

You can also use the  REDIRECT METHOD

 

https://developer.authorize.net/api/reference/features/accept_hosted.html#Displaying_the_Form

 

 

Follow me at

https://twitter.com/anuragg29

https://www.linkedin.com/in/anuragg



Send feedback at developer_feedback@authorize.net
Member
Posts: 6
Registered: ‎10-05-2017

Re: Accept Hosted Form not working on some computers

Thanks for your response.

 

How would I get the transactionId and other info back to my application?

 

I do not see any samples for the redirect method.

 

Thanks!