[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: H_wire -> h_wire
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: H_wire -> h_wire |
Date: |
Fri, 17 Jan 2020 21:59:54 +0100 |
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 baab5b9d H_wire -> h_wire
baab5b9d is described below
commit baab5b9d206169897b4c257ff6decf2c0b9fe1f6
Author: Florian Dold <address@hidden>
AuthorDate: Fri Jan 17 21:59:47 2020 +0100
H_wire -> h_wire
---
src/headless/bank.ts | 16 ++++++++++------
src/operations/pay.ts | 2 +-
src/types/talerTypes.ts | 4 ++--
src/types/types-test.ts | 2 +-
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/headless/bank.ts b/src/headless/bank.ts
index 4a537928..b82951f4 100644
--- a/src/headless/bank.ts
+++ b/src/headless/bank.ts
@@ -41,6 +41,14 @@ function makeId(length: number): string {
return result;
}
+function makeAuth(username: string, password: string): string {
+ const auth = `${username}:${password}`;
+ const authEncoded: string = Buffer.from(auth).toString("base64");
+ return `Basic ${authEncoded}`;
+}
+
+
+
export class Bank {
constructor(private bankBaseUrl: string) {}
@@ -51,16 +59,13 @@ export class Bank {
const reqUrl = new URL("api/withdraw-headless-uri", this.bankBaseUrl).href;
- const auth = `${bankUser.username}:${bankUser.password}`;
- const authEncoded: string = Buffer.from(auth).toString("base64")
-
const resp = await Axios({
method: "post",
url: reqUrl,
data: body,
responseType: "json",
headers: {
- "Authorization": `Basic ${authEncoded}`,
+ "Authorization": makeAuth(bankUser.username, bankUser.password),
},
});
@@ -97,8 +102,7 @@ export class Bank {
data: body,
responseType: "json",
headers: {
- "X-Taler-Bank-Username": bankUser.username,
- "X-Taler-Bank-Password": bankUser.password,
+ "Authorization": makeAuth(bankUser.username, bankUser.password),
},
});
diff --git a/src/operations/pay.ts b/src/operations/pay.ts
index 43bdb2f4..098e6e18 100644
--- a/src/operations/pay.ts
+++ b/src/operations/pay.ts
@@ -721,7 +721,7 @@ async function processDownloadProposalImpl(
})),
timestamp: parsedContractTerms.timestamp,
wireMethod: parsedContractTerms.wire_method,
- wireInfoHash: parsedContractTerms.H_wire,
+ wireInfoHash: parsedContractTerms.h_wire,
maxDepositFee: Amounts.parseOrThrow(parsedContractTerms.max_fee),
},
contractTermsRaw: JSON.stringify(proposalResp.contract_terms),
diff --git a/src/types/talerTypes.ts b/src/types/talerTypes.ts
index f8e44900..b1a86413 100644
--- a/src/types/talerTypes.ts
+++ b/src/types/talerTypes.ts
@@ -279,7 +279,7 @@ export class ContractTerms {
/**
* Hash of the merchant's wire details.
*/
- H_wire: string;
+ h_wire: string;
/**
* Hash of the merchant's wire details.
@@ -791,7 +791,7 @@ export const codecForContractTerms = () =>
.property("order_id", codecForString)
.property("fulfillment_url", codecForString)
.property("merchant_base_url", codecForString)
- .property("H_wire", codecForString)
+ .property("h_wire", codecForString)
.property("auto_refund", makeCodecOptional(codecForDuration))
.property("wire_method", codecForString)
.property("summary", codecForString)
diff --git a/src/types/types-test.ts b/src/types/types-test.ts
index 77ab2c4e..67d379f7 100644
--- a/src/types/types-test.ts
+++ b/src/types/types-test.ts
@@ -131,7 +131,7 @@ test("amount stringification", t => {
test("contract terms validation", t => {
const c = {
nonce: "123123123",
- H_wire: "123",
+ h_wire: "123",
amount: "EUR:1.5",
auditors: [],
exchanges: [{ master_pub: "foo", url: "foo" }],
--
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: H_wire -> h_wire,
gnunet <=