From 531ac7ebd29968566d50c7d811c42cdc148a13ed Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 12 May 2026 14:59:19 +0300 Subject: [PATCH] refactor: extract method --- lnbits/fiat/square.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lnbits/fiat/square.py b/lnbits/fiat/square.py index a3684d628..1ea1d969c 100644 --- a/lnbits/fiat/square.py +++ b/lnbits/fiat/square.py @@ -122,6 +122,22 @@ class SquareWallet(FiatProvider): if opts.fiat_method == "subscription": return self._create_subscription_invoice(opts.subscription) + return await self._create_checkout_invoice( + amount=amount, + payment_hash=payment_hash, + currency=currency, + opts=opts, + memo=memo, + ) + + async def _create_checkout_invoice( + self, + amount: float, + payment_hash: str, + currency: str, + opts: SquareCreateInvoiceOptions, + memo: str | None = None, + ) -> FiatInvoiceResponse: amount_cents = int(amount * 100) co = opts.checkout or SquareCheckoutOptions() success_url = (