Skip to content

Commit

Permalink
fix(backend): quote open payments type
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairCurrey committed Oct 19, 2023
1 parent 43e2d5c commit 04051d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 8 additions & 2 deletions packages/backend/src/open_payments/quote/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export class Quote extends WalletAddressSubresource {
'receiveAmount',
'minExchangeRate',
'lowEstimatedExchangeRate',
'highEstimatedExchangeRate'
'highEstimatedExchangeRate',
'method'
]
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}
}
9 changes: 6 additions & 3 deletions packages/backend/src/open_payments/quote/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
})
}
)
Expand Down Expand Up @@ -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'
})
})
})
Expand Down

0 comments on commit 04051d1

Please sign in to comment.