Example #1
0
 /**
  * Tests the getters and setters of the model
  * @test
  */
 public function setGetTest()
 {
     $sample = array('client' => 'client_88a388d9dd48f86c3136', 'token' => '098f6bcd4621d373cade4e832627b4f6');
     $this->_payment->setClient($sample['client'])->setToken($sample['token']);
     $this->assertEquals($this->_payment->getClient(), $sample['client']);
     $this->assertEquals($this->_payment->getToken(), $sample['token']);
     return $this->_payment;
 }
Example #2
0
 public function start()
 {
     $payment = new Payment();
     $payment->setToken($this->environment->request('token'));
     $payment->setClient($this->order->getCustomer());
     $response = null;
     try {
         $this->log($payment);
         $response = $this->paymill->create($payment);
         $this->log($response);
     } catch (Exception $e) {
         $this->log($e);
         throw $e;
     } finally {
         if ($paymentId = $response->getId()) {
             return $this->makeTransaction($paymentId);
         }
     }
 }