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

Commit f0fbe03

Browse files
Release 4.15.0.
1 parent 53954ea commit f0fbe03

File tree

16 files changed

+232
-4
lines changed

16 files changed

+232
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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": "4.14.0",
3+
"version": "4.15.0",
44
"description": "SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API",
55
"homepage": "https://github.com/Ingenico-ePayments/connect-sdk-nodejs#readme",
66
"bugs": {

schemas/hostedcheckout/CreateHostedCheckoutRequest.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,19 @@
802802
},
803803
"additionalProperties" : false
804804
},
805+
"Frequency" : {
806+
"type" : "object",
807+
"properties" : {
808+
"interval" : {
809+
"type" : "string"
810+
},
811+
"intervalFrequency" : {
812+
"type" : "integer",
813+
"maximum" : 2147483647
814+
}
815+
},
816+
"additionalProperties" : false
817+
},
805818
"GPayThreeDSecure" : {
806819
"type" : "object",
807820
"properties" : {
@@ -848,6 +861,9 @@
848861
"paymentProductFilters" : {
849862
"$ref" : "#/definitions/PaymentProductFiltersHostedCheckout"
850863
},
864+
"recurringPaymentsData" : {
865+
"$ref" : "#/definitions/RecurringPaymentsData"
866+
},
851867
"returnCancelState" : {
852868
"type" : "boolean"
853869
},
@@ -875,6 +891,9 @@
875891
"amountOfMoneyPerInstallment" : {
876892
"$ref" : "#/definitions/AmountOfMoney"
877893
},
894+
"amountOfMoneyTotal" : {
895+
"$ref" : "#/definitions/AmountOfMoney"
896+
},
878897
"frequencyOfInstallments" : {
879898
"type" : "string"
880899
},
@@ -1498,6 +1517,18 @@
14981517
},
14991518
"additionalProperties" : false
15001519
},
1520+
"RecurringPaymentsData" : {
1521+
"type" : "object",
1522+
"properties" : {
1523+
"recurringInterval" : {
1524+
"$ref" : "#/definitions/Frequency"
1525+
},
1526+
"trialInformation" : {
1527+
"$ref" : "#/definitions/TrialInformation"
1528+
}
1529+
},
1530+
"additionalProperties" : false
1531+
},
15011532
"RedirectPaymentMethodSpecificInputBase" : {
15021533
"type" : "object",
15031534
"properties" : {
@@ -1771,6 +1802,40 @@
17711802
}
17721803
},
17731804
"additionalProperties" : false
1805+
},
1806+
"TrialInformation" : {
1807+
"type" : "object",
1808+
"properties" : {
1809+
"amountOfMoneyAfterTrial" : {
1810+
"$ref" : "#/definitions/AmountOfMoney"
1811+
},
1812+
"endDate" : {
1813+
"type" : "string"
1814+
},
1815+
"isRecurring" : {
1816+
"type" : "boolean"
1817+
},
1818+
"trialPeriod" : {
1819+
"$ref" : "#/definitions/TrialPeriod"
1820+
},
1821+
"trialPeriodRecurring" : {
1822+
"$ref" : "#/definitions/Frequency"
1823+
}
1824+
},
1825+
"additionalProperties" : false
1826+
},
1827+
"TrialPeriod" : {
1828+
"type" : "object",
1829+
"properties" : {
1830+
"duration" : {
1831+
"type" : "integer",
1832+
"maximum" : 2147483647
1833+
},
1834+
"interval" : {
1835+
"type" : "string"
1836+
}
1837+
},
1838+
"additionalProperties" : false
17741839
}
17751840
}
17761841
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema" : "http://json-schema.org/draft-04/schema#",
3+
"type" : "object",
4+
"properties" : {
5+
"amountOfMoney" : {
6+
"$ref" : "#/definitions/AmountOfMoney"
7+
},
8+
"bin" : {
9+
"type" : "string"
10+
},
11+
"countryCode" : {
12+
"type" : "string"
13+
},
14+
"paymentProductId" : {
15+
"type" : "integer",
16+
"maximum" : 2147483647
17+
}
18+
},
19+
"additionalProperties" : false,
20+
"definitions" : {
21+
"AmountOfMoney" : {
22+
"type" : "object",
23+
"properties" : {
24+
"amount" : {
25+
"type" : "integer",
26+
"maximum" : 9223372036854775807
27+
},
28+
"currencyCode" : {
29+
"type" : "string"
30+
}
31+
},
32+
"additionalProperties" : false
33+
}
34+
}
35+
}

schemas/payment/CompletePaymentRequest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@
576576
"amountOfMoneyPerInstallment" : {
577577
"$ref" : "#/definitions/AmountOfMoney"
578578
},
579+
"amountOfMoneyTotal" : {
580+
"$ref" : "#/definitions/AmountOfMoney"
581+
},
579582
"frequencyOfInstallments" : {
580583
"type" : "string"
581584
},

schemas/payment/CreatePaymentRequest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,9 @@
10941094
"amountOfMoneyPerInstallment" : {
10951095
"$ref" : "#/definitions/AmountOfMoney"
10961096
},
1097+
"amountOfMoneyTotal" : {
1098+
"$ref" : "#/definitions/AmountOfMoney"
1099+
},
10971100
"frequencyOfInstallments" : {
10981101
"type" : "string"
10991102
},

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import services = require("./services");
2121
import tokens = require("./tokens");
2222
import mandates = require("./mandates");
2323
import sessions = require("./sessions");
24+
import installments = require("./installments");
2425
import files = require("./files");
2526

2627
import webhooks = require("./webhooks");
@@ -87,6 +88,7 @@ const connectSdk: ConnectSdk = {
8788
tokens: tokens,
8889
mandates: mandates,
8990
sessions: sessions,
91+
installments: installments,
9092
files: files,
9193
context: sdkcontext,
9294

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file was auto-generated from the API references found at
3+
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
4+
*/
5+
import { validate } from "jsonschema";
6+
import communicator = require("../utils/communicator");
7+
import sdkcontext = require("../utils/context");
8+
import { PaymentContext, SdkCallback } from "../model";
9+
import { GetInstallmentRequest } from "../model/domain/installments";
10+
11+
// eslint-disable-next-line @typescript-eslint/no-var-requires
12+
const requestSchema = require("../../schemas/installments/GetInstallmentRequest.json");
13+
14+
const getInstallmentsInfo = function(merchantId: string, postData: GetInstallmentRequest, paymentContext: PaymentContext | null, cb: SdkCallback): void {
15+
// validate postData
16+
const isValidRequest = validate(postData, requestSchema);
17+
if (!isValidRequest.valid) {
18+
const logger = sdkcontext.getLogger();
19+
if (sdkcontext.isLoggingEnabled()) {
20+
logger("error", isValidRequest.errors);
21+
}
22+
throw new Error(isValidRequest.errors.toString());
23+
}
24+
communicator.json({
25+
method: "POST",
26+
modulePath: "/v1/" + merchantId + "/installments/getInstallmentsInfo",
27+
body: postData,
28+
paymentContext: paymentContext,
29+
cb: cb
30+
});
31+
};
32+
export = getInstallmentsInfo;

src/installments/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* This file was auto-generated from the API references found at
3+
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
4+
*/
5+
import getInstallmentsInfo = require("./getInstallmentsInfo");
6+
import { InstallmentsClient } from "../model/installments";
7+
8+
const installmentsClient: InstallmentsClient = {
9+
getInstallmentsInfo: getInstallmentsInfo
10+
};
11+
export = installmentsClient;

src/model/domain/hostedcheckout/definitions/index.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was auto-generated from the API references found at
33
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
44
*/
5-
import { AbstractPaymentMethodSpecificInput, KeyValuePair, PaymentProductFilter } from "../../definitions";
5+
import { AbstractPaymentMethodSpecificInput, AmountOfMoney, KeyValuePair, PaymentProductFilter } from "../../definitions";
66
import { GPayThreeDSecure, Payment, PaymentCreationReferences } from "../../payment/definitions";
77

88
export interface CreatedPaymentOutput {
@@ -24,10 +24,16 @@ export interface DisplayedData {
2424
showData?: KeyValuePair[] | null;
2525
}
2626

27+
export interface Frequency {
28+
interval?: string | null;
29+
intervalFrequency?: number | null;
30+
}
31+
2732
export interface HostedCheckoutSpecificInput {
2833
isRecurring?: boolean | null;
2934
locale?: string | null;
3035
paymentProductFilters?: PaymentProductFiltersHostedCheckout | null;
36+
recurringPaymentsData?: RecurringPaymentsData | null;
3137
returnCancelState?: boolean | null;
3238
returnUrl?: string | null;
3339
showResultPage?: boolean | null;
@@ -60,3 +66,21 @@ export interface PaymentProductFiltersHostedCheckout {
6066
restrictTo?: PaymentProductFilter | null;
6167
tokensOnly?: boolean | null;
6268
}
69+
70+
export interface RecurringPaymentsData {
71+
recurringInterval?: Frequency | null;
72+
trialInformation?: TrialInformation | null;
73+
}
74+
75+
export interface TrialInformation {
76+
amountOfMoneyAfterTrial?: AmountOfMoney | null;
77+
endDate?: string | null;
78+
isRecurring?: boolean | null;
79+
trialPeriod?: TrialPeriod | null;
80+
trialPeriodRecurring?: Frequency | null;
81+
}
82+
83+
export interface TrialPeriod {
84+
duration?: number | null;
85+
interval?: string | null;
86+
}

0 commit comments

Comments
 (0)