decord/source/modules/billing/experiments/BlockedPaymentsCountryExperiment.tsx

44 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 7426
// Function ID: 7427
2026-07-29 08:29:29 +00:00
// Name: useBlockedPaymentsConfig
2026-08-24 06:08:38 +00:00
// Dependencies: [4290, 1472, 7427, 2]
2026-07-20 16:05:17 +00:00
// Exports: getIsPaymentsBlocked, useBlockedPaymentsConfig, useIsPaymentsBlocked
2026-08-24 06:08:38 +00:00
// Module 7426 (useBlockedPaymentsConfig)
import set from "set" /* 2 */;
import useGeoForUserDefault from "useGeoForUser" /* 7427 */;
import createExperiment from "createExperiment" /* 4290 */;
import ApexExperiment from "ApexExperiment" /* 1472 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
const items = [{ id: 1, label: "Payments Blocked", config: { paymentsBlocked: true } }];
let closure_2 = createExperiment.createExperiment({ kind: "user", id: "2022-03_block_russian_purchases", label: "Block purchases based on country", defaultConfig: { paymentsBlocked: false }, treatments: items });
const obj = { 1: null };
obj[1] = { enabled: true };
let closure_3 = ApexExperiment.createApexExperiment({ name: "2026-03-block-purchases", kind: "user", defaultConfig: { enabled: false }, variations: obj });
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/billing/experiments/BlockedPaymentsCountryExperiment.tsx");
2026-07-20 16:05:17 +00:00
export const useBlockedPaymentsConfig = function useBlockedPaymentsConfig() {
let enabled = closure_2.useExperiment({ location: "c519a9_1" }, { autoTrackExposure: false }).paymentsBlocked;
if (!enabled) {
enabled = closure_3.useConfig({ location: "c519a9_1" }).enabled;
}
if (!enabled) {
2026-08-24 06:08:38 +00:00
enabled = "RU" === useGeoForUserDefault().defaultBillingCountryCode;
2026-07-20 16:05:17 +00:00
}
return enabled;
};
export const useIsPaymentsBlocked = function useIsPaymentsBlocked() {
let enabled = closure_2.useExperiment({ location: "dc120b_3" }, { autoTrackExposure: false }).paymentsBlocked;
if (!enabled) {
enabled = closure_3.useConfig({ location: "dc120b_3" }).enabled;
}
return enabled;
};
export const getIsPaymentsBlocked = function getIsPaymentsBlocked() {
let enabled = closure_2.getCurrentConfig({ location: "1ee357_1" }, { autoTrackExposure: false }).paymentsBlocked;
if (!enabled) {
enabled = closure_3.getConfig({ location: "1ee357_1" }).enabled;
}
return enabled;
};