From e3be406b4b3f6722abdd8f6eb5ed3f4083af01d7 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 23 Jun 2025 12:50:14 +0300 Subject: [PATCH] fix: ids --- lnbits/core/services/payments.py | 4 ++-- tests/api/test_api.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lnbits/core/services/payments.py b/lnbits/core/services/payments.py index 37bf2012c..64c19c300 100644 --- a/lnbits/core/services/payments.py +++ b/lnbits/core/services/payments.py @@ -145,7 +145,7 @@ async def create_wallet_fiat_invoice( internal_payment.extra["fiat_payment_request"] = fiat_invoice.payment_request new_checking_id = ( f"fiat_{fiat_provider_name}_" - f"_{fiat_invoice.checking_id or internal_payment.checking_id}" + f"{fiat_invoice.checking_id or internal_payment.checking_id}" ) await update_payment(internal_payment, new_checking_id, conn=conn) internal_payment.checking_id = new_checking_id @@ -958,7 +958,7 @@ async def _debit_fiat_service_faucet_wallet( ) await create_payment( checking_id=f"internal_fiat_{fiat_provider_name}_" - f"_faucet_{payment.payment_hash}", + f"faucet_{payment.payment_hash}", data=create_payment_model, status=PaymentState.SUCCESS, conn=conn, diff --git a/tests/api/test_api.py b/tests/api/test_api.py index c28627b84..b698c357a 100644 --- a/tests/api/test_api.py +++ b/tests/api/test_api.py @@ -13,6 +13,7 @@ from lnbits.walletsfiat.base import FiatInvoiceResponse from ..helpers import ( get_random_invoice_data, + get_random_string, ) @@ -165,7 +166,7 @@ async def test_create_fiat_invoice(client, inkey_headers_to, mocker: MockerFixtu fiat_payment_request = "https://stripe.com/pay/session_123" fiat_mock_response = FiatInvoiceResponse( ok=True, - checking_id="session_123", + checking_id=f"session_123_{get_random_string(10)}", payment_request=fiat_payment_request, )