コード例 #1
0
ファイル: Client.php プロジェクト: gingerpayments/ginger-php
 /**
  * Get possible iDEAL issuers.
  *
  * @return Issuers
  */
 public function getIdealIssuers()
 {
     try {
         return Issuers::fromArray($this->httpClient->get('ideal/issuers/')->json());
     } catch (RequestException $exception) {
         throw new ClientException('An error occurred while processing the request: ' . $exception->getMessage(), $exception->getCode(), $exception);
     }
 }
コード例 #2
0
ファイル: IssuersTest.php プロジェクト: duronrulez/ginger-php
 /**
  * @test
  */
 public function itShouldBeTraversable()
 {
     $array = [['id' => 'ABNANL2A', 'name' => 'ABN AMRO Bank', 'list_type' => 'Nederland'], ['id' => 'INGBNL2A', 'name' => 'ING Bank', 'list_type' => 'Nederland']];
     $issuers = Issuers::fromArray($array);
     $iterations = 0;
     foreach ($issuers as $key => $issuer) {
         $this->assertEquals($iterations, $key);
         $this->assertInstanceOf('GingerPayments\\Payment\\Ideal\\Issuer', $issuer);
         $iterations++;
     }
     $this->assertEquals(2, $iterations);
 }