Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): add local payment (#2857)
* feat(backend): add local payment quote migration * feat(backend): WIP seperate ILPModels, LocalQuote, BaseQuote models - trouble updating the services. this may not be the best way. also not sure I can prevent querying for non-local quotes on LocalQuote (and vice-versa for ILPQuote). - the idea behind seperate models was a firm Quote type (it has the ilp specific props or it doesnt instead of 1 type MAYBE having them) - typeguards could work instead but seemed messier. or maybe I can still have seperate quote service methods returning different types? * refactor(backend): change model/services to reflect optional ilp quote details - includes some WIP changes including gql field removal and handling missing ilp quote details * feat(backend): WIP local payment method with getQuote * feat(backend): add local payment method to payment method handler * chore(backend): fix format * feat(backend): stub in control payment handler service with receiver isLocal - stubs in isLocal variable in place of actualy receiver.isLocal property - updates/adds test. new test expectedly fails because there is no way to set the receiver to local yet. can implement after isLocal is added to receiver * feat(backend): local payment .pay * chore: rm comment * chore: WIP debugging wrong sentAmount - for new local payment method service, sentAmount matches debitAmount, whereas is matches receive amount for local/remote ilp payments * chore: rm comment * feat(backend): use receiver.isLocal to control payment method in quote/outgoing payment * fix(backend): added source amount * fix(backend): p2p case (cross currency, local, fixed send) * fix: lint error * chore: rm logs * fix: quote service test * fix: lint errors * refactor(backend): split migrations * refactor(backend): rm migration that was split into many * WIP bruno requests for testing * feat(backend): start rm ilpQuoteDetail join on op where not used * fix(backend): rm unecessary ilpQuoteDetail join * chore(backend): format * fix(backend): dont join op on quote.ilpQuoteDetails on get * fix(backend): rm ilpQuoteDetails join on op cancel * fix(backend): rm unecessary join in op validate grant amount * fix(backend): rm join from fundPayment * fix(backend): rm unecessary join, unused method * fix(backend): fetch ilpQuoteDetails where used instead of joining * chore(backend): move ilpquotedetails dir * chore(backend): rm console.log * fix(backend): rm ilpQuoteDetails joins from quote service * chore(backend): rm console.log * refactor(backend): rename sourceAmount to debitAmountMinusFees * chore(backend): cleanup, rm unused fee method * test(backend): add local payment tests * chore: format * fix(bruno): local open payments requests * test(backend): add integration tests for local payments * chore(backend): cleanup * chore: restore old version of date definition in test * chore: cleanup * fix: rm unused import * test(integration): new case - p2p, fixed-send, local * chore(integration): rename test for consistency * fix(backend): throw error in pay if incoming payment is not pending * feat(backend): simplify migrations * chore(backend): clarify comment * chore(auth): format * refactor(backend): use IlpQuoteDetails model directly in ilp payment method * refactor(backend): rm ilpQuoteDetails service * fix(integration): wa typo * chore: rm bruno test examples * refactor: mv debitAmountMinusFees to fee calc and clarify TODO * Update bruno/collections/Rafiki/Examples/Admin API - only locally/Peer-to-Peer Local Payment/Create Receiver -remote Incoming Payment-.bru Co-authored-by: Max Kurapov <max@interledger.org> * fix: make timeout required again Making optional depends on single phase transfer * feat: error when post fails in local pay * refactor(backend): add optional quoteId to getQuote args - add runtime check to ilp payment method implementation requireing it * refactor: rm ilp quote details out of quote service * refactor: insert ilp quote details in ilp getQuote * fix(backend): payment handler test * chore(bruno): rename request * chore(integration): rm erroneous todo comment - comment indicated there was a bug where there was not. incoming payment not completing was expected because it doesnt have an amount and didnt expire * fix(backend): local quote amounts, estimatedExchangeRaet * chore(backend): format * refactor(backend): rate convert methods to be explicit --------- Co-authored-by: Max Kurapov <max@interledger.org>
- Loading branch information