Skip to content

Commit

Permalink
DTPAYETWO-759- Updated error message when accountId or email is missi…
Browse files Browse the repository at this point in the history
…ng for paypal accounts
  • Loading branch information
akswaminathan-pp-dev committed Dec 1, 2022
1 parent 7d7bd2a commit 7a97915
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
Changelog
=========
2.1.1
-------------------
- Added field 'accountId' to PayPal.
- PayPal account creation allowed using field 'accountId' which accepts Email, Phone Number, PayPal PayerID.
- Venmo account creation allowed using field 'accountId' which accepts Email, Phone Number, Venmo Handle, Venmo External ID.

2.1.0
-------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Hyperwallet.js
Expand Up @@ -1034,7 +1034,7 @@ export default class Hyperwallet {
throw new Error("transferMethodCurrency is required");
}
if (!data.email && !data.accountId) {
throw new Error("email/accountId is required");
throw new Error("email or accountId is required");
}
this.client.doPost(`users/${encodeURIComponent(userToken)}/paypal-accounts`, data, {}, callback);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Hyperwallet.spec.js
Expand Up @@ -1996,7 +1996,7 @@ describe("Hyperwallet", () => {
expect(() => client.createPayPalAccount("test-user-token", {
transferMethodCountry: "test-transferMethodCountry",
transferMethodCurrency: "test-transferMethodCurrency",
}, callback)).to.throw("email/accountId is required");
}, callback)).to.throw("email or accountId is required");
});

/** @test {Hyperwallet#createPayPalAccount} */
Expand Down

0 comments on commit 7a97915

Please sign in to comment.