diff --git a/backend/internal/square/square_dev.go b/backend/internal/square/square_dev.go index 33013ff..a2979df 100644 --- a/backend/internal/square/square_dev.go +++ b/backend/internal/square/square_dev.go @@ -161,9 +161,9 @@ func (m *MockClient) GetCheckout(ctx context.Context, checkoutID string) (*Payme log.Printf("[SQUARE-MOCK] GetCheckout: id=%s", checkoutID) m.mu.RLock() - checkout, ok := m.checkouts[checkoutID] - m.mu.RUnlock() + defer m.mu.RUnlock() + checkout, ok := m.checkouts[checkoutID] if !ok { return nil, fmt.Errorf("checkout not found: %s", checkoutID) } @@ -172,10 +172,7 @@ func (m *MockClient) GetCheckout(ctx context.Context, checkoutID string) (*Payme return nil, fmt.Errorf("checkout pending") } - m.mu.RLock() result, ok := m.completed[checkoutID] - m.mu.RUnlock() - if !ok { return nil, fmt.Errorf("checkout result not found: %s", checkoutID) }