@flittpayments/js-sdk 2.0.10 → 2.0.11
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 +21 -32
- package/dist/esm/checkout.js +24 -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,
|
|
@@ -565,6 +546,7 @@ const ButtonFrameCss = {
|
|
|
565
546
|
overflow: 'hidden !important',
|
|
566
547
|
height: '100% !important',
|
|
567
548
|
outline: 'none !important',
|
|
549
|
+
'color-scheme': 'light',
|
|
568
550
|
'z-index': '1 !important'
|
|
569
551
|
};
|
|
570
552
|
const ButtonFrameAttrs = {
|
|
@@ -1508,6 +1490,7 @@ const Response = Model.extend({
|
|
|
1508
1490
|
|
|
1509
1491
|
const Api = Module.extend({
|
|
1510
1492
|
defaults: {
|
|
1493
|
+
version: 'default',
|
|
1511
1494
|
origin: ApiOrigin,
|
|
1512
1495
|
endpoint: ApiEndpoint,
|
|
1513
1496
|
container: 'body',
|
|
@@ -1520,7 +1503,10 @@ const Api = Module.extend({
|
|
|
1520
1503
|
this.initParams(params);
|
|
1521
1504
|
},
|
|
1522
1505
|
url(type, url) {
|
|
1523
|
-
return
|
|
1506
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1507
|
+
version: this.params.version,
|
|
1508
|
+
origin: location.origin
|
|
1509
|
+
});
|
|
1524
1510
|
},
|
|
1525
1511
|
extendParams(params) {
|
|
1526
1512
|
this.utils.extend(this.params, params);
|
|
@@ -2032,6 +2018,7 @@ const PaymentElement = Module.extend({
|
|
|
2032
2018
|
|
|
2033
2019
|
const PaymentButton = Module.extend({
|
|
2034
2020
|
defaults: {
|
|
2021
|
+
version: 'default',
|
|
2035
2022
|
origin: ApiOrigin,
|
|
2036
2023
|
endpoint: ApiEndpoint,
|
|
2037
2024
|
methods: ['apple', 'google'],
|
|
@@ -2057,6 +2044,7 @@ const PaymentButton = Module.extend({
|
|
|
2057
2044
|
this.supported = false;
|
|
2058
2045
|
this.params = {
|
|
2059
2046
|
element: params.element,
|
|
2047
|
+
version: params.version || this.defaults.version,
|
|
2060
2048
|
methods: params.methods || this.defaults.methods,
|
|
2061
2049
|
origin: params.origin || this.defaults.origin,
|
|
2062
2050
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2081,6 +2069,7 @@ const PaymentButton = Module.extend({
|
|
|
2081
2069
|
this.api = api;
|
|
2082
2070
|
} else {
|
|
2083
2071
|
this.api = new Api({
|
|
2072
|
+
version: this.params.version,
|
|
2084
2073
|
origin: this.params.origin,
|
|
2085
2074
|
endpoint: this.params.endpoint
|
|
2086
2075
|
});
|
|
@@ -2284,7 +2273,7 @@ const PaymentContainer = Module.extend({
|
|
|
2284
2273
|
css.image = this.getAppleSvg(style.color);
|
|
2285
2274
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2286
2275
|
}
|
|
2287
|
-
{
|
|
2276
|
+
if (css) {
|
|
2288
2277
|
this.utils.forEach(css, function (value, name) {
|
|
2289
2278
|
element.style.setProperty(['--', name].join(''), value);
|
|
2290
2279
|
});
|
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,
|
|
@@ -643,6 +629,7 @@ const ButtonFrameCss = {
|
|
|
643
629
|
overflow: 'hidden !important',
|
|
644
630
|
height: '100% !important',
|
|
645
631
|
outline: 'none !important',
|
|
632
|
+
'color-scheme': 'light',
|
|
646
633
|
'z-index': '1 !important',
|
|
647
634
|
};
|
|
648
635
|
|
|
@@ -1630,6 +1617,7 @@ const Response = Model.extend({
|
|
|
1630
1617
|
|
|
1631
1618
|
const Api = Module.extend({
|
|
1632
1619
|
defaults: {
|
|
1620
|
+
version: 'default',
|
|
1633
1621
|
origin: ApiOrigin,
|
|
1634
1622
|
endpoint: ApiEndpoint,
|
|
1635
1623
|
container: 'body',
|
|
@@ -1643,7 +1631,10 @@ const Api = Module.extend({
|
|
|
1643
1631
|
this.initParams(params);
|
|
1644
1632
|
},
|
|
1645
1633
|
url(type, url) {
|
|
1646
|
-
return
|
|
1634
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1635
|
+
version: this.params.version,
|
|
1636
|
+
origin: location.origin,
|
|
1637
|
+
})
|
|
1647
1638
|
},
|
|
1648
1639
|
extendParams(params) {
|
|
1649
1640
|
this.utils.extend(this.params, params);
|
|
@@ -2166,6 +2157,7 @@ const PaymentElement = Module.extend({
|
|
|
2166
2157
|
|
|
2167
2158
|
const PaymentButton = Module.extend({
|
|
2168
2159
|
defaults: {
|
|
2160
|
+
version: 'default',
|
|
2169
2161
|
origin: ApiOrigin,
|
|
2170
2162
|
endpoint: ApiEndpoint,
|
|
2171
2163
|
methods: ['apple', 'google'],
|
|
@@ -2191,6 +2183,7 @@ const PaymentButton = Module.extend({
|
|
|
2191
2183
|
this.supported = false;
|
|
2192
2184
|
this.params = {
|
|
2193
2185
|
element: params.element,
|
|
2186
|
+
version: params.version || this.defaults.version,
|
|
2194
2187
|
methods: params.methods || this.defaults.methods,
|
|
2195
2188
|
origin: params.origin || this.defaults.origin,
|
|
2196
2189
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2215,6 +2208,7 @@ const PaymentButton = Module.extend({
|
|
|
2215
2208
|
this.api = api;
|
|
2216
2209
|
} else {
|
|
2217
2210
|
this.api = new Api({
|
|
2211
|
+
version: this.params.version,
|
|
2218
2212
|
origin: this.params.origin,
|
|
2219
2213
|
endpoint: this.params.endpoint,
|
|
2220
2214
|
});
|
|
@@ -2427,7 +2421,7 @@ const PaymentContainer = Module.extend({
|
|
|
2427
2421
|
css.image = this.getAppleSvg(style.color);
|
|
2428
2422
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2429
2423
|
}
|
|
2430
|
-
{
|
|
2424
|
+
if (css) {
|
|
2431
2425
|
this.utils.forEach(css, function (value, name) {
|
|
2432
2426
|
element.style.setProperty(['--', name].join(''), value);
|
|
2433
2427
|
});
|
|
@@ -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
|
+
};
|