@flittpayments/js-sdk 2.0.9 → 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 +26 -33
- package/dist/esm/checkout.js +29 -31
- 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,
|
|
@@ -1203,7 +1184,12 @@ const Modal = Module.extend({
|
|
|
1203
1184
|
this.addEvent(this.find('.flitt-modal-close'), 'click', 'closeModal');
|
|
1204
1185
|
this.addEvent(this.find('.flitt-modal-title a'), 'click', 'submitForm');
|
|
1205
1186
|
this.initScrollbar();
|
|
1206
|
-
this.
|
|
1187
|
+
this.submitToIframe();
|
|
1188
|
+
},
|
|
1189
|
+
submitToIframe() {
|
|
1190
|
+
if (this.modal) {
|
|
1191
|
+
this.body.appendChild(this.modal);
|
|
1192
|
+
}
|
|
1207
1193
|
if (this.form) {
|
|
1208
1194
|
this.form.submit();
|
|
1209
1195
|
}
|
|
@@ -1503,6 +1489,7 @@ const Response = Model.extend({
|
|
|
1503
1489
|
|
|
1504
1490
|
const Api = Module.extend({
|
|
1505
1491
|
defaults: {
|
|
1492
|
+
version: 'default',
|
|
1506
1493
|
origin: ApiOrigin,
|
|
1507
1494
|
endpoint: ApiEndpoint,
|
|
1508
1495
|
container: 'body',
|
|
@@ -1515,7 +1502,10 @@ const Api = Module.extend({
|
|
|
1515
1502
|
this.initParams(params);
|
|
1516
1503
|
},
|
|
1517
1504
|
url(type, url) {
|
|
1518
|
-
return
|
|
1505
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1506
|
+
version: this.params.version,
|
|
1507
|
+
origin: location.origin
|
|
1508
|
+
});
|
|
1519
1509
|
},
|
|
1520
1510
|
extendParams(params) {
|
|
1521
1511
|
this.utils.extend(this.params, params);
|
|
@@ -2027,6 +2017,7 @@ const PaymentElement = Module.extend({
|
|
|
2027
2017
|
|
|
2028
2018
|
const PaymentButton = Module.extend({
|
|
2029
2019
|
defaults: {
|
|
2020
|
+
version: 'default',
|
|
2030
2021
|
origin: ApiOrigin,
|
|
2031
2022
|
endpoint: ApiEndpoint,
|
|
2032
2023
|
methods: ['apple', 'google'],
|
|
@@ -2052,6 +2043,7 @@ const PaymentButton = Module.extend({
|
|
|
2052
2043
|
this.supported = false;
|
|
2053
2044
|
this.params = {
|
|
2054
2045
|
element: params.element,
|
|
2046
|
+
version: params.version || this.defaults.version,
|
|
2055
2047
|
methods: params.methods || this.defaults.methods,
|
|
2056
2048
|
origin: params.origin || this.defaults.origin,
|
|
2057
2049
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2076,6 +2068,7 @@ const PaymentButton = Module.extend({
|
|
|
2076
2068
|
this.api = api;
|
|
2077
2069
|
} else {
|
|
2078
2070
|
this.api = new Api({
|
|
2071
|
+
version: this.params.version,
|
|
2079
2072
|
origin: this.params.origin,
|
|
2080
2073
|
endpoint: this.params.endpoint
|
|
2081
2074
|
});
|
|
@@ -2279,7 +2272,7 @@ const PaymentContainer = Module.extend({
|
|
|
2279
2272
|
css.image = this.getAppleSvg(style.color);
|
|
2280
2273
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2281
2274
|
}
|
|
2282
|
-
{
|
|
2275
|
+
if (css) {
|
|
2283
2276
|
this.utils.forEach(css, function (value, name) {
|
|
2284
2277
|
element.style.setProperty(['--', name].join(''), value);
|
|
2285
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,
|
|
@@ -1320,7 +1306,12 @@ const Modal = Module.extend({
|
|
|
1320
1306
|
this.addEvent(this.find('.flitt-modal-close'), 'click', 'closeModal');
|
|
1321
1307
|
this.addEvent(this.find('.flitt-modal-title a'), 'click', 'submitForm');
|
|
1322
1308
|
this.initScrollbar();
|
|
1323
|
-
this.
|
|
1309
|
+
this.submitToIframe();
|
|
1310
|
+
},
|
|
1311
|
+
submitToIframe() {
|
|
1312
|
+
if (this.modal) {
|
|
1313
|
+
this.body.appendChild(this.modal);
|
|
1314
|
+
}
|
|
1324
1315
|
if (this.form) {
|
|
1325
1316
|
this.form.submit();
|
|
1326
1317
|
}
|
|
@@ -1625,6 +1616,7 @@ const Response = Model.extend({
|
|
|
1625
1616
|
|
|
1626
1617
|
const Api = Module.extend({
|
|
1627
1618
|
defaults: {
|
|
1619
|
+
version: 'default',
|
|
1628
1620
|
origin: ApiOrigin,
|
|
1629
1621
|
endpoint: ApiEndpoint,
|
|
1630
1622
|
container: 'body',
|
|
@@ -1638,7 +1630,10 @@ const Api = Module.extend({
|
|
|
1638
1630
|
this.initParams(params);
|
|
1639
1631
|
},
|
|
1640
1632
|
url(type, url) {
|
|
1641
|
-
return
|
|
1633
|
+
return buildUrl(this.params.origin, this.params.endpoint[type], {
|
|
1634
|
+
version: this.params.version,
|
|
1635
|
+
origin: location.origin,
|
|
1636
|
+
})
|
|
1642
1637
|
},
|
|
1643
1638
|
extendParams(params) {
|
|
1644
1639
|
this.utils.extend(this.params, params);
|
|
@@ -2161,6 +2156,7 @@ const PaymentElement = Module.extend({
|
|
|
2161
2156
|
|
|
2162
2157
|
const PaymentButton = Module.extend({
|
|
2163
2158
|
defaults: {
|
|
2159
|
+
version: 'default',
|
|
2164
2160
|
origin: ApiOrigin,
|
|
2165
2161
|
endpoint: ApiEndpoint,
|
|
2166
2162
|
methods: ['apple', 'google'],
|
|
@@ -2186,6 +2182,7 @@ const PaymentButton = Module.extend({
|
|
|
2186
2182
|
this.supported = false;
|
|
2187
2183
|
this.params = {
|
|
2188
2184
|
element: params.element,
|
|
2185
|
+
version: params.version || this.defaults.version,
|
|
2189
2186
|
methods: params.methods || this.defaults.methods,
|
|
2190
2187
|
origin: params.origin || this.defaults.origin,
|
|
2191
2188
|
endpoint: this.utils.extend({}, this.defaults.endpoint, params.endpoint),
|
|
@@ -2210,6 +2207,7 @@ const PaymentButton = Module.extend({
|
|
|
2210
2207
|
this.api = api;
|
|
2211
2208
|
} else {
|
|
2212
2209
|
this.api = new Api({
|
|
2210
|
+
version: this.params.version,
|
|
2213
2211
|
origin: this.params.origin,
|
|
2214
2212
|
endpoint: this.params.endpoint,
|
|
2215
2213
|
});
|
|
@@ -2422,7 +2420,7 @@ const PaymentContainer = Module.extend({
|
|
|
2422
2420
|
css.image = this.getAppleSvg(style.color);
|
|
2423
2421
|
css.label = this.getAppleLabel(lang, style.mode);
|
|
2424
2422
|
}
|
|
2425
|
-
{
|
|
2423
|
+
if (css) {
|
|
2426
2424
|
this.utils.forEach(css, function (value, name) {
|
|
2427
2425
|
element.style.setProperty(['--', name].join(''), value);
|
|
2428
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
|
+
};
|