import type { GlobalState, TabArgs } from '../types'; import { selectTabState } from './tabs'; import { getCurrentTabId } from '../../util/establishMultitabRole'; export function selectPaymentInputInvoice( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.inputInvoice; } export function selectPaymentFormId( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.formId; } export function selectPaymentRequestId( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.requestId; } export function selectProviderPublishableKey( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.nativeParams?.publishableKey; } export function selectProviderPublicToken( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.nativeParams?.publicToken; } export function selectStripeCredentials( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.stripeCredentials; } export function selectSmartGlocalCredentials( global: T, ...[tabId = getCurrentTabId()]: TabArgs ) { return selectTabState(global, tabId).payment.smartGlocalCredentials; }