@@ -29,8 +29,7 @@ public function __construct(
2929 protected array $ config ,
3030 protected Dispatcher $ events ,
3131 protected LoggerInterface $ logger ,
32- ) {
33- }
32+ ) {}
3433
3534 abstract public function name (): string ;
3635
@@ -56,6 +55,7 @@ final public function pay(PaymentRequest $request): PaymentResponse
5655 try {
5756 $ response = $ this ->executePayment ($ request , $ txn );
5857 $ this ->applyResponse ($ txn , $ response );
58+
5959 return $ response ;
6060 } catch (Throwable $ e ) {
6161 return $ this ->handleFailure ($ txn , $ e );
@@ -67,6 +67,7 @@ final public function status(Transaction $transaction): StatusResponse
6767 $ response = $ this ->executeStatus ($ transaction );
6868 $ transaction ->refreshFromStatus ($ response );
6969 $ this ->events ->dispatch (new PaymentStatusChecked ($ transaction , $ response ));
70+
7071 return $ response ;
7172 }
7273
@@ -83,6 +84,7 @@ protected function credential(string $key, mixed $default = null): mixed
8384 protected function baseUrl (): string
8485 {
8586 $ key = $ this ->mode () === 'live ' ? 'live_url ' : 'sandbox_url ' ;
87+
8688 return (string ) ($ this ->config [$ key ] ?? '' );
8789 }
8890
@@ -189,12 +191,14 @@ protected function extractError(Throwable $e): array
189191 $ e ->providerErrorMessage () ?? $ e ->getMessage (),
190192 ];
191193 }
194+
192195 return ['PROVIDER_FAILURE ' , $ e ->getMessage ()];
193196 }
194197
195198 protected function throwsExceptions (): bool
196199 {
197200 $ flag = config ('payify.throw_exceptions ' );
201+
198202 return $ flag ?? (bool ) config ('app.debug ' );
199203 }
200204
0 commit comments