H_wire -> h_wire
This commit is contained in:
parent
21100c451b
commit
baab5b9d20
@ -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),
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
@ -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" }],
|
||||
|
Loading…
Reference in New Issue
Block a user