Author: Noah Language: text
Description: Ya Know Timestamp: 2018-05-08 01:16:44 +0000
View raw paste Reply
  1.  
  2.  
  3. <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  4. <script type="text/javascript" src="https://js.stripe.com/v2/"></script>
  5.      
  6.       <script type="text/javascript">
  7.      
  8.         Stripe.setPublishableKey('pk_live_F8DH33wXwPwiX4dMZZv4EASC');
  9.        
  10.         function onSubmitDo () {
  11.          
  12.           Stripe.card.createToken( document.getElementById('payment-form'), myStripeResponseHandler );
  13.              
  14.           return false;
  15.          
  16.         };
  17.         function myStripeResponseHandler ( status, response ) {
  18.          
  19.           console.log( status );
  20.           console.log( response );
  21.        
  22.           if ( response.error ) {
  23.             document.getElementById('payment-error').innerHTML = response.error.message;
  24.           } else {
  25.             var tokenInput = document.createElement("input");
  26.             tokenInput.type = "hidden";
  27.             tokenInput.name = "stripeToken";
  28.             tokenInput.value = response.id;
  29.             var paymentForm = document.getElementById('payment-form');
  30.             paymentForm.appendChild(tokenInput);
  31.             paymentForm.submit();
  32.           }
  33.          
  34.        };
  35.          
  36.            </script>
  37.     <div id="payment-error"></div>
  38.     <form action="http://payments.altispeed.com/pay.php" method="post" onsubmit="return onSubmitDo()" name="payment-form" id="payment-form">
  39.      
  40.     <div class="left_name"><strong>Amount :<span>*</span> </strong></div>
  41.                      <div class="right_field"><input name="amount" data-stripe="amount" id="amount" type="text"></div>
  42.                      
  43.               <div class="left_name"><strong>First Name :<span>*</span> </strong></div>
  44.                      <div class="right_field"><input name="fname" data-stripe="fname" id="fname" type="text"></div>
  45.                      
  46.                      <div class="left_name"><strong>Last Name :<span>*</span> </strong></div>
  47.                      <div class="right_field"><input name="lname" data-stripe="lname" id="lname" type="text"></div>
  48.                      
  49.                      
  50.                     <div class="left_name"><strong>Email :<span>*</span></strong></div>
  51.                      <div class="right_field"><input name="email" data-stripe="email" id="email" type="text"></div>
  52.                    
  53.                     <div class="left_name"><strong>Invoice Number :</strong></div>
  54.                      <div class="right_field"><input name="invoice_number" data-stripe="invoice_number" id="invoice_number" type="text"></div>
  55.                    
  56.                    
  57.                        
  58.                     <div class="left_name"><strong>Card Number :<span>*</span></strong></div>
  59.                      <div class="right_field"><input name="number" data-stripe="number" id="number" type="text"></div>
  60.                      
  61.                      
  62.                        <div class="left_name"><strong>Expiration Date (MM/YY) :<span>*</span> </strong></div>
  63.                         <div class="right_field"><input name="exp-month" id="exp-month" data-stripe="exp-month" type="text"> / <input name="exp_year" id="exp_year" data-stripe="exp_year" type="text"></div>
  64.                        
  65.                         <div class="left_name"><strong>CVC :<span>*</span></strong></div>
  66.                      <div class="right_field"><input name="cvc" data-stripe="cvc" id="cvc" type="text"></div>
  67.                        
  68.                        <div class="left_name">&nbsp; </div>
  69.                        <div class="right_field"><input type="submit" id="send" value="Pay" name="book_submit"></div>
View raw paste Reply