|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/erp.theinteractive.co.in/resources/views/midtras/ |
Upload File : |
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
<!-- @TODO: replace SET_YOUR_CLIENT_KEY_HERE with your client key -->
<script type="text/javascript"
src="https://app.sandbox.midtrans.com/snap/snap.js"
data-client-key="{{ $data['midtrans_secret'] }}"></script>
<!-- Note: replace with src="https://app.midtrans.com/snap/snap.js" for Production environment -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<form action="{{ route($data['fallback_url'],$data) }}" id="submit_form" method="POST">
@csrf
<input type="hidden" name="json" id="json_callback">
</form>
<script type="text/javascript">
// For example trigger on button clicked, or any time you need
// Trigger snap popup. @TODO: Replace TRANSACTION_TOKEN_HERE with your transaction token
window.snap.pay('{{$data['snap_token']}}', {
onSuccess: function(result){
/* You may add your own implementation here */
console.log(result);
send_response_to_form(result);
},
onPending: function(result){
/* You may add your own implementation here */
console.log(result);
send_response_to_form(result);
},
onError: function(result){
/* You may add your own implementation here */
console.log(result);
send_response_to_form(result);
},
onClose: function(){
/* You may add your own implementation here */
alert('you closed the popup without finishing the payment');
}
})
function send_response_to_form(result){
document.getElementById('json_callback').value = JSON.stringify(result);
$('#submit_form').submit();
}
</script>
</body>
</html>