Search in sources :

Example 1 with OAuth2Recipe

use of com.paypal.android.sdk.onetouch.core.config.OAuth2Recipe 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();
}
Also used : OAuth2Recipe(com.paypal.android.sdk.onetouch.core.config.OAuth2Recipe) ConfigEndpoint(com.paypal.android.sdk.onetouch.core.config.ConfigEndpoint) X509Certificate(java.security.cert.X509Certificate)

Aggregations

ConfigEndpoint (com.paypal.android.sdk.onetouch.core.config.ConfigEndpoint)1 OAuth2Recipe (com.paypal.android.sdk.onetouch.core.config.OAuth2Recipe)1 X509Certificate (java.security.cert.X509Certificate)1