@fat-zebra/sdk 1.5.8-beta.3 → 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 -31
- 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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Fat Zebra SDK
|
|
2
|
+
|
|
3
|
+
## Change log
|
|
4
|
+
|
|
5
|
+
## [1.5.8] – 2025-05-27
|
|
6
|
+
### Changed
|
|
7
|
+
- removed yarn.lock in favour of package-lock.json
|
|
8
|
+
|
|
9
|
+
## [1.5.7] – 2025-03-31
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
Support for 3-D Secure 2.x PARes Status: CHALLENGED
|
|
13
|
+
|
|
14
|
+
- Introduced a new PARes.CHALLENGED enumeration value to represent a "challenge" status in 3-D Secure (3DS) 2.x authentication flows. This is a required change from Cybersouce
|
|
15
|
+
as it will now explicitly handle challenged events. For more information: https://developer.cybersource.com/library/documentation/dev_guides/Payer_Authentication_SCMP_API/html/Topics/Response_FieldsTable23Response_Fields_Field_NameDescriptionReturned_ByData_Type_Lengthauthorizatio-6wc.htm
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Pass through economic commerce indicator: https://developer.cybersource.com/docs/cybs/en-us/payments/developer/vital/sa/payments/payments-processing-pa-process-intro/payments-processing-pa-eci.html
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Security
|
|
23
|
+
- Patched routine package updates
|
|
24
|
+
|
package/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fat-zebra/sdk
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
A modern JavaScript SDK for integrating with [Fat Zebra](https://docs.fatzebra.com/docs/react-sdk-overview) payment services. This SDK enables fast and secure handling of payments.
|
|
4
|
+
|
|
5
|
+
## 📦 Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @fat-zebra/sdk
|
|
9
|
+
# or
|
|
10
|
+
yarn add @fat-zebra/sdk
|
|
@@ -132,37 +132,12 @@ export class ApplePay {
|
|
|
132
132
|
this.applePaySession.onpaymentauthorized = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
133
133
|
try {
|
|
134
134
|
const result = yield payNow.authorizePayment(Object.assign(Object.assign({}, payNowPaymentAttributes), { merchant: this.username, token: event.payment.token, domain_name: this.domain_name }), `${this.fzPayNowDomain}${purchaseTokenPath}?react_sdk=${this.react_sdk}`);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
emit(FatZebra.PublicEvent.PAYMENT_SUCCESS, payload);
|
|
142
|
-
const message = {
|
|
143
|
-
subject: 'Payment successful.',
|
|
144
|
-
data: {
|
|
145
|
-
payload
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
window.parent.postMessage(message, "*");
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
152
|
-
const payload = {
|
|
153
|
-
data: 'Payment failed.',
|
|
154
|
-
errors: result.purchase.errors
|
|
155
|
-
};
|
|
156
|
-
console.log('its successful apple pay', result);
|
|
157
|
-
emit(FatZebra.PublicEvent.PAYMENT_ERROR, payload);
|
|
158
|
-
const message = {
|
|
159
|
-
subject: 'Payment unsuccessful.',
|
|
160
|
-
data: {
|
|
161
|
-
payload
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
window.parent.postMessage(message, "*");
|
|
165
|
-
}
|
|
135
|
+
this.applePaySession.completePayment(window.ApplePaySession.STATUS_SUCCESS);
|
|
136
|
+
const payload = {
|
|
137
|
+
message: 'Payment successful.',
|
|
138
|
+
data: result,
|
|
139
|
+
};
|
|
140
|
+
emit(FatZebra.PublicEvent.PAYMENT_SUCCESS, payload);
|
|
166
141
|
}
|
|
167
142
|
catch (e) {
|
|
168
143
|
this.applePaySession.completePayment(window.ApplePaySession.STATUS_FAILURE);
|
|
@@ -36,7 +36,7 @@ export const authorizePayment = (payload, url) => __awaiter(void 0, void 0, void
|
|
|
36
36
|
const request = new XMLHttpRequest();
|
|
37
37
|
request.onload = () => {
|
|
38
38
|
if (request.status >= 200 && request.status < 300) {
|
|
39
|
-
return resolve(
|
|
39
|
+
return resolve(true);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
return reject(new Error());
|
package/dist/main.js
CHANGED
|
@@ -62,8 +62,8 @@ export default class FatZebra {
|
|
|
62
62
|
postMessageClient.setEventListeners(handlers);
|
|
63
63
|
}
|
|
64
64
|
verifyCard(params) {
|
|
65
|
+
var _a;
|
|
65
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
var _a;
|
|
67
67
|
const valid = validateVerifyCardParams(params);
|
|
68
68
|
if (!valid) {
|
|
69
69
|
emit(PublicEvent.VALIDATION_ERROR, {
|
|
@@ -77,14 +77,14 @@ export default class FatZebra {
|
|
|
77
77
|
const headless = bridge.load(process.env.PAYNOW_BRIDGE_URL);
|
|
78
78
|
const card = params.paymentMethod.data;
|
|
79
79
|
this.cardDidTokenize(headless, (data) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
-
var
|
|
80
|
+
var _b;
|
|
81
81
|
const bin = card.number.substr(0, 6);
|
|
82
82
|
this.sca.run({
|
|
83
83
|
cardToken: data.token,
|
|
84
84
|
customer: params.customer,
|
|
85
85
|
paymentIntent: params.paymentIntent,
|
|
86
86
|
bin,
|
|
87
|
-
challengeWindowSize: (
|
|
87
|
+
challengeWindowSize: (_b = params.options) === null || _b === void 0 ? void 0 : _b.challengeWindowSize,
|
|
88
88
|
});
|
|
89
89
|
}));
|
|
90
90
|
this.tokenizeCard(card, headless);
|