migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ 'Payment' }}</title>
|
||||
<link rel="stylesheet" href="{{ asset('assets/bootstrap-5/bootstrap.min.css') }}">
|
||||
@stack('script')
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
background: #f4f4f9;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.loader-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loader {
|
||||
border: 8px solid #e0e0e0;
|
||||
border-top: 8px solid #4A90E2;
|
||||
border-radius: 50%;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
animation: spin 1s linear infinite;
|
||||
margin: 0 auto 20px;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #333;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
<script src="{{ asset('assets/bootstrap-5/bootstrap.bundle.min.js') }}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,226 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>
|
||||
@yield('title')
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('assets/modules/payment/mercado_pogo/css/bootstrap.min.css') }}">
|
||||
<link rel="stylesheet" type="text/css" href="{{ asset('assets/modules/payment/mercado_pogo/css/index.css') }}">
|
||||
<script src="{{ asset('assets/admin-module/js/jquery-3.6.0.min.js') }}"></script>
|
||||
<script src="https://sdk.mercadopago.com/js/v2"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<!-- Hidden input to store your integration public key -->
|
||||
<input type="hidden" id="mercado-pago-public-key" value="{{ $config->public_key }}">
|
||||
|
||||
<!-- Payment -->
|
||||
<section class="payment-form dark">
|
||||
<div class="container__payment">
|
||||
<div class="block-heading">
|
||||
<h2>Card Payment</h2>
|
||||
<!-- <p>This is an example of a Mercado Pago integration</p> -->
|
||||
</div>
|
||||
<div class="form-payment">
|
||||
<div class="products">
|
||||
<p class="alert alert-danger d-none" role="alert" id="error_alert"></p>
|
||||
<div class="total">Amount to be paid {{ $data->currency_code }}<span
|
||||
class="price">{{ $data->payment_amount }}</span></div>
|
||||
</div>
|
||||
<div class="payment-details">
|
||||
<form id="form-checkout">
|
||||
<h3 class="title">Buyer Details</h3>
|
||||
<div class="row">
|
||||
<div class="form-group col">
|
||||
<input id="form-checkout__cardholderEmail" name="cardholderEmail" type="email"
|
||||
class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-5">
|
||||
<select id="form-checkout__identificationType" name="identificationType"
|
||||
class="form-control"></select>
|
||||
</div>
|
||||
<div class="form-group col-sm-7">
|
||||
<input id="form-checkout__identificationNumber" name="docNumber" type="text"
|
||||
class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<h3 class="title">Card Details</h3>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-8">
|
||||
<input id="form-checkout__cardholderName" name="cardholderName" type="text"
|
||||
class="form-control" />
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<div class="input-group expiration-date">
|
||||
<input id="form-checkout__cardExpirationMonth" name="cardExpirationMonth"
|
||||
type="text" class="form-control" />
|
||||
<span class="date-separator">/</span>
|
||||
<input id="form-checkout__cardExpirationYear" name="cardExpirationYear"
|
||||
type="text" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-8">
|
||||
<input id="form-checkout__cardNumber" name="cardNumber" type="text"
|
||||
class="form-control" />
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<input id="form-checkout__securityCode" name="securityCode" type="text"
|
||||
class="form-control" />
|
||||
</div>
|
||||
<div id="issuerInput" class="form-group col-sm-12 hidden">
|
||||
<select id="form-checkout__issuer" name="issuer" class="form-control"></select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<select id="form-checkout__installments" name="installments" type="text"
|
||||
class="form-control"></select>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<br>
|
||||
<button id="form-checkout__submit" type="submit"
|
||||
class="btn btn--primary btn-block">Pay</button>
|
||||
<br>
|
||||
<p id="loading-message">Loading, please wait...</p>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
<script>
|
||||
"use strict";
|
||||
const publicKey = document.getElementById("mercado-pago-public-key").value;
|
||||
const mercadopago = new MercadoPago(publicKey);
|
||||
|
||||
loadCardForm();
|
||||
|
||||
function loadCardForm() {
|
||||
const productCost = '{{ $data->payment_amount }}';
|
||||
|
||||
const cardForm = mercadopago.cardForm({
|
||||
amount: productCost,
|
||||
autoMount: true,
|
||||
form: {
|
||||
id: "form-checkout",
|
||||
cardholderName: {
|
||||
id: "form-checkout__cardholderName",
|
||||
placeholder: "Card holder name",
|
||||
},
|
||||
cardholderEmail: {
|
||||
id: "form-checkout__cardholderEmail",
|
||||
placeholder: "Card holder email",
|
||||
},
|
||||
cardNumber: {
|
||||
id: "form-checkout__cardNumber",
|
||||
placeholder: "Card number",
|
||||
},
|
||||
cardExpirationMonth: {
|
||||
id: "form-checkout__cardExpirationMonth",
|
||||
placeholder: "MM",
|
||||
},
|
||||
cardExpirationYear: {
|
||||
id: "form-checkout__cardExpirationYear",
|
||||
placeholder: "YY",
|
||||
},
|
||||
securityCode: {
|
||||
id: "form-checkout__securityCode",
|
||||
placeholder: "Security code",
|
||||
},
|
||||
installments: {
|
||||
id: "form-checkout__installments",
|
||||
placeholder: "Installments",
|
||||
},
|
||||
identificationType: {
|
||||
id: "form-checkout__identificationType",
|
||||
},
|
||||
identificationNumber: {
|
||||
id: "form-checkout__identificationNumber",
|
||||
placeholder: "Identification number",
|
||||
},
|
||||
issuer: {
|
||||
id: "form-checkout__issuer",
|
||||
placeholder: "Issuer",
|
||||
},
|
||||
},
|
||||
callbacks: {
|
||||
onFormMounted: error => {
|
||||
if (error)
|
||||
return console.warn("Form Mounted handling error: ", error);
|
||||
},
|
||||
onSubmit: event => {
|
||||
event.preventDefault();
|
||||
document.getElementById("loading-message").style.display = "block";
|
||||
|
||||
const {
|
||||
paymentMethodId,
|
||||
issuerId,
|
||||
cardholderEmail: email,
|
||||
amount,
|
||||
token,
|
||||
installments,
|
||||
identificationNumber,
|
||||
identificationType,
|
||||
} = cardForm.getCardFormData();
|
||||
|
||||
fetch("{{ route('mercadopago.make_payment', ['payment_id' => $data->id]) }}", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-CSRF-TOKEN": "{{ csrf_token() }}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token,
|
||||
issuerId,
|
||||
paymentMethodId,
|
||||
transactionAmount: Number(amount),
|
||||
installments: Number(installments),
|
||||
payer: {
|
||||
email,
|
||||
identification: {
|
||||
type: identificationType,
|
||||
number: identificationNumber,
|
||||
},
|
||||
},
|
||||
}),
|
||||
})
|
||||
.then(response => {
|
||||
return response.json();
|
||||
})
|
||||
.then(result => {
|
||||
if (result.error) {
|
||||
document.getElementById("loading-message").style.display = "none";
|
||||
document.getElementById("error_alert").innerText = result.error;
|
||||
document.getElementById("error_alert").style.display = "block";
|
||||
return false;
|
||||
}
|
||||
location.href = '{{ route('payment-success') }}';
|
||||
})
|
||||
.catch(error => {
|
||||
document.getElementById("loading-message").style.display = "none";
|
||||
document.getElementById("error_alert").innerHtml = error;
|
||||
document.getElementById("error_alert").style.display = "block";
|
||||
});
|
||||
},
|
||||
onFetching: (resource) => {
|
||||
const payButton = document.getElementById("form-checkout__submit");
|
||||
payButton.setAttribute('disabled', true);
|
||||
return () => {
|
||||
payButton.removeAttribute("disabled");
|
||||
};
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
35
public/restaurant/resources/views/payment/paystack.blade.php
Normal file
35
public/restaurant/resources/views/payment/paystack.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
@extends('payment.layouts.master')
|
||||
|
||||
@section('content')
|
||||
<center>
|
||||
<div class="loader"></div>
|
||||
</center>
|
||||
|
||||
<form method="POST" action="{!! route('paystack.payment', ['token' => $data->id]) !!}" accept-charset="UTF-8" class="form-horizontal" role="form">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<input type="hidden" name="email"
|
||||
value="{{ $payer->email != null ? $payer->email : 'required@email.com' }}">
|
||||
{{-- required --}}
|
||||
<input type="hidden" name="orderID" value="{{ $data->attribute_id }}">
|
||||
<input type="hidden" name="amount" value="{{ $data->payment_amount * 100 }}"> {{-- required in kobo --}}
|
||||
<input type="hidden" name="quantity" value="1">
|
||||
<input type="hidden" name="currency" value="{{ $data->currency_code }}">
|
||||
<input type="hidden" name="metadata" value="{{ json_encode($array = ['key_name' => 'value']) }}">
|
||||
{{-- For other necessary things you want to add to your payload. it is optional though --}}
|
||||
<input type="hidden" name="reference" value="{{ $reference }}"> {{-- required --}}
|
||||
|
||||
<button class="btn btn-block d-none" id="pay-button" type="submit"></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.getElementById("pay-button").click();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
28
public/restaurant/resources/views/payment/paytm.blade.php
Normal file
28
public/restaurant/resources/views/payment/paytm.blade.php
Normal file
@@ -0,0 +1,28 @@
|
||||
@extends('payment.layouts.master')
|
||||
|
||||
@push('script')
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<center>
|
||||
<div class="loader"></div>
|
||||
</center>
|
||||
|
||||
<form method="post" action="<?php echo \Illuminate\Support\Facades\Config::get('paytm_config.PAYTM_TXN_URL'); ?>" id="form">
|
||||
<table border="1">
|
||||
<tbody>
|
||||
@foreach ($paramList as $name => $value)
|
||||
<input type="hidden" name="{{ $name }}" value="{{ $value }}">
|
||||
@endforeach
|
||||
<input type="hidden" name="CHECKSUMHASH" value="{{ $checkSum }}">
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.getElementById("form").submit();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,44 @@
|
||||
@extends('payment.layouts.master')
|
||||
|
||||
@section('content')
|
||||
<center>
|
||||
<div class="loader"></div>
|
||||
</center>
|
||||
|
||||
<form action="{!! route('razor-pay.payment', ['payment_id' => $data->id]) !!}" id="form" method="POST">
|
||||
@csrf
|
||||
<script src="https://checkout.razorpay.com/v1/checkout.js" data-key="{{ config()->get('razor_config.api_key') }}"
|
||||
data-amount="{{ round($data->payment_amount, 2) * 100 }}"
|
||||
data-buttontext="Pay {{ round($data->payment_amount, 2) . ' ' . $data->currency_code }}"
|
||||
data-name="{{ $business_name }}" data-description="{{ $data->payment_amount }}" data-image="{{ $business_logo }}"
|
||||
data-prefill.name="{{ $data->name ?? '' }}" data-prefill.email="{{ $data->email ?? '' }}"
|
||||
data-prefill.contact="{{ $data?->phone ?? '' }}"
|
||||
data-callback_url="{{ route('razor-pay.callback', ['payment_data' => base64_encode($data->id)]) }}"
|
||||
data-theme.color="#ff7529"></script>
|
||||
<button class="btn btn-block" id="pay-button" type="submit" style="display:none"></button>
|
||||
<button class="razorpay-cancel-button" type="button" id="cancel-button" onclick="handleCancel()">Cancel</button>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
"use strict";
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.getElementById("pay-button").click();
|
||||
});
|
||||
|
||||
function handleCancel() {
|
||||
window.location.href = '{{ route('razor-pay.cancel', ['payment_id' => $data->id]) }}';
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@push('script')
|
||||
<style>
|
||||
.razorpay-cancel-button {
|
||||
border: 1px solid #0000008c;
|
||||
border-radius: 2px;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: .125rem 1rem;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
33
public/restaurant/resources/views/payment/stripe.blade.php
Normal file
33
public/restaurant/resources/views/payment/stripe.blade.php
Normal file
@@ -0,0 +1,33 @@
|
||||
@extends('payment.layouts.master')
|
||||
|
||||
@push('script')
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=fetch"></script>
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<center>
|
||||
<div class="loader"></div>
|
||||
</center>
|
||||
|
||||
<script type="text/javascript">
|
||||
var stripe = Stripe('{{ $config['published_key'] }}');
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
fetch("{{ url("payment/stripe/token/?payment_id={$data->id}") }}", {
|
||||
method: "GET",
|
||||
}).then(function(response) {
|
||||
return response.text();
|
||||
}).then(function(session) {
|
||||
return stripe.redirectToCheckout({
|
||||
sessionId: JSON.parse(session).id
|
||||
});
|
||||
}).then(function(result) {
|
||||
if (result.error) {
|
||||
alert(result.error.message);
|
||||
}
|
||||
}).catch(function(error) {
|
||||
console.error("error:", error);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user