@fat-zebra/sdk 1.5.2 → 1.5.3-beta.3
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.dev.md +5 -0
- package/build-styles.js +8 -1
- package/dist/index.js +3 -2
- package/dist/local/fatzebra.js +6 -5
- package/dist/local/fatzebra.js.map +1 -1
- package/dist/react/ApplePay.d.ts +9 -0
- package/dist/react/ApplePay.js +11 -0
- package/dist/react/applePayUrl.d.ts +12 -0
- package/dist/react/applePayUrl.js +35 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -3
- package/tsconfig.package.json +2 -1
- package/dist/paypal/paypal-button.d.ts +0 -31
- package/dist/paypal/paypal-button.js +0 -199
- package/dist/paypal/paypal-checkout.d.ts +0 -21
- package/dist/paypal/paypal-checkout.js +0 -100
- package/dist/paypal/types.d.ts +0 -188
- package/dist/paypal/types.js +0 -5
- package/dist/paypal/validation.d.ts +0 -4
- package/dist/paypal/validation.js +0 -65
- package/dist/production/fatzebra.css +0 -91
- package/dist/production/fatzebra.js +0 -2
- package/dist/production/fatzebra.js.LICENSE.txt +0 -1
- package/dist/staging/fatzebra.css +0 -91
- package/dist/staging/fatzebra.js +0 -17717
- package/dist/staging/fatzebra.js.map +0 -1
- package/dist/staging/index.html +0 -247
- package/scripts/release-package.js +0 -113
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { PayPalConfig, PayPalOrderParams } from './types';
|
|
2
|
-
import { ValidationResult } from '../shared/types';
|
|
3
|
-
export declare const validatePayPalSetup: (props: PayPalConfig) => ValidationResult;
|
|
4
|
-
export declare const validatePayPalRequest: (props: PayPalOrderParams, billing?: boolean) => ValidationResult;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { PayPalIntent } from './types';
|
|
2
|
-
const PaypalConfigRequiredProps = ['currency', 'containerId', 'payment'];
|
|
3
|
-
const PaypalOrderRequiredProps = ['intent', 'purchases'];
|
|
4
|
-
const PaypalBillingRequiredProps = ['shippingAddress'];
|
|
5
|
-
export const validatePayPalSetup = (props) => {
|
|
6
|
-
let errors = [];
|
|
7
|
-
const keys = Object.keys(props);
|
|
8
|
-
for (let requiredProp of PaypalConfigRequiredProps) {
|
|
9
|
-
// @ts-ignore
|
|
10
|
-
if (!keys.includes(requiredProp) || props[requiredProp] === undefined) {
|
|
11
|
-
errors.push(`${requiredProp} is missing.`);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
valid: errors.length == 0,
|
|
16
|
-
errors
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export const validatePayPalRequest = (props, billing) => {
|
|
20
|
-
let errors = [];
|
|
21
|
-
const keys = Object.keys(props);
|
|
22
|
-
if (!keys.includes('paymentMethod')) {
|
|
23
|
-
errors.push(`paymentMethod is missing.`);
|
|
24
|
-
}
|
|
25
|
-
if (!keys.includes('paymentIntent') && !billing) {
|
|
26
|
-
errors.push(`paymentIntent is missing.`);
|
|
27
|
-
}
|
|
28
|
-
if (props.paymentMethod) {
|
|
29
|
-
const orderKeys = Object.keys(props.paymentMethod.data);
|
|
30
|
-
if (orderKeys.includes('intent')) {
|
|
31
|
-
const intent = props.paymentMethod.data.intent.toLowerCase();
|
|
32
|
-
const intents = Object.values(PayPalIntent).map(v => v.toLowerCase());
|
|
33
|
-
if (!intents.includes(intent)) {
|
|
34
|
-
errors.push(`intent is invalid, must be one of [${intents.join(', ')}].`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
if (!props.paymentMethod.type) {
|
|
38
|
-
errors.push(`paymentMethod.type is missing.`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (errors.length > 0) {
|
|
42
|
-
return {
|
|
43
|
-
valid: errors.length == 0,
|
|
44
|
-
errors
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
const paymentMethod = props.paymentMethod.data;
|
|
48
|
-
const providedKeys = Object.keys(paymentMethod);
|
|
49
|
-
let requiredProps;
|
|
50
|
-
if (billing === true) {
|
|
51
|
-
requiredProps = PaypalBillingRequiredProps;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
requiredProps = PaypalOrderRequiredProps;
|
|
55
|
-
}
|
|
56
|
-
for (let requiredProp of requiredProps) {
|
|
57
|
-
if (!providedKeys.includes(requiredProp)) {
|
|
58
|
-
errors.push(`${requiredProp} is missing.`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
valid: errors.length == 0,
|
|
63
|
-
errors
|
|
64
|
-
};
|
|
65
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.checkout-button-wrapper {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
align-items: center;
|
|
5
|
-
height: 200px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.iframe-checkout {
|
|
9
|
-
flex: 1;
|
|
10
|
-
border: none;
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 100%;
|
|
13
|
-
min-height: 0;
|
|
14
|
-
overflow: auto;
|
|
15
|
-
-webkit-overflow-scrolling: touch;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iframe-foreground,
|
|
19
|
-
.iframe-background {
|
|
20
|
-
top: 0;
|
|
21
|
-
left: 0;
|
|
22
|
-
right: 0;
|
|
23
|
-
bottom: 0;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.iframe-foreground,
|
|
28
|
-
.iframe-background {
|
|
29
|
-
position: fixed;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.iframe-foreground {
|
|
33
|
-
z-index: -1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.iframe-background {
|
|
37
|
-
background: rgba(0, 0, 0, 0.5);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.iframe-foreground {
|
|
41
|
-
flex-grow: 1;
|
|
42
|
-
top: auto;
|
|
43
|
-
width: 100%;
|
|
44
|
-
max-width: 480px;
|
|
45
|
-
height: 80vh;
|
|
46
|
-
background-color: #ffffff;
|
|
47
|
-
border-radius: 25px 25px 0 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.slide-in .iframe-foreground {
|
|
51
|
-
transform: translateY(100vh);
|
|
52
|
-
transition: transform 0.4s ease, z-index 0.3s ease 0.4s;
|
|
53
|
-
z-index: -1;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.slide-in .iframe-background {
|
|
57
|
-
opacity: 0;
|
|
58
|
-
z-index: -1;
|
|
59
|
-
transition: opacity 0.3s ease, z-index 0.3s ease 0.3s;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.slide-in.show .iframe-foreground {
|
|
63
|
-
transform: none;
|
|
64
|
-
transition: transform 0.4s ease;
|
|
65
|
-
z-index: 100;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.slide-in.show .iframe-background {
|
|
69
|
-
opacity: 1;
|
|
70
|
-
z-index: 0;
|
|
71
|
-
transition: opacity 0.3s ease;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@media only screen and (min-width: 480px) {
|
|
75
|
-
.iframe-foreground {
|
|
76
|
-
margin: 0 auto;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@media only screen and (min-width: 768px) {
|
|
81
|
-
.iframe-foreground {
|
|
82
|
-
margin: 0;
|
|
83
|
-
width: 400px;
|
|
84
|
-
height: 100vh;
|
|
85
|
-
left: 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.slide-in .iframe-foreground {
|
|
89
|
-
transform: translateX(-400px);
|
|
90
|
-
}
|
|
91
|
-
}
|