6 use Omnipay\Tests\TestCase;
8 class RestCreateCardRequestTest
extends TestCase
16 public function setUp()
20 $this->request =
new RestCreateCardRequest($this->getHttpClient(), $this->getHttpRequest());
25 $this->request->initialize(array(
'card' =>
$card));
31 $data = $this->request->getData();
33 $this->assertSame(
$card->getNumber(), $data[
'number']);
34 $this->assertSame(
$card->getBrand(), $data[
'type']);
35 $this->assertSame(
$card->getExpiryMonth(), $data[
'expire_month']);
36 $this->assertSame(
$card->getExpiryYear(), $data[
'expire_year']);
37 $this->assertSame(
$card->getCvv(), $data[
'cvv2']);
38 $this->assertSame(
$card->getFirstName(), $data[
'first_name']);
39 $this->assertSame(
$card->getLastName(), $data[
'last_name']);
40 $this->assertSame(
$card->getAddress1(), $data[
'billing_address'][
'line1']);
41 $this->assertSame(
$card->getAddress2(), $data[
'billing_address'][
'line2']);
42 $this->assertSame(
$card->getCity(), $data[
'billing_address'][
'city']);
43 $this->assertSame(
$card->getState(), $data[
'billing_address'][
'state']);
44 $this->assertSame(
$card->getPostcode(), $data[
'billing_address'][
'postal_code']);
45 $this->assertSame(
$card->getCountry(), $data[
'billing_address'][
'country_code']);