use of com.paypal.android.sdk.onetouch.core.config.ConfigEndpoint in project braintree_android by braintree.
the class AuthorizationRequest method getBrowserSwitchUrl.
@Override
public String getBrowserSwitchUrl(Context context, OtcConfiguration config) throws CertificateException, UnsupportedEncodingException, NoSuchPaddingException, NoSuchAlgorithmException, IllegalBlockSizeException, JSONException, BadPaddingException, InvalidEncryptionDataException, InvalidKeyException {
OAuth2Recipe recipe = config.getBrowserOauth2Config(getScopes());
ConfigEndpoint configEndpoint = recipe.getEndpoint(getEnvironment());
X509Certificate cert = EncryptionUtils.getX509CertificateFromBase64String(configEndpoint.certificate);
return configEndpoint.url + "?payload=" + URLEncoder.encode(buildPayload(context, cert), "utf-8") + "&payloadEnc=" + URLEncoder.encode(buildPayloadEnc(cert), "utf-8") + "&x-source=" + context.getPackageName() + "&x-success=" + getSuccessUrl() + "&x-cancel=" + getCancelUrl();
}
Aggregations