diff --git a/src/Hyperwallet/Hyperwallet.php b/src/Hyperwallet/Hyperwallet.php index 341897c6..3e1ce4ae 100644 --- a/src/Hyperwallet/Hyperwallet.php +++ b/src/Hyperwallet/Hyperwallet.php @@ -13,20 +13,20 @@ use Hyperwallet\Model\IProgramAware; use Hyperwallet\Model\PaperCheck; use Hyperwallet\Model\PaperCheckStatusTransition; -use Hyperwallet\Model\PayPalAccountStatusTransition; -use Hyperwallet\Model\Transfer; -use Hyperwallet\Model\TransferRefund; -use Hyperwallet\Model\TransferStatusTransition; use Hyperwallet\Model\Payment; use Hyperwallet\Model\PaymentStatusTransition; use Hyperwallet\Model\PayPalAccount; +use Hyperwallet\Model\PayPalAccountStatusTransition; use Hyperwallet\Model\PrepaidCard; use Hyperwallet\Model\PrepaidCardStatusTransition; use Hyperwallet\Model\Program; use Hyperwallet\Model\ProgramAccount; use Hyperwallet\Model\Receipt; +use Hyperwallet\Model\Transfer; use Hyperwallet\Model\TransferMethod; use Hyperwallet\Model\TransferMethodConfiguration; +use Hyperwallet\Model\TransferRefund; +use Hyperwallet\Model\TransferStatusTransition; use Hyperwallet\Model\User; use Hyperwallet\Model\UserStatusTransition; use Hyperwallet\Model\VenmoAccount; @@ -90,7 +90,7 @@ public function __construct($username, $password, $programToken = null, $server */ public function createUser(User $user) { $this->addProgramToken($user); - $body = $this->client->doPost('/rest/v3/users', array(), $user, array()); + $body = $this->client->doPost('/rest/v4/users', array(), $user, array()); return new User($body); } @@ -107,7 +107,7 @@ public function getUser($userToken) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}', array('user-token' => $userToken), array()); + $body = $this->client->doGet('/rest/v4/users/{user-token}', array('user-token' => $userToken), array()); return new User($body); } @@ -124,7 +124,7 @@ public function updateUser(User $user) { if (!$user->getToken()) { throw new HyperwalletArgumentException('token is required!'); } - $body = $this->client->doPut('/rest/v3/users/{user-token}', array('user-token' => $user->getToken()), $user, array()); + $body = $this->client->doPut('/rest/v4/users/{user-token}', array('user-token' => $user->getToken()), $user, array()); return new User($body); } @@ -137,7 +137,7 @@ public function updateUser(User $user) { * @throws HyperwalletApiException */ public function listUsers($options = array()) { - $body = $this->client->doGet('/rest/v3/users', array(), $options); + $body = $this->client->doGet('/rest/v4/users', array(), $options); return new ListResponse($body, function ($entry) { return new User($entry); }); @@ -161,7 +161,7 @@ public function getUserStatusTransition($userToken, $statusTransitionToken) { throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'status-transition-token' => $statusTransitionToken ), array()); @@ -183,7 +183,7 @@ public function listUserStatusTransitions($userToken, array $options = array()) throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/status-transitions', array( 'user-token' => $userToken ), $options); return new ListResponse($body, function ($entry) { @@ -207,7 +207,7 @@ public function getAuthenticationToken($userToken) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/authentication-token', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/authentication-token', array( 'user-token' => $userToken, ), null, array()); return new AuthenticationToken($body); @@ -231,7 +231,7 @@ public function createPaperCheck($userToken, PaperCheck $paperCheck) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/paper-checks', + $body = $this->client->doPost('/rest/v4/users/{user-token}/paper-checks', array('user-token' => $userToken), $paperCheck, array()); return new PaperCheck($body); } @@ -253,7 +253,7 @@ public function getPaperCheck($userToken, $paperCheckToken) { if (empty($paperCheckToken)) { throw new HyperwalletArgumentException('paperCheckToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}', array( 'user-token' => $userToken, 'paper-check-token' => $paperCheckToken ), array()); @@ -289,7 +289,7 @@ public function listPaperChecks($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paper-checks', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new PaperCheck($entry); }); @@ -331,7 +331,7 @@ public function createPaperCheckStatusTransition($userToken, $paperCheckToken, P throw new HyperwalletArgumentException('paperCheckToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array( 'user-token' => $userToken, 'paper-check-token' => $paperCheckToken ), $transition, array()); @@ -360,7 +360,7 @@ public function getPaperCheckStatusTransition($userToken, $paperCheckToken, $sta throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'paper-check-token' => $paperCheckToken, 'status-transition-token' => $statusTransitionToken @@ -387,7 +387,7 @@ public function listPaperCheckStatusTransitions($userToken, $paperCheckToken, ar throw new HyperwalletArgumentException('paperCheckToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array( 'user-token' => $userToken, 'paper-check-token' => $paperCheckToken ), $options); @@ -419,7 +419,7 @@ public function createTransfer(Transfer $transfer) { if (empty($transfer->getClientTransferId())) { throw new HyperwalletArgumentException('clientTransferId is required!'); } - $body = $this->client->doPost('/rest/v3/transfers', array(), $transfer, array()); + $body = $this->client->doPost('/rest/v4/transfers', array(), $transfer, array()); return new Transfer($body); } @@ -433,7 +433,7 @@ public function createTransferRefund($transferToken, $transferRefund) { if (empty($transferRefund->getClientRefundId())) { throw new HyperwalletArgumentException('clientRefundId is required!'); } - $body = $this->client->doPost('/rest/v3/transfers/{transfer-token}/refunds', + $body = $this->client->doPost('/rest/v4/transfers/{transfer-token}/refunds', array('transfer-token' => $transferToken), $transferRefund, array()); return new TransferRefund($body); } @@ -451,7 +451,7 @@ public function getTransfer($transferToken) { if (empty($transferToken)) { throw new HyperwalletArgumentException('transferToken is required!'); } - $body = $this->client->doGet('/rest/v3/transfers/{transfer-token}', array('transfer-token' => $transferToken), + $body = $this->client->doGet('/rest/v4/transfers/{transfer-token}', array('transfer-token' => $transferToken), array()); return new Transfer($body); } @@ -463,7 +463,7 @@ public function getTransferRefund($transferToken, $refundToken) { if (empty($refundToken)) { throw new HyperwalletArgumentException('refundToken is required!'); } - $body = $this->client->doGet('/rest/v3/transfers/{transfer-token}/refunds/{refund-token}', array( + $body = $this->client->doGet('/rest/v4/transfers/{transfer-token}/refunds/{refund-token}', array( 'transfer-token' => $transferToken, 'refund-token' => $refundToken), array()); @@ -479,7 +479,7 @@ public function getTransferRefund($transferToken, $refundToken) { * @throws HyperwalletApiException */ public function listTransfers($options = array()) { - $body = $this->client->doGet('/rest/v3/transfers', array(), $options); + $body = $this->client->doGet('/rest/v4/transfers', array(), $options); return new ListResponse($body, function ($entry) { return new Transfer($entry); }); @@ -497,7 +497,7 @@ public function listTransferRefunds($transferToken, array $options = array()) { if (empty($transferToken)) { throw new HyperwalletArgumentException('transferToken is required!'); } - $body = $this->client->doGet('/rest/v3/transfers/{transfer-token}/refunds', array('transfer-token' => $transferToken), $options); + $body = $this->client->doGet('/rest/v4/transfers/{transfer-token}/refunds', array('transfer-token' => $transferToken), $options); return new ListResponse($body, function ($entry) { return new TransferRefund($entry); }); @@ -518,7 +518,7 @@ public function createTransferStatusTransition($transferToken, TransferStatusTra throw new HyperwalletArgumentException('transferToken is required!'); } - $body = $this->client->doPost('/rest/v3/transfers/{transfer-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/transfers/{transfer-token}/status-transitions', array( 'transfer-token' => $transferToken ), $transition, array()); return new TransferStatusTransition($body); @@ -551,7 +551,7 @@ public function createPayPalAccount($userToken, PayPalAccount $payPalAccount) { if (empty($payPalAccount->getEmail())) { throw new HyperwalletArgumentException('email is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $payPalAccount, array()); + $body = $this->client->doPost('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $payPalAccount, array()); return new PayPalAccount($body); } @@ -572,7 +572,7 @@ public function getPayPalAccount($userToken, $payPalAccountToken) { if (empty($payPalAccountToken)) { throw new HyperwalletArgumentException('payPalAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paypal-accounts/{paypal-account-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paypal-accounts/{paypal-account-token}', array( 'user-token' => $userToken, 'paypal-account-token' => $payPalAccountToken ), array()); @@ -607,7 +607,7 @@ public function listPayPalAccounts($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new PayPalAccount($entry); }); @@ -649,7 +649,7 @@ public function createPayPalAccountStatusTransition($userToken, $payPalAccountTo throw new HyperwalletArgumentException('payPalAccountToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array( 'user-token' => $userToken, 'payPal-account-token' => $payPalAccountToken ), $transition, array()); @@ -678,7 +678,7 @@ public function getPayPalAccountStatusTransition($userToken, $payPalAccountToken throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'payPal-account-token' => $payPalAccountToken, 'status-transition-token' => $statusTransitionToken @@ -705,7 +705,7 @@ public function listPayPalAccountStatusTransitions($userToken, $payPalAccountTok throw new HyperwalletArgumentException('payPalAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array( 'user-token' => $userToken, 'payPal-account-token' => $payPalAccountToken ), $options); @@ -732,7 +732,7 @@ public function createPrepaidCard($userToken, PrepaidCard $prepaidCard) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => $userToken), $prepaidCard, array()); + $body = $this->client->doPost('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => $userToken), $prepaidCard, array()); return new PrepaidCard($body); } @@ -753,7 +753,7 @@ public function getPrepaidCard($userToken, $prepaidCardToken) { if (empty($prepaidCardToken)) { throw new HyperwalletArgumentException('prepaidCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken ), array()); @@ -789,7 +789,7 @@ public function listPrepaidCards($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new PrepaidCard($entry); }); @@ -916,7 +916,7 @@ public function createPrepaidCardStatusTransition($userToken, $prepaidCardToken, throw new HyperwalletArgumentException('prepaidCardToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken ), $transition, array()); @@ -945,7 +945,7 @@ public function getPrepaidCardStatusTransition($userToken, $prepaidCardToken, $s throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken, 'status-transition-token' => $statusTransitionToken @@ -972,7 +972,7 @@ public function listPrepaidCardStatusTransitions($userToken, $prepaidCardToken, throw new HyperwalletArgumentException('prepaidCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken ), $options); @@ -999,7 +999,7 @@ public function createBankAccount($userToken, BankAccount $bankAccount) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => $userToken), $bankAccount, array()); + $body = $this->client->doPost('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => $userToken), $bankAccount, array()); return new BankAccount($body); } @@ -1020,7 +1020,7 @@ public function getBankAccount($userToken, $bankAccountToken) { if (empty($bankAccountToken)) { throw new HyperwalletArgumentException('bankAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}', array( 'user-token' => $userToken, 'bank-account-token' => $bankAccountToken ), array()); @@ -1056,7 +1056,7 @@ public function listBankAccounts($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new BankAccount($entry); }); @@ -1098,7 +1098,7 @@ public function createBankAccountStatusTransition($userToken, $bankAccountToken, throw new HyperwalletArgumentException('bankAccountToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array( 'user-token' => $userToken, 'bank-account-token' => $bankAccountToken ), $transition, array()); @@ -1127,7 +1127,7 @@ public function getBankAccountStatusTransition($userToken, $bankAccountToken, $s throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'bank-account-token' => $bankAccountToken, 'status-transition-token' => $statusTransitionToken @@ -1154,7 +1154,7 @@ public function listBankAccountStatusTransitions($userToken, $bankAccountToken, throw new HyperwalletArgumentException('bankAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array( 'user-token' => $userToken, 'bank-account-token' => $bankAccountToken ), $options); @@ -1181,7 +1181,7 @@ public function createBankCard($userToken, BankCard $bankCard) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/bank-cards', array('user-token' => $userToken), $bankCard, array()); + $body = $this->client->doPost('/rest/v4/users/{user-token}/bank-cards', array('user-token' => $userToken), $bankCard, array()); return new BankCard($body); } @@ -1202,7 +1202,7 @@ public function getBankCard($userToken, $bankCardToken) { if (empty($bankCardToken)) { throw new HyperwalletArgumentException('bankCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}', array( 'user-token' => $userToken, 'bank-card-token' => $bankCardToken ), array()); @@ -1239,7 +1239,7 @@ public function listBankCards($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-cards', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new BankCard($entry); }); @@ -1279,7 +1279,7 @@ public function createBankCardStatusTransition($userToken, $bankCardToken, BankC throw new HyperwalletArgumentException('bankCardToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array( 'user-token' => $userToken, 'bank-card-token' => $bankCardToken ), $transition, array()); @@ -1308,7 +1308,7 @@ public function getBankCardStatusTransition($userToken, $bankCardToken, $statusT throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'bank-card-token' => $bankCardToken, 'status-transition-token' => $statusTransitionToken @@ -1335,7 +1335,7 @@ public function listBankCardStatusTransitions($userToken, $bankCardToken, array throw new HyperwalletArgumentException('bankCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array( 'user-token' => $userToken, 'bank-card-token' => $bankCardToken ), $options); @@ -1366,7 +1366,7 @@ public function createTransferMethod($userToken, $jsonCacheToken, TransferMethod if (empty($jsonCacheToken)) { throw new HyperwalletArgumentException('jsonCacheToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => $userToken), $transferMethod, array(), array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => $userToken), $transferMethod, array(), array( 'Json-Cache-Token' => $jsonCacheToken )); if ($body['type'] === PrepaidCard::TYPE_PREPAID_CARD) { @@ -1393,7 +1393,7 @@ public function listBalancesForUser($userToken, $options = array()) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/balances', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new Balance($entry); }); @@ -1417,7 +1417,7 @@ public function listBalancesForPrepaidCard($userToken, $prepaidCardToken, $optio throw new HyperwalletArgumentException('prepaidCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken ), $options); @@ -1444,7 +1444,7 @@ public function listBalancesForAccount($programToken, $accountToken, $options = throw new HyperwalletArgumentException('accountToken is required!'); } - $body = $this->client->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/balances', array( + $body = $this->client->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array( 'program-token' => $programToken, 'account-token' => $accountToken ), $options); @@ -1467,7 +1467,7 @@ public function listBalancesForAccount($programToken, $accountToken, $options = */ public function createPayment(Payment $payment) { $this->addProgramToken($payment); - $body = $this->client->doPost('/rest/v3/payments', array(), $payment, array()); + $body = $this->client->doPost('/rest/v4/payments', array(), $payment, array()); return new Payment($body); } @@ -1484,7 +1484,7 @@ public function getPayment($paymentToken) { if (empty($paymentToken)) { throw new HyperwalletArgumentException('paymentToken is required!'); } - $body = $this->client->doGet('/rest/v3/payments/{payment-token}', array('payment-token' => $paymentToken), array()); + $body = $this->client->doGet('/rest/v4/payments/{payment-token}', array('payment-token' => $paymentToken), array()); return new Payment($body); } @@ -1497,7 +1497,7 @@ public function getPayment($paymentToken) { * @throws HyperwalletApiException */ public function listPayments($options = array()) { - $body = $this->client->doGet('/rest/v3/payments', array(), $options); + $body = $this->client->doGet('/rest/v4/payments', array(), $options); return new ListResponse($body, function ($entry) { return new Payment($entry); }); @@ -1518,7 +1518,7 @@ public function createPaymentStatusTransition($paymentToken, PaymentStatusTransi throw new HyperwalletArgumentException('paymentToken is required!'); } - $body = $this->client->doPost('/rest/v3/payments/{payment-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/payments/{payment-token}/status-transitions', array( 'payment-token' => $paymentToken ), $transition, array()); return new PaymentStatusTransition($body); @@ -1542,7 +1542,7 @@ public function getPaymentStatusTransition($paymentToken, $statusTransitionToken throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/payments/{payment-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/payments/{payment-token}/status-transitions/{status-transition-token}', array( 'payment-token' => $paymentToken, 'status-transition-token' => $statusTransitionToken ), array()); @@ -1564,7 +1564,7 @@ public function listPaymentStatusTransitions($paymentToken, array $options = arr throw new HyperwalletArgumentException('paymentToken is required!'); } - $body = $this->client->doGet('/rest/v3/payments/{payment-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/payments/{payment-token}/status-transitions', array( 'payment-token' => $paymentToken ), $options); return new ListResponse($body, function ($entry) { @@ -1589,7 +1589,7 @@ public function getProgram($programToken) { if (empty($programToken)) { throw new HyperwalletArgumentException('programToken is required!'); } - $body = $this->client->doGet('/rest/v3/programs/{program-token}', array('program-token' => $programToken), array()); + $body = $this->client->doGet('/rest/v4/programs/{program-token}', array('program-token' => $programToken), array()); return new Program($body); } @@ -1614,7 +1614,7 @@ public function getProgramAccount($programToken, $accountToken) { if (empty($accountToken)) { throw new HyperwalletArgumentException('accountToken is required!'); } - $body = $this->client->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}', array( + $body = $this->client->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}', array( 'program-token' => $programToken, 'account-token' => $accountToken ), array()); @@ -1655,7 +1655,7 @@ public function getTransferMethodConfiguration($userToken, $country, $currency, throw new HyperwalletArgumentException('profileType is required!'); } - $body = $this->client->doGet('/rest/v3/transfer-method-configurations', array(), array( + $body = $this->client->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => $userToken, 'country' => $country, 'currency' => $currency, @@ -1680,7 +1680,7 @@ public function listTransferMethodConfigurations($userToken, $options = array()) throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/transfer-method-configurations', array(), array_merge(array( + $body = $this->client->doGet('/rest/v4/transfer-method-configurations', array(), array_merge(array( 'userToken' => $userToken, ), $options)); return new ListResponse($body, function ($entity) { @@ -1711,7 +1711,7 @@ public function listReceiptsForProgramAccount($programToken, $accountToken, $opt throw new HyperwalletArgumentException('accountToken is required!'); } - $body = $this->client->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/receipts', array( + $body = $this->client->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array( 'program-token' => $programToken, 'account-token' => $accountToken ), $options); @@ -1735,7 +1735,7 @@ public function listReceiptsForUser($userToken, $options = array()) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/receipts', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/receipts', array( 'user-token' => $userToken ), $options); return new ListResponse($body, function ($entry) { @@ -1762,7 +1762,7 @@ public function listReceiptsForPrepaidCard($userToken, $prepaidCardToken, $optio throw new HyperwalletArgumentException('prepaidCardToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array( 'user-token' => $userToken, 'prepaid-card-token' => $prepaidCardToken ), $options); @@ -1788,7 +1788,7 @@ public function getWebhookNotification($webhookNotificationToken) { if (empty($webhookNotificationToken)) { throw new HyperwalletArgumentException('webhookNotificationToken is required!'); } - $body = $this->client->doGet('/rest/v3/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => $webhookNotificationToken), array()); + $body = $this->client->doGet('/rest/v4/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => $webhookNotificationToken), array()); return new WebhookNotification($body); } @@ -1801,7 +1801,7 @@ public function getWebhookNotification($webhookNotificationToken) { * @throws HyperwalletApiException */ public function listWebhookNotifications($options = array()) { - $body = $this->client->doGet('/rest/v3/webhook-notifications', array(), $options); + $body = $this->client->doGet('/rest/v4/webhook-notifications', array(), $options); return new ListResponse($body, function ($entry) { return new WebhookNotification($entry); }); @@ -1845,7 +1845,7 @@ private function updateTransferMethod($userToken, $transferMethod, $transferMeth throw new HyperwalletArgumentException('transfer method token is required!'); } - return $this->client->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array( + return $this->client->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array( 'user-token' => $userToken, 'transfer-method-token' => $transferMethod->getToken(), 'transfer-method-name' => $transferMethodName, @@ -1886,7 +1886,7 @@ public function uploadDocumentsForUser($userToken, $options) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->putMultipartData('/rest/v3/users/{user-token}', array('user-token' => $userToken), $options); + $body = $this->client->putMultipartData('/rest/v4/users/{user-token}', array('user-token' => $userToken), $options); return new User($body); } @@ -1917,7 +1917,7 @@ public function createVenmoAccount($userToken, VenmoAccount $venmoAccount) { if (empty($venmoAccount->getAccountId())) { throw new HyperwalletArgumentException('Venmo account is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => $userToken), $venmoAccount, array()); + $body = $this->client->doPost('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => $userToken), $venmoAccount, array()); return new VenmoAccount($body); } @@ -1938,7 +1938,7 @@ public function getVenmoAccount($userToken, $venmoAccountToken) { if (empty($venmoAccountToken)) { throw new HyperwalletArgumentException('venmoAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}', array( 'user-token' => $userToken, 'venmo-account-token' => $venmoAccountToken ), array()); @@ -1973,7 +1973,7 @@ public function listVenmoAccounts($userToken, $options = array()) { if (empty($userToken)) { throw new HyperwalletArgumentException('userToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => $userToken), $options); + $body = $this->client->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => $userToken), $options); return new ListResponse($body, function ($entry) { return new VenmoAccount($entry); }); @@ -2015,7 +2015,7 @@ public function createVenmoAccountStatusTransition($userToken, $venmoAccountToke throw new HyperwalletArgumentException('venmoAccountToken is required!'); } - $body = $this->client->doPost('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array( + $body = $this->client->doPost('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array( 'user-token' => $userToken, 'venmo-account-token' => $venmoAccountToken ), $transition, array()); @@ -2044,7 +2044,7 @@ public function getVenmoAccountStatusTransition($userToken, $venmoAccountToken, throw new HyperwalletArgumentException('statusTransitionToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array( 'user-token' => $userToken, 'venmo-account-token' => $venmoAccountToken, 'status-transition-token' => $statusTransitionToken @@ -2071,7 +2071,7 @@ public function listVenmoAccountStatusTransitions($userToken, $venmoAccountToken throw new HyperwalletArgumentException('venmoAccountToken is required!'); } - $body = $this->client->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array( + $body = $this->client->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array( 'user-token' => $userToken, 'venmo-account-token' => $venmoAccountToken ), $options); diff --git a/src/Hyperwallet/Model/AuthenticationToken.php b/src/Hyperwallet/Model/AuthenticationToken.php index 9fa4899c..a70bab06 100644 --- a/src/Hyperwallet/Model/AuthenticationToken.php +++ b/src/Hyperwallet/Model/AuthenticationToken.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Authentication Token + * Represents a V4 Authentication Token * * @property string $value The client token value @@ -39,4 +39,4 @@ public function getValue() { return $this->value; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/Balance.php b/src/Hyperwallet/Model/Balance.php index 9cb907f9..eb1e18bc 100644 --- a/src/Hyperwallet/Model/Balance.php +++ b/src/Hyperwallet/Model/Balance.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Balance + * Represents a V4 Balance * * @property string $currency The currency * @property string $amount The amount @@ -13,7 +13,7 @@ class Balance extends BaseModel { /** * @internal - * + * * Read only fields * * @var string[] diff --git a/src/Hyperwallet/Model/BankAccount.php b/src/Hyperwallet/Model/BankAccount.php index 5d90e7ef..60b49ec5 100644 --- a/src/Hyperwallet/Model/BankAccount.php +++ b/src/Hyperwallet/Model/BankAccount.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Bank Account + * Represents a V4 Bank Account * * @property string $token The bank account token * @property string $type The transfer method type diff --git a/src/Hyperwallet/Model/BankAccountStatusTransition.php b/src/Hyperwallet/Model/BankAccountStatusTransition.php index cd5b746c..aef0ed01 100644 --- a/src/Hyperwallet/Model/BankAccountStatusTransition.php +++ b/src/Hyperwallet/Model/BankAccountStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Bank Account Status Transition + * Represents a V4 Bank Account Status Transition * * @package Hyperwallet\Model */ @@ -19,4 +19,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/BankCard.php b/src/Hyperwallet/Model/BankCard.php index 143023be..7cfff2b1 100644 --- a/src/Hyperwallet/Model/BankCard.php +++ b/src/Hyperwallet/Model/BankCard.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Bank Card + * Represents a V4 Bank Card * * @property string $token The bank card token * @property string $type The transfer method type @@ -233,4 +233,4 @@ public function setDateOfExpiry(\DateTime $dateOfExpiry = null) { return $this; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/BankCardStatusTransition.php b/src/Hyperwallet/Model/BankCardStatusTransition.php index 0d56cb65..8e5ab3fd 100644 --- a/src/Hyperwallet/Model/BankCardStatusTransition.php +++ b/src/Hyperwallet/Model/BankCardStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Bank Card Status Transition + * Represents a V4 Bank Card Status Transition * * @package Hyperwallet\Model */ @@ -18,4 +18,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/Error.php b/src/Hyperwallet/Model/Error.php index 6837b0e4..8ea23705 100644 --- a/src/Hyperwallet/Model/Error.php +++ b/src/Hyperwallet/Model/Error.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Error + * Represents a V4 Error * * @package Hyperwallet\Model */ @@ -89,4 +89,4 @@ public function getCode() { public function getRelatedResources() { return $this->relatedResources; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/PaperCheck.php b/src/Hyperwallet/Model/PaperCheck.php index d6319a61..12e51d41 100644 --- a/src/Hyperwallet/Model/PaperCheck.php +++ b/src/Hyperwallet/Model/PaperCheck.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Paper Check + * Represents a V4 Paper Check * * @property string $token The paper check token * @property string $status The paper check status @@ -10,42 +10,42 @@ * @property string $type The transfer method type * @property string $transferMethodCountry The transfer method country * @property string $transferMethodCurrency The transfer method currency - * @property string $addressLine1 The address line #1 + * @property string $addressLine1 The address line #1 * @property string $addressLine2 The address line #2 * @property string $businessContactRole The business contact role * @property string $businessName The business name * @property string $businessOperatingName The business operating name * @property string $businessRegistrationCountry The business registration country - * @property string $businessRegistrationId The business registration id - * @property string $businessRegistrationStateProvince The business registration state province - * @property string $businessType The business type - * @property string $city The city + * @property string $businessRegistrationId The business registration id + * @property string $businessRegistrationStateProvince The business registration state province + * @property string $businessType The business type + * @property string $city The city * @property string $country The country - * @property string $countryOfBirth The country of birth - * @property string $countryOfNationality The country of nationality - * @property \DateTime $dateOfBirth The date of birth - * @property string $driversLicenseId The drivers license id - * @property string $employerId The employer id - * @property string $firstName The first name - * @property string $gender The gender + * @property string $countryOfBirth The country of birth + * @property string $countryOfNationality The country of nationality + * @property \DateTime $dateOfBirth The date of birth + * @property string $driversLicenseId The drivers license id + * @property string $employerId The employer id + * @property string $firstName The first name + * @property string $gender The gender * @property string $governmentId The government id - * @property string $governmentIdType The government id type - * @property string $isDefaultTransferMethod The is default transfer method - * @property string $lastName The last name - * @property string $middleName The middle name - * @property string $mobileNumber The mobile number - * @property string $passportId The passport id - * @property string $phoneNumber The phone number - * @property string $postalCode The postal code - * @property string $profileType The profile type - * @property string $shippingMethod The shipping method + * @property string $governmentIdType The government id type + * @property string $isDefaultTransferMethod The is default transfer method + * @property string $lastName The last name + * @property string $middleName The middle name + * @property string $mobileNumber The mobile number + * @property string $passportId The passport id + * @property string $phoneNumber The phone number + * @property string $postalCode The postal code + * @property string $profileType The profile type + * @property string $shippingMethod The shipping method * @property string $stateProvince The state province * * @package Hyperwallet\Model */ class PaperCheck extends BaseModel { - + /** * @internal * @@ -56,7 +56,7 @@ class PaperCheck extends BaseModel { private static $READ_ONLY_FIELDS = array('phoneNumber', 'passportId', 'mobileNumber', 'middleName', 'lastName', 'governmentIdType', 'governmentId', 'gender', 'firstName', 'employerId', 'driversLicenseId', 'dateOfBirth', 'countryOfNationality', 'countryOfBirth', 'businessType', 'businessRegistrationStateProvince', 'businessRegistrationId', 'businessRegistrationCountry', 'businessName', 'businessOperatingName', 'businessContactRole', 'createdOn', 'status', 'token'); const TYPE_PAPER_CHECK = 'PAPER_CHECK'; - + const STATUS_ACTIVATED = 'ACTIVATED'; const STATUS_VERIFIED = 'VERIFIED'; const STATUS_INVALID = 'INVALID'; @@ -65,22 +65,22 @@ class PaperCheck extends BaseModel { const BUSINESS_CONTACT_ROLE_DIRECTOR = 'DIRECTOR'; const BUSINESS_CONTACT_ROLE_OWNER = 'OWNER'; const BUSINESS_CONTACT_ROLE_OTHER = 'OTHER'; - + const BUSINESS_TYPE_CORPORATION = 'CORPORATION'; const BUSINESS_TYPE_PARTNERSHIP = 'PARTNERSHIP'; - + const GENDER_MALE = 'MALE'; const GENDER_FEMALE = 'FEMALE'; - + const GOVERNMENT_ID_TYPE_PASSPORT = 'PASSPORT'; const GOVERNMENT_ID_TYPE_NATIONAL_ID_CARD = 'NATIONAL_ID_CARD'; - + const PROFILE_TYPE_INDIVIDUAL = 'INDIVIDUAL'; const PROFILE_TYPE_BUSINESS = 'BUSINESS'; - + const SHIPPING_METHOD_STANDARD = 'STANDARD'; const SHIPPING_METHOD_EXPEDITED = 'EXPEDITED'; - + /** * Creates a instance of PaperCheck * @@ -89,9 +89,9 @@ class PaperCheck extends BaseModel { public function __construct(array $properties = array()) { parent::__construct(self::$READ_ONLY_FIELDS, $properties); } - + /** - * Get the paper check token + * Get the paper check token * * @return string */ @@ -109,9 +109,9 @@ public function setToken($token) { $this->token = $token; return $this; } - + /** - * Get the paper check status + * Get the paper check status * * @return string */ @@ -120,7 +120,7 @@ public function getStatus() { } /** - * Get the paper check creation date + * Get the paper check creation date * * @return \DateTime */ @@ -136,7 +136,7 @@ public function getCreatedOn() { public function getType() { return $this->type; } - + /** * Set the transfer method type * @@ -149,14 +149,14 @@ public function setType($type) { } /** - * Get the transfer method country + * Get the transfer method country * * @return string */ public function getTransferMethodCountry() { return $this->transferMethodCountry; } - + /** * Set the transfer method country * @@ -169,14 +169,14 @@ public function setTransferMethodCountry($transferMethodCountry) { } /** - * Get the transfer method currency + * Get the transfer method currency * * @return string */ public function getTransferMethodCurrency() { return $this->transferMethodCurrency; } - + /** * Set the transfer method currency * @@ -189,14 +189,14 @@ public function setTransferMethodCurrency($transferMethodCurrency) { } /** - * Get the address line #1 + * Get the address line #1 * * @return string */ public function getAddressLine1() { return $this->addressLine1; } - + /** * Set the address line #1 * @@ -209,14 +209,14 @@ public function setAddressLine1($addressLine1) { } /** - * Get the address line #2 + * Get the address line #2 * * @return string */ public function getAddressLine2() { return $this->addressLine2; } - + /** * Set the address line #2 * @@ -229,7 +229,7 @@ public function setAddressLine2($addressLine2) { } /** - * Get the business contact role + * Get the business contact role * * @return string */ @@ -238,7 +238,7 @@ public function getBusinessContactRole() { } /** - * Get the business name + * Get the business name * * @return string */ @@ -257,7 +257,7 @@ public function getBusinessOperatingName() } /** - * Get the business registration country + * Get the business registration country * * @return string */ @@ -266,7 +266,7 @@ public function getBusinessRegistrationCountry() { } /** - * Get the business registration id + * Get the business registration id * * @return string */ @@ -275,7 +275,7 @@ public function getBusinessRegistrationId() { } /** - * Get the business registration state province + * Get the business registration state province * * @return string */ @@ -284,7 +284,7 @@ public function getBusinessRegistrationStateProvince() { } /** - * Get the business type + * Get the business type * * @return string */ @@ -293,14 +293,14 @@ public function getBusinessType() { } /** - * Get the city + * Get the city * * @return string */ public function getCity() { return $this->city; } - + /** * Set the city * @@ -313,14 +313,14 @@ public function setCity($city) { } /** - * Get the country + * Get the country * * @return string */ public function getCountry() { return $this->country; } - + /** * Set the country * @@ -333,7 +333,7 @@ public function setCountry($country) { } /** - * Get the country of birth + * Get the country of birth * * @return string */ @@ -342,7 +342,7 @@ public function getCountryOfBirth() { } /** - * Get the country of nationality + * Get the country of nationality * * @return string */ @@ -351,7 +351,7 @@ public function getCountryOfNationality() { } /** - * Get the date of birth + * Get the date of birth * * @return \DateTime */ @@ -360,7 +360,7 @@ public function getDateOfBirth() { } /** - * Get the drivers license id + * Get the drivers license id * * @return string */ @@ -369,7 +369,7 @@ public function getDriversLicenseId() { } /** - * Get the employer id + * Get the employer id * * @return string */ @@ -378,7 +378,7 @@ public function getEmployerId() { } /** - * Get the first name + * Get the first name * * @return string */ @@ -387,7 +387,7 @@ public function getFirstName() { } /** - * Get the gender + * Get the gender * * @return string */ @@ -396,7 +396,7 @@ public function getGender() { } /** - * Get the government id + * Get the government id * * @return string */ @@ -405,7 +405,7 @@ public function getGovernmentId() { } /** - * Get the government id type + * Get the government id type * * @return string */ @@ -414,14 +414,14 @@ public function getGovernmentIdType() { } /** - * Get the is default transfer method + * Get the is default transfer method * * @return string */ public function getIsDefaultTransferMethod() { return $this->isDefaultTransferMethod; } - + /** * Set the is default transfer method * @@ -434,7 +434,7 @@ public function setIsDefaultTransferMethod($isDefaultTransferMethod) { } /** - * Get the last name + * Get the last name * * @return string */ @@ -443,7 +443,7 @@ public function getLastName() { } /** - * Get the middle name + * Get the middle name * * @return string */ @@ -452,7 +452,7 @@ public function getMiddleName() { } /** - * Get the mobile number + * Get the mobile number * * @return string */ @@ -461,7 +461,7 @@ public function getMobileNumber() { } /** - * Get the passport id + * Get the passport id * * @return string */ @@ -470,7 +470,7 @@ public function getPassportId() { } /** - * Get the phone number + * Get the phone number * * @return string */ @@ -479,7 +479,7 @@ public function getPhoneNumber() { } /** - * Get the postal code + * Get the postal code * * @return string */ @@ -499,7 +499,7 @@ public function setPostalCode($postalCode) { } /** - * Get the profile type + * Get the profile type * * @return string */ @@ -517,16 +517,16 @@ public function setProfileType($profileType) { $this->profileType = $profileType; return $this; } - + /** - * Get the shipping method + * Get the shipping method * * @return string */ public function getShippingMethod() { return $this->shippingMethod; } - + /** * Set the shipping method * @@ -539,14 +539,14 @@ public function setShippingMethod($shippingMethod) { } /** - * Get the state province + * Get the state province * * @return string */ public function getStateProvince() { return $this->stateProvince; } - + /** * Set the state province * @@ -558,4 +558,4 @@ public function setStateProvince($stateProvince) { return $this; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/PaperCheckStatusTransition.php b/src/Hyperwallet/Model/PaperCheckStatusTransition.php index 9aaae4c8..1c8b2186 100644 --- a/src/Hyperwallet/Model/PaperCheckStatusTransition.php +++ b/src/Hyperwallet/Model/PaperCheckStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Paper Check Status Transition + * Represents a V4 Paper Check Status Transition * * @package Hyperwallet\Model */ @@ -19,4 +19,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/PayPalAccount.php b/src/Hyperwallet/Model/PayPalAccount.php index 4b9fd0ac..958d7003 100644 --- a/src/Hyperwallet/Model/PayPalAccount.php +++ b/src/Hyperwallet/Model/PayPalAccount.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 PayPal Account + * Represents a V4 PayPal Account * * @property string $token The PayPal account token * @property string $status The PayPal account status @@ -174,4 +174,4 @@ public function setEmail($email) { $this->email = $email; return $this; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/PayPalAccountStatusTransition.php b/src/Hyperwallet/Model/PayPalAccountStatusTransition.php index b44bdd8d..0c281b10 100644 --- a/src/Hyperwallet/Model/PayPalAccountStatusTransition.php +++ b/src/Hyperwallet/Model/PayPalAccountStatusTransition.php @@ -3,7 +3,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 PayPal Account Status Transition + * Represents a V4 PayPal Account Status Transition * * @package Hyperwallet\Model */ diff --git a/src/Hyperwallet/Model/Payment.php b/src/Hyperwallet/Model/Payment.php index 7662de4a..0a6af216 100644 --- a/src/Hyperwallet/Model/Payment.php +++ b/src/Hyperwallet/Model/Payment.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Payment + * Represents a V4 Payment * * @property string $token The payment token * @property \DateTime $createdOn The payment creation date @@ -240,7 +240,7 @@ public function getProgramToken() { /** * Set the payment program token - * + * * @param string $programToken * @return Payment */ diff --git a/src/Hyperwallet/Model/PaymentStatusTransition.php b/src/Hyperwallet/Model/PaymentStatusTransition.php index 4cd3fa68..80f226ac 100644 --- a/src/Hyperwallet/Model/PaymentStatusTransition.php +++ b/src/Hyperwallet/Model/PaymentStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Payment Status Transition + * Represents a V4 Payment Status Transition * * @package Hyperwallet\Model */ @@ -19,4 +19,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/PrepaidCard.php b/src/Hyperwallet/Model/PrepaidCard.php index 6d6d5eae..123dad94 100644 --- a/src/Hyperwallet/Model/PrepaidCard.php +++ b/src/Hyperwallet/Model/PrepaidCard.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Prepaid Card + * Represents a V4 Prepaid Card * * @property string $token The prepaid card token * @property string $type The transfer method type @@ -186,7 +186,7 @@ public function getCardBrand() { /** * Get the prepaid card expiry date - * + * * @return \DateTime */ public function getDateOfExpiry() { diff --git a/src/Hyperwallet/Model/PrepaidCardStatusTransition.php b/src/Hyperwallet/Model/PrepaidCardStatusTransition.php index 532f9a32..b9e52507 100644 --- a/src/Hyperwallet/Model/PrepaidCardStatusTransition.php +++ b/src/Hyperwallet/Model/PrepaidCardStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Prepaid Card Status Transition + * Represents a V4 Prepaid Card Status Transition * * @package Hyperwallet\Model */ @@ -24,4 +24,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/Program.php b/src/Hyperwallet/Model/Program.php index 19b4e24f..7acd664c 100644 --- a/src/Hyperwallet/Model/Program.php +++ b/src/Hyperwallet/Model/Program.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Program + * Represents a V4 Program * * @property string $token The program token * @property \DateTime $createdOn The program creation date @@ -60,7 +60,7 @@ public function getName() { /** * Get the parent program token - * + * * @return string */ public function getParentToken() { diff --git a/src/Hyperwallet/Model/ProgramAccount.php b/src/Hyperwallet/Model/ProgramAccount.php index db070a9e..5b91782c 100644 --- a/src/Hyperwallet/Model/ProgramAccount.php +++ b/src/Hyperwallet/Model/ProgramAccount.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Program Account + * Represents a V4 Program Account * * @property string $token The program account token * @property string $type The program account type @@ -67,7 +67,7 @@ public function getCreatedOn() { /** * Get the program account email - * + * * @return string */ public function getEmail() { diff --git a/src/Hyperwallet/Model/Receipt.php b/src/Hyperwallet/Model/Receipt.php index 91d256df..d0f79470 100644 --- a/src/Hyperwallet/Model/Receipt.php +++ b/src/Hyperwallet/Model/Receipt.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Receipt + * Represents a V4 Receipt * * @property string $journalId The journal id * @property string $type The transaction type diff --git a/src/Hyperwallet/Model/StatusTransition.php b/src/Hyperwallet/Model/StatusTransition.php index 3688eb2f..f2fa3682 100644 --- a/src/Hyperwallet/Model/StatusTransition.php +++ b/src/Hyperwallet/Model/StatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Status Transition + * Represents a V4 Status Transition * * @property string $token The status transition token * @property \DateTime $createdOn The status transition creation date @@ -113,7 +113,7 @@ public function getNotes() { /** * Set the status transition notes - * + * * @param string $notes * @return StatusTransition */ diff --git a/src/Hyperwallet/Model/Transfer.php b/src/Hyperwallet/Model/Transfer.php index e4915915..bc0bfe9c 100644 --- a/src/Hyperwallet/Model/Transfer.php +++ b/src/Hyperwallet/Model/Transfer.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Transfer + * Represents a V4 Transfer * * @property string $token The transfer token * @property string $status The transfer status @@ -308,4 +308,4 @@ public function setMemo($memo) { public function getExpiresOn() { return $this->expiresOn ? new \DateTime($this->expiresOn) : null; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/TransferMethod.php b/src/Hyperwallet/Model/TransferMethod.php index 2b77a341..38f40219 100644 --- a/src/Hyperwallet/Model/TransferMethod.php +++ b/src/Hyperwallet/Model/TransferMethod.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Transfer Method + * Represents a V4 Transfer Method * * @property string $token The transfer method token * @property string $type The transfer method type @@ -192,7 +192,7 @@ public function getCardBrand() { public function getDateOfExpiry() { return $this->dateOfExpiry ? new \DateTime($this->dateOfExpiry) : null; } - + /** * Get the bank account id * diff --git a/src/Hyperwallet/Model/TransferMethodConfiguration.php b/src/Hyperwallet/Model/TransferMethodConfiguration.php index 66de7d50..e565ba58 100644 --- a/src/Hyperwallet/Model/TransferMethodConfiguration.php +++ b/src/Hyperwallet/Model/TransferMethodConfiguration.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Program + * Represents a V4 Program * * @property string[] $countries The transfer method countries * @property string[] $currencies The transfer method currencies diff --git a/src/Hyperwallet/Model/TransferRefund.php b/src/Hyperwallet/Model/TransferRefund.php index fdaa5d5b..8def9022 100644 --- a/src/Hyperwallet/Model/TransferRefund.php +++ b/src/Hyperwallet/Model/TransferRefund.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Transfer + * Represents a V4 Transfer * * @property string $token The transfer refund token * @property string $status The transfer status @@ -305,4 +305,4 @@ public function setForeignExchanges($foreignExchanges) { return $this; } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/TransferStatusTransition.php b/src/Hyperwallet/Model/TransferStatusTransition.php index cba9fdc0..ba866d56 100644 --- a/src/Hyperwallet/Model/TransferStatusTransition.php +++ b/src/Hyperwallet/Model/TransferStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Transfer Status Transition + * Represents a V4 Transfer Status Transition * * @package Hyperwallet\Model */ @@ -27,4 +27,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/User.php b/src/Hyperwallet/Model/User.php index adb0df4d..700560b1 100644 --- a/src/Hyperwallet/Model/User.php +++ b/src/Hyperwallet/Model/User.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 User + * Represents a V4 User * * @property string $token The user token * @property string $status The user status diff --git a/src/Hyperwallet/Model/UserStatusTransition.php b/src/Hyperwallet/Model/UserStatusTransition.php index 97530bf3..16733fa8 100644 --- a/src/Hyperwallet/Model/UserStatusTransition.php +++ b/src/Hyperwallet/Model/UserStatusTransition.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 User Status Transition + * Represents a V4 User Status Transition * * @package Hyperwallet\Model */ @@ -17,4 +17,4 @@ public function __construct(array $properties = array()) { parent::__construct($properties); } -} \ No newline at end of file +} diff --git a/src/Hyperwallet/Model/VenmoAccount.php b/src/Hyperwallet/Model/VenmoAccount.php index 225de548..43011304 100644 --- a/src/Hyperwallet/Model/VenmoAccount.php +++ b/src/Hyperwallet/Model/VenmoAccount.php @@ -3,7 +3,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Venmo Account + * Represents a V4 Venmo Account * * @property string $token The Venmo account token * @property string $status The Venmo account status diff --git a/src/Hyperwallet/Model/WebhookNotification.php b/src/Hyperwallet/Model/WebhookNotification.php index 320c4661..a113a05a 100644 --- a/src/Hyperwallet/Model/WebhookNotification.php +++ b/src/Hyperwallet/Model/WebhookNotification.php @@ -2,7 +2,7 @@ namespace Hyperwallet\Model; /** - * Represents a V3 Webhook Notification + * Represents a V4 Webhook Notification * * @property string $token The webhook notification token * @property string $type The webhook notification type diff --git a/src/Hyperwallet/Response/ListResponse.php b/src/Hyperwallet/Response/ListResponse.php index 15c76688..5c87cf19 100644 --- a/src/Hyperwallet/Response/ListResponse.php +++ b/src/Hyperwallet/Response/ListResponse.php @@ -130,7 +130,7 @@ public function offsetSet($offset, $value) { /** * @internal - * + * * Offset to unset * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset

diff --git a/tests/Hyperwallet/Tests/HyperwalletTest.php b/tests/Hyperwallet/Tests/HyperwalletTest.php index 88de3aa0..72b307bf 100644 --- a/tests/Hyperwallet/Tests/HyperwalletTest.php +++ b/tests/Hyperwallet/Tests/HyperwalletTest.php @@ -14,16 +14,16 @@ use Hyperwallet\Model\BankCardStatusTransition; use Hyperwallet\Model\PaperCheck; use Hyperwallet\Model\PaperCheckStatusTransition; -use Hyperwallet\Model\Transfer; -use Hyperwallet\Model\TransferRefund; -use Hyperwallet\Model\TransferStatusTransition; -use Hyperwallet\Model\PayPalAccount; -use Hyperwallet\Model\PayPalAccountStatusTransition; use Hyperwallet\Model\Payment; use Hyperwallet\Model\PaymentStatusTransition; +use Hyperwallet\Model\PayPalAccount; +use Hyperwallet\Model\PayPalAccountStatusTransition; use Hyperwallet\Model\PrepaidCard; use Hyperwallet\Model\PrepaidCardStatusTransition; +use Hyperwallet\Model\Transfer; use Hyperwallet\Model\TransferMethod; +use Hyperwallet\Model\TransferRefund; +use Hyperwallet\Model\TransferStatusTransition; use Hyperwallet\Model\User; use Hyperwallet\Model\VenmoAccount; use Hyperwallet\Model\VenmoAccountStatusTransition; @@ -86,7 +86,7 @@ public function testCreateUser_withoutProgramToken() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new User(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertNull($user->getProgramToken()); @@ -97,7 +97,7 @@ public function testCreateUser_withoutProgramToken() { $this->assertEquals(array('success' => 'true'), $newUser->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users', array(), $user, array()); } public function testCreateUser_withProgramTokenAddedByDefault() { @@ -106,7 +106,7 @@ public function testCreateUser_withProgramTokenAddedByDefault() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new User(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertNull($user->getProgramToken()); @@ -117,7 +117,7 @@ public function testCreateUser_withProgramTokenAddedByDefault() { $this->assertEquals(array('success' => 'true'), $newUser->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users', array(), $user, array()); } public function testCreateUser_withProgramTokenInUserObject() { @@ -126,7 +126,7 @@ public function testCreateUser_withProgramTokenInUserObject() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new User(array('programToken' => 'test-program-token2')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertEquals('test-program-token2', $user->getProgramToken()); @@ -137,7 +137,7 @@ public function testCreateUser_withProgramTokenInUserObject() { $this->assertEquals(array('success' => 'true'), $newUser->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users', array(), $user, array()); } public function testGetUser_noUserToken() { @@ -157,7 +157,7 @@ public function testGetUser_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}', array('user-token' => 'test-user-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}', array('user-token' => 'test-user-token'), array())->thenReturn(array('success' => 'true')); // Run test $user = $client->getUser('test-user-token'); @@ -165,7 +165,7 @@ public function testGetUser_allParameters() { $this->assertEquals(array('success' => 'true'), $user->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}', array('user-token' => 'test-user-token'), array()); } public function testUpdateUser_noToken() { @@ -187,7 +187,7 @@ public function testUpdateUser_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new User(array('token' => 'test-user-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}', array('user-token' => 'test-user-token'), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}', array('user-token' => 'test-user-token'), $user, array())->thenReturn(array('success' => 'true')); // Run test $newUser = $client->updateUser($user); @@ -195,7 +195,7 @@ public function testUpdateUser_allParameters() { $this->assertEquals(array('success' => 'true'), $newUser->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}', array('user-token' => 'test-user-token'), $user, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}', array('user-token' => 'test-user-token'), $user, array()); } public function testListUsers_noParameters() { @@ -203,7 +203,7 @@ public function testListUsers_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $userList = $client->listUsers(); @@ -212,7 +212,7 @@ public function testListUsers_noParameters() { $this->assertEquals(1, $userList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users', array(), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users', array(), array()); } public function testListUsers_withParameters() { @@ -220,7 +220,7 @@ public function testListUsers_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $userList = $client->listUsers(array('test' => 'value')); @@ -231,7 +231,7 @@ public function testListUsers_withParameters() { $this->assertEquals(array('success' => 'true'), $userList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users', array(), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users', array(), array('test' => 'value')); } public function testGetUserStatusTransition_noUserToken() { @@ -265,7 +265,7 @@ public function testGetUserStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getUserStatusTransition('test-user-token', 'test-status-transition-token'); @@ -273,7 +273,7 @@ public function testGetUserStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListUserStatusTransitions_noUserToken() { @@ -294,7 +294,7 @@ public function testListUserStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listUserStatusTransitions('test-user-token'); @@ -303,7 +303,7 @@ public function testListUserStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array()); } public function testListUserStatusTransitions_withParameters() { @@ -311,7 +311,7 @@ public function testListUserStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listUserStatusTransitions('test-user-token', array('test' => 'value')); @@ -322,7 +322,7 @@ public function testListUserStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/status-transitions', array('user-token' => 'test-user-token'), array('test' => 'value')); } //-------------------------------------- @@ -346,7 +346,7 @@ public function testGetAuthenticationToken_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/authentication-token', array('user-token' => 'test-user-token'), null, array())->thenReturn(array('value' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/authentication-token', array('user-token' => 'test-user-token'), null, array())->thenReturn(array('value' => 'true')); // Run test $authenticationToken = $client->getAuthenticationToken('test-user-token'); @@ -354,7 +354,7 @@ public function testGetAuthenticationToken_allParameters() { $this->assertEquals(array('value' => 'true'), $authenticationToken->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/authentication-token', array('user-token' => 'test-user-token'), null, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/authentication-token', array('user-token' => 'test-user-token'), null, array()); } //-------------------------------------- @@ -380,7 +380,7 @@ public function testCreatePaperCheck_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $paperCheck = new PaperCheck(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), $paperCheck, array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), $paperCheck, array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $newPaperCheck = $client->createPaperCheck('test-user-token', $paperCheck); @@ -388,7 +388,7 @@ public function testCreatePaperCheck_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $newPaperCheck->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), $paperCheck, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), $paperCheck, array()); } public function testGetPaperCheck_noUserToken() { @@ -420,7 +420,7 @@ public function testGetPaperCheck_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $paperCheck = $client->getPaperCheck('test-user-token', 'test-paper-check-token'); @@ -428,7 +428,7 @@ public function testGetPaperCheck_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $paperCheck->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array()); } public function testUpdatePaperCheck_noUserToken() { @@ -463,7 +463,7 @@ public function testUpdatePaperCheck_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $paperCheck = new PaperCheck(array('token' => 'test-paper-check-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paper-check-token', 'transfer-method-name' => 'paper-checks'), $paperCheck, array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paper-check-token', 'transfer-method-name' => 'paper-checks'), $paperCheck, array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $newPaperCheck = $client->updatePaperCheck('test-user-token', $paperCheck); @@ -471,7 +471,7 @@ public function testUpdatePaperCheck_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $newPaperCheck->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paper-check-token', 'transfer-method-name' => 'paper-checks'), $paperCheck, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paper-check-token', 'transfer-method-name' => 'paper-checks'), $paperCheck, array()); } public function testListPaperChecks_noUserToken() { @@ -491,7 +491,7 @@ public function testListPaperChecks_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $paperCheckList = $client->listPaperChecks('test-user-token'); @@ -500,7 +500,7 @@ public function testListPaperChecks_noParameters() { $this->assertEquals(1, $paperCheckList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array()); } public function testListPaperChecks_withParameters() { @@ -508,7 +508,7 @@ public function testListPaperChecks_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); // Run test $paperCheckList = $client->listPaperChecks('test-user-token', array('test' => 'value')); @@ -519,7 +519,7 @@ public function testListPaperChecks_withParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $paperCheckList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testDeactivatePaperCheck_noUserToken() { @@ -556,7 +556,7 @@ public function testDeactivatePaperCheck_allParameters() { $statusTransition = new PaperCheckStatusTransition(); $statusTransition->setTransition(PaperCheckStatusTransition::TRANSITION_DE_ACTIVATED); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $newStatusTransition = $client->deactivatePaperCheck('test-user-token', 'test-paper-check-token'); @@ -564,7 +564,7 @@ public function testDeactivatePaperCheck_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array()); } public function testCreatePaperCheckStatusTransition_noUserToken() { @@ -599,7 +599,7 @@ public function testCreatePaperCheckStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new PaperCheckStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $newStatusTransition = $client->createPaperCheckStatusTransition('test-user-token', 'test-paper-check-token', $statusTransition); @@ -607,7 +607,7 @@ public function testCreatePaperCheckStatusTransition_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), $statusTransition, array()); } public function testGetPaperCheckStatusTransition_noUserToken() { @@ -654,7 +654,7 @@ public function testGetPaperCheckStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('postalCode' => 'ABCD')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('postalCode' => 'ABCD')); // Run test $statusTransition = $client->getPaperCheckstatusTransition('test-user-token', 'test-paper-check-token', 'test-status-transition-token'); @@ -662,7 +662,7 @@ public function testGetPaperCheckStatusTransition_allParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListPaperCheckStatusTransitions_noUserToken() { @@ -696,7 +696,7 @@ public function testListPaperCheckStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPaperCheckStatusTransitions('test-user-token', 'test-paper-check-token'); @@ -705,7 +705,7 @@ public function testListPaperCheckStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array()); } public function testListPaperCheckStatusTransitions_withParameters() { @@ -713,7 +713,7 @@ public function testListPaperCheckStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('postalCode' => 'ABCD')))); // Run test $statusTransitionList = $client->listPaperCheckStatusTransitions('test-user-token', 'test-paper-check-token', array('test' => 'value')); @@ -724,7 +724,7 @@ public function testListPaperCheckStatusTransitions_withParameters() { $this->assertEquals(array('postalCode' => 'ABCD'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paper-checks/{paper-check-token}/status-transitions', array('user-token' => 'test-user-token', 'paper-check-token' => 'test-paper-check-token'), array('test' => 'value')); } //-------------------------------------- @@ -782,7 +782,7 @@ public function testCreateTransfer_allParameters() { $transfer->setDestinationToken('test-destination-token'); $transfer->setClientTransferId('test-clientTransferId'); - \Phake::when($apiClientMock)->doPost('/rest/v3/transfers', array(), $transfer, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPost('/rest/v4/transfers', array(), $transfer, array())->thenReturn(array('token' => 'test-token')); // Run test $newTransfer = $client->createTransfer($transfer); @@ -790,7 +790,7 @@ public function testCreateTransfer_allParameters() { $this->assertEquals(array('token' => 'test-token'), $newTransfer->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/transfers', array(), $transfer, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/transfers', array(), $transfer, array()); } public function testGetTransfer_noTransferToken() { @@ -810,7 +810,7 @@ public function testGetTransfer_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}', array('transfer-token' => 'test-transfer-token'), array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}', array('transfer-token' => 'test-transfer-token'), array())->thenReturn(array('token' => 'test-token')); // Run test $transfer = $client->getTransfer('test-transfer-token'); @@ -818,7 +818,7 @@ public function testGetTransfer_allParameters() { $this->assertEquals(array('token' => 'test-token'), $transfer->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}', array('transfer-token' => 'test-transfer-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}', array('transfer-token' => 'test-transfer-token'), array()); } public function testListTransfers_noParameters() { @@ -826,7 +826,7 @@ public function testListTransfers_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $transferList = $client->listTransfers(); @@ -835,7 +835,7 @@ public function testListTransfers_noParameters() { $this->assertEquals(1, $transferList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers', array(), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers', array(), array()); } public function testListTransfers_withParameters() { @@ -843,7 +843,7 @@ public function testListTransfers_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $transferList = $client->listTransfers(array('test' => 'value')); @@ -854,7 +854,7 @@ public function testListTransfers_withParameters() { $this->assertEquals(array('token' => 'test-token'), $transferList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers', array(), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers', array(), array('test' => 'value')); } public function testCreateTransferStatusTransition_noTransferToken() { @@ -876,7 +876,7 @@ public function testCreateTransferStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new TransferStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/transfers/{transfer-token}/status-transitions', array('transfer-token' => 'test-transfer-token'), $statusTransition, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPost('/rest/v4/transfers/{transfer-token}/status-transitions', array('transfer-token' => 'test-transfer-token'), $statusTransition, array())->thenReturn(array('token' => 'test-token')); // Run test $newStatusTransition = $client->createTransferStatusTransition('test-transfer-token', $statusTransition); @@ -884,7 +884,7 @@ public function testCreateTransferStatusTransition_allParameters() { $this->assertEquals(array('token' => 'test-token'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/transfers/{transfer-token}/status-transitions', array('transfer-token' => 'test-transfer-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/transfers/{transfer-token}/status-transitions', array('transfer-token' => 'test-transfer-token'), $statusTransition, array()); } //-------------------------------------- @@ -955,7 +955,7 @@ public function testCreatePayPalAccount_allParameters() { $payPalAccount->setTransferMethodCurrency('test-transferMethodCurrency'); $payPalAccount->setEmail('test-email'); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), $payPalAccount, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), $payPalAccount, array())->thenReturn(array('token' => 'test-token')); // Run test $newPayPalAccount = $client->createPayPalAccount('test-user-token', $payPalAccount); @@ -963,7 +963,7 @@ public function testCreatePayPalAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $newPayPalAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), $payPalAccount, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), $payPalAccount, array()); } public function testGetPayPalAccount_noUserToken() { @@ -995,7 +995,7 @@ public function testGetPayPalAccount_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{paypal-account-token}', array('user-token' => 'test-user-token', 'paypal-account-token' => 'test-paypal-account-token'), array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{paypal-account-token}', array('user-token' => 'test-user-token', 'paypal-account-token' => 'test-paypal-account-token'), array())->thenReturn(array('token' => 'test-token')); // Run test $payPalAccount = $client->getPayPalAccount('test-user-token', 'test-paypal-account-token'); @@ -1003,7 +1003,7 @@ public function testGetPayPalAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $payPalAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{paypal-account-token}', array('user-token' => 'test-user-token', 'paypal-account-token' => 'test-paypal-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{paypal-account-token}', array('user-token' => 'test-user-token', 'paypal-account-token' => 'test-paypal-account-token'), array()); } public function testUpdatePayPalAccount_noUserToken() { @@ -1036,7 +1036,7 @@ public function testUpdatePayPalAccount_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $payPalAcc = new PayPalAccount(array('token' => 'test-paypal-account-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paypal-account-token', 'transfer-method-name' => 'paypal-accounts'), $payPalAcc, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paypal-account-token', 'transfer-method-name' => 'paypal-accounts'), $payPalAcc, array())->thenReturn(array('token' => 'test-token')); // Run test $payPalAccount = $client->updatePayPalAccount('test-user-token', $payPalAcc); @@ -1044,7 +1044,7 @@ public function testUpdatePayPalAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $payPalAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paypal-account-token', 'transfer-method-name' => 'paypal-accounts'), $payPalAcc, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-paypal-account-token', 'transfer-method-name' => 'paypal-accounts'), $payPalAcc, array()); } public function testListPayPalAccounts_noUserToken() { @@ -1064,7 +1064,7 @@ public function testListPayPalAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $payPalAccountsList = $client->listPayPalAccounts('test-user-token'); @@ -1073,7 +1073,7 @@ public function testListPayPalAccounts_noParameters() { $this->assertEquals(1, $payPalAccountsList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array()); } public function testListPayPalAccounts_withParameters() { @@ -1081,7 +1081,7 @@ public function testListPayPalAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $payPalAccountsList = $client->listPayPalAccounts('test-user-token', array('test' => 'value')); @@ -1092,7 +1092,7 @@ public function testListPayPalAccounts_withParameters() { $this->assertEquals(array('token' => 'test-token'), $payPalAccountsList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testDeactivatePayPalAccount_noUserToken() { @@ -1129,7 +1129,7 @@ public function testDeactivatePayPalAccount_allParameters() { $statusTransition = new PayPalAccountStatusTransition(); $statusTransition->setTransition(PayPalAccountStatusTransition::TRANSITION_DE_ACTIVATED); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->deactivatePayPalAccount('test-user-token', 'test-payPal-account-token'); @@ -1137,7 +1137,7 @@ public function testDeactivatePayPalAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array()); } public function testCreatePayPalAccountStatusTransition_noUserToken() { @@ -1172,7 +1172,7 @@ public function testCreatePayPalAccountStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new PayPalAccountStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createPayPalAccountStatusTransition('test-user-token', 'test-payPal-account-token', $statusTransition); @@ -1180,7 +1180,7 @@ public function testCreatePayPalAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), $statusTransition, array()); } public function testGetPayPalAccountStatusTransition_noUserToken() { @@ -1227,7 +1227,7 @@ public function testGetPayPalAccountStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getPayPalAccountStatusTransition('test-user-token', 'test-payPal-account-token', 'test-status-transition-token'); @@ -1235,7 +1235,7 @@ public function testGetPayPalAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListPayPalAccountStatusTransitions_noUserToken() { @@ -1269,7 +1269,7 @@ public function testListPayPalAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPayPalAccountStatusTransitions('test-user-token', 'test-payPal-account-token'); @@ -1278,7 +1278,7 @@ public function testListPayPalAccountStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array()); } public function testListPayPalAccountStatusTransitions_withParameters() { @@ -1286,7 +1286,7 @@ public function testListPayPalAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPayPalAccountStatusTransitions('test-user-token', 'test-payPal-account-token', array('test' => 'value')); @@ -1297,7 +1297,7 @@ public function testListPayPalAccountStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/paypal-accounts/{payPal-account-token}/status-transitions', array('user-token' => 'test-user-token', 'payPal-account-token' => 'test-payPal-account-token'), array('test' => 'value')); } //-------------------------------------- @@ -1323,7 +1323,7 @@ public function testCreatePrepaidCard_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $prepaidCard = new PrepaidCard(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), $prepaidCard, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), $prepaidCard, array())->thenReturn(array('success' => 'true')); // Run test $newPrepaidCard = $client->createPrepaidCard('test-user-token', $prepaidCard); @@ -1331,7 +1331,7 @@ public function testCreatePrepaidCard_allParameters() { $this->assertEquals(array('success' => 'true'), $newPrepaidCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), $prepaidCard, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), $prepaidCard, array()); } public function testGetPrepaidCard_noUserToken() { @@ -1363,7 +1363,7 @@ public function testGetPrepaidCard_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('success' => 'true')); // Run test $prepaidCard = $client->getPrepaidCard('test-user-token', 'test-prepaid-card-token'); @@ -1371,7 +1371,7 @@ public function testGetPrepaidCard_allParameters() { $this->assertEquals(array('success' => 'true'), $prepaidCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); } public function testUpdatePrepaidCard_noUserToken() { @@ -1406,7 +1406,7 @@ public function testUpdatePrepaidCard_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $prepaidCard = new PrepaidCard(array('token' => 'test-prepaid-card-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-prepaid-card-token', 'transfer-method-name' => 'prepaid-cards'), $prepaidCard, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-prepaid-card-token', 'transfer-method-name' => 'prepaid-cards'), $prepaidCard, array())->thenReturn(array('success' => 'true')); // Run test $newPrepaidCard = $client->updatePrepaidCard('test-user-token', $prepaidCard); @@ -1414,7 +1414,7 @@ public function testUpdatePrepaidCard_allParameters() { $this->assertEquals(array('success' => 'true'), $newPrepaidCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-prepaid-card-token', 'transfer-method-name' => 'prepaid-cards'), $prepaidCard, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-prepaid-card-token', 'transfer-method-name' => 'prepaid-cards'), $prepaidCard, array()); } public function testListPrepaidCards_noUserToken() { @@ -1434,7 +1434,7 @@ public function testListPrepaidCards_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $prepaidCardList = $client->listPrepaidCards('test-user-token'); @@ -1443,7 +1443,7 @@ public function testListPrepaidCards_noParameters() { $this->assertEquals(1, $prepaidCardList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array()); } public function testListPrepaidCards_withParameters() { @@ -1451,7 +1451,7 @@ public function testListPrepaidCards_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $prepaidCardList = $client->listPrepaidCards('test-user-token', array('test' => 'value')); @@ -1462,7 +1462,7 @@ public function testListPrepaidCards_withParameters() { $this->assertEquals(array('success' => 'true'), $prepaidCardList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards', array('user-token' => 'test-user-token'), array('test' => 'value')); } /** @@ -1518,7 +1518,7 @@ public function testPrepaidCardStatusTransitionMethods_allParameters($methodName $statusTransition = new PrepaidCardStatusTransition(); $statusTransition->setTransition($transition); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $transitionMethod->invoke($client, 'test-user-token', 'test-prepaid-card-token'); @@ -1526,7 +1526,7 @@ public function testPrepaidCardStatusTransitionMethods_allParameters($methodName $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array()); } public function testCreatePrepaidCardStatusTransition_noUserToken() { @@ -1561,7 +1561,7 @@ public function testCreatePrepaidCardStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new PrepaidCardStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createPrepaidCardStatusTransition('test-user-token', 'test-prepaid-card-token', $statusTransition); @@ -1569,7 +1569,7 @@ public function testCreatePrepaidCardStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), $statusTransition, array()); } public function testGetPrepaidCardStatusTransition_noUserToken() { @@ -1616,7 +1616,7 @@ public function testGetPrepaidCardStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getPrepaidCardStatusTransition('test-user-token', 'test-prepaid-card-token', 'test-status-transition-token'); @@ -1624,7 +1624,7 @@ public function testGetPrepaidCardStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListPrepaidCardStatusTransitions_noUserToken() { @@ -1658,7 +1658,7 @@ public function testListPrepaidCardStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPrepaidCardStatusTransitions('test-user-token', 'test-prepaid-card-token'); @@ -1667,7 +1667,7 @@ public function testListPrepaidCardStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); } public function testListPrepaidCardStatusTransitions_withParameters() { @@ -1675,7 +1675,7 @@ public function testListPrepaidCardStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPrepaidCardStatusTransitions('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); @@ -1686,7 +1686,7 @@ public function testListPrepaidCardStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/status-transitions', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); } //-------------------------------------- @@ -1712,7 +1712,7 @@ public function testCreateBankAccount_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $bankAccount = new BankAccount(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array())->thenReturn(array('success' => 'true')); // Run test $newBankAccount = $client->createBankAccount('test-user-token', $bankAccount); @@ -1720,7 +1720,7 @@ public function testCreateBankAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $newBankAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array()); } public function testGetBankAccount_noUserToken() { @@ -1752,7 +1752,7 @@ public function testGetBankAccount_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('success' => 'true')); // Run test $bankAccount = $client->getBankAccount('test-user-token', 'test-bank-account-token'); @@ -1760,7 +1760,7 @@ public function testGetBankAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $bankAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array()); } public function testUpdateBankAccount_noUserToken() { @@ -1795,7 +1795,7 @@ public function testUpdateBankAccount_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $bankAccount = new BankAccount(array('token' => 'test-bank-account-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-account-token', 'transfer-method-name' => 'bank-accounts'), $bankAccount, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-account-token', 'transfer-method-name' => 'bank-accounts'), $bankAccount, array())->thenReturn(array('success' => 'true')); // Run test $newBankAccount = $client->updateBankAccount('test-user-token', $bankAccount); @@ -1803,7 +1803,7 @@ public function testUpdateBankAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $newBankAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-account-token', 'transfer-method-name' => 'bank-accounts'), $bankAccount, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-account-token', 'transfer-method-name' => 'bank-accounts'), $bankAccount, array()); } public function testListBankAccounts_noUserToken() { @@ -1824,7 +1824,7 @@ public function testListBankAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $bankAccountList = $client->listBankAccounts('test-user-token'); @@ -1833,7 +1833,7 @@ public function testListBankAccounts_noParameters() { $this->assertEquals(1, $bankAccountList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array()); } public function testListBankAccounts_withParameters() { @@ -1841,7 +1841,7 @@ public function testListBankAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $bankAccountList = $client->listBankAccounts('test-user-token', array('test' => 'value')); @@ -1852,7 +1852,7 @@ public function testListBankAccounts_withParameters() { $this->assertEquals(array('success' => 'true'), $bankAccountList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testDeactivateBankAccount_noUserToken() { @@ -1889,7 +1889,7 @@ public function testDeactivateBankAccount_allParameters() { $statusTransition = new BankAccountStatusTransition(); $statusTransition->setTransition(BankAccountStatusTransition::TRANSITION_DE_ACTIVATED); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->deactivateBankAccount('test-user-token', 'test-bank-account-token'); @@ -1897,7 +1897,7 @@ public function testDeactivateBankAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array()); } public function testCreateBankAccountStatusTransition_noUserToken() { @@ -1932,7 +1932,7 @@ public function testCreateBankAccountStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new BankAccountStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createBankAccountStatusTransition('test-user-token', 'test-bank-account-token', $statusTransition); @@ -1940,7 +1940,7 @@ public function testCreateBankAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), $statusTransition, array()); } public function testGetBankAccountStatusTransition_noUserToken() { @@ -1987,7 +1987,7 @@ public function testGetBankAccountStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getBankAccountStatusTransition('test-user-token', 'test-bank-account-token', 'test-status-transition-token'); @@ -1995,7 +1995,7 @@ public function testGetBankAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListBankAccountStatusTransitions_noUserToken() { @@ -2029,7 +2029,7 @@ public function testListBankAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listBankAccountStatusTransitions('test-user-token', 'test-bank-account-token'); @@ -2038,7 +2038,7 @@ public function testListBankAccountStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array()); } public function testListBankAccountStatusTransitions_withParameters() { @@ -2046,7 +2046,7 @@ public function testListBankAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listBankAccountStatusTransitions('test-user-token', 'test-bank-account-token', array('test' => 'value')); @@ -2057,7 +2057,7 @@ public function testListBankAccountStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-accounts/{bank-account-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-account-token' => 'test-bank-account-token'), array('test' => 'value')); } //-------------------------------------- @@ -2083,7 +2083,7 @@ public function testCreateBankCard_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $bankCard = new BankCard(); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), $bankCard, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), $bankCard, array())->thenReturn(array('success' => 'true')); // Run test $newBankCard = $client->createBankCard('test-user-token', $bankCard); @@ -2091,7 +2091,7 @@ public function testCreateBankCard_allParameters() { $this->assertEquals(array('success' => 'true'), $newBankCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), $bankCard, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), $bankCard, array()); } public function testGetBankCard_noUserToken() { @@ -2123,7 +2123,7 @@ public function testGetBankCard_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('success' => 'true')); // Run test $bankCard = $client->getBankCard('test-user-token', 'test-bank-card-token'); @@ -2131,7 +2131,7 @@ public function testGetBankCard_allParameters() { $this->assertEquals(array('success' => 'true'), $bankCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array()); } public function testUpdateBankCard_noUserToken() { @@ -2166,7 +2166,7 @@ public function testUpdateBankCard_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $bankCard = new BankCard(array('token' => 'test-bank-card-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-card-token', 'transfer-method-name' => 'bank-cards'), $bankCard, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-card-token', 'transfer-method-name' => 'bank-cards'), $bankCard, array())->thenReturn(array('success' => 'true')); // Run test $newBankCard = $client->updateBankCard('test-user-token', $bankCard); @@ -2174,7 +2174,7 @@ public function testUpdateBankCard_allParameters() { $this->assertEquals(array('success' => 'true'), $newBankCard->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-card-token', 'transfer-method-name' => 'bank-cards'), $bankCard, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-bank-card-token', 'transfer-method-name' => 'bank-cards'), $bankCard, array()); } public function testListBankCards_noUserToken() { @@ -2194,7 +2194,7 @@ public function testListBankCards_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $bankCardList = $client->listBankCards('test-user-token'); @@ -2203,7 +2203,7 @@ public function testListBankCards_noParameters() { $this->assertEquals(1, $bankCardList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array()); } public function testListBankCards_withParameters() { @@ -2211,7 +2211,7 @@ public function testListBankCards_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $bankCardList = $client->listBankCards('test-user-token', array('test' => 'value')); @@ -2222,7 +2222,7 @@ public function testListBankCards_withParameters() { $this->assertEquals(array('success' => 'true'), $bankCardList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testDeactivateBankCard_noUserToken() { @@ -2259,7 +2259,7 @@ public function testDeactivateBankCard_allParameters() { $statusTransition = new BankCardStatusTransition(); $statusTransition->setTransition(BankCardStatusTransition::TRANSITION_DE_ACTIVATED); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->deactivateBankCard('test-user-token', 'test-bank-card-token'); @@ -2267,7 +2267,7 @@ public function testDeactivateBankCard_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array()); } public function testCreateBankCardStatusTransition_noUserToken() { @@ -2302,7 +2302,7 @@ public function testCreateBankCardStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new BankCardStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createBankCardStatusTransition('test-user-token', 'test-bank-card-token', $statusTransition); @@ -2310,7 +2310,7 @@ public function testCreateBankCardStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), $statusTransition, array()); } public function testGetBankCardStatusTransition_noUserToken() { @@ -2357,7 +2357,7 @@ public function testGetBankCardStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getBankCardStatusTransition('test-user-token', 'test-bank-card-token', 'test-status-transition-token'); @@ -2365,7 +2365,7 @@ public function testGetBankCardStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListBankCardStatusTransitions_noUserToken() { @@ -2399,7 +2399,7 @@ public function testListBankCardStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listBankCardStatusTransitions('test-user-token', 'test-bank-card-token'); @@ -2408,7 +2408,7 @@ public function testListBankCardStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array()); } public function testListBankCardStatusTransitions_withParameters() { @@ -2416,7 +2416,7 @@ public function testListBankCardStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listBankCardStatusTransitions('test-user-token', 'test-bank-card-token', array('test' => 'value')); @@ -2427,7 +2427,7 @@ public function testListBankCardStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/bank-cards/{bank-card-token}/status-transitions', array('user-token' => 'test-user-token', 'bank-card-token' => 'test-bank-card-token'), array('test' => 'value')); } @@ -2464,7 +2464,7 @@ public function testCreateTransferMethod_noPayload() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), null, array(), array( + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), null, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' ))->thenReturn(array('success' => 'true', 'type' => TransferMethod::TYPE_BANK_ACCOUNT)); @@ -2474,7 +2474,7 @@ public function testCreateTransferMethod_noPayload() { $this->assertEquals(array('success' => 'true', 'type' => BankAccount::TYPE_BANK_ACCOUNT), $newTransferMethod->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), null, array(), array( + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), null, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' )); } @@ -2487,7 +2487,7 @@ public function testCreateTransferMethod_payload_result_bank_account() { $transferMethod = new TransferMethod(); $transferMethod->setFirstName('test-first-name'); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' ))->thenReturn(array('success' => 'true', 'type' => TransferMethod::TYPE_BANK_ACCOUNT)); @@ -2498,7 +2498,7 @@ public function testCreateTransferMethod_payload_result_bank_account() { $this->assertEquals(array('success' => 'true', 'type' => BankAccount::TYPE_BANK_ACCOUNT), $newTransferMethod->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' )); } @@ -2511,7 +2511,7 @@ public function testCreateTransferMethod_payload_result_wire_account() { $transferMethod = new TransferMethod(); $transferMethod->setFirstName('test-first-name'); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' ))->thenReturn(array('success' => 'true', 'type' => TransferMethod::TYPE_WIRE_ACCOUNT)); @@ -2522,7 +2522,7 @@ public function testCreateTransferMethod_payload_result_wire_account() { $this->assertEquals(array('success' => 'true', 'type' => BankAccount::TYPE_WIRE_ACCOUNT), $newTransferMethod->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' )); } @@ -2535,7 +2535,7 @@ public function testCreateTransferMethod_payload_result_prepaid_card() { $transferMethod = new TransferMethod(); $transferMethod->setFirstName('test-first-name'); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' ))->thenReturn(array('success' => 'true', 'type' => TransferMethod::TYPE_PREPAID_CARD)); @@ -2546,7 +2546,7 @@ public function testCreateTransferMethod_payload_result_prepaid_card() { $this->assertEquals(array('success' => 'true', 'type' => PrepaidCard::TYPE_PREPAID_CARD), $newTransferMethod->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/transfer-methods', array('user-token' => 'test-user-token'), $transferMethod, array(), array( 'Json-Cache-Token' => 'test-json-cache-token' )); } @@ -2573,7 +2573,7 @@ public function testListBalancesForUser_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/balances', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForUser('test-user-token'); @@ -2582,7 +2582,7 @@ public function testListBalancesForUser_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/balances', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array()); } public function testListBalancesForUser_withParameters() { @@ -2590,7 +2590,7 @@ public function testListBalancesForUser_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForUser('test-user-token', array('test' => 'value')); @@ -2601,7 +2601,7 @@ public function testListBalancesForUser_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/balances', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testListBalancesForPrepaidCard_noUserToken() { @@ -2635,7 +2635,7 @@ public function testListBalancesForPrepaidCard_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForPrepaidCard('test-user-token', 'test-prepaid-card-token'); @@ -2644,7 +2644,7 @@ public function testListBalancesForPrepaidCard_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); } public function testListBalancesForPrepaidCard_withParameters() { @@ -2652,7 +2652,7 @@ public function testListBalancesForPrepaidCard_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForPrepaidCard('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); @@ -2663,7 +2663,7 @@ public function testListBalancesForPrepaidCard_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/balances', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); } public function testListBalancesForAccount_noProgramToken() { @@ -2697,7 +2697,7 @@ public function testListBalancesForAccount_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listBalancesForAccount('test-program-token', 'test-account-token'); @@ -2706,7 +2706,7 @@ public function testListBalancesForAccount_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); } public function testListBalancesForAccount_withParameters() { @@ -2714,7 +2714,7 @@ public function testListBalancesForAccount_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listBalancesForAccount('test-program-token', 'test-account-token', array('test' => 'value')); @@ -2725,7 +2725,7 @@ public function testListBalancesForAccount_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/balances', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value')); } //-------------------------------------- @@ -2738,7 +2738,7 @@ public function testCreatePayment_withoutProgramToken() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new Payment(); - \Phake::when($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertNull($user->getProgramToken()); @@ -2749,7 +2749,7 @@ public function testCreatePayment_withoutProgramToken() { $this->assertEquals(array('success' => 'true'), $newPayment->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array()); } public function testCreatePayment_withProgramTokenAddedByDefault() { @@ -2758,7 +2758,7 @@ public function testCreatePayment_withProgramTokenAddedByDefault() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new Payment(); - \Phake::when($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertNull($user->getProgramToken()); @@ -2769,7 +2769,7 @@ public function testCreatePayment_withProgramTokenAddedByDefault() { $this->assertEquals(array('success' => 'true'), $newPayment->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array()); } public function testCreatePayment_withProgramTokenInPaymentObject() { @@ -2778,7 +2778,7 @@ public function testCreatePayment_withProgramTokenInPaymentObject() { $apiClientMock = $this->createAndInjectApiClientMock($client); $user = new Payment(array('programToken' => 'test-program-token2')); - \Phake::when($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array())->thenReturn(array('success' => 'true')); // Run test $this->assertEquals('test-program-token2', $user->getProgramToken()); @@ -2789,7 +2789,7 @@ public function testCreatePayment_withProgramTokenInPaymentObject() { $this->assertEquals(array('success' => 'true'), $newPayment->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/payments', array(), $user, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/payments', array(), $user, array()); } public function testGetPayment_noPaymentToken() { @@ -2809,7 +2809,7 @@ public function testGetPayment_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments/{payment-token}', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('success' => 'true')); // Run test $user = $client->getPayment('test-payment-token'); @@ -2817,7 +2817,7 @@ public function testGetPayment_allParameters() { $this->assertEquals(array('success' => 'true'), $user->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments/{payment-token}', array('payment-token' => 'test-payment-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments/{payment-token}', array('payment-token' => 'test-payment-token'), array()); } public function testListPayments_noParameters() { @@ -2825,7 +2825,7 @@ public function testListPayments_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $userList = $client->listPayments(); @@ -2834,7 +2834,7 @@ public function testListPayments_noParameters() { $this->assertEquals(1, $userList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments', array(), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments', array(), array()); } public function testListPayments_withParameters() { @@ -2842,7 +2842,7 @@ public function testListPayments_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $userList = $client->listPayments(array('test' => 'value')); @@ -2853,7 +2853,7 @@ public function testListPayments_withParameters() { $this->assertEquals(array('success' => 'true'), $userList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments', array(), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments', array(), array('test' => 'value')); } public function testCreatePaymentStatusTransition_noPaymentToken() { @@ -2875,7 +2875,7 @@ public function testCreatePaymentStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new PaymentStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createPaymentStatusTransition('test-payment-token', $statusTransition); @@ -2883,7 +2883,7 @@ public function testCreatePaymentStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), $statusTransition, array()); } public function testGetPaymentStatusTransition_noPaymentToken() { @@ -2917,7 +2917,7 @@ public function testGetPaymentStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions/{status-transition-token}', array('payment-token' => 'test-payment-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions/{status-transition-token}', array('payment-token' => 'test-payment-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getPaymentStatusTransition('test-payment-token', 'test-status-transition-token'); @@ -2925,7 +2925,7 @@ public function testGetPaymentStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions/{status-transition-token}', array('payment-token' => 'test-payment-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions/{status-transition-token}', array('payment-token' => 'test-payment-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListPaymentStatusTransitions_noPaymentToken() { @@ -2946,7 +2946,7 @@ public function testListPaymentStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listPaymentStatusTransitions('test-payment-token'); @@ -2955,7 +2955,7 @@ public function testListPaymentStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array()); } public function testListPaymentStatusTransitions_withParameters() { @@ -2963,7 +2963,7 @@ public function testListPaymentStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listPaymentStatusTransitions('test-payment-token', array('test' => 'value')); @@ -2974,7 +2974,7 @@ public function testListPaymentStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/payments/{payment-token}/status-transitions', array('payment-token' => 'test-payment-token'), array('test' => 'value')); } //-------------------------------------- @@ -2998,7 +2998,7 @@ public function testGetProgram_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}', array('program-token' => 'test-program-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}', array('program-token' => 'test-program-token'), array())->thenReturn(array('success' => 'true')); // Run test $program = $client->getProgram('test-program-token'); @@ -3006,7 +3006,7 @@ public function testGetProgram_allParameters() { $this->assertEquals(array('success' => 'true'), $program->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}', array('program-token' => 'test-program-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}', array('program-token' => 'test-program-token'), array()); } //-------------------------------------- @@ -3042,7 +3042,7 @@ public function testGetProgramAccount_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('success' => 'true')); // Run test $programAccount = $client->getProgramAccount('test-program-token', 'test-account-token'); @@ -3050,7 +3050,7 @@ public function testGetProgramAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $programAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); } //-------------------------------------- @@ -3127,7 +3127,7 @@ public function testGetTransferMethodConfiguration_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array( + \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => 'test-user-token', 'country' => 'US', 'currency' => 'USD', @@ -3141,7 +3141,7 @@ public function testGetTransferMethodConfiguration_allParameters() { $this->assertEquals(array('success' => 'true'), $program->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array( + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => 'test-user-token', 'country' => 'US', 'currency' => 'USD', @@ -3168,7 +3168,7 @@ public function testListTransferMethodConfigurations_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array('userToken' => 'test-user-token'))->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array('userToken' => 'test-user-token'))->thenReturn(array('count' => 1, 'data' => array())); // Run test $userList = $client->listTransferMethodConfigurations('test-user-token'); @@ -3177,7 +3177,7 @@ public function testListTransferMethodConfigurations_noParameters() { $this->assertEquals(1, $userList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array('userToken' => 'test-user-token')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array('userToken' => 'test-user-token')); } public function testListTransferMethodConfigurations_withParameters() { @@ -3185,7 +3185,7 @@ public function testListTransferMethodConfigurations_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array( + \Phake::when($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => 'test-user-token', 'test' => 'value' ))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); @@ -3199,7 +3199,7 @@ public function testListTransferMethodConfigurations_withParameters() { $this->assertEquals(array('success' => 'true'), $tmcList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfer-method-configurations', array(), array( + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfer-method-configurations', array(), array( 'userToken' => 'test-user-token', 'test' => 'value' )); @@ -3240,7 +3240,7 @@ public function testListReceiptsForProgramAccount_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForProgramAccount('test-program-token', 'test-account-token'); @@ -3249,7 +3249,7 @@ public function testListReceiptsForProgramAccount_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array()); } public function testListReceiptsForProgramAccount_withParameters() { @@ -3257,7 +3257,7 @@ public function testListReceiptsForProgramAccount_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForProgramAccount('test-program-token', 'test-account-token', array('test' => 'value')); @@ -3268,7 +3268,7 @@ public function testListReceiptsForProgramAccount_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/programs/{program-token}/accounts/{account-token}/receipts', array('program-token' => 'test-program-token', 'account-token' => 'test-account-token'), array('test' => 'value')); } public function testListReceiptsForUser_noUserToken() { @@ -3289,7 +3289,7 @@ public function testListReceiptsForUser_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForUser('test-user-token'); @@ -3298,7 +3298,7 @@ public function testListReceiptsForUser_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array()); } public function testListReceiptsForUser_withParameters() { @@ -3306,7 +3306,7 @@ public function testListReceiptsForUser_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForUser('test-user-token', array('test' => 'value')); @@ -3317,7 +3317,7 @@ public function testListReceiptsForUser_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/receipts', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testListReceiptsForPrepaidCard_noUserToken() { @@ -3351,7 +3351,7 @@ public function testListReceiptsForPrepaidCard_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $balanceList = $client->listReceiptsForPrepaidCard('test-user-token', 'test-prepaid-card-token'); @@ -3360,7 +3360,7 @@ public function testListReceiptsForPrepaidCard_noParameters() { $this->assertEquals(1, $balanceList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array()); } public function testListReceiptsForPrepaidCard_withParameters() { @@ -3368,7 +3368,7 @@ public function testListReceiptsForPrepaidCard_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $balanceList = $client->listReceiptsForPrepaidCard('test-user-token', 'test-prepaid-card-token', array('test' => 'value')); @@ -3379,7 +3379,7 @@ public function testListReceiptsForPrepaidCard_withParameters() { $this->assertEquals(array('success' => 'true'), $balanceList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/prepaid-cards/{prepaid-card-token}/receipts', array('user-token' => 'test-user-token', 'prepaid-card-token' => 'test-prepaid-card-token'), array('test' => 'value')); } //-------------------------------------- @@ -3403,7 +3403,7 @@ public function testGetWebhookNotification_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => 'test-webhook-notification-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => 'test-webhook-notification-token'), array())->thenReturn(array('success' => 'true')); // Run test $webhookNotification = $client->getWebhookNotification('test-webhook-notification-token'); @@ -3411,7 +3411,7 @@ public function testGetWebhookNotification_allParameters() { $this->assertEquals(array('success' => 'true'), $webhookNotification->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => 'test-webhook-notification-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/webhook-notifications/{webhook-notification-token}', array('webhook-notification-token' => 'test-webhook-notification-token'), array()); } public function testListWebhookNotifications_noParameters() { @@ -3419,7 +3419,7 @@ public function testListWebhookNotifications_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/webhook-notifications', array(), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $webhookNotificationList = $client->listWebhookNotifications(); @@ -3428,7 +3428,7 @@ public function testListWebhookNotifications_noParameters() { $this->assertEquals(1, $webhookNotificationList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/webhook-notifications', array(), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array()); } public function testListWebhookNotifications_withParameters() { @@ -3436,7 +3436,7 @@ public function testListWebhookNotifications_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/webhook-notifications', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $webhookNotificationList = $client->listWebhookNotifications(array('test' => 'value')); @@ -3447,7 +3447,7 @@ public function testListWebhookNotifications_withParameters() { $this->assertEquals(array('success' => 'true'), $webhookNotificationList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/webhook-notifications', array(), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/webhook-notifications', array(), array('test' => 'value')); } //-------------------------------------- @@ -3467,7 +3467,7 @@ public function testCreateBankAccountWithErrorResponse() { 'trm-f3d38df1-adb7-4127-9858-e72ebe682a79', 'trm-601b1401-4464-4f3f-97b3-09079ee7723b' ))))); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array())->thenThrow(new HyperwalletApiException($errorResponse, new HyperwalletException("Error message"))); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array())->thenThrow(new HyperwalletApiException($errorResponse, new HyperwalletException("Error message"))); // Run test try { @@ -3482,7 +3482,7 @@ public function testCreateBankAccountWithErrorResponse() { } // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/bank-accounts', array('user-token' => 'test-user-token'), $bankAccount, array()); } //-------------------------------------- @@ -3578,7 +3578,7 @@ public function testuploadDocumentsForUser() { ] ); - \Phake::when($apiClientMock)->putMultipartData('/rest/v3/users/{user-token}', array('user-token' => $userToken), $options)->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->putMultipartData('/rest/v4/users/{user-token}', array('user-token' => $userToken), $options)->thenReturn(array('success' => 'true')); // Run test $newUser = $client->uploadDocumentsForUser($userToken, $options); @@ -3587,7 +3587,7 @@ public function testuploadDocumentsForUser() { $this->assertEquals(array('success' => 'true'), $newUser->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->putMultipartData('/rest/v3/users/{user-token}', array('user-token' => $userToken), $options); + \Phake::verify($apiClientMock)->putMultipartData('/rest/v4/users/{user-token}', array('user-token' => $userToken), $options); } //-------------------------------------- @@ -3658,7 +3658,7 @@ public function testCreateVenmoAccount_allParameters() { $venmoAccount->setTransferMethodCurrency('test-transferMethodCurrency'); $venmoAccount->setAccountId('account-id'); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), $venmoAccount, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), $venmoAccount, array())->thenReturn(array('token' => 'test-token')); // Run test $newVenmoAccount = $client->createVenmoAccount('test-user-token', $venmoAccount); @@ -3666,7 +3666,7 @@ public function testCreateVenmoAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $newVenmoAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), $venmoAccount, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), $venmoAccount, array()); } public function testGetVenmoAccount_noUserToken() { @@ -3698,7 +3698,7 @@ public function testGetVenmoAccount_allParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('token' => 'test-token')); // Run test $venmoAccount = $client->getVenmoAccount('test-user-token', 'test-venmo-account-token'); @@ -3706,7 +3706,7 @@ public function testGetVenmoAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $venmoAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array()); } public function testUpdateVenmoAccount_noVenmoAccountToken() { @@ -3727,7 +3727,7 @@ public function testUpdateVenmoAccount_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $venmoAcc = new VenmoAccount(array('token' => 'test-venmo-account-token')); - \Phake::when($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-venmo-account-token', 'transfer-method-name' => 'venmo-accounts'), $venmoAcc, array())->thenReturn(array('token' => 'test-token')); + \Phake::when($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-venmo-account-token', 'transfer-method-name' => 'venmo-accounts'), $venmoAcc, array())->thenReturn(array('token' => 'test-token')); // Run test $venmoAccount = $client->updateVenmoAccount('test-user-token', $venmoAcc); @@ -3735,7 +3735,7 @@ public function testUpdateVenmoAccount_allParameters() { $this->assertEquals(array('token' => 'test-token'), $venmoAccount->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPut('/rest/v3/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-venmo-account-token', 'transfer-method-name' => 'venmo-accounts'), $venmoAcc, array()); + \Phake::verify($apiClientMock)->doPut('/rest/v4/users/{user-token}/{transfer-method-name}/{transfer-method-token}', array('user-token' => 'test-user-token', 'transfer-method-token' => 'test-venmo-account-token', 'transfer-method-name' => 'venmo-accounts'), $venmoAcc, array()); } public function testListVenmoAccounts_noUserToken() { @@ -3755,7 +3755,7 @@ public function testListVenmoAccounts_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $venmoAccountsList = $client->listVenmoAccounts('test-user-token'); @@ -3764,7 +3764,7 @@ public function testListVenmoAccounts_noParameters() { $this->assertEquals(1, $venmoAccountsList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array()); } public function testListVenmoAccounts_withParameters() { @@ -3772,7 +3772,7 @@ public function testListVenmoAccounts_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('token' => 'test-token')))); // Run test $venmoAccountsList = $client->listVenmoAccounts('test-user-token', array('test' => 'value')); @@ -3783,7 +3783,7 @@ public function testListVenmoAccounts_withParameters() { $this->assertEquals(array('token' => 'test-token'), $venmoAccountsList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts', array('user-token' => 'test-user-token'), array('test' => 'value')); } public function testDeactivateVenmoAccount_noUserToken() { @@ -3820,7 +3820,7 @@ public function testDeactivateVenmoAccount_allParameters() { $statusTransition = new VenmoAccountStatusTransition(); $statusTransition->setTransition(VenmoAccountStatusTransition::TRANSITION_DE_ACTIVATED); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->deactivateVenmoAccount('test-user-token', 'test-venmo-account-token'); @@ -3828,7 +3828,7 @@ public function testDeactivateVenmoAccount_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array()); } public function testCreateVenmoAccountStatusTransition_noVenmoAccountToken() { @@ -3850,7 +3850,7 @@ public function testCreateVenmoAccountStatusTransition_allParameters() { $apiClientMock = $this->createAndInjectApiClientMock($client); $statusTransition = new VenmoAccountStatusTransition(array('transition' => 'test')); - \Phake::when($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array())->thenReturn(array('success' => 'true')); // Run test $newStatusTransition = $client->createVenmoAccountStatusTransition('test-user-token', 'test-venmo-account-token', $statusTransition); @@ -3858,7 +3858,7 @@ public function testCreateVenmoAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $newStatusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array()); + \Phake::verify($apiClientMock)->doPost('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), $statusTransition, array()); } public function testGetVenmoAccountStatusTransition_noUserToken() { @@ -3905,7 +3905,7 @@ public function testGetVenmoAccountStatusTransition_allParameters() { $client = new Hyperwallet('test-username', 'test-password'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token', 'status-transition-token' => 'test-status-transition-token'), array())->thenReturn(array('success' => 'true')); // Run test $statusTransition = $client->getVenmoAccountStatusTransition('test-user-token', 'test-venmo-account-token', 'test-status-transition-token'); @@ -3913,7 +3913,7 @@ public function testGetVenmoAccountStatusTransition_allParameters() { $this->assertEquals(array('success' => 'true'), $statusTransition->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions/{status-transition-token}', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token', 'status-transition-token' => 'test-status-transition-token'), array()); } public function testListVenmoAccountStatusTransitions_noUserToken() { @@ -3947,7 +3947,7 @@ public function testListVenmoAccountStatusTransitions_noParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array())->thenReturn(array('count' => 1, 'data' => array())); // Run test $statusTransitionList = $client->listVenmoAccountStatusTransitions('test-user-token', 'test-venmo-account-token'); @@ -3956,7 +3956,7 @@ public function testListVenmoAccountStatusTransitions_noParameters() { $this->assertEquals(1, $statusTransitionList->getCount()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array()); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array()); } public function testListVenmoAccountStatusTransitions_withParameters() { @@ -3964,7 +3964,7 @@ public function testListVenmoAccountStatusTransitions_withParameters() { $client = new Hyperwallet('test-username', 'test-password', 'test-program-token'); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); + \Phake::when($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value'))->thenReturn(array('count' => 1, 'data' => array(array('success' => 'true')))); // Run test $statusTransitionList = $client->listVenmoAccountStatusTransitions('test-user-token', 'test-venmo-account-token', array('test' => 'value')); @@ -3975,7 +3975,7 @@ public function testListVenmoAccountStatusTransitions_withParameters() { $this->assertEquals(array('success' => 'true'), $statusTransitionList[0]->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value')); + \Phake::verify($apiClientMock)->doGet('/rest/v4/users/{user-token}/venmo-accounts/{venmo-account-token}/status-transitions', array('user-token' => 'test-user-token', 'venmo-account-token' => 'test-venmo-account-token'), array('test' => 'value')); } public function testCreateTransferRefund_noClientRefundId() { @@ -4066,7 +4066,7 @@ public function testCreateTransferRefund_successful() { $client = new Hyperwallet($userName, $password); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doPost('/rest/v3/transfers/{transfer-token}/refunds', + \Phake::when($apiClientMock)->doPost('/rest/v4/transfers/{transfer-token}/refunds', array('transfer-token' => $transferToken), $transferRefund, array())->thenReturn(array('token' => 'test-token')); // Run test @@ -4085,7 +4085,7 @@ public function testCreateTransferRefund_successful() { $this->assertEquals($foreignExchange1['rate'], "2.3"); // Validate mock - \Phake::verify($apiClientMock)->doPost('/rest/v3/transfers/{transfer-token}/refunds', + \Phake::verify($apiClientMock)->doPost('/rest/v4/transfers/{transfer-token}/refunds', array('transfer-token' => $transferToken), $transferRefund, array()); } @@ -4125,7 +4125,7 @@ public function testGetTransferRefund_successful() { $queryParams = array(); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds/{refund-token}', + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds/{refund-token}', $uriParams, $queryParams)->thenReturn(array('token' => $refundToken)); // Run test @@ -4138,7 +4138,7 @@ public function testGetTransferRefund_successful() { $this->assertEquals(array('token' => $refundToken), $transferRefund->getProperties()); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds/{refund-token}', + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds/{refund-token}', $uriParams, $queryParams); } @@ -4154,14 +4154,14 @@ public function testListTransferRefunds_noParameters() { $client = new Hyperwallet($userName, $password); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds', + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', $uriParams, $queryParams)->thenReturn(array('count' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); // Run test $transferRefundList = $client->listTransferRefunds($transferToken); $this->assertEquals(array('sourceCurrency' => $sourceCurrency), $transferRefundList[0]->getProperties()[0]); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds', + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', $uriParams, $queryParams); } @@ -4179,14 +4179,14 @@ public function testListTransferRefunds_withAllParameters() { $client = new Hyperwallet($userName, $password); $apiClientMock = $this->createAndInjectApiClientMock($client); - \Phake::when($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds', + \Phake::when($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', $uriParams, $queryParams)->thenReturn(array('count' => 1, 'data' => array(array('refundToken' => $refundToken, array('sourceCurrency' => $sourceCurrency))))); // Run test $transferRefundList = $client->listTransferRefunds($transferToken, $queryParams); $this->assertEquals(array('sourceCurrency' => $sourceCurrency), $transferRefundList[0]->getProperties()[0]); // Validate mock - \Phake::verify($apiClientMock)->doGet('/rest/v3/transfers/{transfer-token}/refunds', $uriParams, $queryParams); + \Phake::verify($apiClientMock)->doGet('/rest/v4/transfers/{transfer-token}/refunds', $uriParams, $queryParams); } public function testListTransferRefund_noTransferToken() {