File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,29 @@ public function isSuccessful()
55
55
*/
56
56
public function getChargeReference ()
57
57
{
58
- if (isset ($ this ->data ['object ' ]) && $ this ->data ['object ' ] == ' charge ' ) {
58
+ if (isset ($ this ->data ['object ' ]) && ' charge ' === $ this ->data ['object ' ]) {
59
59
return $ this ->data ['id ' ];
60
60
}
61
61
62
62
return null ;
63
63
}
64
64
65
+ /**
66
+ * Get the outcome of a charge from the response
67
+ *
68
+ * @return array|null
69
+ */
70
+ public function getOutcome ()
71
+ {
72
+ if (isset ($ this ->data ['object ' ]) && 'charge ' === $ this ->data ['object ' ]) {
73
+ if (isset ($ this ->data ['outcome ' ]) && !empty ($ this ->data ['outcome ' ])) {
74
+ return $ this ->data ['outcome ' ];
75
+ }
76
+ }
77
+
78
+ return null ;
79
+ }
80
+
65
81
/**
66
82
* Get the transaction reference.
67
83
*
You can’t perform that action at this time.
0 commit comments