Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update snap_checkout.blade.php #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions resources/views/snap_checkout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,31 @@
<body>


<form id="payment-form" method="post" action="snapfinish">
<input type="hidden" name="_token" value="{!! csrf_token() !!}">
<input type="hidden" name="result_type" id="result-type" value=""></div>
<input type="hidden" name="result_data" id="result-data" value=""></div>
<form id="payment-form" method="post">
@csrf
<input type="hidden" name="result_type" id="result-type" value="">
<input type="hidden" name="result_data" id="result-data" value="">
</form>

<button id="pay-button">Pay!</button>
<script type="text/javascript">

$('#pay-button').click(function (event) {
$.ajaxSetup({
headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
});
event.preventDefault();
$(this).attr("disabled", "disabled");

$.ajax({

url: './snaptoken',
url: './snaptoken', //url provids here there is no need to action attribute in form html tag
cache: false,

dataType: "json",
type: "POST",
data: {
'_token': $('input[name=_token]').val(),
},
success: function(data) {
//location = data;

Expand Down