/** * @return TransferResponse */ protected function createTransfer() { $request = $this->transfers->createTransferRequest(350, "usd", "self"); $request->setDestination($this->createAccount()->getId()); $request->setRecipient(null); return $this->transfers->createTransfer($request); }
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()); }