@fat-zebra/sdk 1.5.8-beta.2 → 1.5.8
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/CHANGELOG.md +24 -0
- package/README.md +9 -3
- package/dist/applepay/applepay.js +6 -33
- package/dist/applepay/clients/paynow-client.js +1 -1
- package/dist/main.js +3 -3
- package/dist/production/fatzebra.js +7 -1
- package/dist/production/fatzebra.js.LICENSE.txt +1 -3
- package/dist/react/useNotification.d.ts +11 -0
- package/dist/react/useNotification.js +26 -0
- package/dist/sandbox/fatzebra.js +7 -1
- package/dist/sandbox/fatzebra.js.LICENSE.txt +1 -1
- package/dist/sca/index.js +2 -2
- package/dist/sca/scenarios/enrollment.js +2 -2
- package/dist/sca/scenarios/validation.js +3 -3
- package/dist/staging/fatzebra.js +198 -89
- package/dist/staging/fatzebra.js.map +1 -1
- package/dist/validation/schemas/click-to-pay/load-params.json +2 -2
- package/dist/validation/schemas/hpp-load-params.json +2 -2
- package/dist/validation/schemas/payment-intent.json +0 -3
- package/dist/validation/schemas/payment-method.json +17 -49
- package/dist/validation/validation-helper.js +2 -1
- package/dist/validation/validators/apple-pay-load-params-button-validator.d.ts +1 -2
- package/dist/validation/validators/apple-pay-load-params-button-validator.js +1 -2
- package/dist/validation/validators/click-to-pay-load-params-validator.d.ts +1 -2
- package/dist/validation/validators/click-to-pay-load-params-validator.js +1 -2
- package/dist/validation/validators/hpp-load-params-validator.d.ts +1 -2
- package/dist/validation/validators/hpp-load-params-validator.js +5 -4
- package/dist/validation/validators/verify-card-params-validator.d.ts +1 -2
- package/dist/validation/validators/verify-card-params-validator.js +5 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
|
package/dist/sca/index.js
CHANGED
|
@@ -90,8 +90,8 @@ class Sca {
|
|
|
90
90
|
this._cardinal.setup(cardinalJwt);
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
|
-
perform3DS(
|
|
94
|
-
return __awaiter(this,
|
|
93
|
+
perform3DS({ sessionID }) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
95
|
this.sessionId = sessionID;
|
|
96
96
|
// Register handler. Called after OTP is entered on challenge prompt.
|
|
97
97
|
this._cardinal.onPaymentValidated((data, error) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -21,7 +21,7 @@ const enrollmentScenarios = [
|
|
|
21
21
|
veresEnrolled: VEResEnrolled.BYPASSED,
|
|
22
22
|
pares: null,
|
|
23
23
|
outcome: {
|
|
24
|
-
success: false,
|
|
24
|
+
success: false,
|
|
25
25
|
authenticationType: 'bypass',
|
|
26
26
|
errorCode: ScaErrorCode.BYPASSED_AUTHENTICATION
|
|
27
27
|
},
|
|
@@ -34,7 +34,7 @@ const enrollmentScenarios = [
|
|
|
34
34
|
veresEnrolled: VEResEnrolled.UNABLE,
|
|
35
35
|
pares: null,
|
|
36
36
|
outcome: {
|
|
37
|
-
success: false,
|
|
37
|
+
success: false,
|
|
38
38
|
errorCode: ScaErrorCode.AUTHENTICATION_NOT_AVAILABLE_ON_LOOKUP
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -34,7 +34,7 @@ const validationScenarios = [
|
|
|
34
34
|
pares: PARes.CANCELED,
|
|
35
35
|
outcome: {
|
|
36
36
|
authenticationType: 'challenge',
|
|
37
|
-
success: false,
|
|
37
|
+
success: false,
|
|
38
38
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
39
39
|
}
|
|
40
40
|
},
|
|
@@ -47,7 +47,7 @@ const validationScenarios = [
|
|
|
47
47
|
pares: PARes.NOT_COMPLETED,
|
|
48
48
|
outcome: {
|
|
49
49
|
authenticationType: 'challenge',
|
|
50
|
-
success: false,
|
|
50
|
+
success: false,
|
|
51
51
|
errorCode: ScaErrorCode.UNAVAILABLE_STEPUP_AUTHENTICATION
|
|
52
52
|
}
|
|
53
53
|
},
|
|
@@ -126,7 +126,7 @@ const validationScenarios = [
|
|
|
126
126
|
pares: null,
|
|
127
127
|
outcome: {
|
|
128
128
|
authenticationType: 'challenge',
|
|
129
|
-
success: false,
|
|
129
|
+
success: false,
|
|
130
130
|
errorCode: ScaErrorCode.UNSUCCESSFUL_STEPUP_AUTHENTICATION
|
|
131
131
|
}
|
|
132
132
|
},
|
package/dist/staging/fatzebra.js
CHANGED
|
@@ -16011,9 +16011,11 @@ var post_message_client_1 = __webpack_require__("./src/shared/post-message-clien
|
|
|
16011
16011
|
var FatZebra = __importStar(__webpack_require__("./src/shared/types.ts"));
|
|
16012
16012
|
var env_1 = __importDefault(__webpack_require__("./src/shared/env.ts"));
|
|
16013
16013
|
var event_manager_1 = __webpack_require__("./src/shared/event-manager.ts");
|
|
16014
|
+
var bridge = __importStar(__webpack_require__("./src/shared/bridge-client.ts"));
|
|
16014
16015
|
var channel = 'applepay';
|
|
16015
16016
|
var merchantSessionPath = '/v2/apple_pay/auth';
|
|
16016
|
-
var
|
|
16017
|
+
var purchasePath = '/v2/apple_pay/token';
|
|
16018
|
+
var tokenPath = '/v2/apple_pay/tokenize';
|
|
16017
16019
|
var ApplePay = /** @class */ (function () {
|
|
16018
16020
|
function ApplePay(config) {
|
|
16019
16021
|
this.paymentIntent = config.paymentIntent;
|
|
@@ -16024,8 +16026,10 @@ var ApplePay = /** @class */ (function () {
|
|
|
16024
16026
|
ApplePay.prototype.load = function (config) {
|
|
16025
16027
|
var _this = this;
|
|
16026
16028
|
var _a, _b, _c;
|
|
16029
|
+
console.log("this is loaded apple pay");
|
|
16027
16030
|
this.domain_name = (_b = (_a = config === null || config === void 0 ? void 0 : config.options) === null || _a === void 0 ? void 0 : _a.domain_name) !== null && _b !== void 0 ? _b : window.location.hostname;
|
|
16028
16031
|
this.iframe = document.createElement('iframe');
|
|
16032
|
+
this.tokenizeOnly = config.options.tokenize_only;
|
|
16029
16033
|
this.react_sdk = (_c = config.options.react_sdk) !== null && _c !== void 0 ? _c : false;
|
|
16030
16034
|
document.getElementById(config.containerId).appendChild(this.iframe);
|
|
16031
16035
|
var applePayUrl = this.getPayNowUrl(config.options);
|
|
@@ -16033,17 +16037,25 @@ var ApplePay = /** @class */ (function () {
|
|
|
16033
16037
|
this.iframe.setAttribute("height", '100%');
|
|
16034
16038
|
this.iframe.setAttribute("width", '100%');
|
|
16035
16039
|
this.iframe.setAttribute('allow', 'payment');
|
|
16040
|
+
this.headless = bridge.load("https://paynow.pmnts-staging.io/sdk/bridge");
|
|
16036
16041
|
this.postMessageClient = new post_message_client_1.PostMessageClient({
|
|
16037
16042
|
channel: channel,
|
|
16038
16043
|
target: this.iframe,
|
|
16039
16044
|
environment: this.environment,
|
|
16040
16045
|
});
|
|
16046
|
+
this.headless.onload = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16047
|
+
return __generator(this, function (_a) {
|
|
16048
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.HPP_READY);
|
|
16049
|
+
return [2 /*return*/];
|
|
16050
|
+
});
|
|
16051
|
+
}); };
|
|
16041
16052
|
this.iframe.onload = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16042
16053
|
return __generator(this, function (_a) {
|
|
16043
16054
|
switch (_a.label) {
|
|
16044
16055
|
case 0: return [4 /*yield*/, this.initialize()];
|
|
16045
16056
|
case 1:
|
|
16046
16057
|
_a.sent();
|
|
16058
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.HPP_READY);
|
|
16047
16059
|
return [2 /*return*/];
|
|
16048
16060
|
}
|
|
16049
16061
|
});
|
|
@@ -16125,11 +16137,66 @@ var ApplePay = /** @class */ (function () {
|
|
|
16125
16137
|
return [2 /*return*/];
|
|
16126
16138
|
}
|
|
16127
16139
|
});
|
|
16128
|
-
}); }
|
|
16140
|
+
}); },
|
|
16129
16141
|
});
|
|
16130
16142
|
resolve();
|
|
16131
16143
|
});
|
|
16132
16144
|
};
|
|
16145
|
+
ApplePay.prototype.handleSuccessResult = function (data) {
|
|
16146
|
+
var transactionPayload;
|
|
16147
|
+
if (this.tokenizeOnly) {
|
|
16148
|
+
transactionPayload = {
|
|
16149
|
+
card_category: data.card_category,
|
|
16150
|
+
card_expiry: data.card_expiry,
|
|
16151
|
+
card_holder: data.card_holder,
|
|
16152
|
+
card_number: data.card_number,
|
|
16153
|
+
card_subcategory: data.card_subcategory,
|
|
16154
|
+
card_type: data.card_type,
|
|
16155
|
+
r: data.r,
|
|
16156
|
+
successful: data.successful,
|
|
16157
|
+
token: data.token,
|
|
16158
|
+
v: data.v
|
|
16159
|
+
};
|
|
16160
|
+
var payload = {
|
|
16161
|
+
data: transactionPayload,
|
|
16162
|
+
message: 'Tokenization successful.'
|
|
16163
|
+
};
|
|
16164
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.TOKENIZATION_SUCCESS, payload);
|
|
16165
|
+
}
|
|
16166
|
+
else {
|
|
16167
|
+
transactionPayload = {
|
|
16168
|
+
transaction_id: data.transaction_id,
|
|
16169
|
+
response_code: data.response_code,
|
|
16170
|
+
message: data.message,
|
|
16171
|
+
amount: data.amount,
|
|
16172
|
+
currency: data.currency,
|
|
16173
|
+
reference: data.reference,
|
|
16174
|
+
card_number: data.card_number,
|
|
16175
|
+
card_holder: data.card_holder,
|
|
16176
|
+
card_expiry: data.card_expiry,
|
|
16177
|
+
card_type: data.card_type,
|
|
16178
|
+
v: data.v
|
|
16179
|
+
};
|
|
16180
|
+
var payload = {
|
|
16181
|
+
data: transactionPayload,
|
|
16182
|
+
message: 'Payment successful.'
|
|
16183
|
+
};
|
|
16184
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_SUCCESS, payload);
|
|
16185
|
+
}
|
|
16186
|
+
};
|
|
16187
|
+
ApplePay.prototype.handleErrorResult = function (_a) {
|
|
16188
|
+
var errors = _a.errors;
|
|
16189
|
+
var payload = {
|
|
16190
|
+
errors: errors,
|
|
16191
|
+
data: null
|
|
16192
|
+
};
|
|
16193
|
+
if (this.tokenizeOnly) {
|
|
16194
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.TOKENIZATION_ERROR, payload);
|
|
16195
|
+
}
|
|
16196
|
+
else {
|
|
16197
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16198
|
+
}
|
|
16199
|
+
};
|
|
16133
16200
|
ApplePay.prototype.purchase = function (request) {
|
|
16134
16201
|
return __awaiter(this, void 0, void 0, function () {
|
|
16135
16202
|
var applePayPaymentRequest, payNowPaymentAttributes, _a;
|
|
@@ -16144,82 +16211,29 @@ var ApplePay = /** @class */ (function () {
|
|
|
16144
16211
|
case 1:
|
|
16145
16212
|
_a.applePaySession = _b.sent();
|
|
16146
16213
|
this.applePaySession.onvalidatemerchant = function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
16147
|
-
var merchantSession, e_1, payload;
|
|
16148
16214
|
return __generator(this, function (_a) {
|
|
16149
16215
|
switch (_a.label) {
|
|
16150
|
-
case 0:
|
|
16151
|
-
_a.trys.push([0, 2, , 3]);
|
|
16152
|
-
return [4 /*yield*/, payNow.getMerchantSession(event.validationURL, __assign(__assign({}, payNowPaymentAttributes), { merchant: this.username, domain_name: this.domain_name, display_name: this.username }), "".concat(this.fzPayNowDomain).concat(merchantSessionPath))];
|
|
16216
|
+
case 0: return [4 /*yield*/, this.handleMerchantValidation(event, payNowPaymentAttributes)];
|
|
16153
16217
|
case 1:
|
|
16154
|
-
|
|
16155
|
-
return [3 /*break*/, 3];
|
|
16156
|
-
case 2:
|
|
16157
|
-
e_1 = _a.sent();
|
|
16158
|
-
payload = {
|
|
16159
|
-
data: 'Payment failed. Unable to establish session',
|
|
16160
|
-
errors: e_1,
|
|
16161
|
-
};
|
|
16162
|
-
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16163
|
-
return [2 /*return*/];
|
|
16164
|
-
case 3:
|
|
16165
|
-
this.applePaySession.completeMerchantValidation(merchantSession);
|
|
16218
|
+
_a.sent();
|
|
16166
16219
|
return [2 /*return*/];
|
|
16167
16220
|
}
|
|
16168
16221
|
});
|
|
16169
16222
|
}); };
|
|
16170
16223
|
this.applePaySession.onpaymentauthorized = function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
16171
|
-
var result, payload, message, payload, message, e_2, payload;
|
|
16172
16224
|
return __generator(this, function (_a) {
|
|
16173
16225
|
switch (_a.label) {
|
|
16174
16226
|
case 0:
|
|
16175
|
-
|
|
16176
|
-
return [4 /*yield*/,
|
|
16227
|
+
if (!this.tokenizeOnly) return [3 /*break*/, 2];
|
|
16228
|
+
return [4 /*yield*/, this.tokenizePayment(event, payNowPaymentAttributes)];
|
|
16177
16229
|
case 1:
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
|
|
16183
|
-
|
|
16184
|
-
|
|
16185
|
-
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_SUCCESS, payload);
|
|
16186
|
-
message = {
|
|
16187
|
-
channel: channel,
|
|
16188
|
-
subject: 'Payment successful.',
|
|
16189
|
-
data: {
|
|
16190
|
-
payload: payload
|
|
16191
|
-
}
|
|
16192
|
-
};
|
|
16193
|
-
this.postMessageClient.send(message);
|
|
16194
|
-
}
|
|
16195
|
-
else {
|
|
16196
|
-
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
16197
|
-
payload = {
|
|
16198
|
-
data: 'Payment failed.',
|
|
16199
|
-
errors: result.purchase.errors
|
|
16200
|
-
};
|
|
16201
|
-
console.log('its successful apple pay', result);
|
|
16202
|
-
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16203
|
-
message = {
|
|
16204
|
-
channel: channel,
|
|
16205
|
-
subject: 'Payment unsuccessful.',
|
|
16206
|
-
data: {
|
|
16207
|
-
payload: payload
|
|
16208
|
-
}
|
|
16209
|
-
};
|
|
16210
|
-
this.postMessageClient.send(message);
|
|
16211
|
-
}
|
|
16212
|
-
return [3 /*break*/, 3];
|
|
16213
|
-
case 2:
|
|
16214
|
-
e_2 = _a.sent();
|
|
16215
|
-
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
16216
|
-
payload = {
|
|
16217
|
-
data: 'Payment failed.',
|
|
16218
|
-
errors: ['Payment declined']
|
|
16219
|
-
};
|
|
16220
|
-
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16221
|
-
return [3 /*break*/, 3];
|
|
16222
|
-
case 3: return [2 /*return*/];
|
|
16230
|
+
_a.sent();
|
|
16231
|
+
return [3 /*break*/, 4];
|
|
16232
|
+
case 2: return [4 /*yield*/, this.completePurchase(event, payNowPaymentAttributes)];
|
|
16233
|
+
case 3:
|
|
16234
|
+
_a.sent();
|
|
16235
|
+
_a.label = 4;
|
|
16236
|
+
case 4: return [2 /*return*/];
|
|
16223
16237
|
}
|
|
16224
16238
|
});
|
|
16225
16239
|
}); };
|
|
@@ -16240,6 +16254,98 @@ var ApplePay = /** @class */ (function () {
|
|
|
16240
16254
|
});
|
|
16241
16255
|
});
|
|
16242
16256
|
};
|
|
16257
|
+
ApplePay.prototype.handleMerchantValidation = function (event, payNowPaymentAttributes) {
|
|
16258
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
16259
|
+
var merchantSession, e_1, payload;
|
|
16260
|
+
return __generator(this, function (_a) {
|
|
16261
|
+
switch (_a.label) {
|
|
16262
|
+
case 0:
|
|
16263
|
+
_a.trys.push([0, 2, , 3]);
|
|
16264
|
+
return [4 /*yield*/, payNow.getMerchantSession(event.validationURL, __assign(__assign({}, payNowPaymentAttributes), { merchant: this.username, domain_name: this.domain_name, display_name: this.username }), "".concat(this.fzPayNowDomain).concat(merchantSessionPath))];
|
|
16265
|
+
case 1:
|
|
16266
|
+
merchantSession = _a.sent();
|
|
16267
|
+
return [3 /*break*/, 3];
|
|
16268
|
+
case 2:
|
|
16269
|
+
e_1 = _a.sent();
|
|
16270
|
+
payload = {
|
|
16271
|
+
data: 'Payment failed. Unable to establish session',
|
|
16272
|
+
errors: e_1,
|
|
16273
|
+
};
|
|
16274
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16275
|
+
return [2 /*return*/];
|
|
16276
|
+
case 3:
|
|
16277
|
+
this.applePaySession.completeMerchantValidation(merchantSession);
|
|
16278
|
+
return [2 /*return*/];
|
|
16279
|
+
}
|
|
16280
|
+
});
|
|
16281
|
+
});
|
|
16282
|
+
};
|
|
16283
|
+
ApplePay.prototype.tokenizePayment = function (event, payNowPaymentAttributes) {
|
|
16284
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
16285
|
+
var _a, card, ok, e_2, payload;
|
|
16286
|
+
return __generator(this, function (_b) {
|
|
16287
|
+
switch (_b.label) {
|
|
16288
|
+
case 0:
|
|
16289
|
+
_b.trys.push([0, 2, , 3]);
|
|
16290
|
+
return [4 /*yield*/, payNow.authorizePayment(__assign(__assign({}, payNowPaymentAttributes), { merchant: this.username, token: event.payment.token, domain_name: this.domain_name }), "".concat(this.fzPayNowDomain).concat(tokenPath, "?react_sdk=").concat(this.react_sdk))];
|
|
16291
|
+
case 1:
|
|
16292
|
+
_a = _b.sent(), card = _a.card, ok = _a.ok;
|
|
16293
|
+
this.applePaySession.completePayment(window.ApplePaySession.STATUS_SUCCESS);
|
|
16294
|
+
if (ok) {
|
|
16295
|
+
this.handleSuccessResult(__assign({}, card));
|
|
16296
|
+
}
|
|
16297
|
+
else {
|
|
16298
|
+
this.handleErrorResult(__assign({}, card));
|
|
16299
|
+
}
|
|
16300
|
+
return [3 /*break*/, 3];
|
|
16301
|
+
case 2:
|
|
16302
|
+
e_2 = _b.sent();
|
|
16303
|
+
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
16304
|
+
payload = {
|
|
16305
|
+
data: 'Transaction failed.',
|
|
16306
|
+
errors: ['Transaction declined'],
|
|
16307
|
+
};
|
|
16308
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16309
|
+
return [3 /*break*/, 3];
|
|
16310
|
+
case 3: return [2 /*return*/];
|
|
16311
|
+
}
|
|
16312
|
+
});
|
|
16313
|
+
});
|
|
16314
|
+
};
|
|
16315
|
+
ApplePay.prototype.completePurchase = function (event, payNowPaymentAttributes) {
|
|
16316
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
16317
|
+
var _a, purchase, ok, e_3, payload;
|
|
16318
|
+
return __generator(this, function (_b) {
|
|
16319
|
+
switch (_b.label) {
|
|
16320
|
+
case 0:
|
|
16321
|
+
_b.trys.push([0, 2, , 3]);
|
|
16322
|
+
return [4 /*yield*/, payNow.authorizePayment(__assign(__assign({}, payNowPaymentAttributes), { merchant: this.username, token: event.payment.token, domain_name: this.domain_name }), "".concat(this.fzPayNowDomain).concat(purchasePath, "?react_sdk=").concat(this.react_sdk))];
|
|
16323
|
+
case 1:
|
|
16324
|
+
_a = _b.sent(), purchase = _a.purchase, ok = _a.ok;
|
|
16325
|
+
this.applePaySession.completePayment(window.ApplePaySession.STATUS_SUCCESS);
|
|
16326
|
+
if (ok) {
|
|
16327
|
+
this.handleSuccessResult(__assign({}, purchase));
|
|
16328
|
+
}
|
|
16329
|
+
else {
|
|
16330
|
+
this.handleErrorResult(__assign({}, purchase));
|
|
16331
|
+
}
|
|
16332
|
+
return [3 /*break*/, 3];
|
|
16333
|
+
case 2:
|
|
16334
|
+
e_3 = _b.sent();
|
|
16335
|
+
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
16336
|
+
payload = {
|
|
16337
|
+
data: 'Transaction failed.',
|
|
16338
|
+
errors: ['Transaction declined'],
|
|
16339
|
+
};
|
|
16340
|
+
(0, event_manager_1.emit)(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
16341
|
+
return [3 /*break*/, 3];
|
|
16342
|
+
case 3:
|
|
16343
|
+
this.applePaySession.begin();
|
|
16344
|
+
return [2 /*return*/];
|
|
16345
|
+
}
|
|
16346
|
+
});
|
|
16347
|
+
});
|
|
16348
|
+
};
|
|
16243
16349
|
ApplePay.prototype.extractApplePaymentRequestParams = function (payload) {
|
|
16244
16350
|
var countryCode = payload.countryCode, currencyCode = payload.currencyCode, merchantCapabilities = payload.merchantCapabilities, supportedNetworks = payload.supportedNetworks, total = payload.total;
|
|
16245
16351
|
return {
|
|
@@ -16341,7 +16447,7 @@ exports.createSession = createSession;
|
|
|
16341
16447
|
/***/ }),
|
|
16342
16448
|
|
|
16343
16449
|
/***/ "./src/applepay/clients/paynow-client.ts":
|
|
16344
|
-
/***/ (function(__unused_webpack_module, exports) {
|
|
16450
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
16345
16451
|
|
|
16346
16452
|
"use strict";
|
|
16347
16453
|
|
|
@@ -16381,8 +16487,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
16381
16487
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
16382
16488
|
}
|
|
16383
16489
|
};
|
|
16490
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16491
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16492
|
+
};
|
|
16384
16493
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
16385
16494
|
exports.authorizePayment = exports.getMerchantSession = exports.objectToQueryString = void 0;
|
|
16495
|
+
var axios_1 = __importDefault(__webpack_require__("./node_modules/axios/dist/browser/axios.cjs"));
|
|
16386
16496
|
var objectToQueryString = function (obj) {
|
|
16387
16497
|
var queryString = [];
|
|
16388
16498
|
for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {
|
|
@@ -16397,18 +16507,18 @@ var getMerchantSession = function (validationUrl, paymentAttributes, baseUrl) {
|
|
|
16397
16507
|
return __generator(this, function (_a) {
|
|
16398
16508
|
queryString = "url=".concat(validationUrl, "&").concat((0, exports.objectToQueryString)(paymentAttributes));
|
|
16399
16509
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
if (
|
|
16403
|
-
|
|
16510
|
+
axios_1.default.get("".concat(baseUrl, "?").concat(queryString))
|
|
16511
|
+
.then(function (response) {
|
|
16512
|
+
if (response.status >= 200 && response.status < 300) {
|
|
16513
|
+
resolve(response.data);
|
|
16404
16514
|
}
|
|
16405
16515
|
else {
|
|
16406
|
-
|
|
16516
|
+
reject(new Error());
|
|
16407
16517
|
}
|
|
16408
|
-
}
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16518
|
+
})
|
|
16519
|
+
.catch(function (error) {
|
|
16520
|
+
reject(error); // Catch network or other errors
|
|
16521
|
+
});
|
|
16412
16522
|
})];
|
|
16413
16523
|
});
|
|
16414
16524
|
}); };
|
|
@@ -16416,19 +16526,18 @@ exports.getMerchantSession = getMerchantSession;
|
|
|
16416
16526
|
var authorizePayment = function (payload, url) { return __awaiter(void 0, void 0, void 0, function () {
|
|
16417
16527
|
return __generator(this, function (_a) {
|
|
16418
16528
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
|
|
16529
|
+
axios_1.default.post(url, payload, {
|
|
16530
|
+
headers: {
|
|
16531
|
+
'Content-Type': 'application/json;charset=UTF-8',
|
|
16532
|
+
},
|
|
16533
|
+
}).then(function (response) {
|
|
16534
|
+
if (response.status >= 200 && response.status < 300) {
|
|
16535
|
+
resolve(response.data);
|
|
16423
16536
|
}
|
|
16424
16537
|
else {
|
|
16425
|
-
|
|
16538
|
+
reject(new Error());
|
|
16426
16539
|
}
|
|
16427
|
-
};
|
|
16428
|
-
request.onerror = reject;
|
|
16429
|
-
request.open('POST', url);
|
|
16430
|
-
request.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
|
|
16431
|
-
request.send(JSON.stringify(payload));
|
|
16540
|
+
});
|
|
16432
16541
|
})];
|
|
16433
16542
|
});
|
|
16434
16543
|
}); };
|
|
@@ -19016,7 +19125,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://www.fatzebra.com/schem
|
|
|
19016
19125
|
/***/ ((module) => {
|
|
19017
19126
|
|
|
19018
19127
|
"use strict";
|
|
19019
|
-
module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://www.fatzebra.com/schemas/applepay/options.json","type":"object","definitions":{"Options":{"type":"object","properties":{"allowed_card_networks":{"type":"array","items":{"type":"string","enum":["amex","chinaUnionPay","discover","jcb","maestro","masterCard","visa"]}},"allowed_card_types":{"type":"array","items":{"type":"string","enum":["supports3DS","supportsCredit","supportsDebit","supportsEMV"]}},"apple_button_type":{"type":"string","enum":["buy","donate","plain","set-up","book","check-out","subscribe","add-money","contribute","order","reload","rent","support","tip","top-up","continue"]},"apple_button_style":{"type":"string","enum":["black","white","white-outline"]},"apple_button_locale":{"type":"string","enum":["ar-AB","ca-ES","cs-CZ","da-DK","de-DE","el-GR","en-AU","en-GB","en-US","es-ES","es-MX","fi-FI","fr-CA","fr-FR","he-IL","hi-IN","hr-HR","hu-HU","id-ID","it-IT","ja-JP","ko-KR","ms-MY","nb-NO","nl-NL","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sv-SE","th-TH","tr-TR","uk-UA","vi-VN","zh-CN","zh-HK","zh-TW"]},"domain_name":{"type":"string"}},"additionalProperties":false}}}');
|
|
19128
|
+
module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://www.fatzebra.com/schemas/applepay/options.json","type":"object","definitions":{"Options":{"type":"object","properties":{"allowed_card_networks":{"type":"array","items":{"type":"string","enum":["amex","chinaUnionPay","discover","jcb","maestro","masterCard","visa"]}},"allowed_card_types":{"type":"array","items":{"type":"string","enum":["supports3DS","supportsCredit","supportsDebit","supportsEMV"]}},"apple_button_type":{"type":"string","enum":["buy","donate","plain","set-up","book","check-out","subscribe","add-money","contribute","order","reload","rent","support","tip","top-up","continue"]},"apple_button_style":{"type":"string","enum":["black","white","white-outline"]},"apple_button_locale":{"type":"string","enum":["ar-AB","ca-ES","cs-CZ","da-DK","de-DE","el-GR","en-AU","en-GB","en-US","es-ES","es-MX","fi-FI","fr-CA","fr-FR","he-IL","hi-IN","hr-HR","hu-HU","id-ID","it-IT","ja-JP","ko-KR","ms-MY","nb-NO","nl-NL","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sv-SE","th-TH","tr-TR","uk-UA","vi-VN","zh-CN","zh-HK","zh-TW"]},"domain_name":{"type":"string"},"tokenize_only":{"type":"boolean"}},"additionalProperties":false}}}');
|
|
19020
19129
|
|
|
19021
19130
|
/***/ }),
|
|
19022
19131
|
|
|
@@ -19242,7 +19351,7 @@ exports.validateVerifyCardParams = validator;
|
|
|
19242
19351
|
|
|
19243
19352
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19244
19353
|
exports.version = void 0;
|
|
19245
|
-
exports.version = '1.5.
|
|
19354
|
+
exports.version = '1.5.8-beta.3';
|
|
19246
19355
|
|
|
19247
19356
|
|
|
19248
19357
|
/***/ })
|
|
@@ -19308,7 +19417,7 @@ exports.version = '1.5.5';
|
|
|
19308
19417
|
/******/
|
|
19309
19418
|
/******/ /* webpack/runtime/getFullHash */
|
|
19310
19419
|
/******/ (() => {
|
|
19311
|
-
/******/ __webpack_require__.h = () => ("
|
|
19420
|
+
/******/ __webpack_require__.h = () => ("8b2d1f17ecae86801a37")
|
|
19312
19421
|
/******/ })();
|
|
19313
19422
|
/******/
|
|
19314
19423
|
/******/ /* webpack/runtime/global */
|