Ejemplo n.º 1
0
 /**
  * Tests the getters and setters of the model
  * @test
  */
 public function setGetTest()
 {
     $url = "www.test.ing";
     $email = "*****@*****.**";
     $livemode = false;
     $eventTypes = array("transaction.succeeded", "transaction.failed");
     $this->_webhook->setUrl($url)->setEmail($email)->setLivemode($livemode)->setEventTypes($eventTypes);
     $this->assertEquals($this->_webhook->getUrl(), $url);
     $this->assertEquals($this->_webhook->getEmail(), $email);
     $this->assertEquals($this->_webhook->getLivemode(), $livemode);
     $this->assertEquals($this->_webhook->getEventTypes(), $eventTypes);
 }
Ejemplo n.º 2
0
 /**
  * Creates and fills a webhookmodel
  *
  * @param array $response
  * @return \Paymill\Models\Response\Webhook
  */
 private function _createWebhook($response)
 {
     $model = new Models\Webhook();
     $model->setId($response['id']);
     isset($response['url']) ? $model->setUrl($response['url']) : $model->setEmail($response['email']);
     $model->setLivemode($response['livemode']);
     $model->setEventTypes($response['event_types']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     $model->setAppId($response['app_id']);
     return $model;
 }