@@ -40,7 +40,7 @@ public function getTransactionReference()
40
40
return $ this ->data ['error ' ]['charge ' ];
41
41
}
42
42
43
- return ;
43
+ return null ;
44
44
}
45
45
46
46
/**
@@ -79,7 +79,7 @@ public function getCustomerReference()
79
79
}
80
80
}
81
81
82
- return ;
82
+ return null ;
83
83
}
84
84
85
85
/**
@@ -110,7 +110,7 @@ public function getCardReference()
110
110
}
111
111
}
112
112
113
- return ;
113
+ return null ;
114
114
}
115
115
116
116
/**
@@ -124,7 +124,7 @@ public function getToken()
124
124
return $ this ->data ['id ' ];
125
125
}
126
126
127
- return ;
127
+ return null ;
128
128
}
129
129
130
130
/**
@@ -138,7 +138,7 @@ public function getCard()
138
138
return $ this ->data ['card ' ];
139
139
}
140
140
141
- return ;
141
+ return null ;
142
142
}
143
143
144
144
/**
@@ -150,9 +150,9 @@ public function getSource()
150
150
{
151
151
if (isset ($ this ->data ['source ' ]) && $ this ->data ['source ' ]['object ' ] == 'card ' ) {
152
152
return $ this ->data ['source ' ];
153
- } else {
154
- return ;
155
153
}
154
+
155
+ return null ;
156
156
}
157
157
158
158
/**
@@ -166,7 +166,7 @@ public function getSubscriptionReference()
166
166
return $ this ->data ['id ' ];
167
167
}
168
168
169
- return ;
169
+ return null ;
170
170
}
171
171
172
172
/**
@@ -180,7 +180,7 @@ public function getEventReference()
180
180
return $ this ->data ['id ' ];
181
181
}
182
182
183
- return ;
183
+ return null ;
184
184
}
185
185
186
186
/**
@@ -194,7 +194,7 @@ public function getInvoiceReference()
194
194
return $ this ->data ['id ' ];
195
195
}
196
196
197
- return ;
197
+ return null ;
198
198
}
199
199
200
200
/**
@@ -208,7 +208,7 @@ public function getList()
208
208
return $ this ->data ['data ' ];
209
209
}
210
210
211
- return ;
211
+ return null ;
212
212
}
213
213
214
214
/**
@@ -224,7 +224,7 @@ public function getPlan()
224
224
return $ this ->data ;
225
225
}
226
226
227
- return ;
227
+ return null ;
228
228
}
229
229
230
230
/**
@@ -239,7 +239,7 @@ public function getPlanId()
239
239
return $ plan ['id ' ];
240
240
}
241
241
242
- return ;
242
+ return null ;
243
243
}
244
244
245
245
/**
@@ -253,7 +253,7 @@ public function getInvoiceItemReference()
253
253
return $ this ->data ['id ' ];
254
254
}
255
255
256
- return ;
256
+ return null ;
257
257
}
258
258
259
259
/**
@@ -269,6 +269,22 @@ public function getMessage()
269
269
return $ this ->data ['error ' ]['message ' ];
270
270
}
271
271
272
- return ;
272
+ return null ;
273
+ }
274
+
275
+ /**
276
+ * Get the error message from the response.
277
+ *
278
+ * Returns null if the request was successful.
279
+ *
280
+ * @return string|null
281
+ */
282
+ public function getCode ()
283
+ {
284
+ if (!$ this ->isSuccessful ()) {
285
+ return $ this ->data ['error ' ]['code ' ];
286
+ }
287
+
288
+ return null ;
273
289
}
274
290
}
0 commit comments