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

Commit

Permalink
Release 4.15.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments committed Oct 16, 2023
1 parent 53954ea commit f0fbe03
Show file tree
Hide file tree
Showing 16 changed files with 232 additions and 4 deletions.
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-nodejs",
"version": "4.14.0",
"version": "4.15.0",
"description": "SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API",
"homepage": "https://github.com/Ingenico-ePayments/connect-sdk-nodejs#readme",
"bugs": {
Expand Down
65 changes: 65 additions & 0 deletions schemas/hostedcheckout/CreateHostedCheckoutRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,19 @@
},
"additionalProperties" : false
},
"Frequency" : {
"type" : "object",
"properties" : {
"interval" : {
"type" : "string"
},
"intervalFrequency" : {
"type" : "integer",
"maximum" : 2147483647
}
},
"additionalProperties" : false
},
"GPayThreeDSecure" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -848,6 +861,9 @@
"paymentProductFilters" : {
"$ref" : "#/definitions/PaymentProductFiltersHostedCheckout"
},
"recurringPaymentsData" : {
"$ref" : "#/definitions/RecurringPaymentsData"
},
"returnCancelState" : {
"type" : "boolean"
},
Expand Down Expand Up @@ -875,6 +891,9 @@
"amountOfMoneyPerInstallment" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"amountOfMoneyTotal" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"frequencyOfInstallments" : {
"type" : "string"
},
Expand Down Expand Up @@ -1498,6 +1517,18 @@
},
"additionalProperties" : false
},
"RecurringPaymentsData" : {
"type" : "object",
"properties" : {
"recurringInterval" : {
"$ref" : "#/definitions/Frequency"
},
"trialInformation" : {
"$ref" : "#/definitions/TrialInformation"
}
},
"additionalProperties" : false
},
"RedirectPaymentMethodSpecificInputBase" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -1771,6 +1802,40 @@
}
},
"additionalProperties" : false
},
"TrialInformation" : {
"type" : "object",
"properties" : {
"amountOfMoneyAfterTrial" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"endDate" : {
"type" : "string"
},
"isRecurring" : {
"type" : "boolean"
},
"trialPeriod" : {
"$ref" : "#/definitions/TrialPeriod"
},
"trialPeriodRecurring" : {
"$ref" : "#/definitions/Frequency"
}
},
"additionalProperties" : false
},
"TrialPeriod" : {
"type" : "object",
"properties" : {
"duration" : {
"type" : "integer",
"maximum" : 2147483647
},
"interval" : {
"type" : "string"
}
},
"additionalProperties" : false
}
}
}
35 changes: 35 additions & 0 deletions schemas/installments/GetInstallmentRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema" : "http://json-schema.org/draft-04/schema#",
"type" : "object",
"properties" : {
"amountOfMoney" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"bin" : {
"type" : "string"
},
"countryCode" : {
"type" : "string"
},
"paymentProductId" : {
"type" : "integer",
"maximum" : 2147483647
}
},
"additionalProperties" : false,
"definitions" : {
"AmountOfMoney" : {
"type" : "object",
"properties" : {
"amount" : {
"type" : "integer",
"maximum" : 9223372036854775807
},
"currencyCode" : {
"type" : "string"
}
},
"additionalProperties" : false
}
}
}
3 changes: 3 additions & 0 deletions schemas/payment/CompletePaymentRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,9 @@
"amountOfMoneyPerInstallment" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"amountOfMoneyTotal" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"frequencyOfInstallments" : {
"type" : "string"
},
Expand Down
3 changes: 3 additions & 0 deletions schemas/payment/CreatePaymentRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,9 @@
"amountOfMoneyPerInstallment" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"amountOfMoneyTotal" : {
"$ref" : "#/definitions/AmountOfMoney"
},
"frequencyOfInstallments" : {
"type" : "string"
},
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import services = require("./services");
import tokens = require("./tokens");
import mandates = require("./mandates");
import sessions = require("./sessions");
import installments = require("./installments");
import files = require("./files");

import webhooks = require("./webhooks");
Expand Down Expand Up @@ -87,6 +88,7 @@ const connectSdk: ConnectSdk = {
tokens: tokens,
mandates: mandates,
sessions: sessions,
installments: installments,
files: files,
context: sdkcontext,

Expand Down
32 changes: 32 additions & 0 deletions src/installments/getInstallmentsInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import { validate } from "jsonschema";
import communicator = require("../utils/communicator");
import sdkcontext = require("../utils/context");
import { PaymentContext, SdkCallback } from "../model";
import { GetInstallmentRequest } from "../model/domain/installments";

// eslint-disable-next-line @typescript-eslint/no-var-requires
const requestSchema = require("../../schemas/installments/GetInstallmentRequest.json");

const getInstallmentsInfo = function(merchantId: string, postData: GetInstallmentRequest, paymentContext: PaymentContext | null, cb: SdkCallback): void {
// validate postData
const isValidRequest = validate(postData, requestSchema);
if (!isValidRequest.valid) {
const logger = sdkcontext.getLogger();
if (sdkcontext.isLoggingEnabled()) {
logger("error", isValidRequest.errors);
}
throw new Error(isValidRequest.errors.toString());
}
communicator.json({
method: "POST",
modulePath: "/v1/" + merchantId + "/installments/getInstallmentsInfo",
body: postData,
paymentContext: paymentContext,
cb: cb
});
};
export = getInstallmentsInfo;
11 changes: 11 additions & 0 deletions src/installments/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import getInstallmentsInfo = require("./getInstallmentsInfo");
import { InstallmentsClient } from "../model/installments";

const installmentsClient: InstallmentsClient = {
getInstallmentsInfo: getInstallmentsInfo
};
export = installmentsClient;
26 changes: 25 additions & 1 deletion src/model/domain/hostedcheckout/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import { AbstractPaymentMethodSpecificInput, KeyValuePair, PaymentProductFilter } from "../../definitions";
import { AbstractPaymentMethodSpecificInput, AmountOfMoney, KeyValuePair, PaymentProductFilter } from "../../definitions";
import { GPayThreeDSecure, Payment, PaymentCreationReferences } from "../../payment/definitions";

export interface CreatedPaymentOutput {
Expand All @@ -24,10 +24,16 @@ export interface DisplayedData {
showData?: KeyValuePair[] | null;
}

export interface Frequency {
interval?: string | null;
intervalFrequency?: number | null;
}

export interface HostedCheckoutSpecificInput {
isRecurring?: boolean | null;
locale?: string | null;
paymentProductFilters?: PaymentProductFiltersHostedCheckout | null;
recurringPaymentsData?: RecurringPaymentsData | null;
returnCancelState?: boolean | null;
returnUrl?: string | null;
showResultPage?: boolean | null;
Expand Down Expand Up @@ -60,3 +66,21 @@ export interface PaymentProductFiltersHostedCheckout {
restrictTo?: PaymentProductFilter | null;
tokensOnly?: boolean | null;
}

export interface RecurringPaymentsData {
recurringInterval?: Frequency | null;
trialInformation?: TrialInformation | null;
}

export interface TrialInformation {
amountOfMoneyAfterTrial?: AmountOfMoney | null;
endDate?: string | null;
isRecurring?: boolean | null;
trialPeriod?: TrialPeriod | null;
trialPeriodRecurring?: Frequency | null;
}

export interface TrialPeriod {
duration?: number | null;
interval?: string | null;
}
17 changes: 17 additions & 0 deletions src/model/domain/installments/definitions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import { Installments } from "../../payment/definitions";

export interface InstallmentDisplayHints {
displayOrder?: number | null;
label?: string | null;
logo?: string | null;
}

export interface InstallmentOptions {
displayHints?: InstallmentDisplayHints | null;
id?: string | null;
installmentPlans?: Installments[] | null;
}
17 changes: 17 additions & 0 deletions src/model/domain/installments/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import { AmountOfMoney } from "../definitions";
import { InstallmentOptions } from "./definitions";

export interface GetInstallmentRequest {
amountOfMoney?: AmountOfMoney | null;
bin?: string | null;
countryCode?: string | null;
paymentProductId?: number | null;
}

export interface InstallmentOptionsResponse {
installmentOptions?: InstallmentOptions[] | null;
}
1 change: 1 addition & 0 deletions src/model/domain/payment/definitions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export interface HostedCheckoutSpecificOutput {

export interface Installments {
amountOfMoneyPerInstallment?: AmountOfMoney | null;
amountOfMoneyTotal?: AmountOfMoney | null;
frequencyOfInstallments?: string | null;
installmentPlanCode?: number | null;
interestRate?: string | null;
Expand Down
2 changes: 2 additions & 0 deletions src/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { ServicesClient } from "./services";
import { TokensClient } from "./tokens";
import { MandatesClient } from "./mandates";
import { SessionsClient } from "./sessions";
import { InstallmentsClient } from "./installments";
import { FilesClient } from "./files";
import { WebhooksHelper } from "./webhooks";

Expand All @@ -37,6 +38,7 @@ export interface ConnectSdk {
readonly tokens: TokensClient;
readonly mandates: MandatesClient;
readonly sessions: SessionsClient;
readonly installments: InstallmentsClient;
readonly files: FilesClient;

readonly context: SdkContext;
Expand Down
16 changes: 16 additions & 0 deletions src/model/installments/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* This file was auto-generated from the API references found at
* https://epayments-api.developer-ingenico.com/s2sapi/v1/
*/
import { GetInstallmentRequest } from "../domain/installments";
import { PaymentContext, SdkCallback } from "../types";

export interface InstallmentsClient {
/**
* Resource /{merchantId}/installments/getInstallmentsInfo - <a href="https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/nodejs/installments/getInstallmentsInfo.html">Get Installment Info</a>
* @param cb The callback for the response.
* If the call was successfull, the response body type will be {@link InstallmentOptionsResponse}.
* If the call was not successful, the response body type will be {@link ErrorResponse}.
*/
getInstallmentsInfo(merchantId: string, postData: GetInstallmentRequest, paymentContext: PaymentContext | null, cb: SdkCallback): void;
}
2 changes: 1 addition & 1 deletion src/utils/headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface ServerMetaInfo {
export function serverMetaInfo(sdkContext: SdkContext): Header {
const info: ServerMetaInfo = {
sdkCreator: "Ingenico",
sdkIdentifier: "NodejsServerSDK/v4.14.0",
sdkIdentifier: "NodejsServerSDK/v4.15.0",
platformIdentifier: process.env["OS"] + " Node.js/" + process.versions.node
};
if (sdkContext.getIntegrator() !== null) {
Expand Down

0 comments on commit f0fbe03

Please sign in to comment.