@kushki/js
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -17,12 +17,15 @@ /* tslint:disable:all */ | ||
private readonly _publicHeader; | ||
private _uaturl; | ||
private _produrl; | ||
private static _aurusError; | ||
request<T = object>(body: object, headers: object, path: string, testEnv: boolean): Observable<T>; | ||
requestGet<T = object>(headers: object, path: string, testEnv: boolean): Observable<T>; | ||
requestToken(body: TokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(body: SubscriptionTokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestTransferToken(body: TransferTokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestMerchantSettings(mid: string, testEnv: boolean): Observable<MerchantSettingsResponse>; | ||
requestPseBankList(mid: string, testEnv: boolean): Observable<BankListResponse>; | ||
requestDeferredConditions(mid: string, bin: string, testEnv: boolean): Observable<DeferredOptionsResponse>; | ||
request<T = object>(body: object, headers: object, path: string, testEnv: boolean, regional: boolean): Observable<T>; | ||
requestGet<T = object>(headers: object, path: string, testEnv: boolean, regional: boolean): Observable<T>; | ||
requestToken(body: TokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(body: SubscriptionTokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestTransferToken(body: TransferTokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestMerchantSettings(mid: string, testEnv: boolean, regional: boolean): Observable<MerchantSettingsResponse>; | ||
requestPseBankList(mid: string, testEnv: boolean, regional: boolean): Observable<BankListResponse>; | ||
requestDeferredConditions(mid: string, bin: string, testEnv: boolean, regional: boolean): Observable<DeferredOptionsResponse>; | ||
private _assingChannel; | ||
} | ||
//# sourceMappingURL=KushkiGateway.d.ts.map |
@@ -27,2 +27,4 @@ "use strict"; | ||
this._publicHeader = "Public-Merchant-Id"; | ||
this._uaturl = ""; | ||
this._produrl = ""; | ||
} | ||
@@ -33,10 +35,10 @@ KushkiGateway_1 = KushkiGateway; | ||
}; | ||
KushkiGateway.prototype.request = function (body, headers, path, testEnv) { | ||
KushkiGateway.prototype.request = function (body, headers, path, testEnv, regional) { | ||
var _this = this; | ||
return rxjs_1.of(1).pipe(operators_1.switchMap(function () { | ||
_this._assingChannel(regional, path); | ||
var options = { | ||
body: body, | ||
headers: headers, | ||
uri: testEnv | ||
? "" + EnvironmentEnum_1.EnvironmentEnum.uat + path | ||
: "" + EnvironmentEnum_1.EnvironmentEnum.prod + path, | ||
uri: testEnv ? _this._uaturl : _this._produrl, | ||
json: true | ||
@@ -52,9 +54,9 @@ }; | ||
}; | ||
KushkiGateway.prototype.requestGet = function (headers, path, testEnv) { | ||
KushkiGateway.prototype.requestGet = function (headers, path, testEnv, regional) { | ||
var _this = this; | ||
return rxjs_1.of(1).pipe(operators_1.switchMap(function () { | ||
_this._assingChannel(regional, path); | ||
var options = { | ||
headers: headers, | ||
uri: testEnv | ||
? "" + EnvironmentEnum_1.EnvironmentEnum.uat + path | ||
: "" + EnvironmentEnum_1.EnvironmentEnum.prod + path, | ||
uri: testEnv ? _this._uaturl : _this._produrl, | ||
json: true | ||
@@ -65,3 +67,3 @@ }; | ||
}; | ||
KushkiGateway.prototype.requestToken = function (body, mid, testEnv) { | ||
KushkiGateway.prototype.requestToken = function (body, mid, testEnv, regional) { | ||
var _this = this; | ||
@@ -72,6 +74,6 @@ return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
_a[_this._publicHeader] = mid, | ||
_a), PathEnum_1.PathEnum.card_tokens, testEnv); | ||
_a), PathEnum_1.PathEnum.card_tokens, testEnv, regional); | ||
}), operators_1.map(function (response) { return response; })); | ||
}; | ||
KushkiGateway.prototype.requestSubscriptionToken = function (body, mid, testEnv) { | ||
KushkiGateway.prototype.requestSubscriptionToken = function (body, mid, testEnv, regional) { | ||
var _this = this; | ||
@@ -82,6 +84,6 @@ return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
_a[_this._publicHeader] = mid, | ||
_a), PathEnum_1.PathEnum.card_subscription_tokens, testEnv); | ||
_a), PathEnum_1.PathEnum.card_subscription_tokens, testEnv, regional); | ||
}), operators_1.map(function (response) { return response; })); | ||
}; | ||
KushkiGateway.prototype.requestTransferToken = function (body, mid, testEnv) { | ||
KushkiGateway.prototype.requestTransferToken = function (body, mid, testEnv, regional) { | ||
var _this = this; | ||
@@ -92,13 +94,13 @@ return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
_a[_this._publicHeader] = mid, | ||
_a), PathEnum_1.PathEnum.transfer_tokens, testEnv); | ||
_a), PathEnum_1.PathEnum.transfer_tokens, testEnv, regional); | ||
})); | ||
}; | ||
KushkiGateway.prototype.requestMerchantSettings = function (mid, testEnv) { | ||
KushkiGateway.prototype.requestMerchantSettings = function (mid, testEnv, regional) { | ||
var _this = this; | ||
return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
var _a; | ||
return _this.requestGet((_a = {}, _a[_this._publicHeader] = mid, _a), PathEnum_1.PathEnum.merchant_settings + "settings", testEnv); | ||
return _this.requestGet((_a = {}, _a[_this._publicHeader] = mid, _a), PathEnum_1.PathEnum.merchant_settings + "settings", testEnv, regional); | ||
}), operators_1.map(function (response) { return response; })); | ||
}; | ||
KushkiGateway.prototype.requestPseBankList = function (mid, testEnv) { | ||
KushkiGateway.prototype.requestPseBankList = function (mid, testEnv, regional) { | ||
var _this = this; | ||
@@ -109,6 +111,6 @@ return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
_a[_this._publicHeader] = mid, | ||
_a), PathEnum_1.PathEnum.bank_list, testEnv); | ||
_a), PathEnum_1.PathEnum.bank_list, testEnv, regional); | ||
}), operators_1.map(function (response) { return response; })); | ||
}; | ||
KushkiGateway.prototype.requestDeferredConditions = function (mid, bin, testEnv) { | ||
KushkiGateway.prototype.requestDeferredConditions = function (mid, bin, testEnv, regional) { | ||
var _this = this; | ||
@@ -119,5 +121,15 @@ return rxjs_1.of(1).pipe(operators_1.concatMap(function () { | ||
_a[_this._publicHeader] = mid, | ||
_a), "" + PathEnum_1.PathEnum.deferred_options + bin, testEnv); | ||
_a), "" + PathEnum_1.PathEnum.deferred_options + bin, testEnv, regional); | ||
}), operators_1.map(function (response) { return response; })); | ||
}; | ||
KushkiGateway.prototype._assingChannel = function (regional, path) { | ||
if (!regional) { | ||
this._uaturl = "" + EnvironmentEnum_1.EnvironmentEnum.uat + path; | ||
this._produrl = "" + EnvironmentEnum_1.EnvironmentEnum.prod + path; | ||
} | ||
else { | ||
this._uaturl = "" + EnvironmentEnum_1.EnvironmentEnum.regionalUat + path; | ||
this._produrl = "" + EnvironmentEnum_1.EnvironmentEnum.regionalProd + path; | ||
} | ||
}; | ||
var KushkiGateway_1; | ||
@@ -124,0 +136,0 @@ KushkiGateway = KushkiGateway_1 = __decorate([ |
@@ -7,4 +7,6 @@ /* tslint:disable:all */ | ||
uat = "https://api-uat.kushkipagos.com/", | ||
prod = "https://api.kushkipagos.com/" | ||
prod = "https://api.kushkipagos.com/", | ||
regionalUat = "https://regional.kushkipagos.com/", | ||
regionalProd = "https://regional.kushkipagos.com/" | ||
} | ||
//# sourceMappingURL=EnvironmentEnum.d.ts.map |
@@ -10,2 +10,4 @@ "use strict"; | ||
EnvironmentEnum["prod"] = "https://api.kushkipagos.com/"; | ||
EnvironmentEnum["regionalUat"] = "https://regional.kushkipagos.com/"; | ||
EnvironmentEnum["regionalProd"] = "https://regional.kushkipagos.com/"; | ||
})(EnvironmentEnum = exports.EnvironmentEnum || (exports.EnvironmentEnum = {})); |
@@ -20,5 +20,7 @@ /* tslint:disable:all */ | ||
private readonly _gateway; | ||
private readonly _regional; | ||
constructor(body: { | ||
merchantId: string; | ||
inTestEnvironment?: boolean; | ||
regional?: boolean; | ||
}); | ||
@@ -25,0 +27,0 @@ requestToken(body: TokenRequest, callback: (value: TokensResponse | Error) => void): void; |
@@ -19,4 +19,6 @@ "use strict"; | ||
body.inTestEnvironment === undefined ? false : body.inTestEnvironment; | ||
body.regional = body.regional === undefined ? false : body.regional; | ||
this._merchantId = body.merchantId; | ||
this._inTestEnvironment = body.inTestEnvironment; | ||
this._regional = body.regional; | ||
this._gateway = new KushkiGateway_1.KushkiGateway(); | ||
@@ -28,3 +30,3 @@ this._kushkiService = new KushkiService_1.KushkiService(this._gateway); | ||
this._kushkiService | ||
.requestToken(body, this._merchantId, this._inTestEnvironment) | ||
.requestToken(body, this._merchantId, this._inTestEnvironment, this._regional) | ||
.subscribe(function (response) { | ||
@@ -36,3 +38,3 @@ callback(response); | ||
this._kushkiService | ||
.requestSubscriptionToken(body, this._merchantId, this._inTestEnvironment) | ||
.requestSubscriptionToken(body, this._merchantId, this._inTestEnvironment, this._regional) | ||
.subscribe(function (response) { | ||
@@ -44,3 +46,3 @@ callback(response); | ||
this._transferService | ||
.requestTransferToken(body, this._merchantId, this._inTestEnvironment) | ||
.requestTransferToken(body, this._merchantId, this._inTestEnvironment, this._regional) | ||
.subscribe(function (response) { | ||
@@ -52,3 +54,3 @@ callback(response); | ||
this._transferService | ||
.requestPseBankList(this._merchantId, this._inTestEnvironment) | ||
.requestPseBankList(this._merchantId, this._inTestEnvironment, this._regional) | ||
.subscribe(function (response) { | ||
@@ -60,3 +62,3 @@ callback(response); | ||
this._kushkiService | ||
.requestDeferred(body, this._merchantId, this._inTestEnvironment) | ||
.requestDeferred(body, this._merchantId, this._inTestEnvironment, this._regional) | ||
.subscribe(function (response) { | ||
@@ -63,0 +65,0 @@ callback(response); |
@@ -17,32 +17,32 @@ /* tslint:disable:all */ | ||
*/ | ||
request(body: object, headers: object, path: string, testEnv: boolean): Observable<object>; | ||
request(body: object, headers: object, path: string, testEnv: boolean, singleIP: boolean): Observable<object>; | ||
/** | ||
* Send GET requests to Kushki Gateway | ||
*/ | ||
requestGet(headers: object, path: string, testEnv: boolean): Observable<object>; | ||
requestGet(headers: object, path: string, testEnv: boolean, regional: boolean): Observable<object>; | ||
/** | ||
* Send token request to Kushki API | ||
*/ | ||
requestToken(body: TokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestToken(body: TokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
* Send token subscription request to Kushki API | ||
*/ | ||
requestSubscriptionToken(body: SubscriptionTokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(body: SubscriptionTokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
* Send transfer token request to Kushki API | ||
*/ | ||
requestTransferToken(body: TransferTokensRequest, mid: string, testEnv: boolean): Observable<TokensResponse>; | ||
requestTransferToken(body: TransferTokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
* Send merchant settings request to Kushki API | ||
*/ | ||
requestMerchantSettings(mid: string, testEnv: boolean): Observable<MerchantSettingsResponse>; | ||
requestMerchantSettings(mid: string, testEnv: boolean, regional: boolean): Observable<MerchantSettingsResponse>; | ||
/** | ||
* Send merchant settings request to Kushki API | ||
*/ | ||
requestPseBankList(mid: string, testEnv: boolean): Observable<BankListResponse>; | ||
requestPseBankList(mid: string, testEnv: boolean, regional: boolean): Observable<BankListResponse>; | ||
/** | ||
* Request deferred information by bin to Kushki API | ||
*/ | ||
requestDeferredConditions(mid: string, bin: string, testEnv: boolean): Observable<DeferredOptionsResponse>; | ||
requestDeferredConditions(mid: string, bin: string, testEnv: boolean, regional: boolean): Observable<DeferredOptionsResponse>; | ||
} | ||
//# sourceMappingURL=IKushkiGateway.d.ts.map |
@@ -18,3 +18,3 @@ /* tslint:disable:all */ | ||
*/ | ||
requestToken(tokenRequest: TokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestToken(tokenRequest: TokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
@@ -26,3 +26,3 @@ * Subscription Token | ||
*/ | ||
requestSubscriptionToken(subscriptionTokenRequest: SubscriptionTokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(subscriptionTokenRequest: SubscriptionTokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
@@ -34,4 +34,4 @@ * Subscription Token | ||
*/ | ||
requestDeferred(binBody: BinBody, mid: string, isTest: boolean): Observable<IDeferredResponse[]>; | ||
requestDeferred(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<IDeferredResponse[]>; | ||
} | ||
//# sourceMappingURL=IKushkiService.d.ts.map |
@@ -15,3 +15,3 @@ /* tslint:disable:all */ | ||
*/ | ||
requestTransferToken(tokenRequest: TransferTokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestTransferToken(tokenRequest: TransferTokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
/** | ||
@@ -22,4 +22,4 @@ * Bank List | ||
*/ | ||
requestPseBankList(mid: string, isTest: boolean): Observable<object>; | ||
requestPseBankList(mid: string, isTest: boolean, regional: boolean): Observable<object>; | ||
} | ||
//# sourceMappingURL=ITransferService.d.ts.map |
@@ -24,5 +24,5 @@ /* tslint:disable:all */ | ||
constructor(gateway: IKushkiGateway); | ||
requestToken(request: TokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(request: SubscriptionTokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestDeferred(binBody: BinBody, mid: string, isTest: boolean): Observable<IDeferredResponse[]>; | ||
requestToken(request: TokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestSubscriptionToken(request: SubscriptionTokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestDeferred(binBody: BinBody, mid: string, isTest: boolean, regional: boolean): Observable<IDeferredResponse[]>; | ||
private static _initSiftScience; | ||
@@ -29,0 +29,0 @@ private _createSiftScienceSession; |
@@ -64,5 +64,5 @@ "use strict"; | ||
KushkiService_1 = KushkiService; | ||
KushkiService.prototype.requestToken = function (request, mid, isTest) { | ||
KushkiService.prototype.requestToken = function (request, mid, isTest, regional) { | ||
var _this = this; | ||
return this._createSiftScienceSession(request.card.number.substring(0, 6), request.card.number.slice(-4), mid, isTest).pipe(operators_1.map(function (siftObject) { | ||
return this._createSiftScienceSession(request.card.number.substring(0, 6), request.card.number.slice(-4), mid, isTest, regional).pipe(operators_1.map(function (siftObject) { | ||
request.isDeferred = | ||
@@ -78,6 +78,6 @@ request.isDeferred === undefined ? false : request.isDeferred; | ||
}), operators_1.switchMap(function (body) { | ||
return _this._gateway.requestToken(body, mid, isTest); | ||
return _this._gateway.requestToken(body, mid, isTest, regional); | ||
})); | ||
}; | ||
KushkiService.prototype.requestSubscriptionToken = function (request, mid, isTest) { | ||
KushkiService.prototype.requestSubscriptionToken = function (request, mid, isTest, regional) { | ||
var _this = this; | ||
@@ -91,7 +91,7 @@ return rxjs_1.of(1).pipe(operators_1.map(function () { | ||
}), operators_1.switchMap(function (body) { | ||
return _this._gateway.requestSubscriptionToken(body, mid, isTest); | ||
return _this._gateway.requestSubscriptionToken(body, mid, isTest, regional); | ||
})); | ||
}; | ||
KushkiService.prototype.requestDeferred = function (binBody, mid, isTest) { | ||
return this._gateway.requestDeferredConditions(mid, binBody.bin, isTest); | ||
KushkiService.prototype.requestDeferred = function (binBody, mid, isTest, regional) { | ||
return this._gateway.requestDeferredConditions(mid, binBody.bin, isTest, regional); | ||
}; | ||
@@ -109,5 +109,7 @@ KushkiService._initSiftScience = function () { | ||
}; | ||
KushkiService.prototype._createSiftScienceSession = function (bin, lastFour, mid, isTest) { | ||
KushkiService.prototype._createSiftScienceSession = function (bin, lastFour, mid, isTest, regional) { | ||
var _this = this; | ||
return rxjs_1.of(1).pipe(operators_1.switchMap(function () { return _this._gateway.requestMerchantSettings(mid, isTest); }), operators_1.map(function (merchantSettings) { | ||
return rxjs_1.of(1).pipe(operators_1.switchMap(function () { | ||
return _this._gateway.requestMerchantSettings(mid, isTest, regional); | ||
}), operators_1.map(function (merchantSettings) { | ||
var sift_environment = isTest | ||
@@ -114,0 +116,0 @@ ? SiftScienceEnum_1.SiftScienceEnum.siftScienceTest |
@@ -15,5 +15,5 @@ /* tslint:disable:all */ | ||
constructor(gateway: IKushkiGateway); | ||
requestTransferToken(request: TransferTokenRequest, mid: string, isTest: boolean): Observable<TokensResponse>; | ||
requestPseBankList(mid: string, isTest: boolean): Observable<BankListResponse>; | ||
requestTransferToken(request: TransferTokenRequest, mid: string, isTest: boolean, regional: boolean): Observable<TokensResponse>; | ||
requestPseBankList(mid: string, isTest: boolean, regional: boolean): Observable<BankListResponse>; | ||
} | ||
//# sourceMappingURL=TransferService.d.ts.map |
@@ -28,7 +28,7 @@ "use strict"; | ||
} | ||
TransferService.prototype.requestTransferToken = function (request, mid, isTest) { | ||
return this._gateway.requestTransferToken(request, mid, isTest); | ||
TransferService.prototype.requestTransferToken = function (request, mid, isTest, regional) { | ||
return this._gateway.requestTransferToken(request, mid, isTest, regional); | ||
}; | ||
TransferService.prototype.requestPseBankList = function (mid, isTest) { | ||
return this._gateway.requestPseBankList(mid, isTest); | ||
TransferService.prototype.requestPseBankList = function (mid, isTest, regional) { | ||
return this._gateway.requestPseBankList(mid, isTest, regional); | ||
}; | ||
@@ -35,0 +35,0 @@ TransferService = __decorate([ |
{ | ||
"name": "@kushki/js", | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"description": "kushki-js", | ||
@@ -5,0 +5,0 @@ "main": "lib/lib.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49960
1192
2882