PHP 7.4.33
Preview: index_21_7_2017.php Size: 2.62 KB
/home/godevadmin/www/admin/braintree/final/index_21_7_2017.php

<?php //require_once("../includes/braintree_init.php"); 
include("wfcart.php");
include("include/config.php");
include("include/functions.php"); 

$payment_method_nonce=$_SESSION['payment_mode'];
$amount=$_SESSION['tot_amount'];
$order_id=$_SESSION['value_order_id'];
?>

<html>
<?php require_once("../includes/head.php"); ?>
<body>

    <?php require_once("../includes/header.php"); ?>

    <div class="wrapper">
        <div class="checkout container">

            <header>
                <h1>Hi, <br>Let's test a transaction</h1>
                <p>
                    Make a test payment with Braintree using PayPal or a card
                </p>
            </header>

            <form method="post" id="payment-form" action="transaction.php">
                <section>
                    <label for="amount">
                        <span class="input-label">Amount</span>
                        <div class="input-wrapper amount-wrapper">
                            <input id="amount" name="amount" type="tel" min="1" placeholder="Amount" value="<?php echo $amount; ?>">
                        </div>
                    </label>

                    <div class="bt-drop-in-wrapper">
                        <div id="bt-dropin"></div>
                    </div>
                </section>

                <input id="nonce" name="payment_method_nonce" type="hidden" value="<?php echo $payment_method_nonce; ?>" />
                <button class="button" type="submit"><span>Test Transaction</span></button>
            </form>
        </div>
    </div>

    <script src="https://js.braintreegateway.com/web/dropin/1.2.0/js/dropin.min.js"></script>
    <script>
        var form = document.querySelector('#payment-form');
        var client_token = "<?php echo(Braintree\ClientToken::generate()); ?>";

        braintree.dropin.create({
          authorization: client_token,
          selector: '#bt-dropin',
          paypal: {
            flow: 'vault'
          }
        }, function (createErr, instance) {
          form.addEventListener('submit', function (event) {
            event.preventDefault();

            instance.requestPaymentMethod(function (err, payload) {
              if (err) {
                console.log('Error', err);
                return;
              }

              // Add the nonce to the form and submit
              document.querySelector('#nonce').value = payload.nonce;
              form.submit();
            });
          });
        });

        var checkout = new Demo({
          formID: 'payment-form'
        });
    </script>
</body>
</html>

Directory Contents

Dirs: 7 × Files: 11

Name Size Perms Modified Actions
braintree DIR
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
- drwxrwxr-x 2023-11-07 19:59:44
Edit Download
- drwxrwxr-x 2023-11-07 19:59:46
Edit Download
css DIR
- drwxrwxr-x 2023-11-07 19:59:46
Edit Download
fonts DIR
- drwxrwxr-x 2023-11-07 19:59:46
Edit Download
images DIR
- drwxrwxr-x 2023-11-07 19:59:46
Edit Download
- drwxrwxr-x 2023-11-07 19:59:46
Edit Download
4.55 KB lrwxrwxr-x 2023-11-07 19:59:44
Edit Download
737 B lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
556 B lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
79.75 KB lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
12.46 KB lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
900 B lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
2.62 KB lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
4.08 KB lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
912 B lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
252 B lrwxrwxr-x 2023-11-07 19:59:46
Edit Download
6.85 KB lrwxrwxr-x 2023-11-07 19:59:46
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).