<?php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');

include('../functions.php');

if(isset($_POST['min_order'])){   
    $min_order=$_POST['min_order'];
    $payment=$_POST['payemnt_value'];
    
    $total_order=get_cart_total();
    if($total_order >= $min_order){
        $make_order=make_order($payment);
        echo $make_order;
    }else{
        echo 0;
    }
}       
       
?>