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 & save the aspect ratio for all iframes
$iframes.each(function () {
$(this).data("width", this.width)
// Remove the hardcoded width & height attributes
.removeAttr("height");
});
// Resize the iframes when the window is resized
$(window).resize(function () {
$iframes.each(function () {
// Get the parent container'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!
10-05-2017 07:09 PM
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.
10-06-2017 07:24 AM
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!
10-11-2017 09:13 AM
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!
04-13-2018 08:41 AM
Hi @gman11980
You can also use the REDIRECT METHOD
https://developer.authorize.net/api/reference/features/accept_hosted.html#Displaying_the_Form
04-14-2018 02:24 PM
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!
04-19-2018 12:33 PM