Rename cryptoCurrency to paymentLabel in storefront invoice views.

Align invoice view naming with InvoiceExtended and CMS.
This commit is contained in:
2026-09-07 12:28:09 +02:00
parent 2d8a508898
commit dd234421a4
7 changed files with 14 additions and 14 deletions
@@ -56,7 +56,7 @@ describe('StorefrontCheckoutViewService', () => {
let toStorefrontInvoiceViewSpy: jest.SpiedFunction<typeof toStorefrontInvoiceViewModule.toStorefrontInvoiceView>; let toStorefrontInvoiceViewSpy: jest.SpiedFunction<typeof toStorefrontInvoiceViewModule.toStorefrontInvoiceView>;
const checkoutInvoiceView = { const checkoutInvoiceView = {
cryptoCurrency: 'XMR', paymentLabel: 'XMR',
amountFiat: 9 amountFiat: 9
} as unknown as StorefrontInvoiceView; } as unknown as StorefrontInvoiceView;
@@ -3,7 +3,7 @@ import type { InvoiceStatusLabel } from '../../../utils/invoice/types/InvoiceSta
import type { InvoiceStatusVariant } from '../../../utils/invoice/types/InvoiceStatusVariant'; import type { InvoiceStatusVariant } from '../../../utils/invoice/types/InvoiceStatusVariant';
export type StorefrontInvoiceView = { export type StorefrontInvoiceView = {
cryptoCurrency: string; paymentLabel: string;
expectedTotalCrypto: string; expectedTotalCrypto: string;
receivedTotalCrypto: string | null; receivedTotalCrypto: string | null;
paymentAddress: string; paymentAddress: string;
@@ -23,14 +23,14 @@
<p class='sf-payment-status sf-payment-status--confirmed'>Payment received</p> <p class='sf-payment-status sf-payment-status--confirmed'>Payment received</p>
<p class='sf-payment-detail'> <p class='sf-payment-detail'>
Received: Received:
<strong>{{checkout.checkoutInvoice.receivedTotalCrypto}} {{checkout.checkoutInvoice.cryptoCurrency}}</strong> <strong>{{checkout.checkoutInvoice.receivedTotalCrypto}} {{checkout.checkoutInvoice.paymentLabel}}</strong>
</p> </p>
<p class='sf-payment-detail'> <p class='sf-payment-detail'>
Your order is being prepared. This page will redirect automatically once it is ready. Your order is being prepared. This page will redirect automatically once it is ready.
</p> </p>
{{> refresh-link href=checkout.refreshHref showAutoRefreshNote=true}} {{> refresh-link href=checkout.refreshHref showAutoRefreshNote=true}}
{{else}} {{else}}
<h2 class='sf-section-title'>Pay with {{checkout.checkoutInvoice.cryptoCurrency}}</h2> <h2 class='sf-section-title'>Pay with {{checkout.checkoutInvoice.paymentLabel}}</h2>
{{#with checkout.checkoutInvoice}} {{#with checkout.checkoutInvoice}}
{{> invoice-payment refreshHref=../checkout.refreshHref showAutoRefreshNote=true}} {{> invoice-payment refreshHref=../checkout.refreshHref showAutoRefreshNote=true}}
{{/with}} {{/with}}
@@ -3,27 +3,27 @@
{{/if}} {{/if}}
{{#if showProminentAmount}} {{#if showProminentAmount}}
<p class='sf-payment-amount'>{{expectedTotalCrypto}} {{cryptoCurrency}}</p> <p class='sf-payment-amount'>{{expectedTotalCrypto}} {{paymentLabel}}</p>
{{/if}} {{/if}}
{{#if showReceivedTotal}} {{#if showReceivedTotal}}
<p class='sf-payment-detail'> <p class='sf-payment-detail'>
Received: Received:
<strong>{{receivedTotalCrypto}} {{cryptoCurrency}}</strong> <strong>{{receivedTotalCrypto}} {{paymentLabel}}</strong>
</p> </p>
{{/if}} {{/if}}
{{#if showExpectedTotal}} {{#if showExpectedTotal}}
<p class='sf-payment-detail'> <p class='sf-payment-detail'>
Expected total: Expected total:
<strong>{{expectedTotalCrypto}} {{cryptoCurrency}}</strong> <strong>{{expectedTotalCrypto}} {{paymentLabel}}</strong>
</p> </p>
{{/if}} {{/if}}
{{#if showInstruction}} {{#if showInstruction}}
<p class='sf-payment-detail'> <p class='sf-payment-detail'>
{{instructionPrefix}} {{instructionPrefix}}
<strong>{{instructionAmountCrypto}} {{cryptoCurrency}}</strong> <strong>{{instructionAmountCrypto}} {{paymentLabel}}</strong>
{{instructionSuffix}} {{instructionSuffix}}
{{#if showExpiry}} {{#if showExpiry}}
Payment expires in Payment expires in
@@ -34,7 +34,7 @@
{{#if showQr}} {{#if showQr}}
<div class='sf-qr-wrap'> <div class='sf-qr-wrap'>
<img src='{{qrCodeUrl}}' width='220' height='220' alt='{{cryptoCurrency}} payment QR code' /> <img src='{{qrCodeUrl}}' width='220' height='220' alt='{{paymentLabel}} payment QR code' />
</div> </div>
{{/if}} {{/if}}
@@ -48,7 +48,7 @@
<ul class='sf-list-reset sf-tx-list'> <ul class='sf-list-reset sf-tx-list'>
{{#each payments}} {{#each payments}}
<li class='sf-tx-item'> <li class='sf-tx-item'>
<div><strong>{{amountCrypto}} {{../cryptoCurrency}}</strong></div> <div><strong>{{amountCrypto}} {{../paymentLabel}}</strong></div>
<div class='sf-mono sf-text-subtle'>{{txHash}}</div> <div class='sf-mono sf-text-subtle'>{{txHash}}</div>
<div class='sf-tx-status sf-tx-status--{{confirmationStatusVariant}}'>{{confirmationStatus}}</div> <div class='sf-tx-status sf-tx-status--{{confirmationStatusVariant}}'>{{confirmationStatus}}</div>
</li> </li>
@@ -198,7 +198,7 @@ describe('StorefrontOrderViewService', () => {
expect(view.totals.shippingCostFiat).toBe(5); expect(view.totals.shippingCostFiat).toBe(5);
expect(view.totals.grandTotalFiat).toBe(15); expect(view.totals.grandTotalFiat).toBe(15);
expect(view.shippingInvoice).toMatchObject({ expect(view.shippingInvoice).toMatchObject({
cryptoCurrency: 'XMR', paymentLabel: 'XMR',
paymentAddress: '4shipping' paymentAddress: '4shipping'
}); });
}); });
@@ -109,7 +109,7 @@ describe('toStorefrontInvoiceView', () => {
const view = await toStorefrontInvoiceView(invoice); const view = await toStorefrontInvoiceView(invoice);
expect(view).toMatchObject({ expect(view).toMatchObject({
cryptoCurrency: 'XMR', paymentLabel: 'XMR',
expectedTotalCrypto: '1.00000000', expectedTotalCrypto: '1.00000000',
receivedTotalCrypto: null, receivedTotalCrypto: null,
paymentAddress, paymentAddress,
@@ -154,7 +154,7 @@ describe('toStorefrontInvoiceView', () => {
const view = await toStorefrontInvoiceView(invoice); const view = await toStorefrontInvoiceView(invoice);
expect(view).toMatchObject({ expect(view).toMatchObject({
cryptoCurrency: 'BTC', paymentLabel: 'BTC',
expectedTotalCrypto: '1.00000000', expectedTotalCrypto: '1.00000000',
paymentAddress: 'bc1qstorefronttest' paymentAddress: 'bc1qstorefronttest'
}); });
@@ -114,7 +114,7 @@ const buildStorefrontInvoiceView = async ({
const statusVariant = resolveInvoiceStatusVariant(invoiceState); const statusVariant = resolveInvoiceStatusVariant(invoiceState);
return { return {
cryptoCurrency: paymentLabel, paymentLabel,
expectedTotalCrypto, expectedTotalCrypto,
receivedTotalCrypto, receivedTotalCrypto,
paymentAddress: invoice.paymentAddress, paymentAddress: invoice.paymentAddress,