$.ajax({
url: "url",
method:'POST',
type: 'POST',
data: {
'amount':total_amount,
'customer_name':customer_name,
'customer_email':customer_email,
'customer_phone':customer_phone,
'card_number': card_number,
'card_expiry': card_expiry_date,
'cvc': card_cvc
},
success: function(result){
console.log('test');
}});
Route :: post('/ checkout-post','CheckoutController @ checkout')->名称('checkout-post')->中间件('cors');公共函数句柄($ request,闭包$ next){返回$ next($ request)->标头('Access-Control-Allow-Origin','*')->标头('Access-Control-Allow-Methods','GET','POST','PUT','PATCH','DELETE','OPTIONS')->标头('Access-Control-Allow-Headers','Content-Type,Authorization');}