summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/taleruri.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/taleruri.ts')
-rw-r--r--packages/taler-util/src/taleruri.ts50
1 files changed, 0 insertions, 50 deletions
diff --git a/packages/taler-util/src/taleruri.ts b/packages/taler-util/src/taleruri.ts
index 15464b981..9717a7d71 100644
--- a/packages/taler-util/src/taleruri.ts
+++ b/packages/taler-util/src/taleruri.ts
@@ -39,7 +39,6 @@ export type TalerUri =
| PayPushUriResult
| BackupRestoreUri
| RefundUriResult
- | RewardUriResult
| WithdrawUriResult
| WithdrawExchangeUri;
@@ -97,12 +96,6 @@ export interface RefundUriResult {
orderId: string;
}
-export interface RewardUriResult {
- type: TalerUriAction.Reward;
- merchantBaseUrl: string;
- merchantRewardId: string;
-}
-
export interface PayPushUriResult {
type: TalerUriAction.PayPush;
exchangeBaseUrl: string;
@@ -188,7 +181,6 @@ export enum TalerUriAction {
Pay = "pay",
Withdraw = "withdraw",
Refund = "refund",
- Reward = "reward",
PayPull = "pay-pull",
PayPush = "pay-push",
PayTemplate = "pay-template",
@@ -231,7 +223,6 @@ const parsers: { [A in TalerUriAction]: Parser } = {
[TalerUriAction.PayTemplate]: parsePayTemplateUri,
[TalerUriAction.Restore]: parseRestoreUri,
[TalerUriAction.Refund]: parseRefundUri,
- [TalerUriAction.Reward]: parseRewardUri,
[TalerUriAction.Withdraw]: parseWithdrawUri,
[TalerUriAction.DevExperiment]: parseDevExperimentUri,
[TalerUriAction.WithdrawExchange]: parseWithdrawExchangeUri,
@@ -272,9 +263,6 @@ export function stringifyTalerUri(uri: TalerUri): string {
case TalerUriAction.Refund: {
return stringifyRefundUri(uri);
}
- case TalerUriAction.Reward: {
- return stringifyRewardUri(uri);
- }
case TalerUriAction.Withdraw: {
return stringifyWithdrawUri(uri);
}
@@ -404,36 +392,6 @@ export function parsePayPullUri(s: string): PayPullUriResult | undefined {
};
}
-/**
- * Parse a taler[+http]://reward URI.
- * Return undefined if not passed a valid URI.
- */
-export function parseRewardUri(s: string): RewardUriResult | undefined {
- const pi = parseProtoInfo(s, "reward");
- if (!pi) {
- return undefined;
- }
- const c = pi?.rest.split("?");
- const parts = c[0].split("/");
- if (parts.length < 2) {
- return undefined;
- }
- const host = parts[0].toLowerCase();
- const unused = parts[parts.length - 1];
- const rewardId = parts[parts.length - 2];
- const pathSegments = parts.slice(1, parts.length - 2);
- const hostAndSegments = [host, ...pathSegments].join("/");
- const merchantBaseUrl = canonicalizeBaseUrl(
- `${pi.innerProto}://${hostAndSegments}/`,
- );
-
- return {
- type: TalerUriAction.Reward,
- merchantBaseUrl,
- merchantRewardId: rewardId,
- };
-}
-
export function parseWithdrawExchangeUri(
s: string,
): WithdrawExchangeUri | undefined {
@@ -613,14 +571,6 @@ export function stringifyRefundUri({
return `${proto}://refund/${path}${orderId}/`;
}
-export function stringifyRewardUri({
- merchantBaseUrl,
- merchantRewardId,
-}: Omit<RewardUriResult, "type">): string {
- const { proto, path } = getUrlInfo(merchantBaseUrl);
- return `${proto}://reward/${path}${merchantRewardId}/`;
-}
-
export function stringifyWithdrawUri({
bankIntegrationApiBaseUrl,
withdrawalOperationId,