globalpayments / rxp-js

Global Payments Ecommerce JavaScript Library
MIT License
34 stars 70 forks source link

How to use rxp-js in react? #35

Open ArvindMaurya1996 opened 4 years ago

ArvindMaurya1996 commented 4 years ago

I have used rxp-js.js using jquery and that works fine. but i need to understand how does it work in REACT js?

i have been struggling around and went through all the documentation but did not got the break through. any help or guidance is really appreciated.

marcfielding1 commented 3 years ago

So I'm just about to do this, this is where I'm at - as a useEffect() of the component you'd want...

fetch("your_url_to_return_sha1_hash",  (jsonFromServerSdk) => {
                RealexHpp.embedded.init(
                    "payButtonId",
                    "targetIframe",
                    "https://dev.rlxcarts.com/mobileSDKsV2/response.php", // not sure this is right for us as we're on elavon.
                    jsonFromServerSdk
                );
                document.getElementByTag('body')[0].addClass('loaded');
            });

I think just testing it out now! Would be good to have a response from the team though.

AminDaryan commented 3 years ago

So I'm just about to do this, this is where I'm at - as a useEffect() of the component you'd want...

fetch("your_url_to_return_sha1_hash",  (jsonFromServerSdk) => {
                RealexHpp.embedded.init(
                    "payButtonId",
                    "targetIframe",
                    "https://dev.rlxcarts.com/mobileSDKsV2/response.php", // not sure this is right for us as we're on elavon.
                    jsonFromServerSdk
                );
                document.getElementByTag('body')[0].addClass('loaded');
            });

I think just testing it out now! Would be good to have a response from the team though.

So Have you figured it out? No clue how to use this.

marcfielding1 commented 3 years ago

Heya sorry for the slow reply,yep lemmy find an example for you.

TobyHodkinson2022 commented 2 years ago

Is there any further progress on this?