66use Exception ;
77use Illuminate \Http \Client \Response ;
88use Illuminate \Support \Facades \Http ;
9- use Illuminate \Support \Facades \Log ;
109
1110class Mpgs
1211{
@@ -18,14 +17,14 @@ class Mpgs
1817
1918 protected static string $ version ;
2019
21- private static Closure | array $ setupUsing = [];
20+ private static Closure | array $ setupUsing = [];
2221
2322 public function __construct ()
2423 {
2524 $ this ->setupClient ();
2625 }
2726
28- public static function setupClientUsing (Closure | array $ setupUsing )
27+ public static function setupClientUsing (Closure | array $ setupUsing )
2928 {
3029 static ::$ setupUsing = $ setupUsing ;
3130 }
@@ -54,7 +53,7 @@ public static function config($key, $default = null): ?string
5453 {
5554 $ value = config ("lunar-mpgs. {$ key }" , $ default );
5655
57- if (!$ value && str ($ key )->contains ('action. ' )) {
56+ if (! $ value && str ($ key )->contains ('action. ' )) {
5857 $ action = str ($ key )->afterLast ('action. ' )->toString ();
5958 $ value = match ($ action ) {
6059 'initiate_checkout ' => '/session ' ,
@@ -69,7 +68,7 @@ public static function config($key, $default = null): ?string
6968
7069 protected function getUrl (string $ action ): string
7170 {
72- return '{+gateway}/version/{version}/merchant/{merchantId} ' . self ::config ("action. {$ action }" );
71+ return '{+gateway}/version/{version}/merchant/{merchantId} ' . self ::config ("action. {$ action }" );
7372 }
7473
7574 protected function execute (string $ method , string $ action , array $ data = [], array $ urlParams = []): Response
@@ -81,13 +80,12 @@ protected function execute(string $method, string $action, array $data = [], arr
8180 ], $ urlParams ));
8281
8382 return $ client
84- ->withBasicAuth ('merchant. ' . static ::$ merchantId , static ::$ apiPassword )
83+ ->withBasicAuth ('merchant. ' . static ::$ merchantId , static ::$ apiPassword )
8584 ->{$ method }($ this ->getUrl ($ action ), $ data );
8685 }
8786
8887 /**
8988 * Create a MPGS checkout session and return the result.
90- *
9189 */
9290 public static function initiateCheckout (array $ data )
9391 {
@@ -104,7 +102,6 @@ public static function initiateCheckout(array $data)
104102
105103 /**
106104 * Retrieve MPGS checkout session details
107- *
108105 */
109106 public static function retrieveSession (string $ sessionId )
110107 {
@@ -120,7 +117,6 @@ public static function retrieveSession(string $sessionId)
120117
121118 /**
122119 * Retrieve the order details from MPGS.
123- *
124120 */
125121 public static function retrieveOrder ($ orderId )
126122 {
0 commit comments