[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix payment transaction
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix payment transaction |
Date: |
Tue, 12 May 2020 12:34:33 +0200 |
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 ee7141e2 fix payment transaction
ee7141e2 is described below
commit ee7141e28b482c9655e0b78052ead0f2b5ed5d05
Author: Florian Dold <address@hidden>
AuthorDate: Tue May 12 16:04:28 2020 +0530
fix payment transaction
---
src/operations/pay.ts | 2 ++
src/operations/transactions.ts | 3 +--
src/operations/withdraw.ts | 1 -
src/types/dbTypes.ts | 4 +++-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index 30ccb56c..45caa958 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -434,6 +434,7 @@ async function recordConfirmPay(
mode: "pay",
order_id: d.contractData.orderId,
};
+ const payCostInfo = await getTotalPaymentCost(ws, coinSelection);
const t: PurchaseRecord = {
abortDone: false,
abortRequested: false,
@@ -442,6 +443,7 @@ async function recordConfirmPay(
lastSessionId: sessionId,
payCoinSelection: coinSelection,
payReq,
+ payCostInfo,
timestampAccept: getTimestampNow(),
timestampLastRefundStatus: undefined,
proposalId: proposal.proposalId,
diff --git a/src/operations/transactions.ts b/src/operations/transactions.ts
index e5c704b0..5e4de418 100644
--- a/src/operations/transactions.ts
+++ b/src/operations/transactions.ts
@@ -176,11 +176,10 @@ export async function getTransactions(
if (!proposal) {
return;
}
- const cost = await getTotalPaymentCost(ws, pr.payCoinSelection);
transactions.push({
type: TransactionType.Payment,
amountRaw: Amounts.stringify(pr.contractData.amount),
- amountEffective: Amounts.stringify(cost.totalCost),
+ amountEffective: Amounts.stringify(pr.payCostInfo.totalCost),
failed: false,
pending: !pr.timestampFirstSuccessfulPay,
timestamp: pr.timestampAccept,
diff --git a/src/operations/withdraw.ts b/src/operations/withdraw.ts
index e1c4ed57..977d998f 100644
--- a/src/operations/withdraw.ts
+++ b/src/operations/withdraw.ts
@@ -91,7 +91,6 @@ export function getWithdrawDenomList(
denoms.sort((d1, d2) => Amounts.cmp(d2.value, d1.value));
for (const d of denoms) {
- console.log("considering denom", d);
let count = 0;
const cost = Amounts.add(d.value, d.feeWithdraw).amount;
for (;;) {
diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts
index eae39fff..37a66251 100644
--- a/src/types/dbTypes.ts
+++ b/src/types/dbTypes.ts
@@ -43,7 +43,7 @@ import {
ReserveRecoupTransaction,
} from "./ReserveTransaction";
import { Timestamp, Duration, getTimestampNow } from "../util/time";
-import { PayCoinSelection } from "../operations/pay";
+import { PayCoinSelection, PayCostInfo } from "../operations/pay";
export enum ReserveRecordStatus {
/**
@@ -1226,6 +1226,8 @@ export interface PurchaseRecord {
payCoinSelection: PayCoinSelection;
+ payCostInfo: PayCostInfo;
+
/**
* Timestamp of the first time that sending a payment to the merchant
* for this purchase was successful.
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: fix payment transaction,
gnunet <=