[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: wallet-core: remove deprecate
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: wallet-core: remove deprecated fields |
Date: |
Wed, 30 Oct 2024 12:24:53 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 50f4866cc wallet-core: remove deprecated fields
50f4866cc is described below
commit 50f4866cc0a435c22be3c99832a1febce6951bc1
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Oct 30 12:24:45 2024 +0100
wallet-core: remove deprecated fields
---
.vscode/tasks.json | 17 ----
.../src/pages/ShowConsolidated.stories.tsx | 5 +-
.../test-merchant-exchange-confusion.ts | 14 ++--
.../integrationtests/test-merchant-longpolling.ts | 6 +-
.../integrationtests/test-merchant-refund-api.ts | 4 +-
.../test-merchant-spec-public-orders.ts | 22 +++---
.../src/integrationtests/test-pay-paid.ts | 8 +-
.../integrationtests/test-payment-idempotency.ts | 4 +-
.../src/integrationtests/test-payment-transient.ts | 10 +--
.../src/integrationtests/test-paywall-flow.ts | 6 +-
.../integrationtests/test-refund-incremental.ts | 4 +-
packages/taler-util/src/types-taler-wallet.ts | 91 ++--------------------
packages/taler-wallet-cli/src/index.ts | 6 +-
packages/taler-wallet-core/src/backup/index.ts | 2 +-
packages/taler-wallet-core/src/db.ts | 2 +-
packages/taler-wallet-core/src/pay-merchant.ts | 5 --
.../taler-wallet-core/src/pay-peer-pull-debit.ts | 2 -
.../taler-wallet-core/src/pay-peer-push-credit.ts | 3 -
packages/taler-wallet-core/src/testing.ts | 10 ++-
packages/taler-wallet-core/src/wallet.ts | 28 +------
.../src/cta/InvoicePay/state.ts | 5 +-
.../src/cta/Payment/state.ts | 4 +-
.../src/cta/Payment/stories.tsx | 61 +++++++--------
tsconfig.build.json | 3 +
24 files changed, 104 insertions(+), 218 deletions(-)
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
deleted file mode 100644
index 4c931ad04..000000000
--- a/.vscode/tasks.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- // See https://go.microsoft.com/fwlink/?LinkId=733558
- // for the documentation about the tasks.json format
- "version": "2.0.0",
- "tasks": [
- {
- "type": "typescript",
- "tsconfig": "tsconfig.build.json",
- "problemMatcher": ["$tsc"],
- "group": {
- "kind": "build",
- "isDefault": true
- },
- "label": "tsc: build - tsconfig.build.json"
- }
- ]
-}
diff --git a/packages/aml-backoffice-ui/src/pages/ShowConsolidated.stories.tsx
b/packages/aml-backoffice-ui/src/pages/ShowConsolidated.stories.tsx
index 2fc661bd4..8a4c0d002 100644
--- a/packages/aml-backoffice-ui/src/pages/ShowConsolidated.stories.tsx
+++ b/packages/aml-backoffice-ui/src/pages/ShowConsolidated.stories.tsx
@@ -21,7 +21,6 @@
import {
AbsoluteTime,
- AmountString,
Duration,
TranslatedString,
} from "@gnu-taler/taler-util";
@@ -35,6 +34,10 @@ export default {
};
const nullTranslator: InternationalizationAPI = {
+ // FIXME
+ ctx(ctx) {
+ return undefined as any;
+ },
str: (str: TemplateStringsArray) => str.join() as TranslatedString,
singular: (str: TemplateStringsArray) => str.join() as TranslatedString,
translate: (str: TemplateStringsArray) => [str.join()] as TranslatedString[],
diff --git
a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
index f56441ef3..4168b7092 100644
---
a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
+++
b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts
@@ -30,6 +30,11 @@ import {
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { URL } from "url";
import { defaultCoinConfig } from "../harness/denomStructures.js";
+import {
+ createWalletDaemonWithClient,
+ FaultyMerchantTestEnvironmentNg,
+ withdrawViaBankV3,
+} from "../harness/environments.js";
import {
FaultInjectedExchangeService,
FaultInjectedMerchantService,
@@ -43,11 +48,6 @@ import {
MerchantService,
setupDb,
} from "../harness/harness.js";
-import {
- createWalletDaemonWithClient,
- FaultyMerchantTestEnvironmentNg,
- withdrawViaBankV3,
-} from "../harness/environments.js";
/**
* Run a test case with a simple TESTKUDOS Taler environment, consisting
@@ -238,7 +238,7 @@ export async function runMerchantExchangeConfusionTest(t:
GlobalTestState) {
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
const orderUrlWithHash = new URL(publicOrderStatusUrl);
orderUrlWithHash.searchParams.set(
@@ -261,7 +261,7 @@ export async function runMerchantExchangeConfusionTest(t:
GlobalTestState) {
);
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Pending);
diff --git
a/packages/taler-harness/src/integrationtests/test-merchant-longpolling.ts
b/packages/taler-harness/src/integrationtests/test-merchant-longpolling.ts
index e6e6cdb2f..216ca29db 100644
--- a/packages/taler-harness/src/integrationtests/test-merchant-longpolling.ts
+++ b/packages/taler-harness/src/integrationtests/test-merchant-longpolling.ts
@@ -25,11 +25,11 @@ import {
codecForMerchantOrderStatusUnpaid,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV3,
withdrawViaBankV3,
} from "../harness/environments.js";
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -141,7 +141,7 @@ export async function runMerchantLongpollingTest(t:
GlobalTestState) {
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
publicOrderStatusResp = await publicOrderStatusPromise;
@@ -156,7 +156,7 @@ export async function runMerchantLongpollingTest(t:
GlobalTestState) {
);
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
diff --git
a/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts
b/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts
index 69f62c18c..527361810 100644
--- a/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts
+++ b/packages/taler-harness/src/integrationtests/test-merchant-refund-api.ts
@@ -83,7 +83,7 @@ async function testRefundApiWithFulfillmentUrl(
);
await walletClient.call(WalletApiOperation.ConfirmPay, {
- proposalId: preparePayResult.proposalId,
+ transactionId: preparePayResult.transactionId,
});
// Check if payment was successful.
@@ -198,7 +198,7 @@ async function testRefundApiWithFulfillmentMessage(
);
await walletClient.call(WalletApiOperation.ConfirmPay, {
- proposalId: preparePayResult.proposalId,
+ transactionId: preparePayResult.transactionId,
});
// Check if payment was successful.
diff --git
a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
index ca0102dea..183420f2c 100644
---
a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
+++
b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
@@ -27,17 +27,17 @@ import {
getRandomBytes,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import {
+ createSimpleTestkudosEnvironmentV3,
+ createWalletDaemonWithClient,
+ withdrawViaBankV3,
+} from "../harness/environments.js";
import {
ExchangeService,
GlobalTestState,
MerchantService,
harnessHttpLib,
} from "../harness/harness.js";
-import {
- createSimpleTestkudosEnvironmentV3,
- createWalletDaemonWithClient,
- withdrawViaBankV3,
-} from "../harness/environments.js";
interface Context {
merchant: MerchantService;
@@ -122,7 +122,7 @@ async function testWithClaimToken(
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
const contractTermsHash = preparePayResp.contractTermsHash;
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
// claimed, unpaid, access with wrong h_contract
{
@@ -176,7 +176,7 @@ async function testWithClaimToken(
}
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
@@ -247,7 +247,7 @@ async function testWithClaimToken(
const confirmPayRes2 = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
sessionId: sessionId,
},
);
@@ -382,7 +382,7 @@ async function testWithoutClaimToken(
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
const contractTermsHash = preparePayResp.contractTermsHash;
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
// claimed, unpaid, access with wrong h_contract
{
@@ -438,7 +438,7 @@ async function testWithoutClaimToken(
}
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
@@ -507,7 +507,7 @@ async function testWithoutClaimToken(
const confirmPayRes2 = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
sessionId: sessionId,
},
);
diff --git a/packages/taler-harness/src/integrationtests/test-pay-paid.ts
b/packages/taler-harness/src/integrationtests/test-pay-paid.ts
index 4af43e53e..a3ebd63e7 100644
--- a/packages/taler-harness/src/integrationtests/test-pay-paid.ts
+++ b/packages/taler-harness/src/integrationtests/test-pay-paid.ts
@@ -25,12 +25,12 @@ import {
codecForMerchantOrderStatusUnpaid,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { FaultInjectionRequestContext } from "../harness/faultInjection.js";
-import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
import {
createFaultInjectedMerchantTestkudosEnvironment,
withdrawViaBankV2,
} from "../harness/environments.js";
+import { FaultInjectionRequestContext } from "../harness/faultInjection.js";
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
/**
* Run test for the wallets repurchase detection mechanism
@@ -112,7 +112,7 @@ export async function runPayPaidTest(t: GlobalTestState) {
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl);
@@ -127,7 +127,7 @@ export async function runPayPaidTest(t: GlobalTestState) {
);
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
diff --git
a/packages/taler-harness/src/integrationtests/test-payment-idempotency.ts
b/packages/taler-harness/src/integrationtests/test-payment-idempotency.ts
index be09c57b4..a7fe63f9d 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-idempotency.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-idempotency.ts
@@ -89,12 +89,12 @@ export async function runPaymentIdempotencyTest(t:
GlobalTestState) {
preparePayResultRep.status === PreparePayResultType.PaymentPossible,
);
- const proposalId = preparePayResult.proposalId;
+ const proposalTransactionId = preparePayResult.transactionId;
const confirmPayResult = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
},
);
diff --git
a/packages/taler-harness/src/integrationtests/test-payment-transient.ts
b/packages/taler-harness/src/integrationtests/test-payment-transient.ts
index a1c1e7b8b..b9f1b5f6d 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-transient.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-transient.ts
@@ -27,12 +27,12 @@ import {
codecForMerchantOrderStatusUnpaid,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { FaultInjectionResponseContext } from "../harness/faultInjection.js";
-import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
import {
createFaultInjectedMerchantTestkudosEnvironment,
withdrawViaBankV2,
} from "../harness/environments.js";
+import { FaultInjectionResponseContext } from "../harness/faultInjection.js";
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
/**
* Run test for a payment where the merchant has a transient
@@ -101,7 +101,7 @@ export async function runPaymentTransientTest(t:
GlobalTestState) {
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl);
@@ -143,7 +143,7 @@ export async function runPaymentTransientTest(t:
GlobalTestState) {
const confirmPayResp = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
- proposalId,
+ transactionId: proposalTransactionId,
},
);
@@ -155,7 +155,7 @@ export async function runPaymentTransientTest(t:
GlobalTestState) {
const confirmPayRespTwo = await walletClient.call(
WalletApiOperation.ConfirmPay,
{
- proposalId,
+ transactionId: proposalTransactionId,
},
);
diff --git a/packages/taler-harness/src/integrationtests/test-paywall-flow.ts
b/packages/taler-harness/src/integrationtests/test-paywall-flow.ts
index 378935f78..0e630de3e 100644
--- a/packages/taler-harness/src/integrationtests/test-paywall-flow.ts
+++ b/packages/taler-harness/src/integrationtests/test-paywall-flow.ts
@@ -25,11 +25,11 @@ import {
codecForMerchantOrderStatusUnpaid,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV3,
withdrawViaBankV3,
} from "../harness/environments.js";
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -110,7 +110,7 @@ export async function runPaywallFlowTest(t:
GlobalTestState) {
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
- const proposalId = preparePayResp.proposalId;
+ const proposalTransactionId = preparePayResp.transactionId;
console.log("requesting", publicOrderStatusUrl.href);
publicOrderStatusResp = await
harnessHttpLib.fetch(publicOrderStatusUrl.href);
@@ -126,7 +126,7 @@ export async function runPaywallFlowTest(t:
GlobalTestState) {
);
const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay,
{
- proposalId: proposalId,
+ transactionId: proposalTransactionId,
});
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
diff --git
a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts
b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts
index b5901c3fb..323a135ab 100644
--- a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts
+++ b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts
@@ -24,11 +24,11 @@ import {
TransactionType,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, delayMs } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV3,
withdrawViaBankV3,
} from "../harness/environments.js";
+import { GlobalTestState, delayMs } from "../harness/harness.js";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -78,7 +78,7 @@ export async function runRefundIncrementalTest(t:
GlobalTestState) {
});
await walletClient.call(WalletApiOperation.ConfirmPay, {
- proposalId: r1.proposalId,
+ transactionId: r1.transactionId,
});
// Check if payment was successful.
diff --git a/packages/taler-util/src/types-taler-wallet.ts
b/packages/taler-util/src/types-taler-wallet.ts
index e235e1ed5..8a4de2b32 100644
--- a/packages/taler-util/src/types-taler-wallet.ts
+++ b/packages/taler-util/src/types-taler-wallet.ts
@@ -89,10 +89,7 @@ import {
codecForMerchantContractTerms,
} from "./types-taler-merchant.js";
import { BackupRecovery } from "./types-taler-sync.js";
-import {
- OrderShortInfo,
- TransactionState,
-} from "./types-taler-wallet-transactions.js";
+import { TransactionState } from "./types-taler-wallet-transactions.js";
/**
* Identifier for a transaction in the wallet.
@@ -705,39 +702,6 @@ export interface SenderWireInfos {
senderWires: string[];
}
-/**
- * Request to mark a reserve as confirmed.
- */
-export interface ConfirmReserveRequest {
- /**
- * Public key of then reserve that should be marked
- * as confirmed.
- */
- reservePub: string;
-}
-
-export const codecForConfirmReserveRequest = (): Codec<ConfirmReserveRequest>
=>
- buildCodecForObject<ConfirmReserveRequest>()
- .property("reservePub", codecForString())
- .build("ConfirmReserveRequest");
-
-export interface PrepareRefundResult {
- proposalId: string;
-
- effectivePaid: AmountString;
- gone: AmountString;
- granted: AmountString;
- pending: boolean;
- awaiting: AmountString;
-
- info: OrderShortInfo;
-}
-
-export interface BenchmarkResult {
- time: { [s: string]: number };
- repetitions: number;
-}
-
export enum PreparePayResultType {
PaymentPossible = "payment-possible",
InsufficientBalance = "insufficient-balance",
@@ -751,7 +715,6 @@ export const codecForPreparePayResultPaymentPossible =
.property("amountRaw", codecForAmountString())
.property("contractTerms", codecForMerchantContractTerms())
.property("transactionId", codecForTransactionIdStr())
- .property("proposalId", codecForString())
.property("contractTermsHash", codecForString())
.property("scopes", codecForList(codecForScopeInfo()))
.property("talerUri", codecForString())
@@ -843,7 +806,6 @@ export const codecForPreparePayResultInsufficientBalance =
.property("amountRaw", codecForAmountString())
.property("contractTerms", codecForAny())
.property("talerUri", codecForString())
- .property("proposalId", codecForString())
.property("transactionId", codecForTransactionIdStr())
.property(
"status",
@@ -871,7 +833,6 @@ export const codecForPreparePayResultAlreadyConfirmed =
.property("contractTerms", codecForAny())
.property("contractTermsHash", codecForString())
.property("transactionId", codecForTransactionIdStr())
- .property("proposalId", codecForString())
.build("PreparePayResultAlreadyConfirmed");
export const codecForPreparePayResult = (): Codec<PreparePayResult> =>
@@ -927,11 +888,6 @@ export interface PreparePayResultPaymentPossible {
* FIXME: Unclear why this is needed! Remove?
*/
talerUri: string;
-
- /**
- * @deprecated use transactionId instead
- */
- proposalId: string;
}
export interface PreparePayResultInsufficientBalance {
@@ -953,11 +909,6 @@ export interface PreparePayResultInsufficientBalance {
talerUri: string;
balanceDetails: PaymentInsufficientBalanceDetails;
-
- /**
- * @deprecated use transactionId
- */
- proposalId: string;
}
export interface PreparePayResultAlreadyConfirmed {
@@ -981,11 +932,6 @@ export interface PreparePayResultAlreadyConfirmed {
contractTermsHash: string;
talerUri: string;
-
- /**
- * @deprecated use transactionId
- */
- proposalId: string;
}
export interface BankWithdrawDetails {
@@ -2072,26 +2018,14 @@ export const codecForForgetKnownBankAccounts =
.property("payto", codecForString())
.build("ForgetKnownBankAccountsRequest");
-export interface AbortProposalRequest {
- proposalId: string;
-}
-
-export const codecForAbortProposalRequest = (): Codec<AbortProposalRequest> =>
- buildCodecForObject<AbortProposalRequest>()
- .property("proposalId", codecForString())
- .build("AbortProposalRequest");
-
export interface GetContractTermsDetailsRequest {
- // @deprecated use transaction id
- proposalId?: string;
- transactionId?: string;
+ transactionId: string;
}
export const codecForGetContractTermsDetails =
(): Codec<GetContractTermsDetailsRequest> =>
buildCodecForObject<GetContractTermsDetailsRequest>()
- .property("proposalId", codecOptional(codecForString()))
- .property("transactionId", codecOptional(codecForString()))
+ .property("transactionId", codecForString())
.build("GetContractTermsDetails");
export interface PreparePayRequest {
@@ -2149,19 +2083,14 @@ export const codecForPreparePayTemplateRequest =
.build("PreparePayTemplate");
export interface ConfirmPayRequest {
- /**
- * @deprecated use transactionId instead
- */
- proposalId?: string;
- transactionId?: TransactionIdStr;
+ transactionId: TransactionIdStr;
sessionId?: string;
forcedCoinSel?: ForcedCoinSel;
}
export const codecForConfirmPayRequest = (): Codec<ConfirmPayRequest> =>
buildCodecForObject<ConfirmPayRequest>()
- .property("proposalId", codecOptional(codecForString()))
- .property("transactionId", codecOptional(codecForTransactionIdStr()))
+ .property("transactionId", codecForTransactionIdStr())
.property("sessionId", codecOptional(codecForString()))
.property("forcedCoinSel", codecForAny())
.build("ConfirmPay");
@@ -2958,11 +2887,6 @@ export interface PreparePeerPushCreditResponse {
scopeInfo: ScopeInfo;
- /**
- * @deprecated use transaction ID instead.
- */
- peerPushCreditId: string;
-
/**
* @deprecated
*/
@@ -2981,11 +2905,6 @@ export interface PreparePeerPullDebitResponse {
scopeInfo: ScopeInfo;
- /**
- * @deprecated Use transactionId instead
- */
- peerPullDebitId: string;
-
/**
* @deprecated Redundant field with bad name, will be removed soon.
*/
diff --git a/packages/taler-wallet-cli/src/index.ts
b/packages/taler-wallet-cli/src/index.ts
index dc11f83b3..c921a6a42 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -150,7 +150,7 @@ async function doPay(
if (pay) {
await wallet.call(WalletApiOperation.ConfirmPay, {
- proposalId: result.proposalId,
+ transactionId: result.transactionId,
});
} else {
console.log("not paying");
@@ -1617,12 +1617,12 @@ advancedCli
.subcommand("payConfirm", "pay-confirm", {
help: "Confirm payment proposed by a merchant.",
})
- .requiredArgument("proposalId", clk.STRING)
+ .requiredArgument("transactionId", clk.STRING)
.maybeOption("sessionIdOverride", ["--session-id"], clk.STRING)
.action(async (args) => {
await withWallet(args, { lazyTaskLoop: true }, async (wallet) => {
await wallet.client.call(WalletApiOperation.ConfirmPay, {
- proposalId: args.payConfirm.proposalId,
+ transactionId: args.payConfirm.transactionId as TransactionIdStr,
sessionId: args.payConfirm.sessionIdOverride,
});
});
diff --git a/packages/taler-wallet-core/src/backup/index.ts
b/packages/taler-wallet-core/src/backup/index.ts
index c5febd278..a9274f74b 100644
--- a/packages/taler-wallet-core/src/backup/index.ts
+++ b/packages/taler-wallet-core/src/backup/index.ts
@@ -325,7 +325,7 @@ async function runBackupCycleForProvider(
}
// const opId = TaskIdentifiers.forBackup(prov);
// await scheduleRetryInTx(ws, tx, opId);
- prov.currentPaymentProposalId = result.proposalId;
+ prov.currentPaymentTransactionId = result.transactionId;
prov.shouldRetryFreshProposal = false;
prov.state = {
tag: BackupProviderStateTag.Retrying,
diff --git a/packages/taler-wallet-core/src/db.ts
b/packages/taler-wallet-core/src/db.ts
index 93331d6d9..bcb9a284f 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -1715,7 +1715,7 @@ export interface BackupProviderRecord {
*
* FIXME: Make this part of a proper BackupProviderState?
*/
- currentPaymentProposalId?: string;
+ currentPaymentTransactionId?: string;
shouldRetryFreshProposal: boolean;
diff --git a/packages/taler-wallet-core/src/pay-merchant.ts
b/packages/taler-wallet-core/src/pay-merchant.ts
index 699a04649..9cce4c4b1 100644
--- a/packages/taler-wallet-core/src/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/pay-merchant.ts
@@ -1639,7 +1639,6 @@ async function checkPaymentByProposalId(
return {
status: PreparePayResultType.InsufficientBalance,
contractTerms: d.contractTermsRaw,
- proposalId: proposal.proposalId,
transactionId,
amountRaw: Amounts.stringify(d.contractData.amount),
scopes,
@@ -1671,7 +1670,6 @@ async function checkPaymentByProposalId(
status: PreparePayResultType.PaymentPossible,
contractTerms: d.contractTermsRaw,
transactionId,
- proposalId: proposal.proposalId,
amountEffective: Amounts.stringify(totalCost),
amountRaw: Amounts.stringify(instructedAmount),
scopes,
@@ -1730,7 +1728,6 @@ async function checkPaymentByProposalId(
: undefined,
scopes,
transactionId,
- proposalId,
talerUri,
};
} else if (!purchase.timestampFirstSuccessfulPay) {
@@ -1746,7 +1743,6 @@ async function checkPaymentByProposalId(
: undefined,
scopes,
transactionId,
- proposalId,
talerUri,
};
} else {
@@ -1764,7 +1760,6 @@ async function checkPaymentByProposalId(
...(paid ? { nextUrl: download.contractData.orderId } : {}),
scopes,
transactionId,
- proposalId,
talerUri,
};
}
diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
index 8d3dc54f0..9c6c696dd 100644
--- a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
+++ b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
@@ -943,7 +943,6 @@ export async function preparePeerPullDebit(
amountRaw: existing.peerPullDebitRecord.amount,
amountEffective: existing.peerPullDebitRecord.totalCostEstimated,
contractTerms: existing.contractTerms.contractTermsRaw,
- peerPullDebitId: existing.peerPullDebitRecord.peerPullDebitId,
scopeInfo: existing.scopeInfo,
exchangeBaseUrl: existing.exchangeBaseUrl,
transactionId: constructTransactionIdentifier({
@@ -1065,7 +1064,6 @@ export async function preparePeerPullDebit(
amountEffective: Amounts.stringify(totalAmount),
amountRaw: contractTerms.amount,
contractTerms: contractTerms,
- peerPullDebitId,
scopeInfo,
exchangeBaseUrl,
transactionId: ctx.transactionId,
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts
b/packages/taler-wallet-core/src/pay-peer-push-credit.ts
index e15cde997..c84d79945 100644
--- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts
+++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts
@@ -642,7 +642,6 @@ export async function preparePeerPushCredit(
amountEffective: existing.existingPushInc.estimatedAmountEffective,
amountRaw: existing.existingContractTerms.amount,
contractTerms: existing.existingContractTerms,
- peerPushCreditId: existing.existingPushInc.peerPushCreditId,
transactionId: constructTransactionIdentifier({
tag: TransactionType.PeerPushCredit,
peerPushCreditId: existing.existingPushInc.peerPushCreditId,
@@ -764,10 +763,8 @@ export async function preparePeerPushCredit(
amountEffective: wi.withdrawalAmountEffective,
amountRaw: purseStatus.balance,
contractTerms: dec.contractTerms,
- peerPushCreditId,
transactionId: ctx.transactionId,
exchangeBaseUrl,
- // FIXME: Shouldn't we place this in a tighter scope?
scopeInfo,
...getPeerCreditLimitInfo(exchange, purseStatus.balance),
};
diff --git a/packages/taler-wallet-core/src/testing.ts
b/packages/taler-wallet-core/src/testing.ts
index 8e5c3d760..ce1d14013 100644
--- a/packages/taler-wallet-core/src/testing.ts
+++ b/packages/taler-wallet-core/src/testing.ts
@@ -78,7 +78,11 @@ import {
} from "./pay-peer-push-credit.js";
import { initiatePeerPushDebit } from "./pay-peer-push-debit.js";
import { getRefreshesForTransaction } from "./refresh.js";
-import { getTransactionById, getTransactions } from "./transactions.js";
+import {
+ getTransactionById,
+ getTransactions,
+ parseTransactionIdentifier,
+} from "./transactions.js";
import type { WalletExecutionContext } from "./wallet.js";
import { acceptBankIntegratedWithdrawal } from "./withdraw.js";
@@ -884,7 +888,9 @@ export async function testPay(
const purchase = await wex.db.runReadOnlyTx(
{ storeNames: ["purchases"] },
async (tx) => {
- return tx.purchases.get(result.proposalId);
+ const parsedTx = parseTransactionIdentifier(r.transactionId);
+ checkLogicInvariant(parsedTx?.tag === TransactionType.Payment);
+ return tx.purchases.get(parsedTx.proposalId);
},
);
checkLogicInvariant(!!purchase);
diff --git a/packages/taler-wallet-core/src/wallet.ts
b/packages/taler-wallet-core/src/wallet.ts
index bfcb79f03..cdc066d85 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -338,7 +338,6 @@ import {
} from "./testing.js";
import {
abortTransaction,
- constructTransactionIdentifier,
deleteTransaction,
failTransaction,
getTransactionById,
@@ -1027,18 +1026,11 @@ async function handleGetContractTermsDetails(
wex: WalletExecutionContext,
req: GetContractTermsDetailsRequest,
): Promise<WalletContractData> {
- if (req.proposalId) {
- // FIXME: deprecated path
- return getContractTermsDetails(wex, req.proposalId);
- }
- if (req.transactionId) {
- const parsedTx = parseTransactionIdentifier(req.transactionId);
- if (parsedTx?.tag === TransactionType.Payment) {
- return getContractTermsDetails(wex, parsedTx.proposalId);
- }
+ const parsedTx = parseTransactionIdentifier(req.transactionId);
+ if (parsedTx?.tag !== TransactionType.Payment) {
throw Error("transactionId is not a payment transaction");
}
- throw Error("transactionId missing");
+ return getContractTermsDetails(wex, parsedTx.proposalId);
}
async function handleGetQrCodesForPayto(
@@ -1098,19 +1090,7 @@ async function handleConfirmPay(
wex: WalletExecutionContext,
req: ConfirmPayRequest,
): Promise<ConfirmPayResult> {
- let transactionId;
- if (req.proposalId) {
- // legacy client support
- transactionId = constructTransactionIdentifier({
- tag: TransactionType.Payment,
- proposalId: req.proposalId,
- });
- } else if (req.transactionId) {
- transactionId = req.transactionId;
- } else {
- throw Error("transactionId or (deprecated) proposalId required");
- }
- return await confirmPay(wex, transactionId, req.sessionId);
+ return await confirmPay(wex, req.transactionId, req.sessionId);
}
async function handleAbortTransaction(
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
index deee83751..a3ef54210 100644
--- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
@@ -21,6 +21,7 @@ import {
PreparePayResult,
PreparePayResultType,
TalerProtocolTimestamp,
+ TransactionIdStr,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
@@ -99,11 +100,13 @@ export function useComponentState({
const paymentPossible: PreparePayResult = {
status: PreparePayResultType.PaymentPossible,
- proposalId: "fakeID",
contractTerms: {} as any,
contractTermsHash: "asd",
amountRaw: hook.response.p2p.amount,
amountEffective: hook.response.p2p.amount,
+ scopes: [],
+ transactionId: "txn:pay:123" as TransactionIdStr,
+ talerUri: "taler://pay/example.com/",
} as PreparePayResult;
const insufficientBalance: PreparePayResult = {
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/state.ts
b/packages/taler-wallet-webextension/src/cta/Payment/state.ts
index 4733e5aee..78f8ad867 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/Payment/state.ts
@@ -21,10 +21,10 @@ import {
PreparePayResultType,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { useEffect } from "preact/hooks";
import { alertFromError, useAlertContext } from "../../context/alert.js";
import { useBackendContext } from "../../context/backend.js";
-import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
import { ButtonHandler } from "../../mui/handlers.js";
import { Props, State } from "./index.js";
@@ -143,7 +143,7 @@ export function useComponentState({
async function doPayment(): Promise<void> {
const res = await api.wallet.call(WalletApiOperation.ConfirmPay, {
- proposalId: payStatus.proposalId,
+ transactionId: payStatus.transactionId,
});
// handle confirm pay
if (res.type !== ConfirmPayResultType.Done) {
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
index 3d55c9509..bd11e8d29 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
@@ -63,9 +63,8 @@ export const NoEnoughBalanceAvailable =
tests.createExample(BaseView, {
balanceExchangeDepositable: "USD:9.5" as AmountString,
perExchange: {},
},
- talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
+ talerUri:
+ "taler://payment/96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
contractTerms: {
merchant: {
name: "the merchant",
@@ -76,6 +75,7 @@ export const NoEnoughBalanceAvailable =
tests.createExample(BaseView, {
summary: "some beers",
amount: "USD:10",
} as Partial<ContractTerms> as any,
+ scopes: [],
amountRaw: "USD:10" as AmountString,
},
});
@@ -92,7 +92,6 @@ export const NoEnoughBalanceMaterial =
tests.createExample(BaseView, {
uri: "",
payStatus: {
- transactionId: " " as TransactionIdStr,
status: PreparePayResultType.InsufficientBalance,
balanceDetails: {
amountRequested: "USD:10" as AmountString,
@@ -106,8 +105,9 @@ export const NoEnoughBalanceMaterial =
tests.createExample(BaseView, {
perExchange: {},
},
talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
contractTerms: {
merchant: {
name: "the merchant",
@@ -134,7 +134,6 @@ export const NoEnoughBalanceAgeAcceptable =
tests.createExample(BaseView, {
uri: "",
payStatus: {
- transactionId: " " as TransactionIdStr,
status: PreparePayResultType.InsufficientBalance,
balanceDetails: {
amountRequested: "USD:10" as AmountString,
@@ -148,8 +147,9 @@ export const NoEnoughBalanceAgeAcceptable =
tests.createExample(BaseView, {
perExchange: {},
},
talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
contractTerms: {
merchant: {
name: "the merchant",
@@ -177,7 +177,9 @@ export const NoEnoughBalanceMerchantAcceptable =
tests.createExample(BaseView, {
uri: "",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
status: PreparePayResultType.InsufficientBalance,
balanceDetails: {
amountRequested: "USD:10" as AmountString,
@@ -191,8 +193,6 @@ export const NoEnoughBalanceMerchantAcceptable =
tests.createExample(BaseView, {
perExchange: {},
},
talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
contractTerms: {
merchant: {
name: "the merchant",
@@ -221,7 +221,9 @@ export const NoEnoughBalanceMerchantDepositable =
tests.createExample(
uri: "",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
status: PreparePayResultType.InsufficientBalance,
balanceDetails: {
amountRequested: "USD:10" as AmountString,
@@ -235,8 +237,6 @@ export const NoEnoughBalanceMerchantDepositable =
tests.createExample(
perExchange: {},
},
talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
contractTerms: {
merchant: {
name: "the merchant",
@@ -264,7 +264,9 @@ export const NoEnoughBalanceFeeGap =
tests.createExample(BaseView, {
uri: "",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
status: PreparePayResultType.InsufficientBalance,
balanceDetails: {
amountRequested: "USD:10" as AmountString,
@@ -278,8 +280,6 @@ export const NoEnoughBalanceFeeGap =
tests.createExample(BaseView, {
perExchange: {},
},
talerUri: "taler://pay/..",
-
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
contractTerms: {
merchant: {
name: "the merchant",
@@ -310,13 +310,13 @@ export const PaymentPossible =
tests.createExample(BaseView, {
uri:
"taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
status: PreparePayResultType.PaymentPossible,
talerUri: "taler://pay/..",
amountEffective: "USD:10" as AmountString,
amountRaw: "USD:10" as AmountString,
- scopes: [],
-
contractTerms: {
nonce: "123213123",
merchant: {
@@ -332,7 +332,6 @@ export const PaymentPossible =
tests.createExample(BaseView, {
summary: "some beers",
} as Partial<ContractTerms> as any,
contractTermsHash: "123456",
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
},
});
@@ -351,7 +350,8 @@ export const PaymentPossibleWithFee =
tests.createExample(BaseView, {
uri:
"taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
status: PreparePayResultType.PaymentPossible,
talerUri: "taler://pay/..",
amountEffective: "USD:10.20" as AmountString,
@@ -370,7 +370,6 @@ export const PaymentPossibleWithFee =
tests.createExample(BaseView, {
summary: "some beers",
} as Partial<ContractTerms> as any,
contractTermsHash: "123456",
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
},
});
@@ -389,7 +388,8 @@ export const TicketWithAProductList =
tests.createExample(BaseView, {
uri:
"taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
status: PreparePayResultType.PaymentPossible,
talerUri: "taler://pay/..",
amountEffective: "USD:10.20" as AmountString,
@@ -427,7 +427,6 @@ export const TicketWithAProductList =
tests.createExample(BaseView, {
],
} as Partial<ContractTerms> as any,
contractTermsHash: "123456",
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
},
});
@@ -446,14 +445,14 @@ export const TicketWithShipping =
tests.createExample(BaseView, {
uri:
"taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
status: PreparePayResultType.PaymentPossible,
talerUri: "taler://pay/..",
amountEffective: "USD:10.20" as AmountString,
amountRaw: "USD:10" as AmountString,
scopes: [],
-
contractTerms: {
nonce: "123213123",
merchant: {
@@ -480,7 +479,6 @@ export const TicketWithShipping =
tests.createExample(BaseView, {
},
} as Partial<ContractTerms> as any,
contractTermsHash: "123456",
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
},
});
@@ -496,7 +494,9 @@ export const AlreadyConfirmedByOther =
tests.createExample(BaseView, {
uri:
"taler://pay/merchant-backend.taler/2021.242-01G2X4275RBWG/?c=66BE594PDZR24744J6EQK52XM0",
payStatus: {
- transactionId: " " as TransactionIdStr,
+ transactionId:
+ "txn:payment:96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0" as
TransactionIdStr,
+ scopes: [],
status: PreparePayResultType.AlreadyConfirmed,
talerUri: "taler://pay/..",
amountEffective: "USD:10" as AmountString,
@@ -512,7 +512,6 @@ export const AlreadyConfirmedByOther =
tests.createExample(BaseView, {
amount: "USD:10",
} as Partial<ContractTerms> as any,
contractTermsHash: "123456",
- proposalId: "96YY92RQZGF3V7TJSPN4SF9549QX7BRF88Q5PYFCSBNQ0YK4RPK0",
paid: false,
},
});
diff --git a/tsconfig.build.json b/tsconfig.build.json
index cc6a9ab1e..1ad690cd2 100644
--- a/tsconfig.build.json
+++ b/tsconfig.build.json
@@ -24,6 +24,9 @@
},
{
"path": "packages/anastasis-core/"
+ },
+ {
+ "path": "packages/taler-harness/"
}
],
"files": []
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: wallet-core: remove deprecated fields,
gnunet <=