File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public function reQuery(Payment $existingPayment): ?ReQuery
96
96
try {
97
97
$ verificationResponse = $ this ->verifyPaystackTransaction ($ existingPayment ->processor_transaction_reference );
98
98
} catch (\Throwable $ th ) {
99
- return new ReQuery ($ existingPayment , $ th ->getMessage ());
99
+ return new ReQuery ($ existingPayment , [ ' error ' => $ th ->getMessage ()] );
100
100
}
101
101
102
102
// status should be true if there was a successful call
@@ -124,7 +124,7 @@ public function reQuery(Payment $existingPayment): ?ReQuery
124
124
125
125
return new ReQuery (
126
126
payment: $ payment ,
127
- responseDescription: ' Response from gateway server: ' . json_encode (( array )$ verificationResponse) ,
127
+ responseDetails: ( array )$ verificationResponse ,
128
128
);
129
129
}
130
130
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ public function reQuery(Payment $existingPayment): ?ReQuery
158
158
159
159
return new ReQuery (
160
160
payment: $ payment ,
161
- responseDescription: ' Response from gateway server: ' . json_encode (( array )$ rrrQueryResponse) ,
161
+ responseDetails: ( array )$ rrrQueryResponse ,
162
162
);
163
163
}
164
164
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ class ReQuery
8
8
{
9
9
public function __construct (
10
10
public Payment $ payment ,
11
- public string $ responseDescription ,
11
+
12
+ /**
13
+ * An array of arbitrary shape based on the specific payment handler.
14
+ */
15
+ public array $ responseDetails ,
12
16
) {}
13
17
}
Original file line number Diff line number Diff line change 33
33
$ mock ->expects ('reQuery ' )->andReturn (
34
34
new ReQuery (
35
35
payment: new Payment (),
36
- responseDescription: ' Successful ' ,
36
+ responseDetails: [ ' status ' => ' Successful '] ,
37
37
),
38
38
);
39
39
52
52
$ mock ->expects ('reQuery ' )->andReturn (
53
53
new ReQuery (
54
54
payment: new Payment (['is_success ' => true ]),
55
- responseDescription: ' Successful ' ,
55
+ responseDetails: [ ' status ' => ' Successful '] ,
56
56
),
57
57
);
58
58
76
76
$ mock ->expects ('reQuery ' )->andReturn (
77
77
new ReQuery (
78
78
payment: new Payment (['is_success ' => false ]),
79
- responseDescription: ' Went South! ' ,
79
+ responseDetails: [ ' status ' => ' Went South! '] ,
80
80
),
81
81
);
82
82
You can’t perform that action at this time.
0 commit comments