Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Release 3.16.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments authored and jenkins committed Jul 24, 2020
1 parent 9097880 commit 1f9c38d
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION.TXT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.15.0
3.16.0
2 changes: 1 addition & 1 deletion dist/connectsdk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/connectsdk.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/connectsdk.noEncrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ define("connectsdk.Util", ["connectsdk.core"], function (connectsdk) {
return {
screenSize: window.innerWidth + "x" + window.innerHeight,
platformIdentifier: window.navigator.userAgent,
sdkIdentifier: ((document.GC && document.GC.rppEnabledPage) ? 'rpp-' : '') + 'JavaScriptClientSDK/v3.15.0',
sdkIdentifier: ((document.GC && document.GC.rppEnabledPage) ? 'rpp-' : '') + 'JavaScriptClientSDK/v3.16.0',
sdkCreator: 'Ingenico'
};
},
Expand Down
2 changes: 1 addition & 1 deletion dist/connectsdk.noEncrypt.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "connect-sdk-client-js",
"version": "3.15.0",
"version": "3.16.0",
"description": "The JavaScript based client SDK that can be used for client to server communication between you and the Ingenico ePayments platform",
"main": "gulpfile.js",
"devDependencies": {
Expand Down
25 changes: 25 additions & 0 deletions src/C2SCommunicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,31 @@ define("connectsdk.C2SCommunicator", ["connectsdk.core", "connectsdk.promise", "
return promise;
};

this.createPaymentProductSession = function(paymentProductId, context) {

var promise = new Promise();
var cacheKey = "createPaymentProductSession_" + context.validationUrl + "_" + context.domainName + "_" + context.displayName;
if (_cache[cacheKey]) {
setTimeout(function () {
promise.resolve(_cache[cacheKey]);
}, 0);
} else {
Net.post(formatUrl(_c2SCommunicatorConfiguration.clientApiUrl) + _c2SCommunicatorConfiguration.customerId + "/products/" + paymentProductId + "/sessions")
.data(JSON.stringify(context))
.set("X-GCS-ClientMetaInfo", _util.base64Encode(metadata))
.set('Authorization', 'GCS v1Client:' + _c2SCommunicatorConfiguration.clientSessionId)
.end(function (res) {
if (res.success) {
_cache[cacheKey] = res.responseJSON;
promise.resolve(res.responseJSON);
} else {
promise.reject(res.responseJSON);
}
});
}
return promise;
};

var constructCacheKeyFromKeyValues = function(prefix, values) {
var cacheKey = prefix;
for (var key in values){
Expand Down
4 changes: 4 additions & 0 deletions src/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ define("connectsdk.Session", ["connectsdk.core", "connectsdk.C2SCommunicator", "
return _c2sCommunicator.getCustomerDetails(paymentProductId, paymentRequestPayload);
};

this.createPaymentProductSession = function (paymentProductId, paymentRequestPayload) {
return _c2sCommunicator.createPaymentProductSession(paymentProductId, paymentRequestPayload);
};

/* In case a full JSON representation of a payment product is already available in context,
this method can be used instead of getPaymentProduct for the same (but synchronous) result. */
this.transformPaymentProductJSON = function(json) {
Expand Down

0 comments on commit 1f9c38d

Please sign in to comment.