File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,18 @@ private function initPayment($invoice)
4545 return $ response ;
4646 }
4747
48+
4849 /**
49- * Redirect Nagad Payment Checkout Page
50+ * Create payment
5051 *
5152 * @param float $amount
5253 * @param string $invoice
5354 *
54- * @return Application|RedirectResponse|Redirector
55- * @throws NagadException
55+ * @return mixed
5656 * @throws InvalidPrivateKey
5757 * @throws InvalidPublicKey
58+ * @throws NagadException
5859 */
59-
6060 public function create ($ amount , $ invoice )
6161 {
6262 $ initialize = $ this ->initPayment ($ invoice );
@@ -85,9 +85,15 @@ public function create($amount, $invoice)
8585 throw new NagadException ($ response ->message );
8686 }
8787
88- if ($ response ->status == "Success " ) {
89- return redirect ($ response ->callBackUrl );
90- }
88+ return $ response ;
89+ }
90+ }
91+
92+ public function executePayment ($ amount , $ invoice )
93+ {
94+ $ response = $ this ->create ($ amount , $ invoice );
95+ if ($ response ->status == "Success " ) {
96+ return redirect ($ response ->callBackUrl );
9197 }
9298 }
9399
You can’t perform that action at this time.
0 commit comments