diff --git a/.env.example b/.env.example
index a13d916..647cb09 100644
--- a/.env.example
+++ b/.env.example
@@ -77,4 +77,5 @@ SIGN_SMS=true
SIGN_DRIVER=Kavenegar
ZARINPAL_MERCHANT=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
-PAY_GATEWAY=zarinpal
+ZIBAL_MERCHANT=zibal
+PAY_GATEWAY=zibal
diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php
index d7cedae..b702583 100644
--- a/app/Helpers/Helper.php
+++ b/app/Helpers/Helper.php
@@ -315,6 +315,7 @@ function sluger($name, $replace_char = '-')
*/
function lastCrump()
{
+
$routes = explode('.', Route::currentRouteName());
if (count($routes) != 3) {
echo '
diff --git a/app/Http/Controllers/CardController.php b/app/Http/Controllers/CardController.php
index 58aaff1..057e29f 100644
--- a/app/Http/Controllers/CardController.php
+++ b/app/Http/Controllers/CardController.php
@@ -154,8 +154,8 @@ class CardController extends Controller
$callbackUrl = route('pay.check', ['invoice_hash' => $invoice->hash, 'gateway' => $gateway->getName()]);
$payment = null;
try {
- $response = $gateway->request(($invoice->total_price - $invoice->credit_price), $callbackUrl);
- $payment = $invoice->storePaymentRequest($response['order_id'], ($invoice->total_price - $invoice->credit_price), $response['token'] ?? null, null, $gateway->getName());
+ $response = $gateway->request((($invoice->total_price - $invoice->credit_price) * config('app.currency.factor')), $callbackUrl);
+ $payment = $invoice->storePaymentRequest($response['order_id'], (($invoice->total_price - $invoice->credit_price) * config('app.currency.factor')), $response['token'] ?? null, null, $gateway->getName());
session(["payment_id" => $payment->id]);
\Session::save();
@@ -218,7 +218,6 @@ class CardController extends Controller
}
-
public function productCompareToggle($slug)
{
@@ -230,7 +229,7 @@ class CardController extends Controller
unset($compares[array_search($product->id, $compares)]);
} else {
$compares[] = $product->id;
- $msg = __( "Product added to compare");
+ $msg = __("Product added to compare");
}
\Cookie::queue('compares', json_encode($compares), 2000);
} else {
diff --git a/app/Http/Controllers/Payment/GatewayVerifyController.php b/app/Http/Controllers/Payment/GatewayVerifyController.php
index 91703cb..570d00d 100755
--- a/app/Http/Controllers/Payment/GatewayVerifyController.php
+++ b/app/Http/Controllers/Payment/GatewayVerifyController.php
@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Payment;
use App\Contracts\Payment;
+use App\Http\Controllers\CardController;
use App\Models\Invoice;
class GatewayVerifyController
@@ -31,6 +32,7 @@ class GatewayVerifyController
return redirect()->route('client.card')->withErrors(__("error in payment.").$message);
}
+ CardController::clear();
return redirect()->route('client.profile')->with('message' , __("payment success"));
}
diff --git a/config/app.php b/config/app.php
index 8238241..57262c5 100644
--- a/config/app.php
+++ b/config/app.php
@@ -183,6 +183,12 @@ return [
'main' => env('XLANG_MAIN','en'),
'api_url' => env('XLANG_API_URL',''),
],
+ 'xshop' =>[
+ 'payment' => [
+ 'gateway' => env('PAY_GATEWAY',''),
+ 'merchant_id' => env('MERCHANT_ID',''),
+ ]
+ ],
diff --git a/resources/views/components/panel-breadcrumb.blade.php b/resources/views/components/panel-breadcrumb.blade.php
index 72c6dee..4920e5c 100644
--- a/resources/views/components/panel-breadcrumb.blade.php
+++ b/resources/views/components/panel-breadcrumb.blade.php
@@ -7,7 +7,7 @@
-
+
{{__("Dashboard")}}
diff --git a/resources/views/segments/customer/AvisaCustomer/AvisaCustomer.blade.php b/resources/views/segments/customer/AvisaCustomer/AvisaCustomer.blade.php
index 43989d9..e84dc8b 100644
--- a/resources/views/segments/customer/AvisaCustomer/AvisaCustomer.blade.php
+++ b/resources/views/segments/customer/AvisaCustomer/AvisaCustomer.blade.php
@@ -226,7 +226,7 @@
class="btn btn-outline-primary btn-sm ">
- @if($inv->status == 'PENDING')
+ @if($inv->status != 'COMPLETED' && $inv->created_at->timestamp < (time() - 3600) )
{{__("Pay now")}}
diff --git a/resources/views/segments/menu/AplMenu/AplMenu.blade.php b/resources/views/segments/menu/AplMenu/AplMenu.blade.php
index 964c025..4ceff90 100644
--- a/resources/views/segments/menu/AplMenu/AplMenu.blade.php
+++ b/resources/views/segments/menu/AplMenu/AplMenu.blade.php
@@ -3,7 +3,7 @@
@@ -86,8 +86,8 @@
-