taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 3026da861fe246e0fb42a1ae21c2819998fcd950
parent d4eb77afbfaebd12db1b83c45aaa1705e28eab27
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Wed, 24 Jun 2026 16:26:05 -0300

cant share pay with p2p invoice

Diffstat:
Mpackages/taler-wallet-webextension/src/components/PaymentButtons.tsx | 8++++++--
Mpackages/taler-wallet-webextension/src/cta/InvoicePay/state.ts | 8+++-----
Mpackages/taler-wallet-webextension/src/cta/InvoicePay/stories.tsx | 1+
Mpackages/taler-wallet-webextension/src/cta/Payment/index.ts | 30++++++++++++++++--------------
Mpackages/taler-wallet-webextension/src/cta/Payment/state.ts | 8+++++---
5 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx b/packages/taler-wallet-webextension/src/components/PaymentButtons.tsx @@ -57,7 +57,9 @@ export function PaymentButtons({ </i18n.Translate> </Button> </section> - <PayWithMobile merchantBaseUrl={state.merchantBaseUrl} orderId={state.orderId} /> + {!state.sharePay ? undefined : + <PayWithMobile merchantBaseUrl={state.sharePay.merchantBaseUrl} orderId={state.sharePay.orderId} /> + } </Fragment> ); } @@ -156,7 +158,9 @@ export function PaymentButtons({ <i18n.Translate>Get digital cash</i18n.Translate> </Button> </section> - <PayWithMobile merchantBaseUrl={state.merchantBaseUrl} orderId={state.orderId} /> + {!state.sharePay ? undefined : + <PayWithMobile merchantBaseUrl={state.sharePay.merchantBaseUrl} orderId={state.sharePay.orderId} /> + } </Fragment> ); } diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts @@ -17,11 +17,7 @@ import { AbsoluteTime, Amounts, - NotificationType, - PreparePayResult, - PreparePayResultType, - TalerProtocolTimestamp, - TransactionIdStr, + NotificationType } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; @@ -112,6 +108,7 @@ export function useComponentState({ ...baseResult, effective: undefined, balanceDetails: undefined, + sharePay: undefined, amount, merchant: undefined, choices: undefined, @@ -131,6 +128,7 @@ export function useComponentState({ return { status: "ready", ...baseResult, + sharePay: undefined, payHandler: { onClick: pushAlertOnError(accept), }, diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/stories.tsx b/packages/taler-wallet-webextension/src/cta/InvoicePay/stories.tsx @@ -54,5 +54,6 @@ export const Ready = tests.createExample(ReadyView, { payHandler: { onClick: undefined, }, + sharePay: undefined, transactionId: "1" as TransactionIdStr, } satisfies State.Ready); diff --git a/packages/taler-wallet-webextension/src/cta/Payment/index.ts b/packages/taler-wallet-webextension/src/cta/Payment/index.ts @@ -63,8 +63,10 @@ export namespace State { expiration: AbsoluteTime; merchant: MerchantInfo | undefined; transactionId: TransactionIdStr; - merchantBaseUrl: string; - orderId:string; + sharePay: { + merchantBaseUrl: string; + orderId: string; + } | undefined, error: undefined; goToWalletManualWithdraw: (amount?: string) => Promise<void>; cancel: () => Promise<void>; @@ -75,12 +77,12 @@ export namespace State { balanceDetails: PaymentInsufficientBalanceDetails | undefined; effective: undefined; choices: - | undefined - | { - list: MerchantContractChoice[]; - index: number; - select: (d: number) => void; - }; + | undefined + | { + list: MerchantContractChoice[]; + index: number; + select: (d: number) => void; + }; } export interface Ready extends BaseInfo { @@ -88,12 +90,12 @@ export namespace State { payHandler: ButtonHandler; effective: AmountJson; choices: - | undefined - | { - list: MerchantContractChoice[]; - index: number; - select: (d: number) => void; - }; + | undefined + | { + list: MerchantContractChoice[]; + index: number; + select: (d: number) => void; + }; } export interface Confirmed extends BaseInfo { diff --git a/packages/taler-wallet-webextension/src/cta/Payment/state.ts b/packages/taler-wallet-webextension/src/cta/Payment/state.ts @@ -172,14 +172,16 @@ export function useComponentStateFromTxId({ contractTerms.pay_deadline, ); - + const baseResult = { transactionId: payStatus.transactionId, receiver: contractTerms.merchant, summary: contractTerms.summary, merchant: contractTerms.merchant, - merchantBaseUrl: contractTerms.merchant_base_url, - orderId: contractTerms.order_id, + sharePay: { + merchantBaseUrl: contractTerms.merchant_base_url, + orderId: contractTerms.order_id, + }, error: undefined, expiration, minimum_age: contractTerms.minimum_age,