This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53954ea
commit f0fbe03
Showing
16 changed files
with
232 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters