diff options
| author | Florian Dold <florian.dold@gmail.com> | 2019-12-06 00:24:34 +0100 | 
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2019-12-06 00:24:34 +0100 | 
| commit | 65bccbd139c53a2baccec442a680373125488102 (patch) | |
| tree | 216860ec3523af33091b8fb52193787034c667f8 /src/wallet.ts | |
| parent | 7b54439fd62bd2a5e15b3068a8fbaffeb0a57468 (diff) | |
separate operations for pay, refund status query and refund submission
Diffstat (limited to 'src/wallet.ts')
| -rw-r--r-- | src/wallet.ts | 14 | 
1 files changed, 11 insertions, 3 deletions
| diff --git a/src/wallet.ts b/src/wallet.ts index 489bb2af8..276e3c371 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -49,7 +49,9 @@ import {    processDownloadProposal,    applyRefund,    getFullRefundFees, -  processPurchase, +  processPurchasePay, +  processPurchaseQueryRefund, +  processPurchaseApplyRefund,  } from "./wallet-impl/pay";  import { @@ -210,7 +212,13 @@ export class Wallet {          await processTip(this.ws, pending.tipId);          break;        case "pay": -        await processPurchase(this.ws, pending.proposalId); +        await processPurchasePay(this.ws, pending.proposalId); +        break; +      case "refund-query": +        await processPurchaseQueryRefund(this.ws, pending.proposalId); +        break; +      case "refund-apply": +        await processPurchaseApplyRefund(this.ws, pending.proposalId);          break;        default:          assertUnreachable(pending); @@ -710,7 +718,7 @@ export class Wallet {      const totalFees = totalRefundFees;      return {        contractTerms: purchase.contractTerms, -      hasRefund: purchase.lastRefundTimestamp !== undefined, +      hasRefund: purchase.lastRefundStatusTimestamp !== undefined,        totalRefundAmount: totalRefundAmount,        totalRefundAndRefreshFees: totalFees,      }; | 
