Ingenico-ePayments / connect-sdk-client-js

Ingenico Connect JavaScript Client SDK
https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/javascript/
Other
26 stars 15 forks source link

Can I use this sdk in a react native app? #9

Closed amarkovits closed 2 years ago

rob-spoor commented 5 years ago

The SDK as it is currently working will not work in React Native. React Native has no access to the DOM or global namespace (window), while these are used in the SDK:

vibdheeraj commented 4 years ago

@amarkovits any update?

priscaure commented 4 years ago

@rob-spoor @amarkovits +1, any update on using this with React Native ?

rob-spoor commented 4 years ago

There are no plans at this moment to make this SDK compatible with React Native.

priscaure commented 4 years ago

There are no plans at this moment to make this SDK compatible with React Native.

@rob-spoor Thank you for your reply ! What's your suggestion to use ingenico epayment with a react-native app ? Is there a way without using any sdk at all ?

rob-spoor commented 4 years ago

The API is described at https://epayments-api.developer-ingenico.com/c2sapi/v1/en_US/json/concepts.html. I've selected SDK "JSON" which actually means without any SDK but raw HTTP requests. This allows you to perform all of the API calls.

The client-side encryption is not documented there though. That's implemented in file Encryptor.js. Since this indirectly uses the browser (navigator and window) to collect device information (needed for 3DS v2) you'll need to copy the functionality and not use it as-is.

An alternative could be to create a fork of the SDK, and fix all occurrences of window, document or navigator.

priscaure commented 4 years ago

The API is described at https://epayments-api.developer-ingenico.com/c2sapi/v1/en_US/json/concepts.html. I've selected SDK "JSON" which actually means without any SDK but raw HTTP requests. This allows you to perform all of the API calls.

The client-side encryption is not documented there though. That's implemented in file Encryptor.js. Since this indirectly uses the browser (navigator and window) to collect device information (needed for 3DS v2) you'll need to copy the functionality and not use it as-is.

An alternative could be to create a fork of the SDK, and fix all occurrences of window, document or navigator.

@rob-spoor Thank you so much for all the informations and your help. I will try to implement that :) Have a great day !

kaue-esparta commented 3 years ago

Hello @priscaure, how are u doing? did u implemented the SDK to React-Native or used the SDK for iOS/Android?

knapeto commented 1 year ago

Any one implemented react native? I am IN to help with publishing it for community @priscaure