btcpayserver/BTCPayServer/Views/Shared/Lightning/LightningLikeMethodCheckout-v2.cshtml
d11n 2301769419
Checkout v2: Display and copy addresses (#4489)
* Checkout v2: Display and copy addresses

Closes #4442.

* Refinements
2023-01-12 10:41:33 +09:00

36 lines
1.7 KiB
Text

@model BTCPayServer.Models.InvoicingModels.PaymentModel
<template id="lightning-method-checkout-template">
<div class="payment-box">
<div v-if="model.invoiceBitcoinUrlQR" class="qr-container" :data-clipboard="model.btcAddress" data-clipboard-confirm-element="QR_Text_@Model.PaymentMethodId">
<div>
<qrcode :value="model.invoiceBitcoinUrlQR" tag="div" :options="qrOptions" />
</div>
<img class="qr-icon" :src="model.cryptoImage" :alt="model.paymentMethodName"/>
<small class="qr-text" id="QR_Text_@Model.PaymentMethodId" v-t="'qr_text'"></small>
</div>
<div v-if="model.btcAddress" class="input-group mt-3">
<div class="form-floating">
<input id="Address_@Model.PaymentMethodId" class="form-control-plaintext" readonly="readonly" :value="model.btcAddress">
<label for="Address_@Model.PaymentMethodId" v-t="'lightning'"></label>
</div>
<button type="button" class="btn btn-link" data-clipboard-target="#Address_@Model.PaymentMethodId" :data-clipboard-confirm="$t('copy_confirm')" v-t="'copy'"></button>
</div>
<a v-if="model.invoiceBitcoinUrl" class="btn btn-primary rounded-pill w-100 mt-4" target="_top"
:href="model.invoiceBitcoinUrl" v-t="'pay_in_wallet'"></a>
</div>
</template>
<script>
Vue.component('LightningLikeMethodCheckout', {
props: ["model"],
template: "#lightning-method-checkout-template",
components: {
qrcode: VueQrcode
},
data () {
// currentTab is needed for backwards-compatibility with old plugin versions
return { currentTab: undefined };
}
});
</script>