use of com.paypal.android.sdk.onetouch.core.config.OtcConfiguration in project braintree_android by braintree.
the class BrowserSwitchHelper method getBrowserSwitchIntent.
public static Intent getBrowserSwitchIntent(ContextInspector contextInspector, ConfigManager configManager, Request request) {
OtcConfiguration configuration = configManager.getConfig();
try {
String url = request.getBrowserSwitchUrl(contextInspector.getContext(), configuration);
Recipe<?> recipe = request.getBrowserSwitchRecipe(configuration);
for (String allowedBrowserPackage : recipe.getTargetPackagesInReversePriorityOrder()) {
boolean canIntentBeResolved = Recipe.isValidBrowserTarget(contextInspector.getContext(), url, allowedBrowserPackage);
if (canIntentBeResolved) {
request.trackFpti(contextInspector.getContext(), TrackingPoint.SwitchToBrowser, recipe.getProtocol());
return Recipe.getBrowserIntent(contextInspector.getContext(), url, allowedBrowserPackage);
}
}
} catch (CertificateException | UnsupportedEncodingException | NoSuchPaddingException | NoSuchAlgorithmException | IllegalBlockSizeException | JSONException | BadPaddingException | InvalidEncryptionDataException | InvalidKeyException ignored) {
}
return null;
}
Aggregations