@flittpayments/js-sdk 2.0.10 → 2.0.11-alpha.0
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 +55 -47
- package/dist/cjs/checkout.js +20 -32
- package/dist/esm/checkout.js +23 -30
- package/dist/types/browser.d.ts +2 -0
- package/dist/types/common.d.ts +2 -0
- package/dist/types/core/component.d.ts +5 -0
- package/dist/types/core/config.d.ts +134 -0
- package/dist/types/core/deferred.d.ts +19 -0
- package/dist/types/core/utils.d.ts +84 -0
- package/dist/types/module.d.ts +13 -0
- package/dist/types/views/index.d.ts +2 -0
- package/dist/types/views/template/acs.d.ts +2 -0
- package/dist/types/views/template/acs_styles.d.ts +2 -0
- package/dist/umd/checkout.js +1 -1
- package/dist/umd/checkout.js.map +1 -1
- package/package.json +16 -19
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-

|
|
2
|
+
|
|
2
3
|
# Flitt JavaScript SDK
|
|
3
4
|
|
|
4
5
|
[](https://www.npmjs.com/package/@flittpayments/js-sdk)
|
|
@@ -21,20 +22,21 @@ or add dependency manually:
|
|
|
21
22
|
```json
|
|
22
23
|
{
|
|
23
24
|
"dependency": {
|
|
24
|
-
"@flittpayments/js-sdk":"^2.0"
|
|
25
|
+
"@flittpayments/js-sdk": "^2.0"
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
```
|
|
29
|
+
|
|
28
30
|
### Manual installation
|
|
29
31
|
|
|
30
32
|
If you do not use NPM, you can download the
|
|
31
33
|
[latest release](https://github.com/flittpayments/flitt-js-sdk/releases).
|
|
32
34
|
Or clone from GitHub the latest developer version
|
|
35
|
+
|
|
33
36
|
```cmd
|
|
34
37
|
git clone git@github.com:flittpayments/js-sdk.git
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
|
|
38
40
|
## Quick start
|
|
39
41
|
|
|
40
42
|
```html
|
|
@@ -47,20 +49,22 @@ git clone git@github.com:flittpayments/js-sdk.git
|
|
|
47
49
|
<!DOCTYPE html>
|
|
48
50
|
<html lang="en">
|
|
49
51
|
<head>
|
|
50
|
-
<meta charset="utf-8"
|
|
51
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
|
52
|
+
<meta charset="utf-8" />
|
|
53
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
52
54
|
</head>
|
|
53
55
|
<body>
|
|
54
56
|
<script src="https://cdn.jsdelivr.net/npm/@flittpayments/js-sdk"></script>
|
|
55
57
|
<script>
|
|
56
|
-
|
|
57
|
-
this.request('api.checkout.form','request', { Parameters }
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
$checkout('Api').scope(function () {
|
|
59
|
+
this.request('api.checkout.form', 'request', { Parameters })
|
|
60
|
+
.done(function (model) {
|
|
61
|
+
model.sendResponse()
|
|
62
|
+
console.log(model.attr('order'))
|
|
63
|
+
})
|
|
64
|
+
.fail(function (model) {
|
|
65
|
+
console.log(model.attr('error'))
|
|
66
|
+
})
|
|
67
|
+
})
|
|
64
68
|
</script>
|
|
65
69
|
</body>
|
|
66
70
|
</html>
|
|
@@ -72,26 +76,29 @@ git clone git@github.com:flittpayments/js-sdk.git
|
|
|
72
76
|
<!DOCTYPE html>
|
|
73
77
|
<html lang="en">
|
|
74
78
|
<head>
|
|
75
|
-
<meta charset="utf-8"
|
|
76
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
|
79
|
+
<meta charset="utf-8" />
|
|
80
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
|
77
81
|
</head>
|
|
78
82
|
<body>
|
|
79
83
|
<script src="https://cdn.jsdelivr.net/npm/@flittpayments/js-sdk"></script>
|
|
80
84
|
<div class="payment-button-container"></div>
|
|
81
85
|
<script>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
$checkout
|
|
87
|
+
.get('PaymentButton', {
|
|
88
|
+
element: '.payment-button-container',
|
|
89
|
+
style: {
|
|
90
|
+
type: 'long', // short|long
|
|
91
|
+
color: 'black', // black|white
|
|
92
|
+
height: 38, // button height
|
|
93
|
+
},
|
|
94
|
+
data: { Parameters },
|
|
95
|
+
})
|
|
96
|
+
.on('success', function (model) {
|
|
97
|
+
console.log('success', model)
|
|
98
|
+
})
|
|
99
|
+
.on('error', function (model) {
|
|
100
|
+
console.log('error', model)
|
|
101
|
+
})
|
|
95
102
|
</script>
|
|
96
103
|
</body>
|
|
97
104
|
</html>
|
|
@@ -103,15 +110,15 @@ git clone git@github.com:flittpayments/js-sdk.git
|
|
|
103
110
|
|
|
104
111
|
```json
|
|
105
112
|
{
|
|
106
|
-
"payment_system":"Supported payment systems: card, p24",
|
|
107
|
-
"token":"host-to-host generated token",
|
|
108
|
-
"card_number":"16/19-digits number",
|
|
109
|
-
"expiry_date":"Supported formats: MM/YY, MM/YYYY, MMYY, MMYYYY",
|
|
110
|
-
"cvv2":"3-digits number"
|
|
113
|
+
"payment_system": "Supported payment systems: card, p24",
|
|
114
|
+
"token": "host-to-host generated token",
|
|
115
|
+
"card_number": "16/19-digits number",
|
|
116
|
+
"expiry_date": "Supported formats: MM/YY, MM/YYYY, MMYY, MMYYYY",
|
|
117
|
+
"cvv2": "3-digits number"
|
|
111
118
|
}
|
|
112
119
|
```
|
|
113
120
|
|
|
114
|
-
Where token is value, returned in payment gateway response from API endpoint /api/checkout/token
|
|
121
|
+
Where token is value, returned in payment gateway response from API endpoint /api/checkout/token
|
|
115
122
|
(more details in API documentation: https://docs.flitt.com/api/create-order/ )
|
|
116
123
|
|
|
117
124
|
request example:
|
|
@@ -137,10 +144,10 @@ response example:
|
|
|
137
144
|
|
|
138
145
|
```json
|
|
139
146
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
"response": {
|
|
148
|
+
"response_status": "success",
|
|
149
|
+
"token": "7ddb3fbb03d60787b3972ef8d6fad0f97f7d2f86"
|
|
150
|
+
}
|
|
144
151
|
}
|
|
145
152
|
```
|
|
146
153
|
|
|
@@ -148,13 +155,13 @@ response example:
|
|
|
148
155
|
|
|
149
156
|
```json
|
|
150
157
|
{
|
|
151
|
-
"payment_system":"Supported payment systems: card, p24",
|
|
152
|
-
"merchant_id":"1396424",
|
|
153
|
-
"currency":"USD",
|
|
154
|
-
"amount":"100.20",
|
|
155
|
-
"card_number":"16/19-digits number",
|
|
156
|
-
"expiry_date":"Supported formats: MM/YY, MM/YYYY, MMYY, MMYYYY",
|
|
157
|
-
"cvv2":"3-digits number"
|
|
158
|
+
"payment_system": "Supported payment systems: card, p24",
|
|
159
|
+
"merchant_id": "1396424",
|
|
160
|
+
"currency": "USD",
|
|
161
|
+
"amount": "100.20",
|
|
162
|
+
"card_number": "16/19-digits number",
|
|
163
|
+
"expiry_date": "Supported formats: MM/YY, MM/YYYY, MMYY, MMYYYY",
|
|
164
|
+
"cvv2": "3-digits number"
|
|
158
165
|
}
|
|
159
166
|
```
|
|
160
167
|
|
|
@@ -162,10 +169,11 @@ optional merchant parameters:
|
|
|
162
169
|
|
|
163
170
|
```json
|
|
164
171
|
{
|
|
165
|
-
"email":"customer email address",
|
|
166
|
-
"phone":"customer phone number"
|
|
172
|
+
"email": "customer email address",
|
|
173
|
+
"phone": "customer phone number"
|
|
167
174
|
}
|
|
168
175
|
```
|
|
176
|
+
|
|
169
177
|
## Usage example
|
|
170
178
|
|
|
171
179
|
https://jsfiddle.net/flitt/on8ydsgq/
|
package/dist/cjs/checkout.js
CHANGED
|
@@ -361,8 +361,6 @@ const getAppleSessionConfig = config => {
|
|
|
361
361
|
if (options.requestPayerName) requiredShippingContactFields.push('name');
|
|
362
362
|
if (options.requestPayerEmail) requiredShippingContactFields.push('email');
|
|
363
363
|
if (options.requestPayerPhone) requiredShippingContactFields.push('phone');
|
|
364
|
-
//method.data.recurringPaymentRequest = recurringPaymentRequest
|
|
365
|
-
//method.data.deferredPaymentRequest = deferredPaymentRequest
|
|
366
364
|
return {
|
|
367
365
|
version: method.data.version,
|
|
368
366
|
countryCode: method.data.countryCode,
|
|
@@ -384,34 +382,16 @@ const getAppleSessionConfig = config => {
|
|
|
384
382
|
requiredShippingContactFields
|
|
385
383
|
};
|
|
386
384
|
};
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
// managementURL: 'https://flitt.ksv.app/manage-booking.html',
|
|
398
|
-
// }
|
|
399
|
-
|
|
400
|
-
// export const recurringPaymentRequest = {
|
|
401
|
-
// paymentDescription: 'Місячна підписка',
|
|
402
|
-
// regularBilling: {
|
|
403
|
-
// label: 'Підписка на місяць',
|
|
404
|
-
// amount: '20.00',
|
|
405
|
-
// type: 'final',
|
|
406
|
-
// paymentTiming: 'recurring',
|
|
407
|
-
// recurringPaymentStartDate: new Date('2026-01-01T00:00:00'),
|
|
408
|
-
// recurringPaymentIntervalUnit: 'month',
|
|
409
|
-
// recurringPaymentIntervalCount: 6,
|
|
410
|
-
// recurringPaymentEndDate: new Date('2028-01-01T00:00:00'),
|
|
411
|
-
// },
|
|
412
|
-
// managementURL: 'https://flitt.ksv.app/manage-subscription.html',
|
|
413
|
-
// }
|
|
414
|
-
|
|
385
|
+
const buildUrl = (origin, path = '', params = {}) => {
|
|
386
|
+
const query = Object.keys(params).filter(function (key) {
|
|
387
|
+
return params[key] !== undefined && params[key] !== null;
|
|
388
|
+
}).map(function (key) {
|
|
389
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`;
|
|
390
|
+
}).join('&');
|
|
391
|
+
const url = [origin, path].join('');
|
|
392
|
+
const separator = !!~url.indexOf('?') ? '&' : '?';
|
|
393
|
+
return query ? `${url}${separator}${query}` : url;
|
|
394
|
+
};
|
|
415
395
|
const getFunction = path => {
|
|
416
396
|
const props = path.split('.');
|
|
417
397
|
const value = props.reduce((acc, cur) => {
|
|
@@ -452,6 +432,7 @@ var Utils = /*#__PURE__*/Object.freeze({
|
|
|
452
432
|
PromiseWithResolvers: PromiseWithResolvers,
|
|
453
433
|
addAttr: addAttr,
|
|
454
434
|
addClass: addClass,
|
|
435
|
+
buildUrl: buildUrl,
|
|
455
436
|
cleanObject: cleanObject,
|
|
456
437
|
createElement: createElement,
|
|
457
438
|
cssUnit: cssUnit,
|
|
@@ -1508,6 +1489,7 @@ const Response = Model.extend({
|
|
|
1508
1489
|
|
|
1509
1490
|
const Api = Module.extend({
|
|
1510
1491
|
defaults: {
|
|
1492
|
+
version: 'default',
|
|
1511
1493
|
origin: ApiOrigin,
|
|
1512
1494
|
endpoint: ApiEndpoint,
|
|
1513
1495
|
container: 'body',
|
|
@@ -1520,7 +1502,10 @@ const Api = Module.extend({
|
|
|
1520
1502
|
this.initParams(params);
|
|
1521
1503
|
},
|
|
1522
1504
|
url(type, url) {
|
|
1523
|
-
return
|
|
1505
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1506
|
+
version: this.params.version,
|
|
1507
|
+
origin: location.origin
|
|
1508
|
+
});
|
|
1524
1509
|
},
|
|
1525
1510
|
extendParams(params) {
|
|
1526
1511
|
this.utils.extend(this.params, params);
|
|
@@ -2032,6 +2017,7 @@ const PaymentElement = Module.extend({
|
|
|
2032
2017
|
|
|
2033
2018
|
const PaymentButton = Module.extend({
|
|
2034
2019
|
defaults: {
|
|
2020
|
+
version: 'default',
|
|
2035
2021
|
origin: ApiOrigin,
|
|
2036
2022
|
endpoint: ApiEndpoint,
|
|
2037
2023
|
methods: ['apple', 'google'],
|
|
@@ -2057,6 +2043,7 @@ const PaymentButton = Module.extend({
|
|
|
2057
2043
|
this.supported = false;
|
|
2058
2044
|
this.params = {
|
|
2059
2045
|
element: params.element,
|
|
2046
|
+
version: params.version || this.defaults.version,
|
|
2060
2047
|
methods: params.methods || this.defaults.methods,
|
|
2061
2048
|
origin: params.origin || this.defaults.origin,
|
|
2062
2049
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2081,6 +2068,7 @@ const PaymentButton = Module.extend({
|
|
|
2081
2068
|
this.api = api;
|
|
2082
2069
|
} else {
|
|
2083
2070
|
this.api = new Api({
|
|
2071
|
+
version: this.params.version,
|
|
2084
2072
|
origin: this.params.origin,
|
|
2085
2073
|
endpoint: this.params.endpoint
|
|
2086
2074
|
});
|
|
@@ -2284,7 +2272,7 @@ const PaymentContainer = Module.extend({
|
|
|
2284
2272
|
css.image = this.getAppleSvg(style.color);
|
|
2285
2273
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2286
2274
|
}
|
|
2287
|
-
{
|
|
2275
|
+
if (css) {
|
|
2288
2276
|
this.utils.forEach(css, function (value, name) {
|
|
2289
2277
|
element.style.setProperty(['--', name].join(''), value);
|
|
2290
2278
|
});
|
package/dist/esm/checkout.js
CHANGED
|
@@ -395,8 +395,6 @@ const getAppleSessionConfig = (config) => {
|
|
|
395
395
|
if (options.requestPayerName) requiredShippingContactFields.push('name');
|
|
396
396
|
if (options.requestPayerEmail) requiredShippingContactFields.push('email');
|
|
397
397
|
if (options.requestPayerPhone) requiredShippingContactFields.push('phone');
|
|
398
|
-
//method.data.recurringPaymentRequest = recurringPaymentRequest
|
|
399
|
-
//method.data.deferredPaymentRequest = deferredPaymentRequest
|
|
400
398
|
return {
|
|
401
399
|
version: method.data.version,
|
|
402
400
|
countryCode: method.data.countryCode,
|
|
@@ -419,32 +417,19 @@ const getAppleSessionConfig = (config) => {
|
|
|
419
417
|
}
|
|
420
418
|
};
|
|
421
419
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
// paymentDescription: 'Місячна підписка',
|
|
436
|
-
// regularBilling: {
|
|
437
|
-
// label: 'Підписка на місяць',
|
|
438
|
-
// amount: '20.00',
|
|
439
|
-
// type: 'final',
|
|
440
|
-
// paymentTiming: 'recurring',
|
|
441
|
-
// recurringPaymentStartDate: new Date('2026-01-01T00:00:00'),
|
|
442
|
-
// recurringPaymentIntervalUnit: 'month',
|
|
443
|
-
// recurringPaymentIntervalCount: 6,
|
|
444
|
-
// recurringPaymentEndDate: new Date('2028-01-01T00:00:00'),
|
|
445
|
-
// },
|
|
446
|
-
// managementURL: 'https://flitt.ksv.app/manage-subscription.html',
|
|
447
|
-
// }
|
|
420
|
+
const buildUrl = (origin, path = '', params = {}) => {
|
|
421
|
+
const query = Object.keys(params)
|
|
422
|
+
.filter(function (key) {
|
|
423
|
+
return params[key] !== undefined && params[key] !== null
|
|
424
|
+
})
|
|
425
|
+
.map(function (key) {
|
|
426
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`
|
|
427
|
+
})
|
|
428
|
+
.join('&');
|
|
429
|
+
const url = [origin, path].join('');
|
|
430
|
+
const separator = !!~url.indexOf('?') ? '&' : '?';
|
|
431
|
+
return query ? `${url}${separator}${query}` : url
|
|
432
|
+
};
|
|
448
433
|
|
|
449
434
|
const getFunction = (path) => {
|
|
450
435
|
const props = path.split('.');
|
|
@@ -484,6 +469,7 @@ var Utils = /*#__PURE__*/Object.freeze({
|
|
|
484
469
|
PromiseWithResolvers: PromiseWithResolvers,
|
|
485
470
|
addAttr: addAttr,
|
|
486
471
|
addClass: addClass,
|
|
472
|
+
buildUrl: buildUrl,
|
|
487
473
|
cleanObject: cleanObject,
|
|
488
474
|
createElement: createElement,
|
|
489
475
|
cssUnit: cssUnit,
|
|
@@ -1630,6 +1616,7 @@ const Response = Model.extend({
|
|
|
1630
1616
|
|
|
1631
1617
|
const Api = Module.extend({
|
|
1632
1618
|
defaults: {
|
|
1619
|
+
version: 'default',
|
|
1633
1620
|
origin: ApiOrigin,
|
|
1634
1621
|
endpoint: ApiEndpoint,
|
|
1635
1622
|
container: 'body',
|
|
@@ -1643,7 +1630,10 @@ const Api = Module.extend({
|
|
|
1643
1630
|
this.initParams(params);
|
|
1644
1631
|
},
|
|
1645
1632
|
url(type, url) {
|
|
1646
|
-
return
|
|
1633
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1634
|
+
version: this.params.version,
|
|
1635
|
+
origin: location.origin,
|
|
1636
|
+
})
|
|
1647
1637
|
},
|
|
1648
1638
|
extendParams(params) {
|
|
1649
1639
|
this.utils.extend(this.params, params);
|
|
@@ -2166,6 +2156,7 @@ const PaymentElement = Module.extend({
|
|
|
2166
2156
|
|
|
2167
2157
|
const PaymentButton = Module.extend({
|
|
2168
2158
|
defaults: {
|
|
2159
|
+
version: 'default',
|
|
2169
2160
|
origin: ApiOrigin,
|
|
2170
2161
|
endpoint: ApiEndpoint,
|
|
2171
2162
|
methods: ['apple', 'google'],
|
|
@@ -2191,6 +2182,7 @@ const PaymentButton = Module.extend({
|
|
|
2191
2182
|
this.supported = false;
|
|
2192
2183
|
this.params = {
|
|
2193
2184
|
element: params.element,
|
|
2185
|
+
version: params.version || this.defaults.version,
|
|
2194
2186
|
methods: params.methods || this.defaults.methods,
|
|
2195
2187
|
origin: params.origin || this.defaults.origin,
|
|
2196
2188
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2215,6 +2207,7 @@ const PaymentButton = Module.extend({
|
|
|
2215
2207
|
this.api = api;
|
|
2216
2208
|
} else {
|
|
2217
2209
|
this.api = new Api({
|
|
2210
|
+
version: this.params.version,
|
|
2218
2211
|
origin: this.params.origin,
|
|
2219
2212
|
endpoint: this.params.endpoint,
|
|
2220
2213
|
});
|
|
@@ -2427,7 +2420,7 @@ const PaymentContainer = Module.extend({
|
|
|
2427
2420
|
css.image = this.getAppleSvg(style.color);
|
|
2428
2421
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2429
2422
|
}
|
|
2430
|
-
{
|
|
2423
|
+
if (css) {
|
|
2431
2424
|
this.utils.forEach(css, function (value, name) {
|
|
2432
2425
|
element.style.setProperty(['--', name].join(''), value);
|
|
2433
2426
|
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export const ApiOrigin: "https://pay.flitt.com";
|
|
2
|
+
export namespace ApiEndpoint {
|
|
3
|
+
let gateway: string;
|
|
4
|
+
let element: string;
|
|
5
|
+
}
|
|
6
|
+
export const ProxyUrl: "http://secure-redirect.cloudipsp.com/submit/";
|
|
7
|
+
export const GooglePayApi: "https://pay.google.com/gp/p/js/pay.js";
|
|
8
|
+
export namespace GoogleBaseRequest {
|
|
9
|
+
let apiVersion: number;
|
|
10
|
+
let apiVersionMinor: number;
|
|
11
|
+
let allowedPaymentMethods: {
|
|
12
|
+
type: string;
|
|
13
|
+
parameters: {
|
|
14
|
+
allowedAuthMethods: string[];
|
|
15
|
+
allowedCardNetworks: string[];
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
export const PaymentMethodsConfig: {
|
|
20
|
+
url: string;
|
|
21
|
+
name: string;
|
|
22
|
+
path: string;
|
|
23
|
+
callback(PaymentsClient: any): any;
|
|
24
|
+
}[];
|
|
25
|
+
export const GooglePayLanguages: string[];
|
|
26
|
+
export namespace PaymentRequestDetails {
|
|
27
|
+
namespace total {
|
|
28
|
+
let label: string;
|
|
29
|
+
namespace amount {
|
|
30
|
+
let currency: string;
|
|
31
|
+
let value: string;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export namespace ApiFrameCss {
|
|
36
|
+
let width: string;
|
|
37
|
+
let height: string;
|
|
38
|
+
let left: string;
|
|
39
|
+
let bottom: string;
|
|
40
|
+
let position: string;
|
|
41
|
+
let border: string;
|
|
42
|
+
}
|
|
43
|
+
export const ButtonFrameCss: {
|
|
44
|
+
border: string;
|
|
45
|
+
margin: string;
|
|
46
|
+
padding: string;
|
|
47
|
+
display: string;
|
|
48
|
+
width: string;
|
|
49
|
+
'min-width': string;
|
|
50
|
+
background: string;
|
|
51
|
+
position: string;
|
|
52
|
+
opacity: string;
|
|
53
|
+
overflow: string;
|
|
54
|
+
height: string;
|
|
55
|
+
outline: string;
|
|
56
|
+
'z-index': string;
|
|
57
|
+
};
|
|
58
|
+
export namespace ButtonFrameAttrs {
|
|
59
|
+
let tabindex: string;
|
|
60
|
+
let scrolling: string;
|
|
61
|
+
let frameborder: number;
|
|
62
|
+
let allowtransparency: boolean;
|
|
63
|
+
let allowpaymentrequest: boolean;
|
|
64
|
+
}
|
|
65
|
+
export const ButtonCoverCss: {
|
|
66
|
+
'z-index': string;
|
|
67
|
+
position: string;
|
|
68
|
+
border: string;
|
|
69
|
+
background: string;
|
|
70
|
+
left: string;
|
|
71
|
+
top: string;
|
|
72
|
+
cursor: string;
|
|
73
|
+
outline: string;
|
|
74
|
+
width: string;
|
|
75
|
+
height: string;
|
|
76
|
+
};
|
|
77
|
+
export const ButtonCoverAttrs: {
|
|
78
|
+
role: string;
|
|
79
|
+
'aria-pressed': string;
|
|
80
|
+
};
|
|
81
|
+
export const ButtonContainerCss: {
|
|
82
|
+
border: string;
|
|
83
|
+
margin: string;
|
|
84
|
+
padding: string;
|
|
85
|
+
display: string;
|
|
86
|
+
background: string;
|
|
87
|
+
'user-select': string;
|
|
88
|
+
overflow: string;
|
|
89
|
+
position: string;
|
|
90
|
+
opacity: string;
|
|
91
|
+
height: string;
|
|
92
|
+
width: string;
|
|
93
|
+
outline: string;
|
|
94
|
+
};
|
|
95
|
+
export const ButtonDefaultColor: "dark";
|
|
96
|
+
export namespace ButtonColorMap {
|
|
97
|
+
let dark: string;
|
|
98
|
+
let light: string;
|
|
99
|
+
let black: string;
|
|
100
|
+
let white: string;
|
|
101
|
+
}
|
|
102
|
+
export namespace ButtonLabelMap {
|
|
103
|
+
let ar: string;
|
|
104
|
+
let bg: string;
|
|
105
|
+
let ca: string;
|
|
106
|
+
let zh: string;
|
|
107
|
+
let hr: string;
|
|
108
|
+
let cs: string;
|
|
109
|
+
let da: string;
|
|
110
|
+
let nl: string;
|
|
111
|
+
let en: string;
|
|
112
|
+
let et: string;
|
|
113
|
+
let es: string;
|
|
114
|
+
let el: string;
|
|
115
|
+
let fi: string;
|
|
116
|
+
let fr: string;
|
|
117
|
+
let de: string;
|
|
118
|
+
let id: string;
|
|
119
|
+
let it: string;
|
|
120
|
+
let ja: string;
|
|
121
|
+
let ko: string;
|
|
122
|
+
let ms: string;
|
|
123
|
+
let no: string;
|
|
124
|
+
let pl: string;
|
|
125
|
+
let pt: string;
|
|
126
|
+
let ru: string;
|
|
127
|
+
let sr: string;
|
|
128
|
+
let sk: string;
|
|
129
|
+
let sl: string;
|
|
130
|
+
let sv: string;
|
|
131
|
+
let th: string;
|
|
132
|
+
let tr: string;
|
|
133
|
+
let uk: string;
|
|
134
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function Deferred(): {
|
|
2
|
+
done(callback: any): /*elided*/ any;
|
|
3
|
+
fail(callback: any): /*elided*/ any;
|
|
4
|
+
progress(callback: any): /*elided*/ any;
|
|
5
|
+
always(callback: any): /*elided*/ any;
|
|
6
|
+
then(resolve: any, reject: any, progress: any): /*elided*/ any;
|
|
7
|
+
promise(object: any): any;
|
|
8
|
+
state: () => number;
|
|
9
|
+
isPending(): boolean;
|
|
10
|
+
isRejected(): boolean;
|
|
11
|
+
isResolved(): boolean;
|
|
12
|
+
isProgress(): boolean;
|
|
13
|
+
resolveWith(context: any, args: any): /*elided*/ any;
|
|
14
|
+
rejectWith(context: any, args: any): /*elided*/ any;
|
|
15
|
+
notifyWith(context: any, args: any): /*elided*/ any;
|
|
16
|
+
resolve(...args: any[]): /*elided*/ any;
|
|
17
|
+
reject(...args: any[]): /*elided*/ any;
|
|
18
|
+
notify(...args: any[]): /*elided*/ any;
|
|
19
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export function getType(o: any): any;
|
|
2
|
+
export function isPlainObject(o: any): boolean;
|
|
3
|
+
export function isFunction(o: any): boolean;
|
|
4
|
+
export function isArray(o: any): boolean;
|
|
5
|
+
export function isElement(o: any): boolean;
|
|
6
|
+
export function toArray(o: any): any;
|
|
7
|
+
export function hasProp(o: any, v: any): any;
|
|
8
|
+
export function forEach(ob: any, cb: any, cx: any): void;
|
|
9
|
+
export function cleanObject(ob: any): any;
|
|
10
|
+
export function extend(obj: any, ...args: any[]): any;
|
|
11
|
+
export function uuid(): string;
|
|
12
|
+
export function isObject(o: any): boolean;
|
|
13
|
+
export function isRegexp(o: any): boolean;
|
|
14
|
+
export function isArguments(o: any): boolean;
|
|
15
|
+
export function isError(o: any): boolean;
|
|
16
|
+
export function isDate(o: any): boolean;
|
|
17
|
+
export function isString(o: any): boolean;
|
|
18
|
+
export function isNumber(o: any): boolean;
|
|
19
|
+
export function map(ob: any, cb: any, cx: any): any[];
|
|
20
|
+
export function querySelectorAll(o: any, p: any): any;
|
|
21
|
+
export function querySelector(o: any, p: any): any;
|
|
22
|
+
export function deparam(params: any): {};
|
|
23
|
+
export function param(obj: any): string;
|
|
24
|
+
export function removeElement(el: any): void;
|
|
25
|
+
export function createElement(tag: any): any;
|
|
26
|
+
export function addClass(...args: any[]): void;
|
|
27
|
+
export function removeClass(...args: any[]): void;
|
|
28
|
+
export function removeAttr(el: any, attrs: any): boolean;
|
|
29
|
+
export function addAttr(el: any, attrs: any): boolean;
|
|
30
|
+
export function getStyle(el: any, prop: any, getComputedStyle: any): any;
|
|
31
|
+
export function getPath(path: any): Window;
|
|
32
|
+
export function stringFormat(format: any, params: any, expr: any): any;
|
|
33
|
+
export function cssUnit(value: any, unit: any): string;
|
|
34
|
+
/**
|
|
35
|
+
* @function
|
|
36
|
+
* @type {function(*, *, *)}
|
|
37
|
+
*/
|
|
38
|
+
export const getPaymentRequest: (arg0: any, arg1: any, arg2: any) => any;
|
|
39
|
+
export function jsonParse(value: any, defaults: any): any;
|
|
40
|
+
export function PromiseWithResolvers(): {
|
|
41
|
+
promise: Promise<any>;
|
|
42
|
+
resolve: undefined;
|
|
43
|
+
reject: undefined;
|
|
44
|
+
};
|
|
45
|
+
export function getAppleSessionConfig(config: PaymentRequestConfig): {
|
|
46
|
+
version: any;
|
|
47
|
+
countryCode: any;
|
|
48
|
+
supportedNetworks: any;
|
|
49
|
+
merchantCapabilities: any;
|
|
50
|
+
merchantIdentifier: any;
|
|
51
|
+
lineItems: any;
|
|
52
|
+
additionalLineItems: any;
|
|
53
|
+
recurringPaymentRequest: any;
|
|
54
|
+
deferredPaymentRequest: any;
|
|
55
|
+
currencyCode: any;
|
|
56
|
+
total: {
|
|
57
|
+
label: any;
|
|
58
|
+
amount: any;
|
|
59
|
+
};
|
|
60
|
+
requiredBillingContactFields: string[];
|
|
61
|
+
requiredShippingContactFields: string[];
|
|
62
|
+
};
|
|
63
|
+
export function getFunction(path: any): any;
|
|
64
|
+
export function loadExternalApi(url: any, path: any): Promise<any>;
|
|
65
|
+
export type PaymentRequestMethod = {
|
|
66
|
+
data: {
|
|
67
|
+
[string]: any;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type PaymentRequestOptions = {
|
|
71
|
+
requestPayerEmail?: boolean;
|
|
72
|
+
requestPayerPhone?: boolean;
|
|
73
|
+
requestPayerName?: boolean;
|
|
74
|
+
requestShipping?: boolean;
|
|
75
|
+
};
|
|
76
|
+
export type PaymentRequestConfig = {
|
|
77
|
+
/**
|
|
78
|
+
* methods
|
|
79
|
+
*/
|
|
80
|
+
PaymentRequestMethod?: any;
|
|
81
|
+
options: {
|
|
82
|
+
[string]: any;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default Component;
|
|
2
|
+
import * as Utils from './core/utils.js';
|
|
3
|
+
import * as Config from './core/config.js';
|
|
4
|
+
import { Api } from './core/api.js';
|
|
5
|
+
import { Module } from './core/module.js';
|
|
6
|
+
import { Connector } from './core/connector.js';
|
|
7
|
+
import { Response } from './core/response.js';
|
|
8
|
+
import { PaymentRequestApi } from './core/payment/request.js';
|
|
9
|
+
import { PaymentContainer } from './core/payment/container.js';
|
|
10
|
+
import { PaymentElement } from './core/payment/element.js';
|
|
11
|
+
import { PaymentButton } from './core/payment/button.js';
|
|
12
|
+
import { Component } from './core/component.js';
|
|
13
|
+
export { Utils, Config, Api, Module, Connector, Response, PaymentRequestApi, PaymentContainer, PaymentElement, PaymentButton };
|