CONST ACCEPTED_CARDS = 'accepted-card-types'
type AcceptedCardTypes = {
acceptedCardTypes: string[];
};
async userAccounts(
...
): Promise<GraphQLTypes.AccountListResponse> {
...
const launchDarkly: LaunchDarkly = new LaunchDarkly({
config: config.launchDarkly,
context: { logger },
});
const acceptedCardTypes = await launchDarkly.getFeatureValue({
feature: ACCEPTED_CARDS,
defaultValue: [],
});
return {
...,
acceptedCardTypes: acceptedCardTypes ? acceptedCardTypes[paymentProcessor] : [],
};
} |