final checkout and card

This commit is contained in:
Kevin Adametz 2019-02-21 21:38:36 +01:00
parent 4bd21bd986
commit 1953c97cd0
33 changed files with 2131 additions and 1084 deletions

View file

@ -6,8 +6,15 @@ namespace App\Services;
class Util
{
private static $postRoute = 'base.';
public static function getToken()
{
return hash_hmac('sha256', str_random(40), config('app.key'));
}
public static function formatDate(){
if(\App::getLocale() == "en"){
return 'yyyy-mm-dd';
@ -47,6 +54,7 @@ class Util
public static function addRoute($p = []){
$b = [];
if(\Session::has('user_shop')){
if($user_shop = \Session::get('user_shop')){
$b = ['subdomain' => $user_shop->slug];
@ -55,4 +63,24 @@ class Util
return array_merge($p, $b);
}
public static function isCheckout(){
if(\Session::has('isCheckout')){
if(\Session::get('isCheckout') == true){
return true;
}
}
return false;
}
public static function getUserShopBackUrl($uri){
if(\Session::has('user_shop')){
if($user_shop = \Session::get('user_shop')){
return 'http://'.$user_shop->slug.".".Config('app.domain').$uri;
}
}
return url($uri);
}
}