@kushki/js 1.40.1-alpha.14317.3 → 1.40.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/Kushki.d.ts +119 -23
- package/lib/Kushki.js +119 -20
- package/lib/KushkiInfo.js +3 -2
- package/lib/constant/Identifiers.d.ts +1 -3
- package/lib/constant/Identifiers.js +1 -3
- package/lib/gateway/KushkiGateway.d.ts +9 -14
- package/lib/gateway/KushkiGateway.js +19 -39
- package/lib/gateway/SiftScience.d.ts +1 -0
- package/lib/gateway/SiftScience.js +5 -0
- package/lib/infrastructure/CardBrandsEnum.d.ts +2 -1
- package/lib/infrastructure/CardBrandsEnum.js +1 -0
- package/lib/infrastructure/CardinalValidated.d.ts +10 -0
- package/lib/infrastructure/CardinalValidated.js +8 -0
- package/lib/infrastructure/Container.js +3 -7
- package/lib/infrastructure/EnvironmentEnum.d.ts +1 -1
- package/lib/infrastructure/EnvironmentEnum.js +1 -1
- package/lib/infrastructure/ErrorEnum.d.ts +4 -1
- package/lib/infrastructure/ErrorEnum.js +19 -1
- package/lib/infrastructure/PathEnum.d.ts +4 -6
- package/lib/infrastructure/PathEnum.js +3 -5
- package/lib/repository/IApplePayService.d.ts +40 -0
- package/lib/repository/ICardService.d.ts +3 -5
- package/lib/repository/IKushkiGateway.d.ts +23 -36
- package/lib/service/ApplePayService.d.ts +36 -0
- package/lib/service/ApplePayService.js +189 -0
- package/lib/service/CardService.d.ts +8 -9
- package/lib/service/CardService.js +103 -112
- package/lib/types/apple_pay_get_token_events.d.ts +46 -0
- package/lib/types/apple_pay_get_token_options.d.ts +12 -0
- package/lib/types/apple_pay_options.d.ts +25 -0
- package/lib/types/apple_pay_start_session_request.d.ts +8 -0
- package/lib/types/kushki_subscription_tokens_request.d.ts +0 -10
- package/lib/types/subscription_token_request.d.ts +0 -10
- package/package.json +5 -6
- package/lib/infrastructure/KPayUserPoolEnum.d.ts +0 -5
- package/lib/infrastructure/KPayUserPoolEnum.js +0 -8
- package/lib/infrastructure/KpayPaymentKind.d.ts +0 -6
- package/lib/infrastructure/KpayPaymentKind.js +0 -9
- package/lib/repository/IAuthService.d.ts +0 -20
- package/lib/repository/IKPayService.d.ts +0 -26
- package/lib/repository/IKPayService.js +0 -2
- package/lib/repository/IMobileProcessorService.d.ts +0 -16
- package/lib/repository/IMobileProcessorService.js +0 -2
- package/lib/service/AuthService.d.ts +0 -31
- package/lib/service/AuthService.js +0 -161
- package/lib/service/KPayService.d.ts +0 -19
- package/lib/service/KPayService.js +0 -45
- package/lib/service/MobileProcessorService.d.ts +0 -35
- package/lib/service/MobileProcessorService.js +0 -126
- package/lib/types/delete_payment_method_request.d.ts +0 -6
- package/lib/types/delete_payment_method_response.d.ts +0 -7
- package/lib/types/init_auth_request.d.ts +0 -6
- package/lib/types/init_auth_response.d.ts +0 -6
- package/lib/types/mobile_processor_charge_request.d.ts +0 -13
- package/lib/types/mobile_processor_charge_response.d.ts +0 -7
- package/lib/types/mobile_processor_token.d.ts +0 -66
- package/lib/types/mobile_processor_token_request.d.ts +0 -11
- package/lib/types/mobile_processor_token_response.d.ts +0 -15
- package/lib/types/payment_data_response.d.ts +0 -37
- package/lib/types/saved_payment_data_request.d.ts +0 -10
- package/lib/types/subscription_token_kpay_request.d.ts +0 -13
- package/lib/types/token_kpay_request.d.ts +0 -12
- package/lib/types/validate_session_response.d.ts +0 -6
- package/lib/types/verify_auth_request.d.ts +0 -7
- package/lib/types/verify_auth_response.d.ts +0 -7
- /package/lib/repository/{IAuthService.js → IApplePayService.js} +0 -0
|
@@ -13,6 +13,7 @@ import { SiftScienceAntiFraudSessionResponse } from "./../../lib/types/sift_scie
|
|
|
13
13
|
*/
|
|
14
14
|
export declare class SiftScience implements IAntiFraud {
|
|
15
15
|
private readonly _siftProperty;
|
|
16
|
+
private readonly _siftScriptId;
|
|
16
17
|
private _sift;
|
|
17
18
|
constructor(regional: boolean);
|
|
18
19
|
createSiftScienceSession(processor: string, clientIdentification: string, mid: string, isTest: boolean, merchantSettingsResponse: MerchantSettingsResponse, userId?: string): Observable<SiftScienceObject>;
|
|
@@ -28,6 +28,7 @@ const uuid_1 = require("uuid");
|
|
|
28
28
|
let SiftScience = class SiftScience {
|
|
29
29
|
constructor(regional) {
|
|
30
30
|
this._siftProperty = "_sift";
|
|
31
|
+
this._siftScriptId = "sift_sc_id";
|
|
31
32
|
this._sift = [];
|
|
32
33
|
this._initSiftScience(regional);
|
|
33
34
|
}
|
|
@@ -92,7 +93,11 @@ let SiftScience = class SiftScience {
|
|
|
92
93
|
try {
|
|
93
94
|
// istanbul ignore next
|
|
94
95
|
if (!UtilsService_1.UtilsService.sIsEmpty(window)) {
|
|
96
|
+
const last_script = document.getElementById(this._siftScriptId);
|
|
97
|
+
if (last_script)
|
|
98
|
+
return;
|
|
95
99
|
const e = window.document.createElement("script");
|
|
100
|
+
e.id = this._siftScriptId;
|
|
96
101
|
e.src = regional
|
|
97
102
|
? "https://regional-cdn.kushkipagos.com/siftscience/s.js"
|
|
98
103
|
: "https://cdn.siftscience.com/s.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionCodeEnum = void 0;
|
|
4
|
+
var ActionCodeEnum;
|
|
5
|
+
(function (ActionCodeEnum) {
|
|
6
|
+
ActionCodeEnum["SUCCESS"] = "SUCCESS";
|
|
7
|
+
ActionCodeEnum["FAIL"] = "FAILURE";
|
|
8
|
+
})(ActionCodeEnum = exports.ActionCodeEnum || (exports.ActionCodeEnum = {}));
|
|
@@ -8,16 +8,14 @@ const Identifiers_1 = require("./../../lib/constant/Identifiers");
|
|
|
8
8
|
const KushkiGateway_1 = require("./../../lib/gateway/KushkiGateway");
|
|
9
9
|
const SiftScience_1 = require("./../../lib/gateway/SiftScience");
|
|
10
10
|
const inversify_1 = require("inversify");
|
|
11
|
-
const
|
|
11
|
+
const ApplePayService_1 = require("./../../lib/service/ApplePayService");
|
|
12
12
|
const CardAsyncService_1 = require("./../../lib/service/CardAsyncService");
|
|
13
13
|
const CardDynamicService_1 = require("./../../lib/service/CardDynamicService");
|
|
14
14
|
const CardService_1 = require("./../../lib/service/CardService");
|
|
15
15
|
const CardSubscriptionDynamicService_1 = require("./../../lib/service/CardSubscriptionDynamicService");
|
|
16
16
|
const CashService_1 = require("./../../lib/service/CashService");
|
|
17
17
|
const CommissionService_1 = require("./../../lib/service/CommissionService");
|
|
18
|
-
const KPayService_1 = require("./../../lib/service/KPayService");
|
|
19
18
|
const KushkiService_1 = require("./../../lib/service/KushkiService");
|
|
20
|
-
const MobileProcessorService_1 = require("./../../lib/service/MobileProcessorService");
|
|
21
19
|
const MultiMerchantService_1 = require("./../../lib/service/MultiMerchantService");
|
|
22
20
|
const PayoutsCashService_1 = require("./../../lib/service/PayoutsCashService");
|
|
23
21
|
const PayoutsTransferService_1 = require("./../../lib/service/PayoutsTransferService");
|
|
@@ -28,12 +26,10 @@ const TransferSubscriptionsService_1 = require("./../../lib/service/TransferSubs
|
|
|
28
26
|
const CONTAINER = new inversify_1.Container();
|
|
29
27
|
exports.CONTAINER = CONTAINER;
|
|
30
28
|
// Service
|
|
31
|
-
CONTAINER.bind(Identifiers_1.IDENTIFIERS.
|
|
32
|
-
CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardService).toFactory((context) => (regional) => new CardService_1.CardService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AuthService)(regional), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
29
|
+
CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardService).toFactory((context) => (regional) => new CardService_1.CardService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
33
30
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.CashService).toFactory((context) => (regional) => new CashService_1.CashService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
34
31
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardDynamicService).toFactory((context) => () => new CardDynamicService_1.CardDynamicService(context.container.get(Identifiers_1.IDENTIFIERS.CardService)(), context.container.get(Identifiers_1.IDENTIFIERS.CardAsyncService)()));
|
|
35
32
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardSubscriptionDynamicService).toFactory((context) => () => new CardSubscriptionDynamicService_1.CardSubscriptionDynamicService(context.container.get(Identifiers_1.IDENTIFIERS.CardService)(), context.container.get(Identifiers_1.IDENTIFIERS.CardAsyncService)()));
|
|
36
|
-
CONTAINER.bind(Identifiers_1.IDENTIFIERS.MobileProcessorService).toFactory((context) => () => new MobileProcessorService_1.MobileProcessorService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
37
33
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.KushkiService).toFactory((context) => (_regional) => new KushkiService_1.KushkiService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
38
34
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.TransferService).toFactory((context) => (regional) => new TransferService_1.TransferService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
39
35
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.SecureService).toFactory((context) => () => new SecureService_1.SecureService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
@@ -43,8 +39,8 @@ CONTAINER.bind(Identifiers_1.IDENTIFIERS.CardAsyncService).toFactory((context) =
|
|
|
43
39
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.PayoutsCashService).toFactory((context) => (regional) => new PayoutsCashService_1.PayoutsCashService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
44
40
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.TransferSubscriptionService).toFactory((context) => (regional) => new TransferSubscriptionsService_1.TransferSubscriptionsService(context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional), context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
45
41
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.PayoutsTransferService).toFactory((context) => (regional) => new PayoutsTransferService_1.PayoutsTransferService(context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional), context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
46
|
-
CONTAINER.bind(Identifiers_1.IDENTIFIERS.KPayService).toFactory((context) => (regional) => new KPayService_1.KPayService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AuthService)(regional)));
|
|
47
42
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.SiftScienceService).toFactory((context) => (regional) => new SiftScienceService_1.SiftScienceService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway), context.container.get(Identifiers_1.IDENTIFIERS.AntiFraud)(regional)));
|
|
43
|
+
CONTAINER.bind(Identifiers_1.IDENTIFIERS.ApplePayService).toFactory((context) => () => new ApplePayService_1.ApplePayService(context.container.get(Identifiers_1.IDENTIFIERS.KushkiGateway)));
|
|
48
44
|
// Gateway
|
|
49
45
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.KushkiGateway).to(KushkiGateway_1.KushkiGateway);
|
|
50
46
|
CONTAINER.bind(Identifiers_1.IDENTIFIERS.AntiFraud).toFactory(() => (regional) => new SiftScience_1.SiftScience(regional));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Environment enum file
|
|
4
4
|
*/
|
|
5
5
|
export declare enum EnvironmentEnum {
|
|
6
|
-
uat = "https://api-
|
|
6
|
+
uat = "https://api-uat.kushkipagos.com/",
|
|
7
7
|
prod = "https://api.kushkipagos.com/",
|
|
8
8
|
regionalUat = "https://regional-uat.kushkipagos.com/",
|
|
9
9
|
regionalProd = "https://regional.kushkipagos.com/"
|
|
@@ -6,7 +6,7 @@ exports.EnvironmentEnum = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
var EnvironmentEnum;
|
|
8
8
|
(function (EnvironmentEnum) {
|
|
9
|
-
EnvironmentEnum["uat"] = "https://api-
|
|
9
|
+
EnvironmentEnum["uat"] = "https://api-uat.kushkipagos.com/";
|
|
10
10
|
EnvironmentEnum["prod"] = "https://api.kushkipagos.com/";
|
|
11
11
|
EnvironmentEnum["regionalUat"] = "https://regional-uat.kushkipagos.com/";
|
|
12
12
|
EnvironmentEnum["regionalProd"] = "https://regional.kushkipagos.com/";
|
|
@@ -21,6 +21,9 @@ var ErrorCode;
|
|
|
21
21
|
ErrorCode["E015"] = "E015";
|
|
22
22
|
ErrorCode["E016"] = "E016";
|
|
23
23
|
ErrorCode["E017"] = "E017";
|
|
24
|
+
ErrorCode["E018"] = "E018";
|
|
25
|
+
ErrorCode["E019"] = "E019";
|
|
26
|
+
ErrorCode["E020"] = "E020";
|
|
24
27
|
})(ErrorCode = exports.ErrorCode || (exports.ErrorCode = {}));
|
|
25
28
|
exports.ERRORS = {
|
|
26
29
|
[ErrorCode.E001]: {
|
|
@@ -50,7 +53,7 @@ exports.ERRORS = {
|
|
|
50
53
|
},
|
|
51
54
|
[ErrorCode.E006]: {
|
|
52
55
|
code: ErrorCode.E006,
|
|
53
|
-
message: "Error de
|
|
56
|
+
message: "Error en solicitud de token de apple pay.",
|
|
54
57
|
statusCode: StatusCodeEnum_1.StatusCodeEnum.BadRequest,
|
|
55
58
|
},
|
|
56
59
|
[ErrorCode.E007]: {
|
|
@@ -108,4 +111,19 @@ exports.ERRORS = {
|
|
|
108
111
|
message: "Marca de tarjeta inválida.",
|
|
109
112
|
statusCode: StatusCodeEnum_1.StatusCodeEnum.BadRequest,
|
|
110
113
|
},
|
|
114
|
+
[ErrorCode.E018]: {
|
|
115
|
+
code: ErrorCode.E018,
|
|
116
|
+
message: "No se cargaron los recursos para validación con 3DS.",
|
|
117
|
+
statusCode: StatusCodeEnum_1.StatusCodeEnum.InternalServerError,
|
|
118
|
+
},
|
|
119
|
+
[ErrorCode.E019]: {
|
|
120
|
+
code: ErrorCode.E019,
|
|
121
|
+
message: "No se crearon los recursos de Apple Pay.",
|
|
122
|
+
statusCode: StatusCodeEnum_1.StatusCodeEnum.InternalServerError,
|
|
123
|
+
},
|
|
124
|
+
[ErrorCode.E020]: {
|
|
125
|
+
code: ErrorCode.E020,
|
|
126
|
+
message: "No es posible realizar pagos con Apple Pay.",
|
|
127
|
+
statusCode: StatusCodeEnum_1.StatusCodeEnum.InternalServerError,
|
|
128
|
+
},
|
|
111
129
|
};
|
|
@@ -25,11 +25,9 @@ export declare enum PathEnum {
|
|
|
25
25
|
payouts_cash_tokens = "payouts/cash/v1/tokens",
|
|
26
26
|
transfer_subscription_tokens = "transfer-subscriptions/v1/tokens",
|
|
27
27
|
payouts_transfer_tokens = "payouts/transfer/v1/tokens",
|
|
28
|
-
mobile_processor_token = "mobile-processor/v1/token",
|
|
29
|
-
mobile_processor_charge = "mobile-processor/v1/charge",
|
|
30
28
|
cybersource_jwt = "card/v1/authToken",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
get_user_id = "v1/subscriptions/",
|
|
30
|
+
validate_apple_domain = "apple-pay/v1/validate",
|
|
31
|
+
start_apple_pay_session = "apple-pay/v1/session/start",
|
|
32
|
+
get_apple_pay_token = "apple-pay/v1/token"
|
|
35
33
|
}
|
|
@@ -28,11 +28,9 @@ var PathEnum;
|
|
|
28
28
|
PathEnum["payouts_cash_tokens"] = "payouts/cash/v1/tokens";
|
|
29
29
|
PathEnum["transfer_subscription_tokens"] = "transfer-subscriptions/v1/tokens";
|
|
30
30
|
PathEnum["payouts_transfer_tokens"] = "payouts/transfer/v1/tokens";
|
|
31
|
-
PathEnum["mobile_processor_token"] = "mobile-processor/v1/token";
|
|
32
|
-
PathEnum["mobile_processor_charge"] = "mobile-processor/v1/charge";
|
|
33
31
|
PathEnum["cybersource_jwt"] = "card/v1/authToken";
|
|
34
|
-
PathEnum["savedPaymentMethods"] = "/personal-wallet/v1/payment-data/";
|
|
35
|
-
PathEnum["kpay_delete_payment_method"] = "personal-wallet/v1/walletSubscription";
|
|
36
|
-
PathEnum["kpay_get_saved_payment_methods"] = "personal-wallet/v1/payment-data";
|
|
37
32
|
PathEnum["get_user_id"] = "v1/subscriptions/";
|
|
33
|
+
PathEnum["validate_apple_domain"] = "apple-pay/v1/validate";
|
|
34
|
+
PathEnum["start_apple_pay_session"] = "apple-pay/v1/session/start";
|
|
35
|
+
PathEnum["get_apple_pay_token"] = "apple-pay/v1/token";
|
|
38
36
|
})(PathEnum = exports.PathEnum || (exports.PathEnum = {}));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* tslint:disable:all */
|
|
2
|
+
/**
|
|
3
|
+
* IApplePayService file.
|
|
4
|
+
*/
|
|
5
|
+
import { AppleTokenResponse } from "./../../lib/types/apple_pay_get_token_events";
|
|
6
|
+
import { ApplePayGetTokenOptions } from "./../../lib/types/apple_pay_get_token_options";
|
|
7
|
+
import { ApplePayOptions } from "./../../lib/types/apple_pay_options";
|
|
8
|
+
import { ErrorResponse } from "./../../lib/types/error_response";
|
|
9
|
+
export interface IApplePayService {
|
|
10
|
+
/**
|
|
11
|
+
* Create Apple Pay button into kushki <div>
|
|
12
|
+
* @param options - style and text options for button
|
|
13
|
+
* @param mid - public merchant id
|
|
14
|
+
* @param isTest - is in test flag
|
|
15
|
+
* @param regional - is for regional flag
|
|
16
|
+
* @param onInit - call when button initialization finish correctly
|
|
17
|
+
* @param onClick - call if button is initialized correctly and the user click the button
|
|
18
|
+
* @param onError - call if exist an error on button initialization
|
|
19
|
+
*/
|
|
20
|
+
initApplePayButton(options: ApplePayOptions, mid: string, isTest: boolean, regional: boolean, onInit: () => void, onClick: () => void, onError: (error: ErrorResponse) => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Request card token with Apple Pay encrypted data
|
|
23
|
+
* @param options - payment options like currency, country, amount, etc.
|
|
24
|
+
* @param mid - public merchant id
|
|
25
|
+
* @param isTest - is in test flag
|
|
26
|
+
* @param regional - is for regional flag
|
|
27
|
+
* @param callback - call when process finish correctly with card token or error
|
|
28
|
+
* @param onCancel - call if the payment process is canceled
|
|
29
|
+
*/
|
|
30
|
+
requestApplePayToken(options: ApplePayGetTokenOptions, mid: string, isTest: boolean, regional: boolean, callback: (value: AppleTokenResponse | ErrorResponse) => void, onCancel: () => void): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Apple session object structure
|
|
34
|
+
*/
|
|
35
|
+
export interface IAppleSession {
|
|
36
|
+
completePayment: (merchantSession: object) => void;
|
|
37
|
+
completeMerchantValidation: (merchantSession: object) => void;
|
|
38
|
+
abort: () => void;
|
|
39
|
+
validationURL: string;
|
|
40
|
+
}
|
|
@@ -10,14 +10,12 @@ import { IDeferredResponse } from "./../../lib/types/remote/deferred_response";
|
|
|
10
10
|
import { TokenResponse } from "./../../lib/types/remote/token_response";
|
|
11
11
|
import { SecureInitRequest } from "./../../lib/types/secure_init_request";
|
|
12
12
|
import { SecureInitResponse } from "./../../lib/types/secure_init_response";
|
|
13
|
-
import { SubscriptionTokenKPayRequest } from "./../../lib/types/subscription_token_kpay_request";
|
|
14
13
|
import { SubscriptionTokenRequest } from "./../../lib/types/subscription_token_request";
|
|
15
14
|
import { SubscriptionIdRequest } from "./../../lib/types/subscriptionId_request";
|
|
16
|
-
import { TokenKPayRequest } from "./../../lib/types/token_kpay_request";
|
|
17
15
|
import { TokenRequest } from "./../../lib/types/token_request";
|
|
18
16
|
import { Validate3DSRequest } from "./../../lib/types/validate_3ds_request";
|
|
19
17
|
import { Validate3DsResponse } from "./../../lib/types/validate_3ds_response";
|
|
20
|
-
export declare type IGeneralTokenRequest = TokenRequest |
|
|
18
|
+
export declare type IGeneralTokenRequest = TokenRequest | SubscriptionTokenRequest;
|
|
21
19
|
export interface ICardService {
|
|
22
20
|
/**
|
|
23
21
|
* Token
|
|
@@ -27,7 +25,7 @@ export interface ICardService {
|
|
|
27
25
|
* @param regional - Define if endpoint used regional URL
|
|
28
26
|
* @param callback
|
|
29
27
|
*/
|
|
30
|
-
requestToken(tokenRequest: TokenRequest
|
|
28
|
+
requestToken(tokenRequest: TokenRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: TokenResponse | ErrorResponse) => void): void;
|
|
31
29
|
/**
|
|
32
30
|
* Subscription Token
|
|
33
31
|
* @param subscriptionTokenRequest - subscription tokens request body
|
|
@@ -36,7 +34,7 @@ export interface ICardService {
|
|
|
36
34
|
* @param regional - Define if endpoint used regional URL
|
|
37
35
|
* @param callback
|
|
38
36
|
*/
|
|
39
|
-
requestSubscriptionToken(subscriptionTokenRequest: SubscriptionTokenRequest
|
|
37
|
+
requestSubscriptionToken(subscriptionTokenRequest: SubscriptionTokenRequest, mid: string, isTest: boolean, regional: boolean, callback: (value: TokenResponse | ErrorResponse) => void): void;
|
|
40
38
|
/**
|
|
41
39
|
* Subscription Token
|
|
42
40
|
* @param binBody - deferred bin request body
|
|
@@ -3,26 +3,22 @@
|
|
|
3
3
|
* Interface for Kushki Gateway.
|
|
4
4
|
*/
|
|
5
5
|
import { Observable } from "rxjs";
|
|
6
|
+
import { ApplePayGetTokenRequest } from "./../../lib/types/apple_pay_get_token_events";
|
|
7
|
+
import { ApplePayStartSessionRequest } from "./../../lib/types/apple_pay_start_session_request";
|
|
6
8
|
import { BankListResponse } from "./../../lib/types/bank_list_response";
|
|
7
9
|
import { BinInfoResponse } from "./../../lib/types/bin_info_response";
|
|
8
10
|
import { CardAsyncTokenRequest } from "./../../lib/types/card_async_token_request";
|
|
9
11
|
import { CardAsyncTokenResponse } from "./../../lib/types/card_async_token_response";
|
|
10
12
|
import { CashTokenRequest } from "./../../lib/types/cash_token_request";
|
|
11
13
|
import { DeferredOptionsResponse } from "./../../lib/types/deferred_options_response";
|
|
12
|
-
import { DeletePaymentMethodRequest } from "./../../lib/types/delete_payment_method_request";
|
|
13
14
|
import { GetBrandsLogosByMerchantResponse } from "./../../lib/types/get_brands_logos_by_merchant_response";
|
|
14
15
|
import { GetUserId } from "./../../lib/types/get_user_id";
|
|
15
16
|
import { JwtResponse } from "./../../lib/types/jwt_response";
|
|
16
17
|
import { KushkiSubscriptionTokensRequest } from "./../../lib/types/kushki_subscription_tokens_request";
|
|
17
18
|
import { KushkiTokensRequest } from "./../../lib/types/kushki_tokens_request";
|
|
18
19
|
import { MerchantSettingsResponse } from "./../../lib/types/merchant_settings_response";
|
|
19
|
-
import { MobileProcessorChargeRequest } from "./../../lib/types/mobile_processor_charge_request";
|
|
20
|
-
import { MobileProcessorChargeResponse } from "./../../lib/types/mobile_processor_charge_response";
|
|
21
|
-
import { MobileProcessorTokenRequest } from "./../../lib/types/mobile_processor_token_request";
|
|
22
|
-
import { MobileProcessorTokenResponse } from "./../../lib/types/mobile_processor_token_response";
|
|
23
20
|
import { MultiMerchantInfoRequest } from "./../../lib/types/multimerchant_info_request";
|
|
24
21
|
import { MultiMerchantInfoResponse } from "./../../lib/types/multimerchant_info_response";
|
|
25
|
-
import { PaymentDataResponse } from "./../../lib/types/payment_data_response";
|
|
26
22
|
import { PayoutsCashTokenRequest } from "./../../lib/types/payouts_cash_request";
|
|
27
23
|
import { PayoutsTransferTokenRequest } from "./../../lib/types/payouts_transfer_token_request";
|
|
28
24
|
import { CommissionConfigurationAmount } from "./../../lib/types/remote/commission_configuration_amount";
|
|
@@ -30,13 +26,13 @@ import { CommissionConfigurationRequest } from "./../../lib/types/remote/commiss
|
|
|
30
26
|
import { TokenResponse } from "./../../lib/types/remote/token_response";
|
|
31
27
|
import { TransferTokenRequest } from "./../../lib/types/remote/transfer_token_request";
|
|
32
28
|
import { ResponseStatusValidator } from "./../../lib/types/response_status_validator";
|
|
33
|
-
import { SavedPaymentMethodRequest } from "./../../lib/types/saved_payment_data_request";
|
|
34
29
|
import { SecureOtpRequest } from "./../../lib/types/secure_otp_request";
|
|
35
30
|
import { SecureOtpResponse } from "./../../lib/types/secure_otp_response";
|
|
36
31
|
import { SubscriptionCardAsyncTokenRequest } from "./../../lib/types/subscription_card_async_token_request";
|
|
37
32
|
import { SubscriptionCardAsyncTokenResponse } from "./../../lib/types/subscription_card_async_token_response";
|
|
38
33
|
import { TokenChargeRequest } from "./../../lib/types/token_charge_request";
|
|
39
34
|
import { TransferSubscriptionTokenRequest } from "./../../lib/types/transfer_subscription_token_request";
|
|
35
|
+
import { Validate3DsResponse } from "./../../lib/types/validate_3ds_response";
|
|
40
36
|
export interface IKushkiGateway {
|
|
41
37
|
/**
|
|
42
38
|
* Send POST requests to Kushki Gateway
|
|
@@ -46,10 +42,6 @@ export interface IKushkiGateway {
|
|
|
46
42
|
* Send GET requests to Kushki Gateway
|
|
47
43
|
*/
|
|
48
44
|
requestGet(path: string, testEnv: boolean, regional: boolean, mid?: string): Observable<object>;
|
|
49
|
-
/**
|
|
50
|
-
* Send DELETE requests to Kushki Gateway
|
|
51
|
-
*/
|
|
52
|
-
requestDelete<T extends object = object>(path: string, testEnv: boolean, regional: boolean, mid: string, authorization: string): Observable<T>;
|
|
53
45
|
/**
|
|
54
46
|
* Send tokens request to Kushki API
|
|
55
47
|
*/
|
|
@@ -61,7 +53,7 @@ export interface IKushkiGateway {
|
|
|
61
53
|
/**
|
|
62
54
|
* Send tokens subscription request to Kushki API
|
|
63
55
|
*/
|
|
64
|
-
requestSubscriptionToken(body: KushkiSubscriptionTokensRequest, mid: string, testEnv: boolean, regional: boolean
|
|
56
|
+
requestSubscriptionToken(body: KushkiSubscriptionTokensRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokenResponse>;
|
|
65
57
|
/**
|
|
66
58
|
* Send transfer tokens request to Kushki API
|
|
67
59
|
*/
|
|
@@ -137,47 +129,42 @@ export interface IKushkiGateway {
|
|
|
137
129
|
*/
|
|
138
130
|
requestPayoutsTransferBankList(mid: string, testEnv: boolean, regional: boolean): Observable<BankListResponse>;
|
|
139
131
|
/**
|
|
140
|
-
*
|
|
141
|
-
* @param
|
|
132
|
+
* Get JWT for 3DS
|
|
133
|
+
* @param mid - public credential for request
|
|
142
134
|
* @param testEnv - is test environment
|
|
143
135
|
* @param regional - Define if endpoint used regional URL
|
|
144
136
|
*/
|
|
145
|
-
|
|
137
|
+
cybersourceJwt(mid: string, testEnv: boolean, regional: boolean, subscriptionId?: string): Observable<JwtResponse>;
|
|
146
138
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @param
|
|
139
|
+
* Get userId
|
|
140
|
+
* @param subscriptionId subscription id for the request
|
|
141
|
+
* @param mid public credential for request
|
|
149
142
|
* @param testEnv - is test environment
|
|
150
143
|
* @param regional - Define if endpoint used regional URL
|
|
151
144
|
*/
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* @param body
|
|
155
|
-
* @param testEnv
|
|
156
|
-
* @param mid - public credential for request
|
|
157
|
-
* @param regional - Define if endpoint used regional URL
|
|
158
|
-
* @param authorization
|
|
159
|
-
*/
|
|
160
|
-
deletePaymentMethod(body: DeletePaymentMethodRequest, testEnv: boolean, regional: boolean, mid: string, authorization: string): Observable<boolean>;
|
|
145
|
+
getUserId(subscriptionId: string, mid: string, testEnv: boolean, regional: boolean): Observable<GetUserId>;
|
|
161
146
|
/**
|
|
162
|
-
*
|
|
163
|
-
* @param
|
|
164
|
-
* @param mid
|
|
147
|
+
* Validate if merchant domain is valid in Apple configuration
|
|
148
|
+
* @param domain current domain of merchant application
|
|
149
|
+
* @param mid public credential for request
|
|
150
|
+
* @param testEnv - is test environment
|
|
165
151
|
* @param regional - Define if endpoint used regional URL
|
|
166
152
|
*/
|
|
167
|
-
|
|
153
|
+
validateAppleDomain(domain: string, mid: string, testEnv: boolean, regional: boolean): Observable<Validate3DsResponse>;
|
|
168
154
|
/**
|
|
169
|
-
*
|
|
170
|
-
* @param
|
|
155
|
+
* Start Apple Pay Session
|
|
156
|
+
* @param body start session required params
|
|
157
|
+
* @param mid public credential for request
|
|
171
158
|
* @param testEnv - is test environment
|
|
172
159
|
* @param regional - Define if endpoint used regional URL
|
|
173
160
|
*/
|
|
174
|
-
|
|
161
|
+
startApplePaySession(body: ApplePayStartSessionRequest, mid: string, testEnv: boolean, regional: boolean): Observable<object>;
|
|
175
162
|
/**
|
|
176
|
-
* Get
|
|
177
|
-
* @param
|
|
163
|
+
* Get Apple Pay Session
|
|
164
|
+
* @param body token required params
|
|
178
165
|
* @param mid public credential for request
|
|
179
166
|
* @param testEnv - is test environment
|
|
180
167
|
* @param regional - Define if endpoint used regional URL
|
|
181
168
|
*/
|
|
182
|
-
|
|
169
|
+
getApplePayToken(body: ApplePayGetTokenRequest, mid: string, testEnv: boolean, regional: boolean): Observable<TokenResponse>;
|
|
183
170
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* tslint:disable:all */
|
|
2
|
+
import "reflect-metadata";
|
|
3
|
+
import { IApplePayService } from "./../../lib/repository/IApplePayService";
|
|
4
|
+
import { IKushkiGateway } from "./../../lib/repository/IKushkiGateway";
|
|
5
|
+
import { AppleTokenResponse } from "./../../lib/types/apple_pay_get_token_events";
|
|
6
|
+
import { ApplePayGetTokenOptions } from "./../../lib/types/apple_pay_get_token_options";
|
|
7
|
+
import { ApplePayOptions } from "./../../lib/types/apple_pay_options";
|
|
8
|
+
import { ErrorResponse } from "./../../lib/types/error_response";
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
ApplePaySession: any;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Implementation
|
|
16
|
+
*/
|
|
17
|
+
export declare class ApplePayService implements IApplePayService {
|
|
18
|
+
private readonly _gateway;
|
|
19
|
+
private readonly _appleSdkCdn;
|
|
20
|
+
private readonly _appleSdkId;
|
|
21
|
+
private readonly _appleButtonElement;
|
|
22
|
+
private readonly _appleButtonContainer;
|
|
23
|
+
private readonly _requiredMerchantCapabilities;
|
|
24
|
+
private readonly _maxCompatibleVersion;
|
|
25
|
+
constructor(gateway: IKushkiGateway);
|
|
26
|
+
initApplePayButton(options: ApplePayOptions, mid: string, isTest: boolean, regional: boolean, onInit: () => void, onClick: () => void, onError: (error: ErrorResponse) => void): void;
|
|
27
|
+
requestApplePayToken(options: ApplePayGetTokenOptions, mid: string, isTest: boolean, regional: boolean, callback: (value: AppleTokenResponse | ErrorResponse) => void, onCancel: () => void): void;
|
|
28
|
+
private _validateAppleDomain;
|
|
29
|
+
private _isNotPaymentAvailable;
|
|
30
|
+
private _getSupportedApplePayVersion;
|
|
31
|
+
private _loadAppleSdk;
|
|
32
|
+
private _buildAppleButton;
|
|
33
|
+
private _onValidateMerchant;
|
|
34
|
+
private _onPaymentAuthorized;
|
|
35
|
+
static getClientDomain(): string;
|
|
36
|
+
}
|