@tillhub/javascript-sdk 4.221.0 → 4.222.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/CHANGELOG.md +13 -0
- package/dist/types/v0/index.d.ts +2 -1
- package/dist/types/v0/payment_products.d.ts +58 -0
- package/dist/types/v2/order-actions.d.ts +133 -0
- package/dist/types/v3/transactions.d.ts +0 -128
- package/dist/v0/index.js +4 -2
- package/dist/v0/index.js.map +1 -1
- package/dist/v0/payment_products.js +72 -0
- package/dist/v0/payment_products.js.map +1 -0
- package/dist/v2/order-actions.js +115 -1
- package/dist/v2/order-actions.js.map +1 -1
- package/dist/v3/transactions.js +4 -118
- package/dist/v3/transactions.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# [4.222.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.221.0...v4.222.0) (2025-08-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* **payment:** fix tests ([5c48ad4](https://github.com/tillhub/tillhub-sdk-javascript/commit/5c48ad4836db73826d764d4c97c694311e5cef3d))
|
7
|
+
* **payment-products:** add PaymentProducts class and integrate with existing API structure ([f62646f](https://github.com/tillhub/tillhub-sdk-javascript/commit/f62646fbd6c6cf03f1805d2a32d3eae24d43b9f3))
|
8
|
+
|
9
|
+
|
10
|
+
### Reverts
|
11
|
+
|
12
|
+
* Revert "feat(transactions): add create basket, authorize, and charge transaction functionalities with corresponding error handling - UOD-1794" ([fd5f592](https://github.com/tillhub/tillhub-sdk-javascript/commit/fd5f5927514ad99507e323a3787fc88d02061f11))
|
13
|
+
|
1
14
|
# [4.221.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.220.0...v4.221.0) (2025-08-20)
|
2
15
|
|
3
16
|
|
package/dist/types/v0/index.d.ts
CHANGED
@@ -19,6 +19,7 @@ import { IamUserGroups } from './iam_user_groups';
|
|
19
19
|
import { IamRoles } from './iam_roles';
|
20
20
|
import { IamPermissions } from './iam_permissions';
|
21
21
|
import { IamMeClass } from './iam_me';
|
22
|
+
import { PaymentProducts } from './payment_products';
|
22
23
|
import { Branches } from './branches';
|
23
24
|
import { BranchGroups } from './branch_groups';
|
24
25
|
import { Devices } from './devices';
|
@@ -88,4 +89,4 @@ import { DocumentExports } from './document_exports';
|
|
88
89
|
import { BusinessUnits } from './business_units';
|
89
90
|
import { UodInvoices } from './invoices_uod';
|
90
91
|
import { Submissions } from './submissions';
|
91
|
-
export { Auth, Taxes, Deliveries, ProductGroups, ProductTemplates, ProductTemplateDefaults, ProductAddonGroups, ProductAddons, ProductBranchCustomizations, Accounts, ExpenseAccounts, PaymentOptions, Configurations, InventoryConfiguration, Users, IamUsers, IamApiKeys, IamUserGroups, IamRoles, IamPermissions, IamMeClass, Branches, BranchGroups, Devices, Contents, ContentTemplates, Customers, Suppliers, SuppliersProductsRelation, Discounts, Vouchers, VoucherLogs, Invoices, Stocks, StocksBook, Orders, Analytics, Staff, AuditActions, AuditLogs, Images, Notifications, Print, Messages, Favourites, Fiscalization, LegacySettings, Tags, Safes, SafesLogBook, Warehouses, Webhooks, WebhookEvents, SupportedEvents, Videos, StaffGroups, Exports, ProductServiceQuestionGroups, ProductServiceQuestions, Data, Reasons, Me, Processes, Promotions, StaffPermissionsTemplates, VoucherSystems, AbocardSystems, Functions, DeviceGroups, Correspondences, Storefronts, Categories, CategoryTrees, Dependencies, Trash, Timetracking, CountingProtocols, StockTakings, UserPermissionsTemplates, DbBackups, PurchaseOrders, ServiceCategory, Services, ConsignmentNotes, Documents, Holidays, ShiftPlan, ScheduledExports, CustomerAppointments, DocumentExports, BusinessUnits, UodInvoices, Submissions };
|
92
|
+
export { Auth, Taxes, Deliveries, ProductGroups, ProductTemplates, ProductTemplateDefaults, ProductAddonGroups, ProductAddons, ProductBranchCustomizations, Accounts, ExpenseAccounts, PaymentOptions, Configurations, InventoryConfiguration, Users, IamUsers, IamApiKeys, IamUserGroups, IamRoles, IamPermissions, IamMeClass, PaymentProducts, Branches, BranchGroups, Devices, Contents, ContentTemplates, Customers, Suppliers, SuppliersProductsRelation, Discounts, Vouchers, VoucherLogs, Invoices, Stocks, StocksBook, Orders, Analytics, Staff, AuditActions, AuditLogs, Images, Notifications, Print, Messages, Favourites, Fiscalization, LegacySettings, Tags, Safes, SafesLogBook, Warehouses, Webhooks, WebhookEvents, SupportedEvents, Videos, StaffGroups, Exports, ProductServiceQuestionGroups, ProductServiceQuestions, Data, Reasons, Me, Processes, Promotions, StaffPermissionsTemplates, VoucherSystems, AbocardSystems, Functions, DeviceGroups, Correspondences, Storefronts, Categories, CategoryTrees, Dependencies, Trash, Timetracking, CountingProtocols, StockTakings, UserPermissionsTemplates, DbBackups, PurchaseOrders, ServiceCategory, Services, ConsignmentNotes, Documents, Holidays, ShiftPlan, ScheduledExports, CustomerAppointments, DocumentExports, BusinessUnits, UodInvoices, Submissions };
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import { Client } from '../client';
|
2
|
+
import { BaseError } from '../errors/baseError';
|
3
|
+
import { UriHelper } from '../uri-helper';
|
4
|
+
import { ThBaseHandler } from '../base';
|
5
|
+
export interface PaymentProductsOptions {
|
6
|
+
user?: string;
|
7
|
+
base?: string;
|
8
|
+
}
|
9
|
+
export interface PaymentProductsResponse {
|
10
|
+
data: PaymentProduct[];
|
11
|
+
metadata: Record<string, unknown>;
|
12
|
+
next?: () => Promise<PaymentProductsResponse>;
|
13
|
+
}
|
14
|
+
export interface ErrorObject {
|
15
|
+
id: string;
|
16
|
+
label: string;
|
17
|
+
errorDetails: Record<string, unknown>;
|
18
|
+
}
|
19
|
+
export interface PaymentProduct {
|
20
|
+
state?: string;
|
21
|
+
type?: string;
|
22
|
+
processingPlatformIdentifier?: string;
|
23
|
+
salesStream?: SaleStream[];
|
24
|
+
}
|
25
|
+
export interface SaleStream {
|
26
|
+
id?: string;
|
27
|
+
active?: boolean;
|
28
|
+
name?: string;
|
29
|
+
type?: string;
|
30
|
+
businessUnit?: BusinessUnit;
|
31
|
+
}
|
32
|
+
export interface BusinessUnit {
|
33
|
+
unzerId?: string;
|
34
|
+
}
|
35
|
+
export interface PaymentProductsQueryHandler {
|
36
|
+
limit?: number;
|
37
|
+
uri?: string;
|
38
|
+
query?: PaymentProductsQuery;
|
39
|
+
orderFields?: string[] | string;
|
40
|
+
}
|
41
|
+
export interface PaymentProductsQuery extends PaymentProduct {
|
42
|
+
active?: boolean;
|
43
|
+
type?: string;
|
44
|
+
}
|
45
|
+
export declare class PaymentProducts extends ThBaseHandler {
|
46
|
+
static baseEndpoint: string;
|
47
|
+
endpoint: string;
|
48
|
+
http: Client;
|
49
|
+
options: PaymentProductsOptions;
|
50
|
+
uriHelper: UriHelper;
|
51
|
+
constructor(options: PaymentProductsOptions, http: Client);
|
52
|
+
getAll(query?: PaymentProductsQueryHandler | undefined): Promise<PaymentProductsResponse>;
|
53
|
+
}
|
54
|
+
export declare class PaymentProductsFetchFailed extends BaseError {
|
55
|
+
message: string;
|
56
|
+
name: string;
|
57
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
58
|
+
}
|
@@ -54,6 +54,121 @@ export interface AuthorizeChargeResult {
|
|
54
54
|
amount: string;
|
55
55
|
currency: string;
|
56
56
|
}
|
57
|
+
export interface BasketItem {
|
58
|
+
basketItemReferenceId?: string;
|
59
|
+
quantity?: number;
|
60
|
+
vat?: number;
|
61
|
+
amountDiscountPerUnitGross?: number;
|
62
|
+
amountPerUnitGross?: number;
|
63
|
+
title?: string;
|
64
|
+
type?: string;
|
65
|
+
unit?: string;
|
66
|
+
subTitle?: string;
|
67
|
+
imageUrl?: string;
|
68
|
+
}
|
69
|
+
export interface Basket {
|
70
|
+
id?: string;
|
71
|
+
totalValueGross?: number;
|
72
|
+
currencyCode?: string;
|
73
|
+
orderId?: string;
|
74
|
+
basketItems?: BasketItem[];
|
75
|
+
}
|
76
|
+
export interface TransactionResources {
|
77
|
+
customerId?: string;
|
78
|
+
typeId?: string;
|
79
|
+
metadataId?: string;
|
80
|
+
basketId?: string;
|
81
|
+
}
|
82
|
+
export interface TransactionCardAuthentication {
|
83
|
+
verificationId?: string;
|
84
|
+
resultIndicator?: string;
|
85
|
+
dsTransactionId?: string;
|
86
|
+
protocolVersion?: string;
|
87
|
+
authenticationStatus?: string;
|
88
|
+
messageType?: string;
|
89
|
+
xId?: string;
|
90
|
+
}
|
91
|
+
export interface TransactionCard {
|
92
|
+
recurrenceType?: string;
|
93
|
+
brandTransactionId?: string;
|
94
|
+
settlementDay?: string;
|
95
|
+
exemptionType?: string;
|
96
|
+
liability?: string;
|
97
|
+
authentication?: TransactionCardAuthentication;
|
98
|
+
}
|
99
|
+
export interface TransactionRiskData {
|
100
|
+
threatMetrixId?: string;
|
101
|
+
customerGroup?: string;
|
102
|
+
customerId?: string;
|
103
|
+
confirmedAmount?: number;
|
104
|
+
confirmedOrders?: number;
|
105
|
+
internalScore?: number;
|
106
|
+
registrationLevel?: number;
|
107
|
+
registrationDate?: number;
|
108
|
+
}
|
109
|
+
export interface TransactionShipping {
|
110
|
+
deliveryTrackingId?: string;
|
111
|
+
deliveryService?: string;
|
112
|
+
returnTrackingId?: string;
|
113
|
+
}
|
114
|
+
export interface TransactionPaypal {
|
115
|
+
checkoutType?: string;
|
116
|
+
}
|
117
|
+
export interface TransactionPaylater {
|
118
|
+
targetDueDate?: string;
|
119
|
+
merchantComment?: string;
|
120
|
+
merchantOrderId?: string;
|
121
|
+
}
|
122
|
+
export interface TransactionOnlineTransfer {
|
123
|
+
targetDueDate?: string;
|
124
|
+
}
|
125
|
+
export interface TransactionAdditionalData {
|
126
|
+
card?: TransactionCard;
|
127
|
+
riskData?: TransactionRiskData;
|
128
|
+
shipping?: TransactionShipping;
|
129
|
+
paypal?: TransactionPaypal;
|
130
|
+
paylater?: TransactionPaylater;
|
131
|
+
onlineTransfer?: TransactionOnlineTransfer;
|
132
|
+
termsAndConditionUrl?: string;
|
133
|
+
privacyPolicyUrl?: string;
|
134
|
+
}
|
135
|
+
export interface Transaction {
|
136
|
+
amount?: number;
|
137
|
+
currency?: string;
|
138
|
+
returnUrl?: string;
|
139
|
+
card3ds?: boolean;
|
140
|
+
paymentReference?: string;
|
141
|
+
orderId?: string;
|
142
|
+
invoiceId?: string;
|
143
|
+
effectiveInterestRate?: string;
|
144
|
+
resources?: TransactionResources;
|
145
|
+
linkpayId?: string;
|
146
|
+
additionalTransactionData?: TransactionAdditionalData;
|
147
|
+
}
|
148
|
+
export interface TransactionAuthorize extends Transaction {
|
149
|
+
}
|
150
|
+
export interface TransactionCharge extends Transaction {
|
151
|
+
}
|
152
|
+
export interface ErrorObject {
|
153
|
+
id: string;
|
154
|
+
label: string;
|
155
|
+
errorDetails: Record<string, unknown>;
|
156
|
+
}
|
157
|
+
export interface TransactionBasketResponse {
|
158
|
+
data: Basket;
|
159
|
+
msg?: string;
|
160
|
+
errors?: ErrorObject[];
|
161
|
+
}
|
162
|
+
export interface TransactionAuthorizeResponse {
|
163
|
+
data: TransactionAuthorize;
|
164
|
+
msg?: string;
|
165
|
+
errors?: ErrorObject[];
|
166
|
+
}
|
167
|
+
export interface TransactionChargeResponse {
|
168
|
+
data: TransactionCharge;
|
169
|
+
msg?: string;
|
170
|
+
errors?: ErrorObject[];
|
171
|
+
}
|
57
172
|
export declare class OrderActions extends ThBaseHandler {
|
58
173
|
static baseEndpoint: string;
|
59
174
|
endpoint: string;
|
@@ -64,6 +179,9 @@ export declare class OrderActions extends ThBaseHandler {
|
|
64
179
|
orderRefund(orderId: string, payload: ChargeCancelRequest): Promise<ChargeCancelResponse>;
|
65
180
|
orderCancel(orderId: string, payload: AuthorizeCancelRequest): Promise<AuthorizeCancelResponse>;
|
66
181
|
orderCapture(orderId: string, payload: AuthorizeChargeRequest): Promise<AuthorizeChargeResponse>;
|
182
|
+
createBasket(keypairId: string, basket: Basket): Promise<TransactionBasketResponse>;
|
183
|
+
authorize(keypairId: string, transaction: TransactionAuthorize): Promise<TransactionAuthorizeResponse>;
|
184
|
+
charge(keypairId: string, transaction: TransactionCharge): Promise<TransactionChargeResponse>;
|
67
185
|
}
|
68
186
|
export declare class OrderRefundFailed extends BaseError {
|
69
187
|
message: string;
|
@@ -80,3 +198,18 @@ export declare class OrderCaptureFailed extends BaseError {
|
|
80
198
|
name: string;
|
81
199
|
constructor(message?: string, properties?: Record<string, unknown>);
|
82
200
|
}
|
201
|
+
export declare class CreateBasketFailed extends BaseError {
|
202
|
+
message: string;
|
203
|
+
name: string;
|
204
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
205
|
+
}
|
206
|
+
export declare class AuthorizeTransactionFailed extends BaseError {
|
207
|
+
message: string;
|
208
|
+
name: string;
|
209
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
210
|
+
}
|
211
|
+
export declare class ChargeTransactionFailed extends BaseError {
|
212
|
+
message: string;
|
213
|
+
name: string;
|
214
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
215
|
+
}
|
@@ -271,116 +271,6 @@ export interface MarketPlaceItemEntity {
|
|
271
271
|
transactionId?: string | null;
|
272
272
|
usage?: string | null;
|
273
273
|
}
|
274
|
-
export interface BasketItem {
|
275
|
-
basketItemReferenceId?: string;
|
276
|
-
quantity?: number;
|
277
|
-
vat?: number;
|
278
|
-
amountDiscountPerUnitGross?: number;
|
279
|
-
amountPerUnitGross?: number;
|
280
|
-
title?: string;
|
281
|
-
type?: string;
|
282
|
-
unit?: string;
|
283
|
-
subTitle?: string;
|
284
|
-
imageUrl?: string;
|
285
|
-
}
|
286
|
-
export interface Basket {
|
287
|
-
id?: string;
|
288
|
-
totalValueGross?: number;
|
289
|
-
currencyCode?: string;
|
290
|
-
orderId?: string;
|
291
|
-
basketItems?: BasketItem[];
|
292
|
-
}
|
293
|
-
export interface TransactionResources {
|
294
|
-
customerId?: string;
|
295
|
-
typeId?: string;
|
296
|
-
metadataId?: string;
|
297
|
-
basketId?: string;
|
298
|
-
}
|
299
|
-
export interface TransactionCardAuthentication {
|
300
|
-
verificationId?: string;
|
301
|
-
resultIndicator?: string;
|
302
|
-
dsTransactionId?: string;
|
303
|
-
protocolVersion?: string;
|
304
|
-
authenticationStatus?: string;
|
305
|
-
messageType?: string;
|
306
|
-
xId?: string;
|
307
|
-
}
|
308
|
-
export interface TransactionCard {
|
309
|
-
recurrenceType?: string;
|
310
|
-
brandTransactionId?: string;
|
311
|
-
settlementDay?: string;
|
312
|
-
exemptionType?: string;
|
313
|
-
liability?: string;
|
314
|
-
authentication?: TransactionCardAuthentication;
|
315
|
-
}
|
316
|
-
export interface TransactionRiskData {
|
317
|
-
threatMetrixId?: string;
|
318
|
-
customerGroup?: string;
|
319
|
-
customerId?: string;
|
320
|
-
confirmedAmount?: number;
|
321
|
-
confirmedOrders?: number;
|
322
|
-
internalScore?: number;
|
323
|
-
registrationLevel?: number;
|
324
|
-
registrationDate?: number;
|
325
|
-
}
|
326
|
-
export interface TransactionShipping {
|
327
|
-
deliveryTrackingId?: string;
|
328
|
-
deliveryService?: string;
|
329
|
-
returnTrackingId?: string;
|
330
|
-
}
|
331
|
-
export interface TransactionPaypal {
|
332
|
-
checkoutType?: string;
|
333
|
-
}
|
334
|
-
export interface TransactionPaylater {
|
335
|
-
targetDueDate?: string;
|
336
|
-
merchantComment?: string;
|
337
|
-
merchantOrderId?: string;
|
338
|
-
}
|
339
|
-
export interface TransactionOnlineTransfer {
|
340
|
-
targetDueDate?: string;
|
341
|
-
}
|
342
|
-
export interface TransactionAdditionalData {
|
343
|
-
card?: TransactionCard;
|
344
|
-
riskData?: TransactionRiskData;
|
345
|
-
shipping?: TransactionShipping;
|
346
|
-
paypal?: TransactionPaypal;
|
347
|
-
paylater?: TransactionPaylater;
|
348
|
-
onlineTransfer?: TransactionOnlineTransfer;
|
349
|
-
termsAndConditionUrl?: string;
|
350
|
-
privacyPolicyUrl?: string;
|
351
|
-
}
|
352
|
-
export interface Transaction {
|
353
|
-
amount?: number;
|
354
|
-
currency?: string;
|
355
|
-
returnUrl?: string;
|
356
|
-
card3ds?: boolean;
|
357
|
-
paymentReference?: string;
|
358
|
-
orderId?: string;
|
359
|
-
invoiceId?: string;
|
360
|
-
effectiveInterestRate?: string;
|
361
|
-
resources?: TransactionResources;
|
362
|
-
linkpayId?: string;
|
363
|
-
additionalTransactionData?: TransactionAdditionalData;
|
364
|
-
}
|
365
|
-
export interface TransactionAuthorize extends Transaction {
|
366
|
-
}
|
367
|
-
export interface TransactionCharge extends Transaction {
|
368
|
-
}
|
369
|
-
export interface TransactionBasketResponse {
|
370
|
-
data: Basket;
|
371
|
-
msg?: string;
|
372
|
-
errors?: ErrorObject[];
|
373
|
-
}
|
374
|
-
export interface TransactionAuthorizeResponse {
|
375
|
-
data: TransactionAuthorize;
|
376
|
-
msg?: string;
|
377
|
-
errors?: ErrorObject[];
|
378
|
-
}
|
379
|
-
export interface TransactionChargeResponse {
|
380
|
-
data: TransactionCharge;
|
381
|
-
msg?: string;
|
382
|
-
errors?: ErrorObject[];
|
383
|
-
}
|
384
274
|
export declare class Transactions extends ThBaseHandler {
|
385
275
|
static baseEndpoint: string;
|
386
276
|
endpoint: string;
|
@@ -391,9 +281,6 @@ export declare class Transactions extends ThBaseHandler {
|
|
391
281
|
getAll(query?: TransactionsQueryHandler | undefined): Promise<TransactionsResponse>;
|
392
282
|
export(query: TransactionsExportQueryHandler): Promise<TransactionExportResponse>;
|
393
283
|
meta(query?: TransactionsQueryHandler | undefined): Promise<TransactionsMetaResponse>;
|
394
|
-
createBasket(keypairId: string, basket: Basket): Promise<TransactionBasketResponse>;
|
395
|
-
authorize(keypairId: string, transaction: TransactionAuthorize): Promise<TransactionAuthorizeResponse>;
|
396
|
-
charge(keypairId: string, transaction: TransactionCharge): Promise<TransactionChargeResponse>;
|
397
284
|
get(transactionId: string): Promise<TransactionResponse>;
|
398
285
|
}
|
399
286
|
export declare class TransactionsGetMetaFailed extends BaseError {
|
@@ -416,19 +303,4 @@ export declare class TransactionFetchFailed extends BaseError {
|
|
416
303
|
name: string;
|
417
304
|
constructor(message?: string, properties?: Record<string, unknown>);
|
418
305
|
}
|
419
|
-
export declare class CreateBasketFailed extends BaseError {
|
420
|
-
message: string;
|
421
|
-
name: string;
|
422
|
-
constructor(message?: string, properties?: Record<string, unknown>);
|
423
|
-
}
|
424
|
-
export declare class AuthorizeTransactionFailed extends BaseError {
|
425
|
-
message: string;
|
426
|
-
name: string;
|
427
|
-
constructor(message?: string, properties?: Record<string, unknown>);
|
428
|
-
}
|
429
|
-
export declare class ChargeTransactionFailed extends BaseError {
|
430
|
-
message: string;
|
431
|
-
name: string;
|
432
|
-
constructor(message?: string, properties?: Record<string, unknown>);
|
433
|
-
}
|
434
306
|
export {};
|
package/dist/v0/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
exports.Submissions = exports.UodInvoices = exports.BusinessUnits = exports.DocumentExports = exports.CustomerAppointments = exports.ScheduledExports = exports.ShiftPlan = exports.Holidays = exports.Documents = exports.ConsignmentNotes = exports.Services = exports.ServiceCategory = exports.PurchaseOrders = exports.DbBackups = exports.UserPermissionsTemplates = exports.StockTakings = exports.CountingProtocols = exports.Timetracking = exports.Trash = exports.Dependencies = exports.CategoryTrees = exports.Categories = exports.Storefronts = exports.Correspondences = exports.DeviceGroups = exports.Functions = exports.AbocardSystems = exports.VoucherSystems = exports.StaffPermissionsTemplates = exports.Promotions = exports.Processes = exports.Me = exports.Reasons = exports.Data = exports.ProductServiceQuestions = exports.ProductServiceQuestionGroups = exports.Exports = exports.StaffGroups = exports.Videos = exports.SupportedEvents = exports.WebhookEvents = exports.Webhooks = exports.Warehouses = void 0;
|
3
|
+
exports.Safes = exports.Tags = exports.LegacySettings = exports.Fiscalization = exports.Favourites = exports.Messages = exports.Print = exports.Notifications = exports.Images = exports.AuditLogs = exports.AuditActions = exports.Staff = exports.Analytics = exports.Orders = exports.StocksBook = exports.Stocks = exports.Invoices = exports.VoucherLogs = exports.Vouchers = exports.Discounts = exports.SuppliersProductsRelation = exports.Suppliers = exports.Customers = exports.ContentTemplates = exports.Contents = exports.Devices = exports.BranchGroups = exports.Branches = exports.PaymentProducts = exports.IamMeClass = exports.IamPermissions = exports.IamRoles = exports.IamUserGroups = exports.IamApiKeys = exports.IamUsers = exports.Users = exports.InventoryConfiguration = exports.Configurations = exports.PaymentOptions = exports.ExpenseAccounts = exports.Accounts = exports.ProductBranchCustomizations = exports.ProductAddons = exports.ProductAddonGroups = exports.ProductTemplateDefaults = exports.ProductTemplates = exports.ProductGroups = exports.Deliveries = exports.Taxes = exports.Auth = void 0;
|
4
|
+
exports.Submissions = exports.UodInvoices = exports.BusinessUnits = exports.DocumentExports = exports.CustomerAppointments = exports.ScheduledExports = exports.ShiftPlan = exports.Holidays = exports.Documents = exports.ConsignmentNotes = exports.Services = exports.ServiceCategory = exports.PurchaseOrders = exports.DbBackups = exports.UserPermissionsTemplates = exports.StockTakings = exports.CountingProtocols = exports.Timetracking = exports.Trash = exports.Dependencies = exports.CategoryTrees = exports.Categories = exports.Storefronts = exports.Correspondences = exports.DeviceGroups = exports.Functions = exports.AbocardSystems = exports.VoucherSystems = exports.StaffPermissionsTemplates = exports.Promotions = exports.Processes = exports.Me = exports.Reasons = exports.Data = exports.ProductServiceQuestions = exports.ProductServiceQuestionGroups = exports.Exports = exports.StaffGroups = exports.Videos = exports.SupportedEvents = exports.WebhookEvents = exports.Webhooks = exports.Warehouses = exports.SafesLogBook = void 0;
|
5
5
|
var auth_1 = require("./auth");
|
6
6
|
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return auth_1.Auth; } });
|
7
7
|
var taxes_1 = require("./taxes");
|
@@ -44,6 +44,8 @@ var iam_permissions_1 = require("./iam_permissions");
|
|
44
44
|
Object.defineProperty(exports, "IamPermissions", { enumerable: true, get: function () { return iam_permissions_1.IamPermissions; } });
|
45
45
|
var iam_me_1 = require("./iam_me");
|
46
46
|
Object.defineProperty(exports, "IamMeClass", { enumerable: true, get: function () { return iam_me_1.IamMeClass; } });
|
47
|
+
var payment_products_1 = require("./payment_products");
|
48
|
+
Object.defineProperty(exports, "PaymentProducts", { enumerable: true, get: function () { return payment_products_1.PaymentProducts; } });
|
47
49
|
var branches_1 = require("./branches");
|
48
50
|
Object.defineProperty(exports, "Branches", { enumerable: true, get: function () { return branches_1.Branches; } });
|
49
51
|
var branch_groups_1 = require("./branch_groups");
|
package/dist/v0/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v0/index.ts"],"names":[],"mappings":";;;;AAAA,+BAA6B;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v0/index.ts"],"names":[],"mappings":";;;;AAAA,+BAA6B;AA6F3B,qFA7FO,WAAI,OA6FP;AA5FN,iCAA+B;AA6F7B,sFA7FO,aAAK,OA6FP;AA5FP,2CAAyC;AA6FvC,2FA7FO,uBAAU,OA6FP;AA5FZ,mDAAgD;AA6F9C,8FA7FO,8BAAa,OA6FP;AA5Ff,yDAAsD;AA6FpD,iGA7FO,oCAAgB,OA6FP;AA5FlB,yEAAqE;AA6FnE,wGA7FO,mDAAuB,OA6FP;AA5FzB,+DAA2D;AA6FzD,mGA7FO,yCAAkB,OA6FP;AA5FpB,mDAAgD;AA6F9C,8FA7FO,8BAAa,OA6FP;AA5Ff,iFAA6E;AA6F3E,4GA7FO,2DAA2B,OA6FP;AA5F7B,uCAAqC;AA6FnC,yFA7FO,mBAAQ,OA6FP;AA5FV,uDAAoD;AA6FlD,gGA7FO,kCAAe,OA6FP;AA5FjB,qDAAkD;AA6FhD,+FA7FO,gCAAc,OA6FP;AA5FhB,mDAAiD;AA6F/C,+FA7FO,+BAAc,OA6FP;AA5FhB,qEAAkE;AA6FhE,uGA7FO,gDAAsB,OA6FP;AA5FxB,iCAA+B;AA6F7B,sFA7FO,aAAK,OA6FP;AA5FP,yCAAsC;AA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P"}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PaymentProductsFetchFailed = exports.PaymentProducts = void 0;
|
4
|
+
var tslib_1 = require("tslib");
|
5
|
+
var baseError_1 = require("../errors/baseError");
|
6
|
+
var uri_helper_1 = require("../uri-helper");
|
7
|
+
var base_1 = require("../base");
|
8
|
+
var PaymentProducts = (function (_super) {
|
9
|
+
tslib_1.__extends(PaymentProducts, _super);
|
10
|
+
function PaymentProducts(options, http) {
|
11
|
+
var _a, _b;
|
12
|
+
var _this = _super.call(this, http, { endpoint: PaymentProducts.baseEndpoint, base: (_a = options.base) !== null && _a !== void 0 ? _a : 'https://api.tillhub.com' }) || this;
|
13
|
+
_this.options = options;
|
14
|
+
_this.http = http;
|
15
|
+
_this.endpoint = PaymentProducts.baseEndpoint;
|
16
|
+
_this.options.base = (_b = _this.options.base) !== null && _b !== void 0 ? _b : 'https://api.tillhub.com';
|
17
|
+
_this.uriHelper = new uri_helper_1.UriHelper(_this.endpoint, _this.options);
|
18
|
+
return _this;
|
19
|
+
}
|
20
|
+
PaymentProducts.prototype.getAll = function (query) {
|
21
|
+
var _a;
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
23
|
+
var next, base, uri, response_1, error_1;
|
24
|
+
var _this = this;
|
25
|
+
return tslib_1.__generator(this, function (_b) {
|
26
|
+
switch (_b.label) {
|
27
|
+
case 0:
|
28
|
+
base = this.uriHelper.generateBaseUri();
|
29
|
+
uri = this.uriHelper.generateUriWithQuery(base, query);
|
30
|
+
_b.label = 1;
|
31
|
+
case 1:
|
32
|
+
_b.trys.push([1, 3, , 4]);
|
33
|
+
return [4, this.http.getClient().get(uri)];
|
34
|
+
case 2:
|
35
|
+
response_1 = _b.sent();
|
36
|
+
if (response_1.status !== 200) {
|
37
|
+
throw new PaymentProductsFetchFailed(undefined, { status: response_1.status });
|
38
|
+
}
|
39
|
+
if ((_a = response_1.data.cursors) === null || _a === void 0 ? void 0 : _a.after) {
|
40
|
+
next = function () { return _this.getAll({ uri: response_1.data.cursors.after }); };
|
41
|
+
}
|
42
|
+
return [2, {
|
43
|
+
data: response_1.data.results,
|
44
|
+
metadata: { cursor: response_1.data.cursors },
|
45
|
+
next: next
|
46
|
+
}];
|
47
|
+
case 3:
|
48
|
+
error_1 = _b.sent();
|
49
|
+
throw new PaymentProductsFetchFailed(error_1.message, { error: error_1 });
|
50
|
+
case 4: return [2];
|
51
|
+
}
|
52
|
+
});
|
53
|
+
});
|
54
|
+
};
|
55
|
+
PaymentProducts.baseEndpoint = '/api/v0/payment-products';
|
56
|
+
return PaymentProducts;
|
57
|
+
}(base_1.ThBaseHandler));
|
58
|
+
exports.PaymentProducts = PaymentProducts;
|
59
|
+
var PaymentProductsFetchFailed = (function (_super) {
|
60
|
+
tslib_1.__extends(PaymentProductsFetchFailed, _super);
|
61
|
+
function PaymentProductsFetchFailed(message, properties) {
|
62
|
+
if (message === void 0) { message = 'Could not fetch payment products'; }
|
63
|
+
var _this = _super.call(this, message, properties) || this;
|
64
|
+
_this.message = message;
|
65
|
+
_this.name = 'PaymentProductsFetchFailed';
|
66
|
+
Object.setPrototypeOf(_this, PaymentProductsFetchFailed.prototype);
|
67
|
+
return _this;
|
68
|
+
}
|
69
|
+
return PaymentProductsFetchFailed;
|
70
|
+
}(baseError_1.BaseError));
|
71
|
+
exports.PaymentProductsFetchFailed = PaymentProductsFetchFailed;
|
72
|
+
//# sourceMappingURL=payment_products.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"payment_products.js","sourceRoot":"","sources":["../../src/v0/payment_products.ts"],"names":[],"mappings":";;;;AAEA,iDAA+C;AAC/C,4CAAyC;AACzC,gCAAuC;AAkDvC;IAAqC,2CAAa;IAOhD,yBAAa,OAA+B,EAAE,IAAY;;QAA1D,YACE,kBAAM,IAAI,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,YAAY,EAAE,IAA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O,EAAE;gCAC3C,IAAI,MAAA;6BACL,EAAA;;;wBAED,MAAM,IAAI,0BAA0B,CAAC,OAAK,CAAC,OAAO,EAAE,EAAE,KAAK,SAAA,EAAE,CAAC,CAAA;;;;;KAEjE;IAvCa,4BAAY,GAAG,0BAA0B,CAAA;IAwCzD,sBAAC;CAAA,AAzCD,CAAqC,oBAAa,GAyCjD;AAzCY,0CAAe;AA2C5B;IAAgD,sDAAS;IAEvD,oCACS,OAAoD,EAC3D,UAAoC;QAD7B,wBAAA,EAAA,4CAAoD;QAD7D,YAIE,kBAAM,OAAO,EAAE,UAAU,CAAC,SAE3B;QALQ,aAAO,GAAP,OAAO,CAA6C;QAFtD,UAAI,GAAG,4BAA4B,CAAA;QAMxC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAA;;IACnE,CAAC;IACH,iCAAC;AAAD,CAAC,AATD,CAAgD,qBAAS,GASxD;AATY,gEAA0B"}
|
package/dist/v2/order-actions.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.OrderCaptureFailed = exports.OrderCancelFailed = exports.OrderRefundFailed = exports.OrderActions = void 0;
|
3
|
+
exports.ChargeTransactionFailed = exports.AuthorizeTransactionFailed = exports.CreateBasketFailed = exports.OrderCaptureFailed = exports.OrderCancelFailed = exports.OrderRefundFailed = exports.OrderActions = void 0;
|
4
4
|
var tslib_1 = require("tslib");
|
5
5
|
var errors_1 = require("../errors");
|
6
6
|
var uri_helper_1 = require("../uri-helper");
|
@@ -107,6 +107,81 @@ var OrderActions = (function (_super) {
|
|
107
107
|
});
|
108
108
|
});
|
109
109
|
};
|
110
|
+
OrderActions.prototype.createBasket = function (keypairId, basket) {
|
111
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
112
|
+
var base, uri, response, error_4;
|
113
|
+
return tslib_1.__generator(this, function (_a) {
|
114
|
+
switch (_a.label) {
|
115
|
+
case 0:
|
116
|
+
base = this.uriHelper.generateBaseUri();
|
117
|
+
uri = this.uriHelper.generateUriWithQuery(base + "/baskets");
|
118
|
+
_a.label = 1;
|
119
|
+
case 1:
|
120
|
+
_a.trys.push([1, 3, , 4]);
|
121
|
+
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: basket })];
|
122
|
+
case 2:
|
123
|
+
response = _a.sent();
|
124
|
+
return [2, {
|
125
|
+
data: response.data.results[0]
|
126
|
+
}];
|
127
|
+
case 3:
|
128
|
+
error_4 = _a.sent();
|
129
|
+
throw new CreateBasketFailed(error_4.message, { error: error_4 });
|
130
|
+
case 4: return [2];
|
131
|
+
}
|
132
|
+
});
|
133
|
+
});
|
134
|
+
};
|
135
|
+
OrderActions.prototype.authorize = function (keypairId, transaction) {
|
136
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
137
|
+
var base, uri, response, error_5;
|
138
|
+
return tslib_1.__generator(this, function (_a) {
|
139
|
+
switch (_a.label) {
|
140
|
+
case 0:
|
141
|
+
base = this.uriHelper.generateBaseUri();
|
142
|
+
uri = this.uriHelper.generateUriWithQuery(base + "/authorize");
|
143
|
+
_a.label = 1;
|
144
|
+
case 1:
|
145
|
+
_a.trys.push([1, 3, , 4]);
|
146
|
+
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: transaction })];
|
147
|
+
case 2:
|
148
|
+
response = _a.sent();
|
149
|
+
return [2, {
|
150
|
+
data: response.data.results[0]
|
151
|
+
}];
|
152
|
+
case 3:
|
153
|
+
error_5 = _a.sent();
|
154
|
+
throw new AuthorizeTransactionFailed(error_5.message, { error: error_5 });
|
155
|
+
case 4: return [2];
|
156
|
+
}
|
157
|
+
});
|
158
|
+
});
|
159
|
+
};
|
160
|
+
OrderActions.prototype.charge = function (keypairId, transaction) {
|
161
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
162
|
+
var base, uri, response, error_6;
|
163
|
+
return tslib_1.__generator(this, function (_a) {
|
164
|
+
switch (_a.label) {
|
165
|
+
case 0:
|
166
|
+
base = this.uriHelper.generateBaseUri();
|
167
|
+
uri = this.uriHelper.generateUriWithQuery(base + "/charge");
|
168
|
+
_a.label = 1;
|
169
|
+
case 1:
|
170
|
+
_a.trys.push([1, 3, , 4]);
|
171
|
+
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: transaction })];
|
172
|
+
case 2:
|
173
|
+
response = _a.sent();
|
174
|
+
return [2, {
|
175
|
+
data: response.data.results[0]
|
176
|
+
}];
|
177
|
+
case 3:
|
178
|
+
error_6 = _a.sent();
|
179
|
+
throw new ChargeTransactionFailed(error_6.message, { error: error_6 });
|
180
|
+
case 4: return [2];
|
181
|
+
}
|
182
|
+
});
|
183
|
+
});
|
184
|
+
};
|
110
185
|
OrderActions.baseEndpoint = '/api/v2/orders';
|
111
186
|
return OrderActions;
|
112
187
|
}(base_1.ThBaseHandler));
|
@@ -150,4 +225,43 @@ var OrderCaptureFailed = (function (_super) {
|
|
150
225
|
return OrderCaptureFailed;
|
151
226
|
}(errors_1.BaseError));
|
152
227
|
exports.OrderCaptureFailed = OrderCaptureFailed;
|
228
|
+
var CreateBasketFailed = (function (_super) {
|
229
|
+
tslib_1.__extends(CreateBasketFailed, _super);
|
230
|
+
function CreateBasketFailed(message, properties) {
|
231
|
+
if (message === void 0) { message = 'Could not create basket'; }
|
232
|
+
var _this = _super.call(this, message, properties) || this;
|
233
|
+
_this.message = message;
|
234
|
+
_this.name = 'CreateBasketFailed';
|
235
|
+
Object.setPrototypeOf(_this, CreateBasketFailed.prototype);
|
236
|
+
return _this;
|
237
|
+
}
|
238
|
+
return CreateBasketFailed;
|
239
|
+
}(errors_1.BaseError));
|
240
|
+
exports.CreateBasketFailed = CreateBasketFailed;
|
241
|
+
var AuthorizeTransactionFailed = (function (_super) {
|
242
|
+
tslib_1.__extends(AuthorizeTransactionFailed, _super);
|
243
|
+
function AuthorizeTransactionFailed(message, properties) {
|
244
|
+
if (message === void 0) { message = 'Could not authorize transaction'; }
|
245
|
+
var _this = _super.call(this, message, properties) || this;
|
246
|
+
_this.message = message;
|
247
|
+
_this.name = 'AuthorizeTransactionFailed';
|
248
|
+
Object.setPrototypeOf(_this, AuthorizeTransactionFailed.prototype);
|
249
|
+
return _this;
|
250
|
+
}
|
251
|
+
return AuthorizeTransactionFailed;
|
252
|
+
}(errors_1.BaseError));
|
253
|
+
exports.AuthorizeTransactionFailed = AuthorizeTransactionFailed;
|
254
|
+
var ChargeTransactionFailed = (function (_super) {
|
255
|
+
tslib_1.__extends(ChargeTransactionFailed, _super);
|
256
|
+
function ChargeTransactionFailed(message, properties) {
|
257
|
+
if (message === void 0) { message = 'Could not charge transaction'; }
|
258
|
+
var _this = _super.call(this, message, properties) || this;
|
259
|
+
_this.message = message;
|
260
|
+
_this.name = 'ChargeTransactionFailed';
|
261
|
+
Object.setPrototypeOf(_this, ChargeTransactionFailed.prototype);
|
262
|
+
return _this;
|
263
|
+
}
|
264
|
+
return ChargeTransactionFailed;
|
265
|
+
}(errors_1.BaseError));
|
266
|
+
exports.ChargeTransactionFailed = ChargeTransactionFailed;
|
153
267
|
//# sourceMappingURL=order-actions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order-actions.js","sourceRoot":"","sources":["../../src/v2/order-actions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;
|
1
|
+
{"version":3,"file":"order-actions.js","sourceRoot":"","sources":["../../src/v2/order-actions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;AAuMvC;IAAkC,wCAAa;IAO7C,sBAAa,OAA4B,EAAE,IAAY;;QAAvD,YACE,kBAAM,IAAI,EAAE;YACV,QAAQ,EAAE,YAAY,CAAC,YAAY;YACnC,IAAI,QAAE,OAAO,CAAC,IAAI,mCAAI,yBAAyB;SAChD,CAAC,SAOH;QANC,KAAI,CAAC,OAAO,GAAG,OAAO,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gD;QADzD,YAIE,kBAAM,OAAO,EAAE,UAAU,CAAC,SAE3B;QALQ,aAAO,GAAP,OAAO,CAAyC;QAFlD,UAAI,GAAG,yBAAyB,CAAA;QAMrC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAA;;IAChE,CAAC;IACH,8BAAC;AAAD,CAAC,AATD,CAA6C,kBAAS,GASrD;AATY,0DAAuB"}
|
package/dist/v3/transactions.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.TransactionFetchFailed = exports.TransactionsExportFetchFailed = exports.TransactionsFetchFailed = exports.TransactionsGetMetaFailed = exports.Transactions = void 0;
|
4
4
|
var tslib_1 = require("tslib");
|
5
5
|
var errors_1 = require("../errors");
|
6
6
|
var uri_helper_1 = require("../uri-helper");
|
@@ -114,84 +114,9 @@ var Transactions = (function (_super) {
|
|
114
114
|
});
|
115
115
|
});
|
116
116
|
};
|
117
|
-
Transactions.prototype.createBasket = function (keypairId, basket) {
|
118
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
119
|
-
var base, uri, response, error_4;
|
120
|
-
return tslib_1.__generator(this, function (_a) {
|
121
|
-
switch (_a.label) {
|
122
|
-
case 0:
|
123
|
-
base = this.uriHelper.generateBaseUri();
|
124
|
-
uri = this.uriHelper.generateUriWithQuery(base + "/baskets");
|
125
|
-
_a.label = 1;
|
126
|
-
case 1:
|
127
|
-
_a.trys.push([1, 3, , 4]);
|
128
|
-
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: basket })];
|
129
|
-
case 2:
|
130
|
-
response = _a.sent();
|
131
|
-
return [2, {
|
132
|
-
data: response.data.results[0]
|
133
|
-
}];
|
134
|
-
case 3:
|
135
|
-
error_4 = _a.sent();
|
136
|
-
throw new CreateBasketFailed(error_4.message, { error: error_4 });
|
137
|
-
case 4: return [2];
|
138
|
-
}
|
139
|
-
});
|
140
|
-
});
|
141
|
-
};
|
142
|
-
Transactions.prototype.authorize = function (keypairId, transaction) {
|
143
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
144
|
-
var base, uri, response, error_5;
|
145
|
-
return tslib_1.__generator(this, function (_a) {
|
146
|
-
switch (_a.label) {
|
147
|
-
case 0:
|
148
|
-
base = this.uriHelper.generateBaseUri();
|
149
|
-
uri = this.uriHelper.generateUriWithQuery(base + "/authorize");
|
150
|
-
_a.label = 1;
|
151
|
-
case 1:
|
152
|
-
_a.trys.push([1, 3, , 4]);
|
153
|
-
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: transaction })];
|
154
|
-
case 2:
|
155
|
-
response = _a.sent();
|
156
|
-
return [2, {
|
157
|
-
data: response.data.results[0]
|
158
|
-
}];
|
159
|
-
case 3:
|
160
|
-
error_5 = _a.sent();
|
161
|
-
throw new AuthorizeTransactionFailed(error_5.message, { error: error_5 });
|
162
|
-
case 4: return [2];
|
163
|
-
}
|
164
|
-
});
|
165
|
-
});
|
166
|
-
};
|
167
|
-
Transactions.prototype.charge = function (keypairId, transaction) {
|
168
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
169
|
-
var base, uri, response, error_6;
|
170
|
-
return tslib_1.__generator(this, function (_a) {
|
171
|
-
switch (_a.label) {
|
172
|
-
case 0:
|
173
|
-
base = this.uriHelper.generateBaseUri();
|
174
|
-
uri = this.uriHelper.generateUriWithQuery(base + "/charge");
|
175
|
-
_a.label = 1;
|
176
|
-
case 1:
|
177
|
-
_a.trys.push([1, 3, , 4]);
|
178
|
-
return [4, this.http.getClient().post(uri, { keypairId: keypairId, payload: transaction })];
|
179
|
-
case 2:
|
180
|
-
response = _a.sent();
|
181
|
-
return [2, {
|
182
|
-
data: response.data.results[0]
|
183
|
-
}];
|
184
|
-
case 3:
|
185
|
-
error_6 = _a.sent();
|
186
|
-
throw new ChargeTransactionFailed(error_6.message, { error: error_6 });
|
187
|
-
case 4: return [2];
|
188
|
-
}
|
189
|
-
});
|
190
|
-
});
|
191
|
-
};
|
192
117
|
Transactions.prototype.get = function (transactionId) {
|
193
118
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
194
|
-
var base, uri, response,
|
119
|
+
var base, uri, response, error_4;
|
195
120
|
return tslib_1.__generator(this, function (_a) {
|
196
121
|
switch (_a.label) {
|
197
122
|
case 0:
|
@@ -212,8 +137,8 @@ var Transactions = (function (_super) {
|
|
212
137
|
metadata: { count: response.data.count }
|
213
138
|
}];
|
214
139
|
case 3:
|
215
|
-
|
216
|
-
throw new TransactionFetchFailed(
|
140
|
+
error_4 = _a.sent();
|
141
|
+
throw new TransactionFetchFailed(error_4.message, { error: error_4 });
|
217
142
|
case 4: return [2];
|
218
143
|
}
|
219
144
|
});
|
@@ -275,43 +200,4 @@ var TransactionFetchFailed = (function (_super) {
|
|
275
200
|
return TransactionFetchFailed;
|
276
201
|
}(errors_1.BaseError));
|
277
202
|
exports.TransactionFetchFailed = TransactionFetchFailed;
|
278
|
-
var CreateBasketFailed = (function (_super) {
|
279
|
-
tslib_1.__extends(CreateBasketFailed, _super);
|
280
|
-
function CreateBasketFailed(message, properties) {
|
281
|
-
if (message === void 0) { message = 'Could not create basket'; }
|
282
|
-
var _this = _super.call(this, message, properties) || this;
|
283
|
-
_this.message = message;
|
284
|
-
_this.name = 'CreateBasketFailed';
|
285
|
-
Object.setPrototypeOf(_this, CreateBasketFailed.prototype);
|
286
|
-
return _this;
|
287
|
-
}
|
288
|
-
return CreateBasketFailed;
|
289
|
-
}(errors_1.BaseError));
|
290
|
-
exports.CreateBasketFailed = CreateBasketFailed;
|
291
|
-
var AuthorizeTransactionFailed = (function (_super) {
|
292
|
-
tslib_1.__extends(AuthorizeTransactionFailed, _super);
|
293
|
-
function AuthorizeTransactionFailed(message, properties) {
|
294
|
-
if (message === void 0) { message = 'Could not authorize transaction'; }
|
295
|
-
var _this = _super.call(this, message, properties) || this;
|
296
|
-
_this.message = message;
|
297
|
-
_this.name = 'AuthorizeTransactionFailed';
|
298
|
-
Object.setPrototypeOf(_this, AuthorizeTransactionFailed.prototype);
|
299
|
-
return _this;
|
300
|
-
}
|
301
|
-
return AuthorizeTransactionFailed;
|
302
|
-
}(errors_1.BaseError));
|
303
|
-
exports.AuthorizeTransactionFailed = AuthorizeTransactionFailed;
|
304
|
-
var ChargeTransactionFailed = (function (_super) {
|
305
|
-
tslib_1.__extends(ChargeTransactionFailed, _super);
|
306
|
-
function ChargeTransactionFailed(message, properties) {
|
307
|
-
if (message === void 0) { message = 'Could not charge transaction'; }
|
308
|
-
var _this = _super.call(this, message, properties) || this;
|
309
|
-
_this.message = message;
|
310
|
-
_this.name = 'ChargeTransactionFailed';
|
311
|
-
Object.setPrototypeOf(_this, ChargeTransactionFailed.prototype);
|
312
|
-
return _this;
|
313
|
-
}
|
314
|
-
return ChargeTransactionFailed;
|
315
|
-
}(errors_1.BaseError));
|
316
|
-
exports.ChargeTransactionFailed = ChargeTransactionFailed;
|
317
203
|
//# sourceMappingURL=transactions.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/v3/transactions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/v3/transactions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;AA8RvC;IAAkC,wCAAa;IAO7C,sBAAa,OAA4B,EAAE,IAAY;;QAAvD,YACE,kBAAM,IAAI,EAAE;YACV,QAAQ,EAAE,YAAY,CAAC,YAAY;YACnC,IAAI,QAAE,OAAO,CAAC,IAAI,mCAAI,yBAAyB;SAChD,CAAC,SAOH;QANC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,KAAI,CAAC,QAAQ,GAAG,Y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