summaryrefslogtreecommitdiff
path: root/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-26 03:10:52 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-26 03:10:52 +0200
commit79a2eed5589468c2df3e4ee2d190d9fc43b80fe9 (patch)
treeb9250369bb2b54a2fb298f611ff7142a0c825999 /src/wallet.ts
parent9aab9fd6134351bba9445df2b24d3d2c6deedf0e (diff)
downloadwallet-core-79a2eed5589468c2df3e4ee2d190d9fc43b80fe9.tar.gz
wallet-core-79a2eed5589468c2df3e4ee2d190d9fc43b80fe9.tar.bz2
wallet-core-79a2eed5589468c2df3e4ee2d190d9fc43b80fe9.zip
remove dependency in taler-wallet-lib, implement pay signature check/storage
Diffstat (limited to 'src/wallet.ts')
-rw-r--r--src/wallet.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wallet.ts b/src/wallet.ts
index a809b94cc..51046159b 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -1787,7 +1787,7 @@ export class Wallet {
}
- async paymentSucceeded(contractHash: string): Promise<any> {
+ async paymentSucceeded(contractHash: string, merchantSig: string): Promise<any> {
const doPaymentSucceeded = async() => {
let t = await this.q().get<TransactionRecord>(Stores.transactions,
contractHash);
@@ -1795,6 +1795,13 @@ export class Wallet {
console.error("contract not found");
return;
}
+ let merchantPub = t.contract.merchant_pub;
+ let valid = this.cryptoApi.isValidPaymentSignature(merchantSig, contractHash, merchantPub);
+ if (!valid) {
+ console.error("merchant payment signature invalid");
+ // FIXME: properly display error
+ return;
+ }
t.finished = true;
let modifiedCoins: CoinRecord[] = [];
for (let pc of t.payReq.coins) {