File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/Services/PaymentHandlers Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 7
7
use Illuminate \Foundation \Auth \User ;
8
8
use Damms005 \LaravelMultipay \Models \Payment ;
9
9
use Damms005 \LaravelMultipay \Models \PaymentPlan ;
10
+ use Damms005 \LaravelMultipay \ValueObjects \ReQuery ;
10
11
use Illuminate \Database \Eloquent \Casts \ArrayObject ;
11
12
use Damms005 \LaravelMultipay \Services \PaymentService ;
12
13
use Damms005 \LaravelMultipay \Actions \CreateNewPayment ;
@@ -228,24 +229,24 @@ protected static function getPaymentDescription(?Payment $payment): array
228
229
/**
229
230
* @see \Damms005\LaravelMultipay\Contracts\PaymentHandlerInterface::reQuery()
230
231
*/
231
- public function reQueryUnsuccessfulPayment (Payment $ unsuccessfulPayment )
232
+ public function reQueryUnsuccessfulPayment (Payment $ unsuccessfulPayment ): ? ReQuery
232
233
{
233
234
/** @var PaymentHandlerInterface **/
234
235
$ handler = app ()->make (PaymentHandlerInterface::class, [$ unsuccessfulPayment ]);
235
236
236
237
$ reQueryResponse = $ handler ->reQuery ($ unsuccessfulPayment );
237
238
238
239
if ($ reQueryResponse == null ) {
239
- return false ;
240
+ return null ;
240
241
}
241
242
242
- $ isSuccessFulPayment = boolval ($ reQueryResponse ->payment ->refresh ()->is_success );
243
+ $ isSuccessful = boolval ($ reQueryResponse ->payment ->refresh ()->is_success );
243
244
244
- if ($ isSuccessFulPayment ) {
245
+ if ($ isSuccessful ) {
245
246
event (new SuccessfulLaravelMultipayPaymentEvent ($ reQueryResponse ->payment ));
246
247
}
247
248
248
- return $ isSuccessFulPayment ;
249
+ return $ reQueryResponse ;
249
250
}
250
251
251
252
public function paymentCompletionWebhookHandler (Request $ request )
You can’t perform that action at this time.
0 commit comments