diff --git a/src/ObjectHelper.php b/src/ObjectHelper.php index 22fdef2..6eed387 100644 --- a/src/ObjectHelper.php +++ b/src/ObjectHelper.php @@ -216,8 +216,6 @@ public function buildPaymentMethod(stdClass $object, stdClass $salesTaxAddress = 'paymentMethodId' => isset($object->merchantPaymentMethodId) ? $object->merchantPaymentMethodId : null, 'paymentMethodReference' => isset($object->VID) ? $object->VID : null, 'type' => isset($object->type) ? $object->type : null, - 'postcode' => isset($object->billingAddress->postalCode) ? $object->billingAddress->postalCode : null, - 'country' => isset($object->billingAddress->country) ? $object->billingAddress->country : null, // NonStrippingCreditCard won't remove the X's that Vindicia masks with 'card' => new NonStrippingCreditCard($card_info), 'attributes' => isset($nameValues) ? $this->buildAttributes($nameValues) : null diff --git a/src/PaymentMethod.php b/src/PaymentMethod.php index 2fe0038..029cfc4 100644 --- a/src/PaymentMethod.php +++ b/src/PaymentMethod.php @@ -198,48 +198,6 @@ public function setType($value) return $this->setParameter('type', $value); } - /** - * Get the billing postcode. - * - * @return null|string - */ - public function getPostcode() - { - return $this->getParameter('postcode'); - } - - /** - * Sets the billing postcode. - * - * @param string $value - * @return static - */ - public function setPostcode($value) - { - return $this->setParameter('postcode', $value); - } - - /** - * Get the billing country. - * - * @return null|string - */ - public function getCountry() - { - return $this->getParameter('country'); - } - - /** - * Sets the billing country. - * - * @param string $value - * @return static - */ - public function setCountry($value) - { - return $this->setParameter('country', $value); - } - /** * A list of attributes * diff --git a/tests/Message/FetchPaymentMethodRequestTest.php b/tests/Message/FetchPaymentMethodRequestTest.php index 19c3243..9a6a489 100644 --- a/tests/Message/FetchPaymentMethodRequestTest.php +++ b/tests/Message/FetchPaymentMethodRequestTest.php @@ -205,7 +205,6 @@ public function testSendPayPalSuccess() 'PAYMENT_METHOD_REFERENCE' => $this->paymentMethodReference, 'COUNTRY' => $this->card['country'], 'POSTCODE' => $this->card['postcode'] - )); $response = $this->request->send(); @@ -222,8 +221,10 @@ public function testSendPayPalSuccess() $this->assertSame($this->paymentMethodId, $paymentMethod->getId()); $this->assertSame($this->paymentMethodReference, $paymentMethod->getReference()); $this->assertSame('PayPal', $paymentMethod->getType()); - $this->assertSame($this->card['country'], $paymentMethod->getCountry()); - $this->assertSame($this->card['postcode'], $paymentMethod->getPostcode()); + $card = $paymentMethod->getCard(); + $this->assertInstanceOf('\Omnipay\Common\CreditCard', $card); + $this->assertSame($this->card['country'], $card->getCountry()); + $this->assertSame($this->card['postcode'], $card->getPostcode()); $attributes = $paymentMethod->getAttributes(); $this->assertSame(2, count($attributes)); diff --git a/tests/PaymentMethodTest.php b/tests/PaymentMethodTest.php index b0715a8..b6c4a77 100644 --- a/tests/PaymentMethodTest.php +++ b/tests/PaymentMethodTest.php @@ -112,26 +112,6 @@ public function testType() $this->assertSame($type, $this->paymentMethod->getType()); } - /** - * @return void - */ - public function testPostcode() - { - $postcode = $this->faker->postcode(); - $this->assertSame($this->paymentMethod, $this->paymentMethod->setPostcode($postcode)); - $this->assertSame($postcode, $this->paymentMethod->getPostcode()); - } - - /** - * @return void - */ - public function testCountry() - { - $country = $this->faker->region(); - $this->assertSame($this->paymentMethod, $this->paymentMethod->setCountry($country)); - $this->assertSame($country, $this->paymentMethod->getCountry()); - } - /** * @return void */