2018-03-03 07:32:51 +01:00
|
|
|
@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers
|
2018-03-23 09:27:48 +01:00
|
|
|
@inject BTCPayServer.Services.LanguageService langService
|
2018-11-09 11:02:53 +01:00
|
|
|
@using Newtonsoft.Json
|
|
|
|
@using Newtonsoft.Json.Linq
|
2018-03-03 07:32:51 +01:00
|
|
|
@model PaymentModel
|
2017-09-13 08:47:34 +02:00
|
|
|
@{
|
2017-10-27 06:46:21 +02:00
|
|
|
Layout = null;
|
2017-09-13 08:47:34 +02:00
|
|
|
}
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2017-10-27 06:46:21 +02:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
2018-01-30 17:39:58 +01:00
|
|
|
|
2017-10-27 06:46:21 +02:00
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
2018-05-03 23:51:04 +02:00
|
|
|
<title>@Model.HtmlTitle</title>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2018-03-03 07:32:51 +01:00
|
|
|
<bundle name="wwwroot/bundles/checkout-bundle.min.css" />
|
2018-01-30 17:39:58 +01:00
|
|
|
|
2017-10-27 06:46:21 +02:00
|
|
|
<script type="text/javascript">
|
2018-05-03 18:46:52 +02:00
|
|
|
var srvModel = @Html.Raw(Json.Serialize(Model));
|
2017-10-27 06:46:21 +02:00
|
|
|
</script>
|
2018-03-03 07:32:51 +01:00
|
|
|
|
|
|
|
<bundle name="wwwroot/bundles/checkout-bundle.min.js" />
|
2018-07-13 22:58:59 +02:00
|
|
|
<script>vex.defaultOptions.className = 'vex-theme-btcpay'</script>
|
2018-03-27 08:14:50 +02:00
|
|
|
|
2018-07-13 22:58:59 +02:00
|
|
|
@if (Model.CustomCSSLink != null)
|
2018-03-27 08:14:50 +02:00
|
|
|
{
|
|
|
|
<link href="@Model.CustomCSSLink" rel="stylesheet" />
|
|
|
|
}
|
2018-07-13 22:58:59 +02:00
|
|
|
|
2018-11-09 08:09:09 +01:00
|
|
|
@if (Model.IsModal)
|
|
|
|
{
|
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
background: rgba(55, 58, 60, 0.4);
|
|
|
|
}
|
|
|
|
|
|
|
|
.close-icon {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
}
|
2017-09-13 08:47:34 +02:00
|
|
|
</head>
|
2018-11-09 08:09:09 +01:00
|
|
|
<body>
|
2017-10-27 06:46:21 +02:00
|
|
|
<noscript>
|
|
|
|
<center style="padding: 2em">
|
|
|
|
<h2>Javascript is currently disabled in your browser.</h2>
|
|
|
|
<h5>Please enable Javascript and refresh this page for the best experience.</h5>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 06:46:21 +02:00
|
|
|
<p>Alternatively, click below to continue to our HTML-only invoice.</p>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 06:46:21 +02:00
|
|
|
<form action="/invoice-noscript" method="GET">
|
|
|
|
<button style="text-decoration: underline; color: blue">Continue to javascript-disabled invoice ></button>
|
|
|
|
</form>
|
|
|
|
</center>
|
|
|
|
</noscript>
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2017-10-27 06:46:21 +02:00
|
|
|
<!--[if lte IE 8]>
|
|
|
|
<center style="padding: 2em">
|
|
|
|
<form action="/invoice-noscript" method="GET">
|
|
|
|
<button style="text-decoration: underline; color: blue">Continue to legacy browser compatible invoice page
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</center>
|
|
|
|
<![endif]-->
|
2017-09-13 08:47:34 +02:00
|
|
|
|
2018-11-09 08:09:09 +01:00
|
|
|
<invoice>
|
|
|
|
<div class="no-bounce" id="checkoutCtrl" v-cloak>
|
|
|
|
<div class="modal page">
|
|
|
|
<div class="modal-dialog open opened enter-purchaser-email" role="document">
|
|
|
|
<div class="modal-content long">
|
|
|
|
<div class="content">
|
|
|
|
<div class="invoice">
|
|
|
|
<partial name="Checkout-Body" />
|
|
|
|
</div>
|
2017-10-27 06:46:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-20 06:36:19 +02:00
|
|
|
|
2018-11-09 08:09:09 +01:00
|
|
|
<div style="margin-top: 10px; text-align: center;">
|
|
|
|
@* Not working because of nsSeparator: false, keySeparator: false,
|
2018-03-22 06:21:26 +01:00
|
|
|
{{$t("nested.lang")}} >>
|
2018-03-20 20:30:37 +01:00
|
|
|
*@
|
2018-11-09 08:48:38 +01:00
|
|
|
|
2018-11-09 11:02:53 +01:00
|
|
|
<select asp-for="DefaultLang"
|
|
|
|
class="cmblang reverse invisible"
|
2018-11-09 08:48:38 +01:00
|
|
|
onchange="changeLanguage($(this).val())"
|
2018-11-09 11:02:53 +01:00
|
|
|
asp-items="@langService.GetLanguages().Select((language) => new SelectListItem(language.DisplayName,language.Code, false))"></select>
|
2018-11-09 08:48:38 +01:00
|
|
|
|
|
|
|
<script>
|
2018-10-24 07:52:19 +02:00
|
|
|
$(function() {
|
|
|
|
// REVIEW: don't use initDropdown method but rather directly initialize select whenever you are using it
|
|
|
|
initDropdown(".cmblang");
|
|
|
|
});
|
|
|
|
|
|
|
|
function initDropdown(selector) {
|
|
|
|
return $(selector).prettyDropdown({
|
|
|
|
classic: false,
|
|
|
|
height: 32,
|
|
|
|
reverse: true,
|
|
|
|
hoverIntent: 5000
|
2018-03-22 06:07:30 +01:00
|
|
|
});
|
2018-10-24 07:52:19 +02:00
|
|
|
}
|
2018-11-09 11:02:53 +01:00
|
|
|
</script>
|
2018-11-09 08:09:09 +01:00
|
|
|
</div>
|
|
|
|
<div style="margin-top: 10px; text-align: center;" class="form-text small text-muted">
|
|
|
|
<span>Powered by <a target="_blank" href="https://github.com/btcpayserver/btcpayserver">BTCPay Server</a></span>
|
|
|
|
</div>
|
2017-10-27 06:46:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</invoice>
|
2018-11-09 11:02:53 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
var availableLanguages = @Html.Raw(Json.Serialize(
|
|
|
|
langService
|
|
|
|
.GetLanguages()
|
|
|
|
.Select((language) => language.Code)));;
|
|
|
|
var storeDefaultLang = "@Model.DefaultLang";
|
|
|
|
var fallbackLanguage = "en";
|
|
|
|
var languageDropdownElement = $("#DefaultLang");
|
|
|
|
var startingLanguage = computeStartingLanguage();
|
|
|
|
|
|
|
|
|
|
|
|
// initialization
|
|
|
|
i18next
|
|
|
|
.use(window.i18nextXHRBackend)
|
|
|
|
.init({
|
|
|
|
backend: {
|
|
|
|
loadPath: '/locales/{{lng}}.json'
|
|
|
|
},
|
|
|
|
lng: startingLanguage,
|
|
|
|
fallbackLng: fallbackLanguage,
|
|
|
|
nsSeparator: false,
|
|
|
|
keySeparator: false
|
|
|
|
});
|
|
|
|
|
|
|
|
function computeStartingLanguage() {
|
|
|
|
if (urlParams.lang && isLanguageAvailable(urlParams.lang)) {
|
|
|
|
return urlParams.lang;
|
|
|
|
}
|
|
|
|
else if (isLanguageAvailable(storeDefaultLang)) {
|
|
|
|
return storeDefaultLang;
|
|
|
|
} else {
|
|
|
|
return fallbackLanguage;
|
|
|
|
}
|
|
|
|
}
|
2018-03-22 17:12:15 +01:00
|
|
|
|
2018-10-24 07:52:19 +02:00
|
|
|
function changeLanguage(lang) {
|
2018-11-09 11:02:53 +01:00
|
|
|
if (isLanguageAvailable(lang)) {
|
|
|
|
i18next.changeLanguage(lang);
|
|
|
|
}
|
2018-10-24 07:52:19 +02:00
|
|
|
}
|
2018-11-09 11:02:53 +01:00
|
|
|
|
|
|
|
function isLanguageAvailable(languageCode) {
|
|
|
|
return availableLanguages.indexOf(languageCode) >= 0;
|
|
|
|
}
|
|
|
|
|
2018-10-24 07:52:19 +02:00
|
|
|
const i18n = new VueI18next(i18next);
|
|
|
|
|
|
|
|
// TODO: Move all logic from core.js to Vue controller
|
|
|
|
Vue.config.ignoredElements = [
|
|
|
|
'line-items',
|
|
|
|
'low-fee-timeline',
|
|
|
|
// Ignoring custom HTML5 elements, eg: bp-spinner
|
|
|
|
/^bp-/
|
|
|
|
];
|
2018-11-09 08:09:09 +01:00
|
|
|
|
2018-10-24 07:52:19 +02:00
|
|
|
var checkoutCtrl = new Vue({
|
|
|
|
i18n: i18n,
|
|
|
|
el: '#checkoutCtrl',
|
|
|
|
components: {
|
|
|
|
qrcode: VueQr,
|
|
|
|
changelly: ChangellyComponent
|
|
|
|
},
|
|
|
|
data: {
|
2018-11-09 08:09:09 +01:00
|
|
|
srvModel: srvModel,
|
|
|
|
lndModel: null,
|
|
|
|
scanDisplayQr: "",
|
|
|
|
expiringSoon: false,
|
|
|
|
isModal: '@(Model.IsModal ? "true" : "false")'
|
2018-10-24 07:52:19 +02:00
|
|
|
}
|
|
|
|
});
|
2018-11-09 11:02:53 +01:00
|
|
|
</script>
|
2017-09-13 08:47:34 +02:00
|
|
|
</body>
|
2017-10-27 10:53:04 +02:00
|
|
|
</html>
|