Ejemplo n.º 1
0
 public function testAllParametersSetCorrectly()
 {
     $expiryDate = (new DateTime())->add(new DateInterval('P1M'));
     $card = new Card('51515151', '123', $expiryDate);
     $arr = $card->toArray();
     $this->assertEquals('51515151', $arr['number']);
     $this->assertEquals('123', $arr['cvv']);
     $this->assertEquals($expiryDate->format('Y'), $arr['expiry']['year']);
     $this->assertEquals($expiryDate->format('m'), $arr['expiry']['month']);
 }
Ejemplo n.º 2
0
 /**
  * Adds the value of card data to the body
  *
  * @param \Namshi\Innovate\Payment\Card $card
  */
 protected function addCard(Card $card)
 {
     $this->xmlBody['card'] = $card->toArray();
 }