Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo committed Oct 31, 2023
1 parent 7ce4a97 commit 039571a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,17 @@
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.navigation.fragment.NavHostFragment;

import com.braintreepayments.api.BraintreeClient;
import com.braintreepayments.api.PostalAddress;
import com.braintreepayments.api.SEPADirectDebitBrowserSwitchResult;
import com.braintreepayments.api.SEPADirectDebitBrowserSwitchResultCallback;
import com.braintreepayments.api.SEPADirectDebitClient;
import com.braintreepayments.api.SEPADirectDebitFlowStartedCallback;
import com.braintreepayments.api.SEPADirectDebitLauncher;
import com.braintreepayments.api.SEPADirectDebitLauncherCallback;
import com.braintreepayments.api.SEPADirectDebitListener;
import com.braintreepayments.api.SEPADirectDebitMandateType;
import com.braintreepayments.api.SEPADirectDebitNonce;
import com.braintreepayments.api.SEPADirectDebitRequest;
import com.braintreepayments.api.SEPADirectDebitResponse;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.braintreepayments.api;

// TODO: - Docstring
/**
* Result received from the SEPA mandate web flow through {@link SEPADirectDebitBrowserSwitchResultCallback}.
* This result should be passed to
* {@link SEPADirectDebitClient#onBrowserSwitchResult(SEPADirectDebitBrowserSwitchResult, SEPADirectDebitBrowserSwitchResultCallback)} )}
* to complete the SEPA mandate flow.
*/
public class SEPADirectDebitBrowserSwitchResult {

private BrowserSwitchResult browserSwitchResult;
Expand All @@ -21,4 +26,4 @@ BrowserSwitchResult getBrowserSwitchResult() {
Exception getError() {
return error;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface SEPADirectDebitBrowserSwitchResultCallback {

/**
* @param sepaDirectDebitNonce {@link SEPADirectDebitNonce}
* @param error an exception that occurred while processing a PayPal result
* @param error an exception that occurred while processing a PayPal result
*/
void onResult(@Nullable SEPADirectDebitNonce sepaDirectDebitNonce, @Nullable Exception error);
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void tokenize(@NonNull final FragmentActivity activity,
braintreeClient.sendAnalyticsEvent(
"sepa-direct-debit.create-mandate.success");
try {
SEPADirectDebitResponse sepaDirectDebitResponse = new SEPADirectDebitResponse(buildBrowserSwitchOptions(result), null);
SEPADirectDebitResponse sepaDirectDebitResponse =
new SEPADirectDebitResponse(buildBrowserSwitchOptions(result), null);
callback.onResult(sepaDirectDebitResponse, null);
} catch (JSONException exception) {
braintreeClient.sendAnalyticsEvent(
Expand All @@ -85,7 +86,8 @@ public void tokenize(@NonNull final FragmentActivity activity,
if (sepaDirectDebitNonce != null) {
braintreeClient.sendAnalyticsEvent(
"sepa-direct-debit.tokenize.success");
SEPADirectDebitResponse sepaDirectDebitResponse = new SEPADirectDebitResponse(null, sepaDirectDebitNonce);
SEPADirectDebitResponse sepaDirectDebitResponse =
new SEPADirectDebitResponse(null, sepaDirectDebitNonce);
callback.onResult(sepaDirectDebitResponse, null);
} else if (tokenizeError != null) {
braintreeClient.sendAnalyticsEvent(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

import androidx.fragment.app.FragmentActivity;

/**
* Returned via the {@link SEPADirectDebitFlowStartedCallback} after calling
* {@link SEPADirectDebitClient#tokenize(FragmentActivity, SEPADirectDebitRequest, SEPADirectDebitFlowStartedCallback)}.
*
* Inspect the {@link SEPADirectDebitNonce} property to determine if tokenization is complete, or
* if you must continue the SEPA mandate web flow via
* {@link SEPADirectDebitLauncher#launch(FragmentActivity, SEPADirectDebitResponse)}
*/
public class SEPADirectDebitResponse {

private BrowserSwitchOptions browserSwitchOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
interface SEPADirectDebitTokenizeCallback {

void onResult(@Nullable SEPADirectDebitNonce sepaDirectDebitNonce, @Nullable Exception error);

}
1 change: 0 additions & 1 deletion v5_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ class MyActivity : FragmentActivity() {
+ intent)
}


fun initializeClients() {
braintreClient = BraintreeClient(context, "TOKENIZATION_KEY_OR_CLIENT_TOKEN")
- sepaDirectDebitClient = SEPADirectDebitClient(this, braintreeClient)
Expand Down

0 comments on commit 039571a

Please sign in to comment.