1 <?php
2
3 namespace MaxMind\MinFraud\Model;
4
5 /**
6 * Model with details about the credit card used.
7 *
8 * @property-read string|null $brand The card brand, such as "Visa", "Discover",
9 * "American Express", etc.
10 *
11 * @property-read string|null $country This property contains the the two letter
12 * {@link http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ISO 3166-1 alpha-2
13 * country code} associated with the location of the majority of customers
14 * using this credit card as determined by their billing address. In cases
15 * where the location of customers is highly mixed, this defaults to the
16 * country of the bank issuing the card.
17 *
18 * @property-read boolean|null $isIssuedInBillingAddressCountry This property is
19 * true if the country of the billing address matches the country of the
20 * majority of customers using this credit card. In cases where the location
21 * of customers is highly mixed, the match is to the country of the bank
22 * issuing the card.
23 *
24 * @property-read boolean|null $isPrepaid This property is true if the card is a
25 * prepaid card.
26 *
27 * @property-read \MaxMind\MinFraud\Model\Issuer $issuer An object containing
28 * information about the credit card issuer.
29 *
30 * @property-read string|null $type The card's type. The valid values are: charge,
31 * credit, debit.
32 */
33 class CreditCard extends AbstractModel
34 {
35 /**
36 * @internal
37 */
38 protected $brand;
39
40 /**
41 * @internal
42 */
43 protected $country;
44
45 /**
46 * @internal
47 */
48 protected $isIssuedInBillingAddressCountry;
49
50 /**
51 * @internal
52 */
53 protected $isPrepaid;
54
55 /**
56 * @internal
57 */
58 protected $issuer;
59
60 /**
61 * @internal
62 */
63 protected $type;
64
65 public function __construct($response, $locales = ['en'])
66 {
67 parent::__construct($response, $locales);
68
69 $this->issuer = new Issuer($this->safeArrayLookup($response['issuer']));
70
71 $this->brand = $this->safeArrayLookup($response['brand']);
72 $this->country = $this->safeArrayLookup($response['country']);
73 $this->isIssuedInBillingAddressCountry
74 = $this->safeArrayLookup($response['is_issued_in_billing_address_country']);
75 $this->isPrepaid = $this->safeArrayLookup($response['is_prepaid']);
76 $this->type = $this->safeArrayLookup($response['type']);
77 }
78 }
79