/** @test */
 function it_can_be_converted_an_array_for_the_api()
 {
     $redirectFlow = (new RedirectFlow(Creditor::fromArray(['id' => 'CR111']), Mandate::fromArray(['id' => 'MD111'])))->useSepaCore();
     $this->assertEquals(['scheme' => 'sepa_core', 'links' => ['creditor' => 'CR111', 'mandate' => 'MD111']], $redirectFlow->toArray());
 }
Beispiel #2
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());
 }
Beispiel #3
0
 /**
  * @see https://developer.gocardless.com/pro/#creditors-get-a-single-creditor
  *
  * @param $id
  *
  * @return Creditor
  */
 public function getCreditor($id)
 {
     $response = $this->get(self::CREDITORS, [], $id);
     return Creditor::fromArray($response);
 }
Beispiel #4
0
 /**
  * @return Creditor
  */
 public function get_full_creditor()
 {
     return Creditor::fromArray($this->full_creditor_details());
 }