diff --git a/packages/backend/src/open_payments/quote/model.ts b/packages/backend/src/open_payments/quote/model.ts index ec27ced151..7c391e14ba 100644 --- a/packages/backend/src/open_payments/quote/model.ts +++ b/packages/backend/src/open_payments/quote/model.ts @@ -20,7 +20,8 @@ export class Quote extends WalletAddressSubresource { 'receiveAmount', 'minExchangeRate', 'lowEstimatedExchangeRate', - 'highEstimatedExchangeRate' + 'highEstimatedExchangeRate', + 'method' ] } @@ -152,6 +153,10 @@ export class Quote extends WalletAddressSubresource { this.highEstimatedExchangeRateDenominator = value.b.value } + public get method(): 'ilp' { + return 'ilp' + } + $formatJson(json: Pojo): Pojo { json = super.$formatJson(json) return { @@ -179,7 +184,8 @@ export class Quote extends WalletAddressSubresource { debitAmount: serializeAmount(this.debitAmount), receiver: this.receiver, expiresAt: this.expiresAt.toISOString(), - createdAt: this.createdAt.toISOString() + createdAt: this.createdAt.toISOString(), + method: this.method } } } diff --git a/packages/backend/src/open_payments/quote/routes.test.ts b/packages/backend/src/open_payments/quote/routes.test.ts index bff434f234..c152ba2685 100644 --- a/packages/backend/src/open_payments/quote/routes.test.ts +++ b/packages/backend/src/open_payments/quote/routes.test.ts @@ -104,7 +104,8 @@ describe('Quote Routes', (): void => { debitAmount: serializeAmount(quote.debitAmount), receiveAmount: serializeAmount(quote.receiveAmount), createdAt: quote.createdAt.toISOString(), - expiresAt: quote.expiresAt.toISOString() + expiresAt: quote.expiresAt.toISOString(), + method: quote.method } }, urlPath: Quote.urlPath @@ -229,7 +230,8 @@ describe('Quote Routes', (): void => { value: quote.receiveAmount.value.toString() }, createdAt: quote.createdAt.toISOString(), - expiresAt: quote.expiresAt.toISOString() + expiresAt: quote.expiresAt.toISOString(), + method: 'ilp' }) } ) @@ -276,7 +278,8 @@ describe('Quote Routes', (): void => { value: quote.receiveAmount.value.toString() }, createdAt: quote.createdAt.toISOString(), - expiresAt: quote.expiresAt.toISOString() + expiresAt: quote.expiresAt.toISOString(), + method: 'ilp' }) }) })