mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 17:26:05 +01:00
In case of the unified invoice, the LNURL wasn't correct — with this change we are simply reusing th one that was issued on invoice creation instead of generating it anew on the fly. Also fixes missing uppercasing for the QR code in case of non-unified QR. And removes the `lightning:` scheme from the LNURL that's displayed to the user (unifies it with what we do for Onchain and Lightning)
38 lines
2 KiB
Text
38 lines
2 KiB
Text
@model BTCPayServer.Models.InvoicingModels.PaymentModel
|
|
|
|
<template id="lightning-method-checkout-template">
|
|
<div class="payment-box">
|
|
@await Component.InvokeAsync("UiExtensionPoint" , new { location="checkout-v2-lightning-pre-content", model = Model})
|
|
<div v-if="model.invoiceBitcoinUrlQR" class="qr-container" :data-qr-value="model.invoiceBitcoinUrlQR" :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="Lightning_@Model.PaymentMethodId" class="form-control-plaintext" readonly="readonly" :value="model.btcAddress">
|
|
<label for="Lightning_@Model.PaymentMethodId" v-t="'lightning'"></label>
|
|
</div>
|
|
<button type="button" class="btn btn-link" data-clipboard-target="#Lightning_@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>
|
|
@await Component.InvokeAsync("UiExtensionPoint", new {location = "checkout-v2-lightning-post-content", model = Model})
|
|
</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>
|