/** * @param Creditor $creditor * @return CreditorBankAccount */ public function get_creditor_full_bank_account(Creditor $creditor = null) { $creditor = $creditor ?: $this->get_full_creditor(); $account = CreditorBankAccount::fromArray($this->full_bank_account_details()); $account->setAccountHolderName('Nude Wines')->setOwner($creditor); return $account; }
/** * @see https://developer.gocardless.com/pro/#creditor-bank-accounts-disable-a-creditor-bank-account * * @param $id * * @return CreditorBankAccount */ public function disableCreditorBankAccount($id) { $response = $this->post(self::CREDITOR_BANK_ACCOUNTS, [], $id . '/actions/disable'); return CreditorBankAccount::fromArray($response); }
/** @depends test_it_can_create_creditor_bank_account */ function test_it_can_get_a_single_creditor_bank_account(CreditorBankAccount $old) { $new = $this->api->getCreditorBankAccount($old->getId()); $this->assertInstanceOf('GoCardless\\Pro\\Models\\CreditorBankAccount', $new); $this->assertEquals($old->toArray(), $new->toArray()); }