diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a661518..7bbae9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ CHANGELOG ========= +1.12.0 +------------------- + +* Added support for the new credit card output `/credit_card/is_business`. + This indicates whether the card is a business card. It may be accessed via + `$response->creditCard->isBusiness` on the minFraud Insights and Factors + response objects. + 1.11.0 (2020-03-26) ------------------- diff --git a/src/MinFraud/Model/CreditCard.php b/src/MinFraud/Model/CreditCard.php index 31197c68..9a889fab 100644 --- a/src/MinFraud/Model/CreditCard.php +++ b/src/MinFraud/Model/CreditCard.php @@ -13,6 +13,8 @@ * location of the majority of customers using this credit card as determined * by their billing address. In cases where the location of customers is highly * mixed, this defaults to the country of the bank issuing the card. + * @property-read bool|null $isBusiness This property is true if the card is a + * business card. * @property-read bool|null $isIssuedInBillingAddressCountry This property is * true if the country of the billing address matches the country of the * majority of customers using this credit card. In cases where the location @@ -39,6 +41,11 @@ class CreditCard extends AbstractModel */ protected $country; + /** + * @internal + */ + protected $isBusiness; + /** * @internal */ @@ -72,6 +79,7 @@ public function __construct($response, $locales = ['en']) $this->brand = $this->safeArrayLookup($response['brand']); $this->country = $this->safeArrayLookup($response['country']); + $this->isBusiness = $this->safeArrayLookup($response['is_business']); $this->isIssuedInBillingAddressCountry = $this->safeArrayLookup($response['is_issued_in_billing_address_country']); $this->isPrepaid = $this->safeArrayLookup($response['is_prepaid']); diff --git a/tests/MaxMind/Test/MinFraud/Model/CreditCardTest.php b/tests/MaxMind/Test/MinFraud/Model/CreditCardTest.php index deecde09..f0f83fbf 100644 --- a/tests/MaxMind/Test/MinFraud/Model/CreditCardTest.php +++ b/tests/MaxMind/Test/MinFraud/Model/CreditCardTest.php @@ -21,6 +21,7 @@ public function testCreditCard() ], 'brand' => 'Visa', 'country' => 'US', + 'is_business' => true, 'is_issued_in_billing_address_country' => false, 'is_prepaid' => true, 'is_virtual' => true, @@ -64,6 +65,12 @@ public function testCreditCard() 'country' ); + $this->assertSame( + $array['is_business'], + $cc->isBusiness, + 'isBusiness' + ); + $this->assertSame( $array['is_issued_in_billing_address_country'], $cc->isIssuedInBillingAddressCountry, diff --git a/tests/data/factors-response.json b/tests/data/factors-response.json index fb557110..c512b655 100644 --- a/tests/data/factors-response.json +++ b/tests/data/factors-response.json @@ -117,6 +117,7 @@ }, "brand": "Visa", "country": "US", + "is_business": true, "is_issued_in_billing_address_country": true, "is_prepaid": true, "type": "credit" diff --git a/tests/data/insights-response.json b/tests/data/insights-response.json index d16bfae0..0d6b153d 100644 --- a/tests/data/insights-response.json +++ b/tests/data/insights-response.json @@ -117,6 +117,7 @@ }, "brand": "Visa", "country": "US", + "is_business": true, "is_issued_in_billing_address_country": true, "is_prepaid": true, "type": "credit"