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 d2a345c commit b1f6f63
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ChangeLog
=========
2.2.4
-------------------
- 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.2.3
-------------------
- Enhanced the code base to support PHP build from version 5.6 to 8.x
Expand Down
2 changes: 1 addition & 1 deletion src/Hyperwallet/Hyperwallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ public function createPayPalAccount($userToken, PayPalAccount $payPalAccount) {
throw new HyperwalletArgumentException('transferMethodCurrency is required!');
}
if (empty($payPalAccount->getEmail()) and empty($payPalAccount->getAccountId()) ) {
throw new HyperwalletArgumentException('email/accountId is required!');
throw new HyperwalletArgumentException('email or accountId is required!');
}
$body = $this->client->doPost('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $payPalAccount, array());
return new PayPalAccount($body);
Expand Down
2 changes: 1 addition & 1 deletion tests/Hyperwallet/Tests/HyperwalletTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ public function testCreatePayPalAccount_noEmail() {
$client->createPayPalAccount('test-user-token', $payPalAccount);
$this->fail('HyperwalletArgumentException expected');
} catch (HyperwalletArgumentException $e) {
$this->assertEquals('email/accountId is required!', $e->getMessage());
$this->assertEquals('email or accountId is required!', $e->getMessage());
}
}

Expand Down

0 comments on commit b1f6f63

Please sign in to comment.