Skip to content

Commit

Permalink
fix(payment): Set as paid if 2fa is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
d-beezee committed Apr 14, 2022
1 parent aec70c6 commit b491ada
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/tranferwise/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ class Transferwise {
transferId: string;
}): Promise<any> {
let twoFactorAuthHeader;
let response;
try {
await this.request(
response = await this.request(
"POST",
`/v3/profiles/${profileId}/transfers/${transferId}/payments`,
{ type: "BALANCE" }
Expand All @@ -216,7 +217,7 @@ class Transferwise {
}
twoFactorAuthHeader = res.response.headers["x-2fa-approval"];
}
if (!twoFactorAuthHeader) throw new Error("No 2FA header");
if (!twoFactorAuthHeader) return response;
const twoFactorAuthCode = await signRequest(twoFactorAuthHeader);

try {
Expand Down

0 comments on commit b491ada

Please sign in to comment.