@extends('shared.front') @section('content')

{{ __('messages.checkout.payment') }}

@php $b_token_valid = \App\Http\Controllers\HomeController::is_token_still_valid(config('starspin.config.session_timeout')); if (!$b_token_valid) { \App\Http\Controllers\HomeController::do_logout(); } $login_link = config('starspin.config.starguide_login_url') . "?redirect=" . action('HomeController@checkout') . "&utm_source=StarSpin&utm_medium=online&utm_campaign=Star_Spin_Registration"; $logout = config('starspin.config.starguide_logout_url') . "?redirect=" . config('starspin.config.root_url') . "&utm_source=StarSpin&utm_medium=online&utm_campaign=Star_Spin_Registration"; $is_login = \App\Http\Controllers\HomeController::is_loggedin(); if (!$is_login) { $token = isset($_GET["token"]) ? $_GET["token"] : ""; $user_id = isset($_GET["user_id"]) ? $_GET["user_id"] : ""; } if (!$is_login && $user_id && $token) { $arr_val = array ( "USER_ID" => $user_id, "ACCESS_TOKEN" => config('starspin.config.access_token'), "TOKEN" => $token ); // GET user $url_get_user = config('starspin.config.api_host') . \App\Http\Controllers\HomeController::template2content(config('starspin.config.uri_get_user'), $arr_val); $response = \App\Http\Controllers\HomeController::callAPI('GET', $url_get_user, false); $user_data = $response ? json_decode($response, true) : null; if ($user_data && isset($user_data["api_status"]) && $user_data["api_status"]=="success") { $full_name = isset($user_data["full_name"]) ? $user_data["full_name"] : ""; $mobile = isset($user_data["mobile"]) ? $user_data["mobile"] : ""; $city = isset($user_data["location"]) ? $user_data["location"] : ""; $email = isset($user_data["email"]) ? $user_data["email"] : ""; $user = \App\Member::query()->where('id', '=', $user_id)->first(); if($user == null){ $user = new \App\Member(); $user->id = $user_id; $user->starguide_user_id = $user_id; $user->email = $email; $user->full_name = $full_name; $user->mobile = $mobile; $user->city = $city; $user->ip_address = \App\Http\Controllers\HomeController::get_client_ip_address(); $user->added_date = date("Y-m-d H:i:s"); $user->save(); } if ($user) { \App\Http\Controllers\HomeController::set_login($user, $token); $is_login = \App\Http\Controllers\HomeController::is_loggedin(); } } } else{ $userInfo = \App\Http\Controllers\HomeController::get_current_user_object(); $user_id = $userInfo ? $userInfo->id : ''; } @endphp @if($is_login && $user_id != '') @else
{{ __('messages.checkout.already_have_account') }} {{ __('messages.checkout.login') }}
@endif
@csrf

{{ __('messages.checkout.delivery_information_1') }}

{{ __('messages.checkout.fullname_error') }}
{{ __('messages.checkout.identity_card_error') }}
{{ __('messages.checkout.phone_number_error') }}
{{ __('messages.checkout.email_error') }}

{{ __('messages.checkout.delivery_information') }}

{{ __('messages.checkout.address_error') }}
{{ __('messages.checkout.city_error') }}
{{ __('messages.checkout.district_error') }}
{{ __('messages.checkout.ward_error') }}

{{ __('messages.checkout.delivery_information_2') }}

@include('home.elements.invoice')
@include('home.elements.payment-note')

{{ __('messages.checkout.referral') }}

{!! __('messages.checkout.discount_50k') !!}

{{ __('messages.checkout.referrers') }} {{ __('messages.checkout.referrer_text') }}

{{ __('messages.checkout.referrer_gift') }}

{{ __('messages.checkout.phone_number_referral') }}

{{ __('messages.checkout.phone_number_referral_rule') }}

{{ __('messages.checkout.phone_number_referral') }}

{{ __('messages.checkout.phone_number_error') }}
  • {{ __('messages.cart.sub_total') }} VNĐ
  • {{ __('messages.cart.discount') }} 0 VNĐ
  • {{ __('messages.cart.shipping_fee') }} --
  • {{ __('messages.cart.promotion_code') }} --
{{ __('messages.cart.total_bill') }} VNĐ {{ __('messages.cart.include_vat') }}
@include('home.elements.shipment-note')
@if(($checkoutOff ?? 0) == 0)
@endif
@endsection