コード例 #1
0
ファイル: BalanceTest.php プロジェクト: jlinn/stripe-api-php
 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());
 }
コード例 #2
0
 /**
  * @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);
 }