MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/imenso.co/payment/stripe/index.html
 <!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>


<script src="https://js.stripe.com/v3/"></script>

<div id="payment-request-button">
  <!-- A Stripe Element will be inserted here. -->
</div>
<script type="text/javascript">
  

var stripe = Stripe('pk_test_URVEzaP70mvypbBSbTcP1Gpg00TJk3ES5j');

var paymentRequest = stripe.paymentRequest({
  country: 'US',
  currency: 'usd',
  total: {
    label: 'Demo total',
    amount: 1000,
  },
  requestPayerName: true,
  requestPayerEmail: true,
});

var elements = stripe.elements();
var prButton = elements.create('paymentRequestButton', {
  paymentRequest: paymentRequest,
});

// Check the availability of the Payment Request API first.
paymentRequest.canMakePayment().then(function(result) {
  if (result) {
     alert(2);
    prButton.mount('#payment-request-button');
  } else {
     alert(1);
   document.getElementById('payment-request-button').style.display = 'none';
  }
});


paymentRequest.on('token', function(ev) {
  // Send the token to your server to charge it!

  fetch('/charges', {
    method: 'POST',
    body: JSON.stringify({token: ev.token.id}),
    headers: {'content-type': 'application/json'},
  })
  .then(function(response) {
    if (response.ok) {
      // Report to the browser that the payment was successful, prompting
      // it to close the browser payment interface.
      ev.complete('success');
    } else {
      // Report to the browser that the payment failed, prompting it to
      // re-show the payment interface, or show an error message and close
      // the payment interface.
      ev.complete('fail');
    }
  });
});
</script>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>