Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                


<!--Скрипт виджета Тинькоффа-->
<script src="https://securepay.tinkoff.ru/html/payForm/js/tinkoff_v2.js"></script> 

<script type="text/javascript">

<!--Скрипт определения цены в рублях в зависимости от курса и выбранного количества приглашений-->
function curr_convert() {
  	var price;
	var a = 77;
	price = a * parseInt(document.getElementById('countinvitations').value);
	document.getElementById('priceId').value = price.toString();
}

<!--Скрипт отправки в Тинькофф-->
function makePayment(amount, email, receipt) {
	var params = {
		//Код терминала (обязательный параметр), выдается банком.
		TerminalKey: "wunderrussialtdDEMO", 
 		//Сумма заказа в копейках (обязательный параметр)
		Amount: amount,
		//Чек
		Receipt: receipt,
    //Дополнительные параметры платежа
		DATA: "Email=" + email,
		PayForm: "eng",
		//Флаг открытия платежной формы во фрейме
		Frame: true
	};
	doPay(params);
}
<!--Скрипт замены Receipt-->
var newFunk = function(){
	var receipt = '{"Email": "'+$('#email').val()+'", "Taxation": "osn", "Items": [{"Name": "Наименование товара 1","Price": '+Number($('#priceId').val()*100)+',"Quantity": 1.00,"Amount": '+Number($('#priceId').val()*100)+',"Tax": "none"}]}';
	$('[name="receipt"]').val(receipt);
  
  makePayment(document.TinkoffPayForm.paySum.value.replace(/,/ig,'.')*100, document.TinkoffPayForm.payEmail.value, document.TinkoffPayForm.receipt.value, document.TinkoffPayForm.language.value)
};

</script> 

<style> 
        .tinkoffPayRow { display: block; width: 160px; } 
</style>

<!-- Выпадающий список с ценой/количество-->
<form name="TinkoffPayForm" id = "payform">
<div class = "pay-row">
    
		<select autofocus="" id="countinvitations" onblur="curr_convert();" onchange="curr_convert();">
			<option selected="" disabled="" value="0">ВЫБЕРИ Тур</option>
			<option value="1300">Тур Питер-Москва М.Дюран 1300€ если будет очень длинный текст</option>
		</select>
  <div id = "paycours">Курс: 77 рублей/евро</div>
</div>
<div class = "pay-row">
<div id = "paytext">Вам будет выставлен счет в рублях (сумма в евро может измениться, в зависимости от курса вашего банка)</div>
	<input class="tinkoffPayRow" type="text" placeholder="Prix" name="paySum" id="priceId" size="6"  disabled=""><div class = "rubl"></div></div>
  	<input class="tinkoffPayRow" type="hidden" name="receipt" id = "receipt" value="">
   <div class = "pay-row">
        <input class="tinkoffPayRow" type="text" placeholder="E-mail" name="payEmail" id="email" required> 
	<input onclick="newFunk()" id="submit" class="tinkoffPayRow" type="button" value="PAY">
</div>
</form>
              
            
!

CSS

              
                .tinkoffPayRow{
  /*border: 1px solid;*/
}

#payform{
  /*border:1px solid #facfac;*/
  margin:10px;
  width:660px;
}
#countinvitations{
  padding:10px;
  display:block;
}
#paycours{
 /* border:1px solid;*/
  display: inline-block;
  float:right;
  padding:10px;
}
#paytext{
  /*border: 1px solid;*/
  display:inline-block;
  width:70%;
  text-align: justify;
}

#priceId{
  font-size:18px; 
 display: block;
  background:none;  
  font-weight:bold;  
  color:red;
  text-align:right;
  border: none;
}

#email{
  display:inline-block;
  height:30px;
  
}


#submit{
  float:right;
  display:block;
  width:120px;
  height:30px;
}

.pay-row{
/*  border:1px solid;*/
  padding:10px;
  display:flex;
  flex-direction:row;
  justify-content: space-between;
}

.rubl{
  display:block;
  margin-top:10px;
  margin-left:-15px;
}

.rubl::before{
  content: "₽";
  font-size:18px;
  font-weight:bold;
  color:red;
}
#priceId::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
  color: red;
  opacity: 1; /* Firefox */
}
              
            
!

JS

              
                
              
            
!
999px

Console