@extends('OmniPayViews::layouts.redirection-layout')

@section('title')<title>Redirecting to payment, please be patient....</title>@endsection

@section('content')
<?php
    if(isset(session('login')->email)){ $email = session('login')->email; }else{ $email = "info@test.com"; }
    if(isset(session('login')->phone)){ $phone = session('login')->phone; }else{ $phone = "+96170123123"; }
    if(isset(session('login')->first_name) && isset(session('login')->last_name)){ $name = session('login')->first_name.' '.session('login')->last_name; }else{ $name = "Curstomer name"; }
?>

<div class="text">Redirecting, please be patient</div>
<form method="post" action="{{ config('omnipay.'.$provider)['data']['URL'] }}" >
{{--    Names: <input type="hidden" id="names" name="names" value="{{ $name }}"> <br/>--}}

    <input type="hidden" id="names" name="names" value="{{ $name }}"> <br />
    <input type="hidden" id="amount" name="amount" value="{{ $amount }}"> <br />
    <input type="hidden" id="email_address" name="email_address" value="{{ $email }}"> <br />
    <input type="hidden" id="phone_number" name="phone_number" value="{{ $phone }}"> <br />
    <input type="hidden" id="currency" name="currency" value="{{ $currency }}"> <br />
    <input type="hidden" id="merch_txnref" name="merch_txnref" value="{{ $id }}"> <br/>
    <input type="hidden" id="merchantid" name="merchantid" value="{{ config('omnipay.'.$provider)['data']["MERCHANTID"] }}"> <br/>

</form>

<script language="javascript">
    $('form').first().submit();
</script>
@endsection
