Skip to content

Commit b1f6f63

Browse files
DTPAYETWO-759- Updated error message when accountId or email is missing for paypal accounts
1 parent d2a345c commit b1f6f63

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
ChangeLog
22
=========
3+
2.2.4
4+
-------------------
5+
- Added field 'accountId' to PayPal.
6+
- PayPal account creation allowed using field 'accountId' which accepts Email, Phone Number, PayPal PayerID.
7+
- Venmo account creation allowed using field 'accountId' which accepts Email, Phone Number, Venmo Handle, Venmo External ID.
8+
39
2.2.3
410
-------------------
511
- Enhanced the code base to support PHP build from version 5.6 to 8.x

src/Hyperwallet/Hyperwallet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ public function createPayPalAccount($userToken, PayPalAccount $payPalAccount) {
667667
throw new HyperwalletArgumentException('transferMethodCurrency is required!');
668668
}
669669
if (empty($payPalAccount->getEmail()) and empty($payPalAccount->getAccountId()) ) {
670-
throw new HyperwalletArgumentException('email/accountId is required!');
670+
throw new HyperwalletArgumentException('email or accountId is required!');
671671
}
672672
$body = $this->client->doPost('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $payPalAccount, array());
673673
return new PayPalAccount($body);

tests/Hyperwallet/Tests/HyperwalletTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ public function testCreatePayPalAccount_noEmail() {
12841284
$client->createPayPalAccount('test-user-token', $payPalAccount);
12851285
$this->fail('HyperwalletArgumentException expected');
12861286
} catch (HyperwalletArgumentException $e) {
1287-
$this->assertEquals('email/accountId is required!', $e->getMessage());
1287+
$this->assertEquals('email or accountId is required!', $e->getMessage());
12881288
}
12891289
}
12901290

0 commit comments

Comments
 (0)