import { Country } from '../models/Country' ; import { TopUpProvider } from '../models/TopUpProvider' ; export class TopUpProviderSupportService { constructor ( private countries ) { } checkRampSupport ( countryName ) { const country = this . countries . find ( ( { name } ) => name === countryName ) ; return ! ! country && country . isEU ; } checkSafelloSupport ( countryName ) { return false ; } checkWyreSupport ( countryName ) { const wyreSupportedCountries = [ 'Australia' , 'Austria' , 'Belgium' , 'Canada' , 'Czechia' , 'Denmark' , 'Estonia' , 'Finland' , 'France' , 'Germany' , 'Greece' , 'Hong Kong' , 'Ireland' , 'Italy' , 'Latvia' , 'Lithuania' , 'Luxembourg' , 'Mexico' , 'Netherlands' , 'New Zealand' , 'Norway' , 'Poland' , 'Portugal' , 'Slovakia' , 'Slovenia' , 'Spain' , 'Sweden' , 'Switzerland' , 'United States' ] ; return wyreSupportedCountries . includes ( countryName ) ; } getProviders ( countryName ) { const providers = [ ] ; this . checkRampSupport ( countryName ) && providers . push ( TopUpProvider . RAMP ) ; this . checkSafelloSupport ( countryName ) && providers . push ( TopUpProvider . SAFELLO ) ; this . checkWyreSupport ( countryName ) && providers . push ( TopUpProvider . WYRE ) ; return providers ; } isInputAmountUsed ( topUpProvider ? ) { return ! ! topUpProvider && [ TopUpProvider . RAMP ] . includes ( topUpProvider ) ; } }