cleanup / history
This commit is contained in:
parent
fb6508de9d
commit
6a9318c298
@ -592,6 +592,11 @@ async function processDownloadProposalImpl(
|
|||||||
if (p.proposalStatus !== ProposalStatus.DOWNLOADING) {
|
if (p.proposalStatus !== ProposalStatus.DOWNLOADING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
p.download = {
|
||||||
|
contractTerms: proposalResp.contract_terms,
|
||||||
|
merchantSig: proposalResp.sig,
|
||||||
|
contractTermsHash,
|
||||||
|
};
|
||||||
if (
|
if (
|
||||||
fulfillmentUrl.startsWith("http://") ||
|
fulfillmentUrl.startsWith("http://") ||
|
||||||
fulfillmentUrl.startsWith("https://")
|
fulfillmentUrl.startsWith("https://")
|
||||||
@ -608,11 +613,6 @@ async function processDownloadProposalImpl(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.download = {
|
|
||||||
contractTerms: proposalResp.contract_terms,
|
|
||||||
merchantSig: proposalResp.sig,
|
|
||||||
contractTermsHash,
|
|
||||||
};
|
|
||||||
p.proposalStatus = ProposalStatus.PROPOSED;
|
p.proposalStatus = ProposalStatus.PROPOSED;
|
||||||
await tx.put(Stores.proposals, p);
|
await tx.put(Stores.proposals, p);
|
||||||
},
|
},
|
||||||
@ -864,7 +864,16 @@ export async function preparePay(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uriResult.sessionId) {
|
if (uriResult.sessionId && purchase.lastSessionId !== uriResult.sessionId) {
|
||||||
|
console.log("automatically re-submitting payment with different session ID")
|
||||||
|
await ws.db.runWithWriteTransaction([Stores.purchases], async (tx) => {
|
||||||
|
const p = await tx.get(Stores.purchases, proposalId);
|
||||||
|
if (!p) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
p.lastSessionId = uriResult.sessionId;
|
||||||
|
await tx.put(Stores.purchases, p);
|
||||||
|
});
|
||||||
await submitPay(ws, proposalId);
|
await submitPay(ws, proposalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import { Timestamp, RefreshReason } from "./walletTypes";
|
|
||||||
import { ReserveTransaction } from "./ReserveTransaction";
|
|
||||||
import { WithdrawalSource } from "./dbTypes";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is part of GNU Taler
|
This file is part of GNU Taler
|
||||||
(C) 2019 GNUnet e.V.
|
(C) 2019 Taler Systems S.A.
|
||||||
|
|
||||||
GNU Taler is free software; you can redistribute it and/or modify it under the
|
GNU Taler is free software; you can redistribute it and/or modify it under the
|
||||||
terms of the GNU General Public License as published by the Free Software
|
terms of the GNU General Public License as published by the Free Software
|
||||||
@ -22,6 +18,11 @@ import { WithdrawalSource } from "./dbTypes";
|
|||||||
* Type and schema definitions for the wallet's history.
|
* Type and schema definitions for the wallet's history.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { Timestamp, RefreshReason } from "./walletTypes";
|
||||||
|
import { ReserveTransaction } from "./ReserveTransaction";
|
||||||
|
import { WithdrawalSource } from "./dbTypes";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type tags for the history event types.
|
* Type tags for the history event types.
|
||||||
*/
|
*/
|
||||||
|
@ -519,11 +519,6 @@ export class Wallet {
|
|||||||
return denoms;
|
return denoms;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getProposal(proposalId: string): Promise<ProposalRecord | undefined> {
|
|
||||||
const proposal = await this.db.get(Stores.proposals, proposalId);
|
|
||||||
return proposal;
|
|
||||||
}
|
|
||||||
|
|
||||||
async getExchanges(): Promise<ExchangeRecord[]> {
|
async getExchanges(): Promise<ExchangeRecord[]> {
|
||||||
return await this.db.iter(Stores.exchanges).toArray();
|
return await this.db.iter(Stores.exchanges).toArray();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user