aboutsummaryrefslogtreecommitdiff
path: root/src/webex/wxApi.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-11-30 04:07:36 +0100
committerFlorian Dold <florian.dold@gmail.com>2017-12-01 03:00:09 +0100
commitb8ccc7c990a1542cf80578b41972f9a5b0870af9 (patch)
tree6f16319f9ce3133c4c4617129a516e692cfc3ac1 /src/webex/wxApi.ts
parentbc2c4aff8e657c7d5709433f137299491b98d257 (diff)
downloadwallet-core-b8ccc7c990a1542cf80578b41972f9a5b0870af9.tar.xz
partial implementation of tipping
Diffstat (limited to 'src/webex/wxApi.ts')
-rw-r--r--src/webex/wxApi.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/webex/wxApi.ts b/src/webex/wxApi.ts
index 7afc116ba..e362fc34a 100644
--- a/src/webex/wxApi.ts
+++ b/src/webex/wxApi.ts
@@ -37,6 +37,9 @@ import {
ReserveCreationInfo,
ReserveRecord,
SenderWireInfos,
+ TipResponse,
+ TipPlanchetDetail,
+ TipStatus,
WalletBalance,
} from "../types";
@@ -358,3 +361,23 @@ export function getPurchase(contractTermsHash: string): Promise<PurchaseRecord>
export function getFullRefundFees(args: { refundPermissions: RefundPermission[] }): Promise<AmountJson> {
return callBackend("get-full-refund-fees", { refundPermissions: args.refundPermissions });
}
+
+
+/**
+ * Get or generate planchets to give the merchant that wants to tip us.
+ */
+export function getTipPlanchets(merchantDomain: string, tipId: string, amount: AmountJson, deadline: number, exchangeUrl: string): Promise<TipPlanchetDetail[]> {
+ return callBackend("get-tip-planchets", { merchantDomain, tipId, amount, deadline, exchangeUrl });
+}
+
+export function getTipStatus(merchantDomain: string, tipId: string): Promise<TipStatus> {
+ return callBackend("get-tip-status", { merchantDomain, tipId });
+}
+
+export function acceptTip(merchantDomain: string, tipId: string): Promise<TipStatus> {
+ return callBackend("accept-tip", { merchantDomain, tipId });
+}
+
+export function processTipResponse(merchantDomain: string, tipId: string, tipResponse: TipResponse): Promise<void> {
+ return callBackend("process-tip-response", { merchantDomain, tipId, tipResponse });
+}