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