Skip to content

Commit 37fcbe6

Browse files
1 parent df94f64 commit 37fcbe6

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

Facade/Customer.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,39 @@ protected function _get($id) {return df_try(function() use($id) {return (new C)-
111111
* `cards`: «The non-confidential details of the customer's cards on file»
112112
* «Connect API v2 Reference» → «Data Types» → «Customer»
113113
* https://docs.connect.squareup.com/api/connect/v2#type-customer
114+
* 2018-12-04
115+
* The `cards` key can be absent:
116+
* https://github.com/mage2pro/core/issues/83
117+
* «array_map(): Argument #2 should be an array
118+
* in vendor/mage2pro/core/StripeClone/Facade/Customer.php on line 149».
119+
* An example of a $c object without `cards`:
120+
* {
121+
* "address": {
122+
* "address_line_1": "4705 Rue Saint-Laurent",
123+
* "administrative_district_level_1": "Quebec",
124+
* "country": "CA",
125+
* "locality": "Sorel",
126+
* "postal_code": "J3R5S8"
127+
* },
128+
* "company_name": "Paille chevrolet sorel tracy ",
129+
* "created_at": "2018-11-24T00:04:56.002Z",
130+
* "creation_source": "THIRD_PARTY",
131+
* "email_address": "<...>",
132+
* "family_name": "<...>",
133+
* "given_name": "philippe",
134+
* "id": "P08A11D3PD4EBDD5ZNG50PHDRM",
135+
* "note": "<...>",
136+
* "phone_number": "5149982307",
137+
* "preferences": {
138+
* "email_unsubscribed": false
139+
* },
140+
* "updated_at": "2018-11-24T00:04:56Z"
141+
* }
114142
* @override
115143
* @see \Df\StripeClone\Facade\Customer::cardsData()
116144
* @used-by \Df\StripeClone\Facade\Customer::cards()
117145
* @param Operation $c
118146
* @return array(array(string => string))
119147
*/
120-
protected function cardsData($c) {return $c['cards'];}
148+
protected function cardsData($c) {return df_eta($c['cards']);}
121149
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mage2pro/square"
3-
,"version": "2.3.0"
3+
,"version": "2.3.1"
44
,"description": "Square Payments integration with Magento 2"
55
,"type": "magento2-module"
66
,"homepage": "https://mage2.pro/c/extensions/square"

0 commit comments

Comments
 (0)