1 parent
c661cc789b
commit
eb8034502b
122 files changed
+543
-439
No files matched your search
@@ -61,10 +61,10 @@ export abstract class AbstractPaymentService<T extends TransactionBaseService>
|
||||
protected static identifier: string
|
||||
|
||||
public getIdentifier(): string {
|
||||
if (!(<typeof AbstractPaymentService>this.constructor).identifier) {
|
||||
throw new Error('Missing static property "identifier".')
|
||||
if (!(this.constructor as typeof AbstractPaymentService).identifier) {
|
||||
throw new Error(`Missing static property "identifier".`)
|
||||
}
|
||||
return (<typeof AbstractPaymentService>this.constructor).identifier
|
||||
return (this.constructor as typeof AbstractPaymentService).identifier
|
||||
}
|
||||
|
||||
public abstract getPaymentData(
|
||||
@@ -102,7 +102,7 @@ export abstract class AbstractPaymentService<T extends TransactionBaseService>
|
||||
public abstract deletePayment(paymentSession: PaymentSession): Promise<void>
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public retrieveSavedMethods(customer: Customer): Promise<Data[]> {
|
||||
public async retrieveSavedMethods(customer: Customer): Promise<Data[]> {
|
||||
return Promise.resolve([])
|
||||
}
|
||||
|
||||
|
||||
@@ -67,10 +67,10 @@ export abstract class AbstractTaxService
|
||||
protected static identifier: string
|
||||
|
||||
public getIdentifier(): string {
|
||||
if (!(<typeof AbstractTaxService>this.constructor).identifier) {
|
||||
throw new Error('Missing static property "identifier".')
|
||||
if (!(this.constructor as typeof AbstractTaxService).identifier) {
|
||||
throw new Error(`Missing static property "identifier".`)
|
||||
}
|
||||
return (<typeof AbstractTaxService>this.constructor).identifier
|
||||
return (this.constructor as typeof AbstractTaxService).identifier
|
||||
}
|
||||
|
||||
public abstract getTaxLines(
|
||||
|
||||
@@ -15,7 +15,7 @@ export abstract class TransactionBaseService {
|
||||
return this
|
||||
}
|
||||
|
||||
const cloned = new (<any>this.constructor)(
|
||||
const cloned = new (this.constructor as any)(
|
||||
{
|
||||
...this.__container__,
|
||||
manager: transactionManager,
|
||||
@@ -111,14 +111,14 @@ export abstract class TransactionBaseService {
|
||||
try {
|
||||
result = await this.manager_.transaction(
|
||||
isolation as IsolationLevel,
|
||||
(m) => doWork(m)
|
||||
async (m) => doWork(m)
|
||||
)
|
||||
return result
|
||||
} catch (error) {
|
||||
if (this.shouldRetryTransaction_(error)) {
|
||||
return this.manager_.transaction(
|
||||
isolation as IsolationLevel,
|
||||
(m): Promise<never | TResult> => doWork(m)
|
||||
async (m): Promise<never | TResult> => doWork(m)
|
||||
)
|
||||
} else {
|
||||
if (errorHandler) {
|
||||
@@ -130,7 +130,7 @@ export abstract class TransactionBaseService {
|
||||
}
|
||||
|
||||
try {
|
||||
return await this.manager_.transaction((m) => doWork(m))
|
||||
return await this.manager_.transaction(async (m) => doWork(m))
|
||||
} catch (error) {
|
||||
if (errorHandler) {
|
||||
const result = await errorHandler(error)
|
||||
|
||||
Reference in new issue
Block a user