Reply
Highlighted
Member
Posts: 4
Registered: ‎08-04-2018

Re: Using accept.js in a single page app (react.js)

Hi - I'm still seeing the issue where the Accept.js modal is scrolled off the screen.  Is this going to be fixed?

Highlighted
Member
Posts: 2
Registered: ‎01-12-2019

Re: Using accept.js in a single page app (react.js)

Hello,

 

Do not hesitate to let me know if this kind of posts are not welcome here.

 

I am the creator and maintainer of react-authorize-net, which is a React library aiming to make the integration of the Authorize.Net platform with a React application as smooth as possible.

I hope this can be as useful to others as it has been for me.

 

Constructive feedback is greatly appreciated.

 

Thank you!

Highlighted
Member
Posts: 4
Registered: ‎03-05-2019

Re: Using accept.js in a single page app (react.js) - Mukesh jaiswal

If you are using ReactJs then you need to call this function in Component
 
Issue resolved: addEventListner is undefined
 
loadScript: function (src) {
        var tag = document.createElement('script');     
        tag.src = src;
        document.body.appendChild(tag);
    }
 
In componentDidMount():
 
Now my issue resolved 
Highlighted
Member
Posts: 4
Registered: ‎03-05-2019

Re: Using accept.js in a single page app (react.js) - Mukesh jaiswal

If you are using ReactJs then you need to call this function in Component
 
Issue resolved: addEventListner is undefined
 
loadScript: function (src) {
        var tag = document.createElement('script');     
        tag.src = src;
        document.body.appendChild(tag);
    }
 
In componentDidMount():
 
Now my issue resolved 
Highlighted
Member
Posts: 4
Registered: ‎03-05-2019

Re: Using accept.js in a single page app (react.js)

If you are using React.js then you need to follow below things to render the script after button render:
 
loadScript: function (src) {
        var tag = document.createElement('script');     
        tag.src = src;
        document.body.appendChild(tag);
    }
 
And in componentDidMount()
 
componentDidMount() {
}
 
 
Highlighted
Member
Posts: 4
Registered: ‎03-05-2019

Re: Using accept.js in a single page app (react.js) - Mukesh kumar jaiswal

If you are using React.js then you need to follow below things to render the script after button render:
 
loadScript: function (src) {
        var tag = document.createElement('script');     
        tag.src = src;
        document.body.appendChild(tag);
    }
 
And in componentDidMount()
 
componentDidMount() {
}
 
 
Highlighted
Member
Posts: 5
Registered: ‎10-31-2018

Re: Using accept.js in a single page app (react.js) - Mukesh kumar jaiswal

The problem with this solution is that the script is added to the dom each time the user returns to the page in the context of the single page app. If the user is on the page with the Pay button, then hits the back button, then goes back to the page with the Pay button, the script will be injected into the dom again.

 

This causes the callback to be called several times, which then returns multiple errors for Anet when the transaction is processed.

Highlighted
Member
Posts: 5
Registered: ‎10-31-2018

Re: Using accept.js in a single page app (react.js) - Mukesh kumar jaiswal

Error messages caused by multiple calls to the callback function include invalid OTS token E00114 and duplicate transaction errors.

Highlighted
New Member
Posts: 1
Registered: ‎03-13-2020

Re: Using accept.js in a single page app (react.js)

Your share is essential. I also used Mod apk applications for android on TechCrue.com, most of them are similar to yours.