fix 7741: add sessionid

This commit is contained in:
Sebastian 2023-07-03 14:01:23 -03:00
parent f407ab2023
commit d98f048fd6
No known key found for this signature in database
GPG Key ID: 173909D1A5F66069
5 changed files with 5 additions and 18 deletions

View File

@ -54,6 +54,7 @@ export interface DetailsMap {
}; };
[TalerErrorCode.WALLET_ORDER_ALREADY_PAID]: { [TalerErrorCode.WALLET_ORDER_ALREADY_PAID]: {
orderId: string; orderId: string;
fulfillmentUrl: string;
}; };
[TalerErrorCode.WALLET_CONTRACT_TERMS_MALFORMED]: empty; [TalerErrorCode.WALLET_CONTRACT_TERMS_MALFORMED]: empty;
[TalerErrorCode.WALLET_CONTRACT_TERMS_SIGNATURE_INVALID]: { [TalerErrorCode.WALLET_CONTRACT_TERMS_SIGNATURE_INVALID]: {

View File

@ -1617,6 +1617,7 @@ export async function processPurchasePay(
type: TaskRunResultType.Error, type: TaskRunResultType.Error,
errorDetail: makeErrorDetail(TalerErrorCode.WALLET_ORDER_ALREADY_PAID, { errorDetail: makeErrorDetail(TalerErrorCode.WALLET_ORDER_ALREADY_PAID, {
orderId: purchase.orderId, orderId: purchase.orderId,
fulfillmentUrl: download.contractData.fulfillmentUrl,
}), }),
}; };
} }
@ -2219,7 +2220,7 @@ export async function sharePayment(
return { return {
nonce: p.noncePriv, nonce: p.noncePriv,
session: p.lastSessionId, session: p.lastSessionId ?? p.downloadSessionId,
token: p.claimToken, token: p.claimToken,
}; };
}); });

View File

@ -43,6 +43,7 @@ export const Ready = tests.createExample(ReadyView, {
fraction: 0, fraction: 0,
}, },
summary: "some subject", summary: "some subject",
uri: "taler://pay/merchant.ar/123",
payStatus: { payStatus: {
status: PreparePayResultType.PaymentPossible, status: PreparePayResultType.PaymentPossible,
amountEffective: "ARS:1", amountEffective: "ARS:1",

View File

@ -14,14 +14,12 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { Fragment, h, VNode } from "preact"; import { Fragment, h, VNode } from "preact";
import { Amount } from "../../components/Amount.js"; import { Amount } from "../../components/Amount.js";
import { LogoHeader } from "../../components/LogoHeader.js";
import { Part } from "../../components/Part.js"; import { Part } from "../../components/Part.js";
import { PaymentButtons } from "../../components/PaymentButtons.js"; import { PaymentButtons } from "../../components/PaymentButtons.js";
import { SubTitle, WalletAction } from "../../components/styled/index.js";
import { Time } from "../../components/Time.js"; import { Time } from "../../components/Time.js";
import { useTranslationContext } from "@gnu-taler/web-util/browser";
import { import {
getAmountWithFee, getAmountWithFee,
InvoicePaymentDetails, InvoicePaymentDetails,

View File

@ -141,25 +141,11 @@ export function useComponentState({
} }
async function doPayment(): Promise<void> { async function doPayment(): Promise<void> {
// if (payStatus.status !== "payment-possible") {
// throw TalerError.fromUncheckedDetail({
// code: TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR,
// when: new Date().toISOString(),
// hint: `payment is not possible: ${payStatus.status}`,
// });
// }
const res = await api.wallet.call(WalletApiOperation.ConfirmPay, { const res = await api.wallet.call(WalletApiOperation.ConfirmPay, {
proposalId: payStatus.proposalId, proposalId: payStatus.proposalId,
}); });
// handle confirm pay // handle confirm pay
if (res.type !== ConfirmPayResultType.Done) { if (res.type !== ConfirmPayResultType.Done) {
// throw new BackgroundError("Could not confirm payment", res.lastError)
// // throw TalerError.fromUncheckedDetail({
// // code: TalerErrorCode.GENERIC_CLIENT_INTERNAL_ERROR,
// // when: new Date().toISOString(),
// // hint: `could not confirm payment`,
// // payResult: res,
// // });
onSuccess(res.transactionId); onSuccess(res.transactionId);
return; return;
} }