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']); }
/** * 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(); }