use of com.braintreepayments.api.models.TokenizationKey in project braintree_android by braintree.
the class BraintreeFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
if (mContext == null) {
mContext = getActivity().getApplicationContext();
}
mNewActivityNeedsConfiguration = false;
mCrashReporter = CrashReporter.setup(this);
mSessionId = getArguments().getString(EXTRA_SESSION_ID);
mIntegrationType = getArguments().getString(EXTRA_INTEGRATION_TYPE);
mAuthorization = getArguments().getParcelable(EXTRA_AUTHORIZATION_TOKEN);
mAnalyticsDatabase = AnalyticsDatabase.getInstance(getApplicationContext());
if (mHttpClient == null) {
mHttpClient = new BraintreeHttpClient(mAuthorization);
}
if (savedInstanceState != null) {
List<PaymentMethodNonce> paymentMethodNonces = savedInstanceState.getParcelableArrayList(EXTRA_CACHED_PAYMENT_METHOD_NONCES);
if (paymentMethodNonces != null) {
mCachedPaymentMethodNonces.addAll(paymentMethodNonces);
}
mHasFetchedPaymentMethodNonces = savedInstanceState.getBoolean(EXTRA_FETCHED_PAYMENT_METHOD_NONCES);
try {
setConfiguration(Configuration.fromJson(savedInstanceState.getString(EXTRA_CONFIGURATION)));
} catch (JSONException ignored) {
}
} else {
if (mAuthorization instanceof TokenizationKey) {
sendAnalyticsEvent("started.client-key");
} else {
sendAnalyticsEvent("started.client-token");
}
}
fetchConfiguration();
}
Aggregations