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

Commit 79b91b5

Browse files
author
Ingenico ePayments
committed
Release 2.5.0.
1 parent d115a31 commit 79b91b5

File tree

6 files changed

+95
-2
lines changed

6 files changed

+95
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "connect-sdk-nodejs",
3-
"version": "2.4.0",
3+
"version": "2.5.0",
44
"description": "SDK to communicate with the GlobalCollect platform using the Ingenico Connect Server API",
55
"dependencies": {
66
"dateformat": "^1.0.12",

payments/complete.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use strict";
2+
/*
3+
* This file was auto-generated from the API references found at
4+
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
5+
*/
6+
var validate = require('jsonschema').validate;
7+
var communicator = require('../utils/communicator');
8+
var sdkcontext = require('../utils/context');
9+
var requestSchema = require('../schemas/payment/CompletePaymentRequest.json');
10+
11+
var myModule = function (merchantId, paymentId, postData, paymentContext, cb) {
12+
// validate postData
13+
var isValidRequest = validate(postData, requestSchema);
14+
if (!isValidRequest.valid) {
15+
var logger = sdkcontext.getLogger();
16+
if (sdkcontext.isLoggingEnabled()) {
17+
logger('error', isValidRequest.errors);
18+
}
19+
throw new Error(isValidRequest.errors);
20+
}
21+
communicator({
22+
method: 'POST',
23+
modulePath: '/v1/' + merchantId + '/payments/' + paymentId + '/complete',
24+
body: postData,
25+
paymentContext: paymentContext,
26+
cb: cb
27+
});
28+
}
29+
30+
module.exports = myModule;

payments/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ modules['capture'] = require('./capture');
1515
// console.log(`Added capture to module space`);
1616
modules['captures'] = require('./captures');
1717
// console.log(`Added captures to module space`);
18+
modules['complete'] = require('./complete');
19+
// console.log(`Added complete to module space`);
20+
modules['thirdPartyStatus'] = require('./thirdPartyStatus');
21+
// console.log(`Added thirdPartyStatus to module space`);
1822
modules['cancel'] = require('./cancel');
1923
// console.log(`Added cancel to module space`);
2024
modules['cancelapproval'] = require('./cancelapproval');

payments/thirdPartyStatus.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"use strict";
2+
/*
3+
* This file was auto-generated from the API references found at
4+
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
5+
*/
6+
var communicator = require('../utils/communicator');
7+
8+
var myModule = function (merchantId, paymentId, paymentContext, cb) {
9+
communicator({
10+
method: 'GET',
11+
modulePath: '/v1/' + merchantId + '/payments/' + paymentId + '/thirdpartystatus',
12+
body: null,
13+
paymentContext: paymentContext,
14+
cb: cb
15+
});
16+
}
17+
18+
module.exports = myModule;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema" : "http://json-schema.org/draft-04/schema#",
3+
"type" : "object",
4+
"properties" : {
5+
"cardPaymentMethodSpecificInput" : {
6+
"$ref" : "#/definitions/CompletePaymentCardPaymentMethodSpecificInput"
7+
}
8+
},
9+
"required" : [ "cardPaymentMethodSpecificInput" ],
10+
"additionalProperties" : false,
11+
"definitions" : {
12+
"CardWithoutCvv" : {
13+
"type" : "object",
14+
"properties" : {
15+
"cardNumber" : {
16+
"type" : "string"
17+
},
18+
"cardholderName" : {
19+
"type" : "string"
20+
},
21+
"expiryDate" : {
22+
"type" : "string"
23+
},
24+
"issueNumber" : {
25+
"type" : "string"
26+
}
27+
},
28+
"additionalProperties" : false
29+
},
30+
"CompletePaymentCardPaymentMethodSpecificInput" : {
31+
"type" : "object",
32+
"properties" : {
33+
"card" : {
34+
"$ref" : "#/definitions/CardWithoutCvv"
35+
}
36+
},
37+
"required" : [ "card" ],
38+
"additionalProperties" : false
39+
}
40+
}
41+
}

utils/headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var serverMetaInfo = function (sdkContext) {
99
key: "X-GCS-ServerMetaInfo",
1010
value: {
1111
'sdkCreator': 'Ingenico',
12-
'sdkIdentifier': 'NodejsServerSDK/v2.4.0',
12+
'sdkIdentifier': 'NodejsServerSDK/v2.5.0',
1313
'platformIdentifier': process.env['OS'] + ' Node.js/' + process.versions.node
1414
}
1515
};

0 commit comments

Comments
 (0)