All files / app/embeddedCheckout createEmbeddedCheckoutSupport.ts

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24    5x   5x 5x   5x                 5x     44x        
import { LanguageService } from '@bigcommerce/checkout-sdk';
 
import { CheckoutSupport, NoopCheckoutSupport } from '../checkout';
 
import isEmbedded from './isEmbedded';
import EmbeddedCheckoutSupport from './EmbeddedCheckoutSupport';
 
const UNSUPPORTED_METHODS = [
    'afterpay',
    'amazon',
    'chasepay',
    'googlepay',
    'klarna',
    'masterpass',
];
 
export default function createEmbeddedCheckoutSupport(
    language: LanguageService
): CheckoutSupport {
    return isEmbedded() ?
        new EmbeddedCheckoutSupport(UNSUPPORTED_METHODS, language) :
        new NoopCheckoutSupport();
}