@tap-payments/apple-pay-button 0.0.0-test → 0.0.1
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/LICENSE +21 -21
- package/README.md +194 -120
- package/build/@types/index.d.ts +79 -74
- package/build/@types/index.js +1 -1
- package/build/api/app.service.d.ts +11 -11
- package/build/api/app.service.js +217 -217
- package/build/api/base.d.ts +9 -9
- package/build/api/base.js +45 -45
- package/build/api/httpClient.d.ts +2 -2
- package/build/api/httpClient.js +16 -16
- package/build/constants/index.d.ts +39 -21
- package/build/constants/index.js +39 -21
- package/build/features/ApplePayButton/ApplePayButton.css +12 -40
- package/build/features/ApplePayButton/ApplePayButton.d.ts +6 -8
- package/build/features/ApplePayButton/ApplePayButton.js +77 -43
- package/build/features/ApplePayButton/index.d.ts +3 -3
- package/build/features/ApplePayButton/index.js +2 -2
- package/build/hooks/index.d.ts +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/useApplePay.d.ts +9 -9
- package/build/hooks/useApplePay.js +223 -202
- package/build/hooks/useScript.d.ts +1 -1
- package/build/hooks/useScript.js +39 -39
- package/build/index.d.ts +4 -4
- package/build/index.js +9 -9
- package/build/utils/config.d.ts +9 -8
- package/build/utils/config.js +54 -54
- package/build/utils/html.d.ts +1 -3
- package/build/utils/html.js +9 -20
- package/build/utils/index.d.ts +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +102 -102
package/build/api/app.service.js
CHANGED
|
@@ -1,217 +1,217 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (_) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
import BaseService from './base';
|
|
53
|
-
import httpClient from './httpClient';
|
|
54
|
-
var APPService = (function (_super) {
|
|
55
|
-
__extends(APPService, _super);
|
|
56
|
-
function APPService() {
|
|
57
|
-
return _super.call(this, httpClient) || this;
|
|
58
|
-
}
|
|
59
|
-
Object.defineProperty(APPService.prototype, "init", {
|
|
60
|
-
enumerable: false,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true,
|
|
63
|
-
value: function (publicKey, merchantId) {
|
|
64
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
var body, data;
|
|
66
|
-
return __generator(this, function (_a) {
|
|
67
|
-
switch (_a.label) {
|
|
68
|
-
case 0:
|
|
69
|
-
body = {
|
|
70
|
-
headers: { authorization: "Bearer ".concat(publicKey) },
|
|
71
|
-
reqBody: { public_key: publicKey, merchant_id: merchantId }
|
|
72
|
-
};
|
|
73
|
-
return [4, this.post('/init', body)];
|
|
74
|
-
case 1:
|
|
75
|
-
data = (_a.sent()).data;
|
|
76
|
-
if (data.errors)
|
|
77
|
-
throw data;
|
|
78
|
-
return [2, {
|
|
79
|
-
merchant: data.merchant,
|
|
80
|
-
payment_options: data.payment_options
|
|
81
|
-
}];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
Object.defineProperty(APPService.prototype, "appleSession", {
|
|
88
|
-
enumerable: false,
|
|
89
|
-
configurable: true,
|
|
90
|
-
writable: true,
|
|
91
|
-
value: function (merchant, validationURL, merchantRegisteredDomain) {
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
var body, data;
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
switch (_a.label) {
|
|
96
|
-
case 0:
|
|
97
|
-
body = {
|
|
98
|
-
validationUrl: validationURL,
|
|
99
|
-
origin: merchantRegisteredDomain,
|
|
100
|
-
merchantIdentifier:
|
|
101
|
-
merchantId: merchant.id,
|
|
102
|
-
merchantName: merchant.name,
|
|
103
|
-
session_token: merchant.session_token
|
|
104
|
-
};
|
|
105
|
-
return [4, this.post('/session', body)];
|
|
106
|
-
case 1:
|
|
107
|
-
data = (_a.sent()).data;
|
|
108
|
-
if (data.errors)
|
|
109
|
-
throw data;
|
|
110
|
-
return [2, data];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(APPService.prototype, "tapTokenization", {
|
|
117
|
-
enumerable: false,
|
|
118
|
-
configurable: true,
|
|
119
|
-
writable: true,
|
|
120
|
-
value: function (applePaymentData, merchant) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
var body, data;
|
|
123
|
-
return __generator(this, function (_a) {
|
|
124
|
-
switch (_a.label) {
|
|
125
|
-
case 0:
|
|
126
|
-
body = {
|
|
127
|
-
method: 'POST',
|
|
128
|
-
path: '/v2/token',
|
|
129
|
-
headers: {
|
|
130
|
-
session_token: merchant.session_token
|
|
131
|
-
},
|
|
132
|
-
reqBody: {
|
|
133
|
-
type: 'applepay',
|
|
134
|
-
token_data: applePaymentData
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
return [4, this.post('/api', body)];
|
|
138
|
-
case 1:
|
|
139
|
-
data = (_a.sent()).data;
|
|
140
|
-
if (data.errors)
|
|
141
|
-
throw data;
|
|
142
|
-
return [2, data];
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
Object.defineProperty(APPService.prototype, "createCharge", {
|
|
149
|
-
enumerable: false,
|
|
150
|
-
configurable: true,
|
|
151
|
-
writable: true,
|
|
152
|
-
value: function (publicKey, merchant, request, cardToken) {
|
|
153
|
-
var body = {
|
|
154
|
-
method: 'POST',
|
|
155
|
-
path: '/v2/charge',
|
|
156
|
-
headers: {
|
|
157
|
-
session_token: merchant.session_token
|
|
158
|
-
},
|
|
159
|
-
reqBody: {
|
|
160
|
-
id: null,
|
|
161
|
-
amount: request.total.amount,
|
|
162
|
-
currency: request.currencyCode,
|
|
163
|
-
public_key: publicKey,
|
|
164
|
-
product: 'GOSELL',
|
|
165
|
-
threeDSecure: true,
|
|
166
|
-
save_card: false,
|
|
167
|
-
fee: 0,
|
|
168
|
-
statement_descriptor: 'Sample',
|
|
169
|
-
description: 'Test Description',
|
|
170
|
-
metadata: {},
|
|
171
|
-
reference: {
|
|
172
|
-
transaction: 'txn_0001',
|
|
173
|
-
order: 'ord_0001'
|
|
174
|
-
},
|
|
175
|
-
receipt: {
|
|
176
|
-
email: false,
|
|
177
|
-
sms: true
|
|
178
|
-
},
|
|
179
|
-
customer: {
|
|
180
|
-
id: null,
|
|
181
|
-
first_name: 'Hala',
|
|
182
|
-
middle_name: null,
|
|
183
|
-
last_name: 'Q.',
|
|
184
|
-
email: 'email@email.com',
|
|
185
|
-
phone: {
|
|
186
|
-
country_code: '965',
|
|
187
|
-
number: '00000000'
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
source: {
|
|
191
|
-
id: cardToken
|
|
192
|
-
},
|
|
193
|
-
hashstring: null,
|
|
194
|
-
post: {
|
|
195
|
-
url: null
|
|
196
|
-
},
|
|
197
|
-
redirect: {
|
|
198
|
-
url: 'https://jslib.gosell.io/demo?token=63cce645332aa501e6cf768f&mode=popup'
|
|
199
|
-
},
|
|
200
|
-
ipaddress: null,
|
|
201
|
-
selected_currency: request.currencyCode,
|
|
202
|
-
selected_amount: request.total.amount,
|
|
203
|
-
merchant: {
|
|
204
|
-
id: merchant.id
|
|
205
|
-
},
|
|
206
|
-
order: {
|
|
207
|
-
id: 'ord_06CO2023731xt7V22SC0X487'
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
return this.post('/api', body);
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
return APPService;
|
|
215
|
-
}(BaseService));
|
|
216
|
-
var appService = new APPService();
|
|
217
|
-
export default appService;
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (_) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import BaseService from './base';
|
|
53
|
+
import httpClient from './httpClient';
|
|
54
|
+
var APPService = (function (_super) {
|
|
55
|
+
__extends(APPService, _super);
|
|
56
|
+
function APPService() {
|
|
57
|
+
return _super.call(this, httpClient) || this;
|
|
58
|
+
}
|
|
59
|
+
Object.defineProperty(APPService.prototype, "init", {
|
|
60
|
+
enumerable: false,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: function (publicKey, merchantId) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var body, data;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
body = {
|
|
70
|
+
headers: { authorization: "Bearer ".concat(publicKey) },
|
|
71
|
+
reqBody: { public_key: publicKey, merchant_id: merchantId }
|
|
72
|
+
};
|
|
73
|
+
return [4, this.post('/init', body)];
|
|
74
|
+
case 1:
|
|
75
|
+
data = (_a.sent()).data;
|
|
76
|
+
if (data.errors)
|
|
77
|
+
throw data;
|
|
78
|
+
return [2, {
|
|
79
|
+
merchant: data.merchant,
|
|
80
|
+
payment_options: data.payment_options
|
|
81
|
+
}];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(APPService.prototype, "appleSession", {
|
|
88
|
+
enumerable: false,
|
|
89
|
+
configurable: true,
|
|
90
|
+
writable: true,
|
|
91
|
+
value: function (merchant, validationURL, merchantRegisteredDomain, merchantIdentifier) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var body, data;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
body = {
|
|
98
|
+
validationUrl: validationURL,
|
|
99
|
+
origin: merchantRegisteredDomain,
|
|
100
|
+
merchantIdentifier: merchantIdentifier,
|
|
101
|
+
merchantId: merchant.id,
|
|
102
|
+
merchantName: merchant.name,
|
|
103
|
+
session_token: merchant.session_token
|
|
104
|
+
};
|
|
105
|
+
return [4, this.post('/session', body)];
|
|
106
|
+
case 1:
|
|
107
|
+
data = (_a.sent()).data;
|
|
108
|
+
if (data.errors)
|
|
109
|
+
throw data;
|
|
110
|
+
return [2, data];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(APPService.prototype, "tapTokenization", {
|
|
117
|
+
enumerable: false,
|
|
118
|
+
configurable: true,
|
|
119
|
+
writable: true,
|
|
120
|
+
value: function (applePaymentData, merchant) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var body, data;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
body = {
|
|
127
|
+
method: 'POST',
|
|
128
|
+
path: '/v2/token',
|
|
129
|
+
headers: {
|
|
130
|
+
session_token: merchant.session_token
|
|
131
|
+
},
|
|
132
|
+
reqBody: {
|
|
133
|
+
type: 'applepay',
|
|
134
|
+
token_data: applePaymentData
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
return [4, this.post('/api', body)];
|
|
138
|
+
case 1:
|
|
139
|
+
data = (_a.sent()).data;
|
|
140
|
+
if (data.errors)
|
|
141
|
+
throw data;
|
|
142
|
+
return [2, data];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(APPService.prototype, "createCharge", {
|
|
149
|
+
enumerable: false,
|
|
150
|
+
configurable: true,
|
|
151
|
+
writable: true,
|
|
152
|
+
value: function (publicKey, merchant, request, cardToken) {
|
|
153
|
+
var body = {
|
|
154
|
+
method: 'POST',
|
|
155
|
+
path: '/v2/charge',
|
|
156
|
+
headers: {
|
|
157
|
+
session_token: merchant.session_token
|
|
158
|
+
},
|
|
159
|
+
reqBody: {
|
|
160
|
+
id: null,
|
|
161
|
+
amount: request.total.amount,
|
|
162
|
+
currency: request.currencyCode,
|
|
163
|
+
public_key: publicKey,
|
|
164
|
+
product: 'GOSELL',
|
|
165
|
+
threeDSecure: true,
|
|
166
|
+
save_card: false,
|
|
167
|
+
fee: 0,
|
|
168
|
+
statement_descriptor: 'Sample',
|
|
169
|
+
description: 'Test Description',
|
|
170
|
+
metadata: {},
|
|
171
|
+
reference: {
|
|
172
|
+
transaction: 'txn_0001',
|
|
173
|
+
order: 'ord_0001'
|
|
174
|
+
},
|
|
175
|
+
receipt: {
|
|
176
|
+
email: false,
|
|
177
|
+
sms: true
|
|
178
|
+
},
|
|
179
|
+
customer: {
|
|
180
|
+
id: null,
|
|
181
|
+
first_name: 'Hala',
|
|
182
|
+
middle_name: null,
|
|
183
|
+
last_name: 'Q.',
|
|
184
|
+
email: 'email@email.com',
|
|
185
|
+
phone: {
|
|
186
|
+
country_code: '965',
|
|
187
|
+
number: '00000000'
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
source: {
|
|
191
|
+
id: cardToken
|
|
192
|
+
},
|
|
193
|
+
hashstring: null,
|
|
194
|
+
post: {
|
|
195
|
+
url: null
|
|
196
|
+
},
|
|
197
|
+
redirect: {
|
|
198
|
+
url: 'https://jslib.gosell.io/demo?token=63cce645332aa501e6cf768f&mode=popup'
|
|
199
|
+
},
|
|
200
|
+
ipaddress: null,
|
|
201
|
+
selected_currency: request.currencyCode,
|
|
202
|
+
selected_amount: request.total.amount,
|
|
203
|
+
merchant: {
|
|
204
|
+
id: merchant.id
|
|
205
|
+
},
|
|
206
|
+
order: {
|
|
207
|
+
id: 'ord_06CO2023731xt7V22SC0X487'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return this.post('/api', body);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
return APPService;
|
|
215
|
+
}(BaseService));
|
|
216
|
+
var appService = new APPService();
|
|
217
|
+
export default appService;
|
package/build/api/base.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
-
export default class BaseService {
|
|
3
|
-
httpClient: AxiosInstance;
|
|
4
|
-
constructor(httpClient: AxiosInstance);
|
|
5
|
-
get(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
-
post(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
-
put(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
-
delete(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
-
}
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
export default class BaseService {
|
|
3
|
+
httpClient: AxiosInstance;
|
|
4
|
+
constructor(httpClient: AxiosInstance);
|
|
5
|
+
get(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
post(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
put(url: string, data?: any, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
8
|
+
delete(url: string, config?: AxiosRequestConfig<any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
9
|
+
}
|
package/build/api/base.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
var BaseService = (function () {
|
|
2
|
-
function BaseService(httpClient) {
|
|
3
|
-
Object.defineProperty(this, "httpClient", {
|
|
4
|
-
enumerable: true,
|
|
5
|
-
configurable: true,
|
|
6
|
-
writable: true,
|
|
7
|
-
value: void 0
|
|
8
|
-
});
|
|
9
|
-
this.httpClient = httpClient;
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(BaseService.prototype, "get", {
|
|
12
|
-
enumerable: false,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: function (url, config) {
|
|
16
|
-
return this.httpClient.get(url, config);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(BaseService.prototype, "post", {
|
|
20
|
-
enumerable: false,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: function (url, data, config) {
|
|
24
|
-
return this.httpClient.post(url, data, config);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(BaseService.prototype, "put", {
|
|
28
|
-
enumerable: false,
|
|
29
|
-
configurable: true,
|
|
30
|
-
writable: true,
|
|
31
|
-
value: function (url, data, config) {
|
|
32
|
-
return this.httpClient.put(url, data, config);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(BaseService.prototype, "delete", {
|
|
36
|
-
enumerable: false,
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: function (url, config) {
|
|
40
|
-
return this.httpClient.delete(url, config);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
return BaseService;
|
|
44
|
-
}());
|
|
45
|
-
export default BaseService;
|
|
1
|
+
var BaseService = (function () {
|
|
2
|
+
function BaseService(httpClient) {
|
|
3
|
+
Object.defineProperty(this, "httpClient", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
configurable: true,
|
|
6
|
+
writable: true,
|
|
7
|
+
value: void 0
|
|
8
|
+
});
|
|
9
|
+
this.httpClient = httpClient;
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(BaseService.prototype, "get", {
|
|
12
|
+
enumerable: false,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: function (url, config) {
|
|
16
|
+
return this.httpClient.get(url, config);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(BaseService.prototype, "post", {
|
|
20
|
+
enumerable: false,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: function (url, data, config) {
|
|
24
|
+
return this.httpClient.post(url, data, config);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(BaseService.prototype, "put", {
|
|
28
|
+
enumerable: false,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: function (url, data, config) {
|
|
32
|
+
return this.httpClient.put(url, data, config);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(BaseService.prototype, "delete", {
|
|
36
|
+
enumerable: false,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: function (url, config) {
|
|
40
|
+
return this.httpClient.delete(url, config);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return BaseService;
|
|
44
|
+
}());
|
|
45
|
+
export default BaseService;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const httpClient: import("axios").AxiosInstance;
|
|
2
|
-
export default httpClient;
|
|
1
|
+
declare const httpClient: import("axios").AxiosInstance;
|
|
2
|
+
export default httpClient;
|
package/build/api/httpClient.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
var MW_BASE_URL = 'https://checkout.payments.tap.company/api';
|
|
3
|
-
var httpClient = axios.create({
|
|
4
|
-
baseURL: MW_BASE_URL,
|
|
5
|
-
headers: {
|
|
6
|
-
'Content-Type': 'application/json',
|
|
7
|
-
Accept: 'application/json'
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
httpClient.interceptors.request.use(function (config) {
|
|
11
|
-
return config;
|
|
12
|
-
});
|
|
13
|
-
httpClient.interceptors.response.use(function (response) {
|
|
14
|
-
return response;
|
|
15
|
-
});
|
|
16
|
-
export default httpClient;
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
var MW_BASE_URL = 'https://checkout.payments.tap.company/api';
|
|
3
|
+
var httpClient = axios.create({
|
|
4
|
+
baseURL: MW_BASE_URL,
|
|
5
|
+
headers: {
|
|
6
|
+
'Content-Type': 'application/json',
|
|
7
|
+
Accept: 'application/json'
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
httpClient.interceptors.request.use(function (config) {
|
|
11
|
+
return config;
|
|
12
|
+
});
|
|
13
|
+
httpClient.interceptors.response.use(function (response) {
|
|
14
|
+
return response;
|
|
15
|
+
});
|
|
16
|
+
export default httpClient;
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
export declare const Scope: {
|
|
2
|
-
readonly AppleToken: "AppleToken";
|
|
3
|
-
readonly TapToken: "TapToken";
|
|
4
|
-
};
|
|
5
|
-
export declare const ButtonStyle: {
|
|
6
|
-
readonly Black: "black";
|
|
7
|
-
readonly White: "white";
|
|
8
|
-
readonly WhiteOutline: "
|
|
9
|
-
};
|
|
10
|
-
export declare const
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
};
|
|
15
|
-
export declare const
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
export declare const Scope: {
|
|
2
|
+
readonly AppleToken: "AppleToken";
|
|
3
|
+
readonly TapToken: "TapToken";
|
|
4
|
+
};
|
|
5
|
+
export declare const ButtonStyle: {
|
|
6
|
+
readonly Black: "black";
|
|
7
|
+
readonly White: "white";
|
|
8
|
+
readonly WhiteOutline: "white-outline";
|
|
9
|
+
};
|
|
10
|
+
export declare const Locale: {
|
|
11
|
+
readonly EN: "en";
|
|
12
|
+
readonly AR: "ar";
|
|
13
|
+
readonly FR: "fr";
|
|
14
|
+
};
|
|
15
|
+
export declare const ButtonType: {
|
|
16
|
+
readonly BOOK: "book";
|
|
17
|
+
readonly BUY: "buy";
|
|
18
|
+
readonly CHECK_OUT: "check-out";
|
|
19
|
+
readonly PAY: "pay";
|
|
20
|
+
readonly PLAIN: "plain";
|
|
21
|
+
readonly SUBSCRIBE: "subscribe";
|
|
22
|
+
};
|
|
23
|
+
export declare const MerchantCapabilities: {
|
|
24
|
+
readonly Supports3DS: "supports3DS";
|
|
25
|
+
readonly SupportsCredit: "supportsCredit";
|
|
26
|
+
readonly SupportsDebit: "supportsDebit";
|
|
27
|
+
};
|
|
28
|
+
export declare const SupportedNetworks: {
|
|
29
|
+
readonly Amex: "amex";
|
|
30
|
+
readonly Mada: "mada";
|
|
31
|
+
readonly MasterCard: "masterCard";
|
|
32
|
+
readonly Visa: "visa";
|
|
33
|
+
readonly ChinaUnionPay: "chinaUnionPay";
|
|
34
|
+
readonly Discover: "discover";
|
|
35
|
+
readonly Electron: "electron";
|
|
36
|
+
readonly Jcb: "jcb";
|
|
37
|
+
readonly Maestro: "maestro";
|
|
38
|
+
};
|
|
39
|
+
export declare const ApplePayVersion = 5;
|