Slave/btc integration #4

Merged
nobswebdev merged 47 commits from slave/btc-integration into master 2026-09-07 11:11:10 +00:00
7 changed files with 14 additions and 14 deletions
Showing only changes of commit dd234421a4 - Show all commits
@@ -56,7 +56,7 @@ describe('StorefrontCheckoutViewService', () => {
let toStorefrontInvoiceViewSpy: jest.SpiedFunction<typeof toStorefrontInvoiceViewModule.toStorefrontInvoiceView>;
const checkoutInvoiceView = {
cryptoCurrency: 'XMR',
paymentLabel: 'XMR',
amountFiat: 9
} as unknown as StorefrontInvoiceView;
@@ -3,7 +3,7 @@ import type { InvoiceStatusLabel } from '../../../utils/invoice/types/InvoiceSta
import type { InvoiceStatusVariant } from '../../../utils/invoice/types/InvoiceStatusVariant';
export type StorefrontInvoiceView = {
cryptoCurrency: string;
paymentLabel: string;
expectedTotalCrypto: string;
receivedTotalCrypto: string | null;
paymentAddress: string;
@@ -23,14 +23,14 @@
<p class='sf-payment-status sf-payment-status--confirmed'>Payment received</p>
<p class='sf-payment-detail'>
Received:
<strong>{{checkout.checkoutInvoice.receivedTotalCrypto}} {{checkout.checkoutInvoice.cryptoCurrency}}</strong>
<strong>{{checkout.checkoutInvoice.receivedTotalCrypto}} {{checkout.checkoutInvoice.paymentLabel}}</strong>
</p>
<p class='sf-payment-detail'>
Your order is being prepared. This page will redirect automatically once it is ready.
</p>
{{> refresh-link href=checkout.refreshHref showAutoRefreshNote=true}}
{{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}}
{{> invoice-payment refreshHref=../checkout.refreshHref showAutoRefreshNote=true}}
{{/with}}
@@ -3,27 +3,27 @@
{{/if}}
{{#if showProminentAmount}}
<p class='sf-payment-amount'>{{expectedTotalCrypto}} {{cryptoCurrency}}</p>
<p class='sf-payment-amount'>{{expectedTotalCrypto}} {{paymentLabel}}</p>
{{/if}}
{{#if showReceivedTotal}}
<p class='sf-payment-detail'>
Received:
<strong>{{receivedTotalCrypto}} {{cryptoCurrency}}</strong>
<strong>{{receivedTotalCrypto}} {{paymentLabel}}</strong>
</p>
{{/if}}
{{#if showExpectedTotal}}
<p class='sf-payment-detail'>
Expected total:
<strong>{{expectedTotalCrypto}} {{cryptoCurrency}}</strong>
<strong>{{expectedTotalCrypto}} {{paymentLabel}}</strong>
</p>
{{/if}}
{{#if showInstruction}}
<p class='sf-payment-detail'>
{{instructionPrefix}}
<strong>{{instructionAmountCrypto}} {{cryptoCurrency}}</strong>
<strong>{{instructionAmountCrypto}} {{paymentLabel}}</strong>
{{instructionSuffix}}
{{#if showExpiry}}
Payment expires in
@@ -34,7 +34,7 @@
{{#if showQr}}
<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>
{{/if}}
@@ -48,7 +48,7 @@
<ul class='sf-list-reset sf-tx-list'>
{{#each payments}}
<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-tx-status sf-tx-status--{{confirmationStatusVariant}}'>{{confirmationStatus}}</div>
</li>
@@ -198,7 +198,7 @@ describe('StorefrontOrderViewService', () => {
expect(view.totals.shippingCostFiat).toBe(5);
expect(view.totals.grandTotalFiat).toBe(15);
expect(view.shippingInvoice).toMatchObject({
cryptoCurrency: 'XMR',
paymentLabel: 'XMR',
paymentAddress: '4shipping'
});
});
@@ -109,7 +109,7 @@ describe('toStorefrontInvoiceView', () => {
const view = await toStorefrontInvoiceView(invoice);
expect(view).toMatchObject({
cryptoCurrency: 'XMR',
paymentLabel: 'XMR',
expectedTotalCrypto: '1.00000000',
receivedTotalCrypto: null,
paymentAddress,
@@ -154,7 +154,7 @@ describe('toStorefrontInvoiceView', () => {
const view = await toStorefrontInvoiceView(invoice);
expect(view).toMatchObject({
cryptoCurrency: 'BTC',
paymentLabel: 'BTC',
expectedTotalCrypto: '1.00000000',
paymentAddress: 'bc1qstorefronttest'
});
@@ -114,7 +114,7 @@ const buildStorefrontInvoiceView = async ({
const statusVariant = resolveInvoiceStatusVariant(invoiceState);
return {
cryptoCurrency: paymentLabel,
paymentLabel,
expectedTotalCrypto,
receivedTotalCrypto,
paymentAddress: invoice.paymentAddress,