diff --git a/cms/src/components/OrderMoneroPaymentPanel.vue b/cms/src/components/OrderInvoicePaymentPanel.vue
similarity index 78%
rename from cms/src/components/OrderMoneroPaymentPanel.vue
rename to cms/src/components/OrderInvoicePaymentPanel.vue
index ab3241d..ac27640 100644
--- a/cms/src/components/OrderMoneroPaymentPanel.vue
+++ b/cms/src/components/OrderInvoicePaymentPanel.vue
@@ -8,14 +8,12 @@
- {{ invoice.expectedTotalCrypto }} {{ paymentMethodCryptoCurrency[invoice.paymentMethod] }}
+ {{ invoice.expectedTotalCrypto }} {{ invoice.paymentLabel }}
-
- {{ formatFiatPrice(fiatPerXmrAtCreation, config.shopFiatCurrency) }} /
- {{ paymentMethodCryptoCurrency[invoice.paymentMethod] }}
+
+ {{ formatFiatPrice(fiatPerCryptoAtCreation, config.shopFiatCurrency) }} /
+ {{ invoice.paymentLabel }}
@@ -37,9 +35,7 @@
- {{ row.amountCrypto }} {{ paymentMethodCryptoCurrency[invoice.paymentMethod] }}
+ {{ row.amountCrypto }} {{ invoice.paymentLabel }}
@@ -69,7 +65,7 @@
import { computed, type PropType } from 'vue';
import { config } from '@/config';
import type { InvoiceExtended } from '@/types/payment/InvoiceExtended';
-import { paymentMethodCryptoCurrency } from '@/types/payment/PaymentMethod';
+import { PaymentMethod } from '@/types/payment/PaymentMethod';
import { formatDate } from '@/utils/formatDate';
import { formatFiatPrice } from '@/utils/formatFiatPrice';
import { resolveInvoiceStatusTagType } from '@/utils/order/resolveInvoiceStatusTagType';
@@ -85,13 +81,25 @@ const props = defineProps({
},
emptyText: {
type: String,
- default: 'No Monero payment session.'
+ default: 'No payment session.'
}
});
const payments = computed(() => props.invoice?.payments ?? []);
-const fiatPerXmrAtCreation = computed(() => props.invoice?.moneroDetails?.fiatPerXmrAtCreation);
+const fiatPerCryptoAtCreation = computed(() => {
+ const invoice = props.invoice;
+
+ if (!invoice) {
+ return undefined;
+ }
+
+ if (invoice.paymentMethod === PaymentMethod.Btc) {
+ return invoice.btcDetails?.fiatPerBtcAtCreation;
+ }
+
+ return invoice.moneroDetails?.fiatPerXmrAtCreation;
+});