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 bool|null $isVirtual This property is true if the card is a
24: * virtual card.
25: * @property-read \MaxMind\MinFraud\Model\Issuer $issuer An object containing
26: * information about the credit card issuer.
27: * @property-read string|null $type The card's type. The valid values are: charge,
28: * credit, debit.
29: */
30: class CreditCard extends AbstractModel
31: {
32: /**
33: * @internal
34: */
35: protected $brand;
36:
37: /**
38: * @internal
39: */
40: protected $country;
41:
42: /**
43: * @internal
44: */
45: protected $isIssuedInBillingAddressCountry;
46:
47: /**
48: * @internal
49: */
50: protected $isPrepaid;
51:
52: /**
53: * @internal
54: */
55: protected $isVirtual;
56:
57: /**
58: * @internal
59: */
60: protected $issuer;
61:
62: /**
63: * @internal
64: */
65: protected $type;
66:
67: public function __construct($response, $locales = ['en'])
68: {
69: parent::__construct($response, $locales);
70:
71: $this->issuer = new Issuer($this->safeArrayLookup($response['issuer']));
72:
73: $this->brand = $this->safeArrayLookup($response['brand']);
74: $this->country = $this->safeArrayLookup($response['country']);
75: $this->isIssuedInBillingAddressCountry
76: = $this->safeArrayLookup($response['is_issued_in_billing_address_country']);
77: $this->isPrepaid = $this->safeArrayLookup($response['is_prepaid']);
78: $this->isVirtual = $this->safeArrayLookup($response['is_virtual']);
79: $this->type = $this->safeArrayLookup($response['type']);
80: }
81: }
82: