aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src/taleruri.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-03 19:03:24 +0200
committerFlorian Dold <florian@dold.me>2023-08-03 19:03:24 +0200
commit57e86b759e0376238f993fea1617609977fefb46 (patch)
treeb4d6a0ec2f3045d78d193dab7cb4801ffdb6215a /packages/taler-util/src/taleruri.ts
parent0b5d0cdc71b8a6828a0ebae051c911225b354154 (diff)
downloadwallet-core-57e86b759e0376238f993fea1617609977fefb46.tar.xz
rename tip->reward in URI
Diffstat (limited to 'packages/taler-util/src/taleruri.ts')
-rw-r--r--packages/taler-util/src/taleruri.ts28
1 files changed, 14 insertions, 14 deletions
diff --git a/packages/taler-util/src/taleruri.ts b/packages/taler-util/src/taleruri.ts
index fc140811b..777cb5245 100644
--- a/packages/taler-util/src/taleruri.ts
+++ b/packages/taler-util/src/taleruri.ts
@@ -26,7 +26,7 @@ export type TalerUri =
| PayPushUriResult
| BackupRestoreUri
| RefundUriResult
- | TipUriResult
+ | RewardUriResult
| WithdrawUriResult
| ExchangeUri
| WithdrawExchangeUri
@@ -60,8 +60,8 @@ export interface RefundUriResult {
orderId: string;
}
-export interface TipUriResult {
- type: TalerUriAction.Tip;
+export interface RewardUriResult {
+ type: TalerUriAction.Reward;
merchantBaseUrl: string;
merchantTipId: string;
}
@@ -167,7 +167,7 @@ export enum TalerUriAction {
Pay = "pay",
Withdraw = "withdraw",
Refund = "refund",
- Tip = "tip",
+ Reward = "reward",
PayPull = "pay-pull",
PayPush = "pay-push",
PayTemplate = "pay-template",
@@ -212,7 +212,7 @@ const parsers: { [A in TalerUriAction]: Parser } = {
[TalerUriAction.PayTemplate]: parsePayTemplateUri,
[TalerUriAction.Restore]: parseRestoreUri,
[TalerUriAction.Refund]: parseRefundUri,
- [TalerUriAction.Tip]: parseTipUri,
+ [TalerUriAction.Reward]: parseRewardUri,
[TalerUriAction.Withdraw]: parseWithdrawUri,
[TalerUriAction.DevExperiment]: parseDevExperimentUri,
[TalerUriAction.Exchange]: parseExchangeUri,
@@ -255,8 +255,8 @@ export function stringifyTalerUri(uri: TalerUri): string {
case TalerUriAction.Refund: {
return stringifyRefundUri(uri);
}
- case TalerUriAction.Tip: {
- return stringifyTipUri(uri);
+ case TalerUriAction.Reward: {
+ return stringifyRewardUri(uri);
}
case TalerUriAction.Withdraw: {
return stringifyWithdrawUri(uri);
@@ -394,11 +394,11 @@ export function parsePayPullUri(s: string): PayPullUriResult | undefined {
}
/**
- * Parse a taler[+http]://tip URI.
+ * Parse a taler[+http]://reward URI.
* Return undefined if not passed a valid URI.
*/
-export function parseTipUri(s: string): TipUriResult | undefined {
- const pi = parseProtoInfo(s, "tip");
+export function parseRewardUri(s: string): RewardUriResult | undefined {
+ const pi = parseProtoInfo(s, "reward");
if (!pi) {
return undefined;
}
@@ -416,7 +416,7 @@ export function parseTipUri(s: string): TipUriResult | undefined {
);
return {
- type: TalerUriAction.Tip,
+ type: TalerUriAction.Reward,
merchantBaseUrl,
merchantTipId: tipId,
};
@@ -699,12 +699,12 @@ export function stringifyRefundUri({
const { proto, path } = getUrlInfo(merchantBaseUrl);
return `${proto}://refund/${path}${orderId}`;
}
-export function stringifyTipUri({
+export function stringifyRewardUri({
merchantBaseUrl,
merchantTipId,
-}: Omit<TipUriResult, "type">): string {
+}: Omit<RewardUriResult, "type">): string {
const { proto, path } = getUrlInfo(merchantBaseUrl);
- return `${proto}://tip/${path}${merchantTipId}`;
+ return `${proto}://reward/${path}${merchantTipId}`;
}
export function stringifyExchangeUri({