Giter VIP home page Giter VIP logo

connect-sdk-client-js's People

Contributors

ingenicoepayments avatar rikvanthof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connect-sdk-client-js's Issues

Authorization header 'clientSessionId' is empty

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?

dataRestrictions - field cardholderName is required now

Since yesterday, 10/Aug, the Get Payment Product api is returning the cardholderName field as mandatory. This is causing a problem in our application. In STAG this field is not mandatory, only in Production. Is it possible to remove this mandatory field?
API: https://ams1.api-ingenico.com/client/v1/.../products/1?countryCode=AR&isRecurring=false&amount=180000&currencyCode=ARS&locale=es_ES&cacheBust=1628706586336

{ "dataRestrictions" : { "isRequired" : true, "validators" : { "length" : { "maxLength" : 50, "minLength" : 2 }, "regularExpression" : { "regularExpression" : "^[-\\sA-Za-z0-9ªºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƒƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǺǻǼǽǾǿȘșȚțΆΈΉΊΌΎΏΑΓΔΕΖΗΙΚΛΝΟΡΣΥΩΪΫάέήίαβγδεζηικλμνξοπρςστυψωϊϋόύώЁЄЇАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёєїҐґẠạẢảấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ.'/]+$" } } }, "displayHints" : { "alwaysShow" : false, "displayOrder" : 1142, "formElement" : { "type" : "text" }, "label" : "Nombre del titular de la tarjeta", "obfuscate" : false, "placeholderLabel" : "John Doe", "preferredInputType" : "StringKeyboard" }, "id" : "cardholderName", "type" : "string" }

errors are not propagated to the calling function

Error is not being propagating to the calling function and "UNKNOWN" errors are impossible to act on. We have a use case where user might have an expired session and in order for us to "act" on this, we need to get some indicator in the application that call is being rejected due to "some" access issue. You can find below an abstract sample, showing that there is nothing useful that is coming back in the error response.

We've created a non intrusive inclusion of error, allowing our client to access error response and act upon in.

PR: #12

        const connectSession = new connectsdk.Session(
            session.sessionToken.token
        );

        try {
           const iinDetails = await connectSession.getIinDetails(
                creditCard.number,
                paymentDetails
            );
        } catch (e) {
           // nothing useful in this error response
        }

Server API session creation response is not compatible with JS SDK

When I create a session through the PHP Server SDK I get a response similar to this:

{
    "assetUrl": "https:\/\/payment.pay1.preprod.secured-by-ingenico.com\/",
    "clientApiUrl": "https:\/\/ams1.preprod.api-ingenico.com\/client",
    "clientSessionId": "<session-id>",
    "customerId": "<client-id>",
    "region": "EU"
}

However this can not directly be used to create a JavaScript SDK Session, since it expects the following properties (see here):

  • clientSessionID
  • apiBaseUrl
  • assetsBaseUrl

Do I really have to manually map the session properties?


Also the clientApiUrl is not usable directly, since the tester expects the url to end with client/v1 instead of just client, which is actually returned from the getSession endpoint.

Bower package

It would be nice to use Bower to install the library. Is it possible to publish the library as Bower package?

npm distribution does not provide forge dependency

I installed the SDK from npm but when I try to run the encrypted version it raises about undefined 'forge'. When I look into it this seems to be a third part encryption library? As a dependency I'd expect it to be installed with the package.

I see it minified in the examples repos but it is very old and the webpack example readme notes we have to update it:

https://github.com/Ingenico-ePayments/connect-sdk-client-js-example/tree/master/minimal-webpack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.