public function setUp()
 {
     $this->connector = \Ezypay\Ezypay::driver('Curl', array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $validation = new \Ezypay\Validation\Validation();
     //$this->resource = \Ezypay\Ezypay::resource('Subscription', $this->connector,$validation);
     $this->resultProducer = new \Ezypay\Result\ResultProducer($this->connector, $validation, 'Customer');
 }
 /**
  * Test delete() method of InvoiceItem resource
  */
 public function testDelete()
 {
     $id = '0215a60f-6d6b-4f21-9af8-15d76e815fe5';
     /**
      * @var $connector DriverInterface
      */
     $connector = \Ezypay\Ezypay::driver('Curl', array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $validation = new \Ezypay\Validation\Validation();
     /**
      * @var $resource \Ezypay\Resource\InvoiceItem
      */
     $resource = \Ezypay\Ezypay::resource('InvoiceItem', $connector, $validation);
     $resource->delete($id);
     $this->assertAttributeEquals(BASE_URL, 'base_url', $connector, 'Failed. Base url not correct');
     $this->assertAttributeEquals('DELETE', 'method', $connector, 'Failed. Method is not correct');
     $this->assertAttributeEquals('invoiceitems/' . $id, 'url', $connector, 'Failed. Url is not correct');
 }
 /**
  * Test Customer findByReferenceId method
  */
 public function testFindByReferenceID()
 {
     /**
      * @var $connector DriverInterface
      */
     $connector = \Ezypay\Ezypay::driver('Curl', array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $validation = new Ezypay\Validation\Validation();
     $id = 123456;
     /**
      * @var $resource resourceInterfaceCustomer
      */
     $resource = \Ezypay\Ezypay::resource('Customer', $connector, $validation);
     $resource->findByReferenceId($id);
     $this->assertAttributeEquals(BASE_URL, 'base_url', $connector, 'Failed. Base url not correct');
     $this->assertAttributeEquals('GET', 'method', $connector, 'Failed. Method is not correct');
     $this->assertAttributeEquals('customers/reference/' . $id, 'url', $connector, 'Failed. Url is not correct');
 }
 /**
  * @return DriverInterface
  */
 public function setUp()
 {
     $this->connector = \Ezypay\Ezypay::driver('Curl', array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $validation = new \Ezypay\Validation\Validation();
     $this->resource = \Ezypay\Ezypay::resource('Plan', $this->connector, $validation);
 }
 /**
  * @return DriverInterface
  */
 public function setUp()
 {
     $this->connector = \Ezypay\Ezypay::driver('Curl', array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $this->validation = new Ezypay\Validation\Validation();
 }
Exemple #6
0
 /**
  * Test instace
  */
 public function testCreateDriver()
 {
     $connector = \Ezypay\Ezypay::driver("Curl", array('base_url' => BASE_URL, 'apiKey' => API_KEY));
     $this->assertInstanceOf('\\Ezypay\\Driver\\Curl', $connector);
 }