/**
  * @depends testListPayments
  * @param Payment $old
  */
 public function testGetPayment($old)
 {
     $new = $this->getClient()->getPayment($old->getId());
     $newArray = $new->toArray();
     $oldArray = $old->toArray();
     $this->assertEquals($newArray, $oldArray);
 }
 /**
  * @param Payment $payment
  * @return Payment
  * @throws \Exception
  */
 public function cancelPayment(Payment $payment)
 {
     $response = $this->post(self::ENDPOINT_PAYMENTS, [], $payment->getId() . self::CANCEL_ACTION);
     $payment->fromArray($response);
     return $payment;
 }
Esempio n. 3
0
 /**
  * @param $id
  * @return Payment
  */
 public function getPayment($id)
 {
     $payment = new Payment();
     $payment->fromArray($this->get(self::ENDPOINT_PAYMENTS, [], $id));
     return $payment;
 }
 public function fromArray($data)
 {
     parent::fromArray($data);
     $this->setCreatedAt(new \DateTime($this->getCreatedAt()));
 }