aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util/src
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-05-05 19:03:44 +0200
committerFlorian Dold <florian@dold.me>2023-05-07 21:51:02 +0200
commit7f0edb6a783d9a50f94f65c815c1280baecaac89 (patch)
treeb4f3bc24fece1f651e8c2f69fc0fcf52e1d6f330 /packages/taler-util/src
parenta0bf83fbb5db026389cc7d203adcff050d5a1b28 (diff)
downloadwallet-core-7f0edb6a783d9a50f94f65c815c1280baecaac89.tar.xz
wallet-core: refund DD37 refactoring
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r--packages/taler-util/src/notifications.ts10
-rw-r--r--packages/taler-util/src/transactions-types.ts10
-rw-r--r--packages/taler-util/src/wallet-types.ts31
3 files changed, 27 insertions, 24 deletions
diff --git a/packages/taler-util/src/notifications.ts b/packages/taler-util/src/notifications.ts
index f0683b31b..fc3286435 100644
--- a/packages/taler-util/src/notifications.ts
+++ b/packages/taler-util/src/notifications.ts
@@ -44,7 +44,6 @@ export enum NotificationType {
WaitingForRetry = "waiting-for-retry",
RefundStarted = "refund-started",
RefundQueried = "refund-queried",
- RefundFinished = "refund-finished",
ExchangeOperationError = "exchange-operation-error",
ExchangeAdded = "exchange-added",
RefreshOperationError = "refresh-operation-error",
@@ -192,14 +191,6 @@ export interface WaitingForRetryNotification {
numDue: number;
}
-export interface RefundFinishedNotification {
- type: NotificationType.RefundFinished;
-
- /**
- * Transaction ID of the purchase (NOT the refund transaction).
- */
- transactionId: string;
-}
export interface ExchangeAddedNotification {
type: NotificationType.ExchangeAdded;
@@ -321,7 +312,6 @@ export type WalletNotification =
| WithdrawalGroupFinishedNotification
| WaitingForRetryNotification
| RefundStartedNotification
- | RefundFinishedNotification
| RefundQueriedNotification
| WithdrawalGroupCreatedNotification
| CoinWithdrawnNotification
diff --git a/packages/taler-util/src/transactions-types.ts b/packages/taler-util/src/transactions-types.ts
index 8c5b59f5e..fac10cc88 100644
--- a/packages/taler-util/src/transactions-types.ts
+++ b/packages/taler-util/src/transactions-types.ts
@@ -130,6 +130,8 @@ export enum TransactionMinorState {
Withdraw = "withdraw",
MerchantOrderProposed = "merchant-order-proposed",
Proposed = "proposed",
+ RefundAvailable = "refund-available",
+ AcceptRefund = "accept-refund",
}
export interface TransactionsResponse {
@@ -549,14 +551,6 @@ export interface TransactionRefund extends TransactionCommon {
// ID for the transaction that is refunded
refundedTransactionId: string;
- // Additional information about the refunded payment
- info: OrderShortInfo;
-
- /**
- * Amount pending to be picked up
- */
- refundPending: AmountString | undefined;
-
// Amount that has been refunded by the merchant
amountRaw: AmountString;
diff --git a/packages/taler-util/src/wallet-types.ts b/packages/taler-util/src/wallet-types.ts
index d2355be6f..9c3bbe815 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -419,6 +419,7 @@ export const codecForPreparePayResultPaymentPossible =
.property("amountEffective", codecForAmountString())
.property("amountRaw", codecForAmountString())
.property("contractTerms", codecForMerchantContractTerms())
+ .property("transactionId", codecForString())
.property("proposalId", codecForString())
.property("contractTermsHash", codecForString())
.property("talerUri", codecForString())
@@ -494,6 +495,7 @@ export const codecForPreparePayResultInsufficientBalance =
.property("contractTerms", codecForAny())
.property("talerUri", codecForString())
.property("proposalId", codecForString())
+ .property("transactionId", codecForString())
.property("noncePriv", codecForString())
.property(
"status",
@@ -518,6 +520,7 @@ export const codecForPreparePayResultAlreadyConfirmed =
.property("talerUri", codecOptional(codecForString()))
.property("contractTerms", codecForAny())
.property("contractTermsHash", codecForString())
+ .property("transactionId", codecForString())
.property("proposalId", codecForString())
.build("PreparePayResultAlreadyConfirmed");
@@ -551,6 +554,10 @@ export type PreparePayResult =
*/
export interface PreparePayResultPaymentPossible {
status: PreparePayResultType.PaymentPossible;
+ transactionId: string;
+ /**
+ * @deprecated use transactionId instead
+ */
proposalId: string;
contractTerms: MerchantContractTerms;
contractTermsHash: string;
@@ -562,6 +569,7 @@ export interface PreparePayResultPaymentPossible {
export interface PreparePayResultInsufficientBalance {
status: PreparePayResultType.InsufficientBalance;
+ transactionId: string;
proposalId: string;
contractTerms: MerchantContractTerms;
amountRaw: string;
@@ -572,6 +580,7 @@ export interface PreparePayResultInsufficientBalance {
export interface PreparePayResultAlreadyConfirmed {
status: PreparePayResultType.AlreadyConfirmed;
+ transactionId: string;
contractTerms: MerchantContractTerms;
paid: boolean;
amountRaw: string;
@@ -1352,14 +1361,14 @@ export const codecForAcceptExchangeTosRequest =
.property("etag", codecOptional(codecForString()))
.build("AcceptExchangeTosRequest");
-export interface ApplyRefundRequest {
- talerRefundUri: string;
+export interface AcceptRefundRequest {
+ transactionId: string;
}
-export const codecForApplyRefundRequest = (): Codec<ApplyRefundRequest> =>
- buildCodecForObject<ApplyRefundRequest>()
- .property("talerRefundUri", codecForString())
- .build("ApplyRefundRequest");
+export const codecForApplyRefundRequest = (): Codec<AcceptRefundRequest> =>
+ buildCodecForObject<AcceptRefundRequest>()
+ .property("transactionId", codecForString())
+ .build("AcceptRefundRequest");
export interface ApplyRefundFromPurchaseIdRequest {
purchaseId: string;
@@ -1641,6 +1650,16 @@ export const codecForPrepareRefundRequest = (): Codec<PrepareRefundRequest> =>
.property("talerRefundUri", codecForString())
.build("PrepareRefundRequest");
+export interface StartRefundQueryRequest {
+ transactionId: string;
+}
+
+export const codecForStartRefundQueryRequest = (): Codec<StartRefundQueryRequest> =>
+ buildCodecForObject<StartRefundQueryRequest>()
+ .property("transactionId", codecForString())
+ .build("StartRefundQueryRequest");
+
+
export interface PrepareTipRequest {
talerTipUri: string;
}