-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instantiate BraintreeClient Within Clients #830
Changes from 14 commits
d8ed6a6
39f6559
f3409c0
e335e03
9bb9dfe
72c6f29
3254786
edc0aee
17367a7
10660d2
20479e8
0970691
78c3c94
d5670aa
d997cec
e6e5a34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,10 @@ | |
import androidx.fragment.app.Fragment; | ||
import androidx.fragment.app.FragmentActivity; | ||
|
||
import com.braintreepayments.api.BraintreeClient; | ||
import com.braintreepayments.api.PaymentMethodNonce; | ||
|
||
import java.util.Objects; | ||
|
||
public abstract class BaseFragment extends Fragment { | ||
|
||
@CallSuper | ||
|
@@ -47,11 +48,15 @@ protected void showDialog(String message) { | |
} | ||
} | ||
|
||
protected BraintreeClient getBraintreeClient() { | ||
|
||
protected void fetchAuthorization(BraintreeAuthorizationCallback callback) { | ||
DemoActivity demoActivity = getDemoActivity(); | ||
if (demoActivity != null) { | ||
return demoActivity.getBraintreeClient(); | ||
demoActivity.fetchAuthorization(callback); | ||
} | ||
return null; | ||
} | ||
Comment on lines
+52
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2cents: I always felt like phasing out There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed - will look into that in another demo refactor PR |
||
|
||
String getAuthStringArg() { | ||
return Objects.requireNonNull(requireArguments().getString("authString")); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.braintreepayments.demo; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.braintreepayments.api.Authorization; | ||
import com.braintreepayments.api.BraintreeClient; | ||
|
||
public interface BraintreeAuthorizationCallback { | ||
void onResult(@NonNull String authString); | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change impact DropIn at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't - drop-in uses the
BraintreeClient
constructor withBraintreeOptions
param, and has the same "com.braintreepayments.api" group ID as the core libraries, so they all can share these "package-private"/library group methods.