diff --git a/CHANGELOG.md b/CHANGELOG.md index 60550cb7d3..5e76b585f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,12 +40,13 @@ * Remove `GooglePayListener` and `GooglePayRequestPaymentCallback` * Add `GooglePayLauncher`, `GooglePayPaymentAuthRequest`, `GooglePayPaymentAuthRequestCallback`, `GooglePayPaymentAuthResult`, - `GooglePayTokenizeCallback` and `GooglePayLauncherCallback` + `GooglePayTokenizeCallback`, `GooglePayTokenizationParameters` and `GooglePayLauncherCallback` * Remove overload constructors, `setListener, and `onActivityResult` from `GooglePayClient` * Change `GooglePayClient#requestPayment` parameters and rename to `GooglePayClient#createPaymentAuthRequest` * Add `GooglePayClient#tokenize` * Remove `merchantId` from `GooglePayRequest` + * Change `GooglePayGetTokenizationParametersCallback` parameters * ThreeDSecure * Remove `ThreeDSecureListener` * Add `ThreeDSecureLauncher`, `ThreeDSecurePaymentAuthResult`, diff --git a/GooglePay/src/main/java/com/braintreepayments/api/GooglePayClient.java b/GooglePay/src/main/java/com/braintreepayments/api/GooglePayClient.java index b9121d16a2..b5c488ac09 100644 --- a/GooglePay/src/main/java/com/braintreepayments/api/GooglePayClient.java +++ b/GooglePay/src/main/java/com/braintreepayments/api/GooglePayClient.java @@ -158,13 +158,12 @@ public void isReadyToPay(@NonNull final FragmentActivity activity, public void getTokenizationParameters( @NonNull final GooglePayGetTokenizationParametersCallback callback) { braintreeClient.getConfiguration((configuration, e) -> { - if (configuration == null) { - callback.onResult(null, null); + if (configuration == null && e != null) { + callback.onTokenizationParametersResult(new GooglePayTokenizationParameters.Failure(e)); return; } - callback.onResult( - getTokenizationParameters(configuration, braintreeClient.getAuthorization()), - getAllowedCardNetworks(configuration)); + callback.onTokenizationParametersResult(new GooglePayTokenizationParameters.Success( + getTokenizationParameters(configuration, braintreeClient.getAuthorization()), getAllowedCardNetworks(configuration))); }); } diff --git a/GooglePay/src/main/java/com/braintreepayments/api/GooglePayGetTokenizationParametersCallback.java b/GooglePay/src/main/java/com/braintreepayments/api/GooglePayGetTokenizationParametersCallback.java index 40cc1e18e9..38133ef523 100644 --- a/GooglePay/src/main/java/com/braintreepayments/api/GooglePayGetTokenizationParametersCallback.java +++ b/GooglePay/src/main/java/com/braintreepayments/api/GooglePayGetTokenizationParametersCallback.java @@ -1,7 +1,5 @@ package com.braintreepayments.api; -import androidx.annotation.Nullable; - import com.google.android.gms.wallet.PaymentMethodTokenizationParameters; import java.util.Collection; @@ -17,17 +15,17 @@ public interface GooglePayGetTokenizationParametersCallback { * Wallet or Google Pay integrations, or when full control over the * {@link com.google.android.gms.wallet.MaskedWalletRequest} and * {@link com.google.android.gms.wallet.FullWalletRequest} is required. - * + *
* {@link PaymentMethodTokenizationParameters} should be supplied to the
* {@link com.google.android.gms.wallet.MaskedWalletRequest} via
- * {@link com.google.android.gms.wallet.MaskedWalletRequest.Builder#setPaymentMethodTokenizationParameters(PaymentMethodTokenizationParameters)}
+ * {@link
+ * com.google.android.gms.wallet.MaskedWalletRequest.Builder#setPaymentMethodTokenizationParameters(PaymentMethodTokenizationParameters)}
* and {@link Collection