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

Server API session creation response is not compatible with JS SDK #7

Closed powli closed 6 years ago

powli commented 6 years ago

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):

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.

rob-spoor commented 6 years ago

The next release will allow the response to be used as session details. The C2SCommunicatorConfiguration class will make sure that both the old session details structure (with clientSessionID, customerId, region and environment) and the create session response will work. Just make sure to:

ebomcke-ingenico commented 6 years ago

Fixed in release 3.8.0.