summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-09 02:18:03 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-09 02:18:03 +0530
commit67df550b4f6d67f8de346985df26133dc8da5c05 (patch)
tree575b514c1f6a9723fd32678da42f21c3c7ab523b /packages/taler-wallet-core/src/wallet.ts
parent68ca4600e0e3460423a6c33530bd4bb8096afa65 (diff)
downloadwallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.tar.gz
wallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.tar.bz2
wallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.zip
implement payment aborts with integration test
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts17
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index e91d74efb..768d5eb0f 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -94,6 +94,7 @@ import {
PrepareTipResult,
codecForPrepareTipRequest,
codecForAcceptTipRequest,
+ codecForAbortPayWithRefundRequest,
} from "./types/walletTypes";
import { Logger } from "./util/logging";
@@ -132,7 +133,7 @@ import {
PendingOperationType,
} from "./types/pending";
import { WalletNotification, NotificationType } from "./types/notifications";
-import { processPurchaseQueryRefund, applyRefund } from "./operations/refund";
+import { processPurchaseQueryRefund, applyRefund, abortFailedPayWithRefund } from "./operations/refund";
import { durationMin, Duration } from "./util/time";
import { processRecoupGroup } from "./operations/recoup";
import {
@@ -744,8 +745,8 @@ export class Wallet {
return prepareTip(this.ws, talerTipUri);
}
- async abortFailedPayment(contractTermsHash: string): Promise<void> {
- throw Error("not implemented");
+ async abortFailedPayWithRefund(proposalId: string): Promise<void> {
+ return abortFailedPayWithRefund(this.ws, proposalId);
}
/**
@@ -1022,11 +1023,6 @@ export class Wallet {
const req = codecForGetExchangeTosRequest().decode(payload);
return this.getExchangeTos(req.exchangeBaseUrl);
}
- case "abortProposal": {
- const req = codecForAbortProposalRequest().decode(payload);
- await this.refuseProposal(req.proposalId);
- return {};
- }
case "retryPendingNow": {
await this.runPending(true);
return {};
@@ -1039,6 +1035,11 @@ export class Wallet {
const req = codecForConfirmPayRequest().decode(payload);
return await this.confirmPay(req.proposalId, req.sessionId);
}
+ case "abortFailedPayWithRefund": {
+ const req = codecForAbortPayWithRefundRequest().decode(payload);
+ await this.abortFailedPayWithRefund(req.proposalId);
+ return {};
+ }
case "dumpCoins": {
return await this.dumpCoins();
}