Exemplo n.º 1
0
 /**
  * @param Customer $customer
  * @return CustomerBankAccount
  */
 public function get_customer_full_bank_account(Customer $customer = null)
 {
     $customer = $customer ?: $this->get_full_customer();
     $account = CustomerBankAccount::fromArray($this->full_bank_account_details());
     $account->setOwner($customer);
     return $account;
 }
Exemplo n.º 2
0
 /**
  * @see https://developer.gocardless.com/pro/#customer-bank-accounts-disable-a-customer-bank-account
  *
  * @param $id
  *
  * @return CustomerBankAccount
  */
 public function disableCustomerBankAccount($id)
 {
     $response = $this->post(self::CUSTOMER_BANK_ACCOUNTS, [], $id . '/actions/disable');
     return CustomerBankAccount::fromArray($response);
 }
Exemplo n.º 3
0
 /** @test */
 function it_can_be_converted_an_array_for_the_api()
 {
     $mandate = (new Mandate(CustomerBankAccount::fromArray(['id' => 'BA111']), Creditor::fromArray(['id' => 'CR111'])))->useSepaCore();
     $this->assertEquals(['scheme' => 'sepa_core', 'links' => ['customer_bank_account' => 'BA111', 'creditor' => 'CR111']], $mandate->toArray());
 }