diff options
author | Florian Dold <florian@dold.me> | 2020-11-18 12:44:06 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2020-11-18 12:44:06 +0100 |
commit | d6409f185d332f6ade298f143cdb7803391f4b0b (patch) | |
tree | 304aa76937ff3fc5c28b2f33e17ee97f2b531200 /packages/taler-wallet-core | |
parent | 636d3cd30cd456099d16500c8126ce96babcf60b (diff) | |
download | wallet-core-d6409f185d332f6ade298f143cdb7803391f4b0b.tar.xz |
re-enable tipping support in the WebExtension UI
Diffstat (limited to 'packages/taler-wallet-core')
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 1 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/types/walletTypes.ts | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index 1d19a72ed..119695de6 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -121,6 +121,7 @@ export async function prepareTip( accepted: !!tipRecord && !!tipRecord.acceptedTimestamp, tipAmountRaw: Amounts.stringify(tipRecord.tipAmountRaw), exchangeBaseUrl: tipRecord.exchangeBaseUrl, + merchantBaseUrl: tipRecord.merchantBaseUrl, expirationTimestamp: tipRecord.tipExpiration, tipAmountEffective: Amounts.stringify(tipRecord.tipAmountEffective), walletTipId: tipRecord.walletTipId, diff --git a/packages/taler-wallet-core/src/types/walletTypes.ts b/packages/taler-wallet-core/src/types/walletTypes.ts index 1b20d7b47..7940497a3 100644 --- a/packages/taler-wallet-core/src/types/walletTypes.ts +++ b/packages/taler-wallet-core/src/types/walletTypes.ts @@ -360,9 +360,33 @@ export interface PrepareTipResult { * Has the tip already been accepted? */ accepted: boolean; + + /** + * Amount that the merchant gave. + */ tipAmountRaw: AmountString; + + /** + * Amount that arrived at the wallet. + * Might be lower than the raw amount due to fees. + */ tipAmountEffective: AmountString; + + /** + * Base URL of the merchant backend giving then tip. + */ + merchantBaseUrl: string; + + /** + * Base URL of the exchange that is used to withdraw the tip. + * Determined by the merchant, the wallet/user has no choice here. + */ exchangeBaseUrl: string; + + /** + * Time when the tip will expire. After it expired, it can't be picked + * up anymore. + */ expirationTimestamp: Timestamp; } @@ -372,6 +396,7 @@ export const codecForPrepareTipResult = (): Codec<PrepareTipResult> => .property("tipAmountRaw", codecForAmountString()) .property("tipAmountEffective", codecForAmountString()) .property("exchangeBaseUrl", codecForString()) + .property("merchantBaseUrl", codecForString()) .property("expirationTimestamp", codecForTimestamp) .property("walletTipId", codecForString()) .build("PrepareTipResult"); |