<?php
/*Template Name: verifypay  */
get_header();
$tabid = $_GET['tap_id'];
?>
<section class="content">

    <div class="container">
        
        
        <?php if (have_posts()) : ?>
            <?php while (have_posts()) : the_post(); ?>
                <h1 class="sec-tit text-center">
                    <?php the_content(); ?>
                </h1>


            <?php endwhile; ?>

        <?php endif; ?>
    </div>

</section>

<script type="text/javascript">
  
        var tabid = '<?php echo $tabid ?>';
        jQuery.ajax({
            type: 'POST',
            url: '<?php echo get_site_url()?>/wp-admin/admin-ajax.php',
            //dataType: 'json',
            data: {'action': 'tabbaymentverify', 'tabid': tabid },

            success: function (data) {
           console.log(JSON.parse(data));
           var dat = JSON.parse(data);
           if(dat['status'] == "CAPTURED"){
                window.location = '<?php echo get_page_link(147); ?>/?&pric=' + dat['amount'] + '&coup=';
           }else{
                window.location = '<?php echo get_page_link(145); ?>';
           }
            },
            error: function (data) {
                console.log(data);
            }

        });





</script>


<?php get_footer(); ?>

