public function testCreateAccount() { $request = $this->accounts->createAccountRequest(); $request->setEmail("bob" . $this->randomString() . "@loblaw.com"); $account = $this->accounts->createAccount($request); $this->assertInstanceOf(Accounts::ACCOUNT_RESPONSE_CLASS, $account); }
public function testGetBalanceTransaction() { $createAccountRequest = $this->accounts->createAccountRequest(); $createAccountRequest->setEmail("foo" . $this->randomString() . "@bar.com"); $createAccountRequest->setCountry("US"); $bankAccountRequest = new BankAccountRequest(); $bankAccountRequest->setCountry("US"); $bankAccountRequest->setCurrency("USD"); $bankAccountRequest->setAccountNumber($this::ACCOUNT_NUMBER); $bankAccountRequest->setRoutingNumber($this::ROUTING_NUMBER); $createAccountRequest->setBankAccount($bankAccountRequest); $createAccountRequest->setManaged(true); $account = $this->accounts->createAccount($createAccountRequest); $transfer = $this->transfers->createTransfer($this->transfers->createTransferRequest(100, "usd", $account->getId())); $this->assertInstanceOf(Transfers::TRANSFER_RESPONSE_CLASS, $transfer); $balanceTransaction = $this->balance->getBalanceTransaction($transfer->getBalanceTransaction()); $this->assertInstanceOf(Balance::BALANCE_TRANSACTION_RESPONSE_CLASS, $balanceTransaction); $this->assertEquals($transfer->getBalanceTransaction(), $balanceTransaction->getId()); }
/** * @return AccountResponse */ protected function createAccount() { $request = $this->accounts->createAccountRequest(); $request->setEmail("foo" . $this->randomString() . "@bar.com"); $account = new BankAccountRequest(); $account->setCountry("us"); $account->setCurrency("usd"); $account->setRoutingNumber(self::ROUTING_NUMBER); $account->setAccountNumber(self::ACCOUNT_NUMBER); $request->setBankAccount($account); return $this->accounts->createAccount($request); }
public function testListAccounts() { $request = $this->accounts->createAccountRequest(); $request->setEmail("bob" . $this->randomString() . "@loblaw.com"); $request->setManaged(true); $account1 = $this->accounts->createAccount($request); $account2 = $this->accounts->createAccount($request); $account3 = $this->accounts->createAccount($request); $request = new ListRequest(); $request->setLimit(2); $list = $this->accounts->listConnectedAccounts($request); $this->assertInstanceOf(Accounts::LIST_ACCOUNT_RESPONSE_CLASS, $list); $this->assertEquals(2, sizeof($list->getData())); $this->accounts->deleteConnectedAccount($account1->getId()); $this->accounts->deleteConnectedAccount($account2->getId()); $this->accounts->deleteConnectedAccount($account3->getId()); }