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