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

Authorization header 'clientSessionId' is empty #5

Closed SkinyMonkey closed 6 years ago

SkinyMonkey commented 6 years ago
import connect from 'connect-sdk-client-js/dist/connectsdk.js';
[...]     {
               //sessionDetails is coming from our APi:  
               //sessionDetails = {clientSessionId: "...",
               //                              customerId: "...",
               //                              region: "EU",
               //                              environment: "PREPROD"}
               const session = new connect(sessionDetails);

                const ingenicoPaymentDetails = {
                  totalAmount: paymentDetails.amount,
                  countryCode: currentUser.country,
                  locale: `${currentUser.locale}_${currentUser.country}`,
                  currency: paymentDetails.currencyCode.toUpperCase(),
                  isRecurring: false
                };

                return createPayload(session, cardDetails, ingenicoPaymentDetails);
}

Using this code, when i use the createPayload given in the requirejs example to test :

https://github.com/Ingenico-ePayments/connect-sdk-client-js-example/blob/master/minimal-requirejs/js/create-payload.js

I can observe that the Authorization header of the request sent by getIINdetails has this value:

Authorization: GCS v1Client:undefined

I checked and rechecked : the clientSessionId is set properly in sessionDetails.

The code is mostly based on what i found in the webpack example by the way.

Could you please help me with this?

rob-spoor commented 6 years ago

I've checked both the code and the documentation and the implementation, and there is an inconsistency. The documentation mentions clientSessionId, but the implementation uses clientSessionID. The latter is correctly documented on https://epayments.developer-ingenico.com/documentation/sdk/mobile/javascript/ but incorrectly documented on the API references. The latter will need to be updated.

SkinyMonkey commented 6 years ago

Thanks man ... I would have never noticed this 1 char difference ...

vibdheeraj commented 4 years ago

@rikvanthof Can we use connect-sdk-client-js in React-native ?

rob-spoor commented 4 years ago

As I said in https://github.com/Ingenico-ePayments/connect-sdk-client-js/issues/9, this is not possible at the moment.