Skip to content
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

Update ReactNativePaymentsModule.java #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AppWerft
Copy link

@AppWerft AppWerft commented Oct 8, 2017

new methods:
setTheme(ReactNativePayments.THEME_DARK);
setLightTheme();
setDarkTheme();
addAllowedCardNetwork(ReactNativePayments.CARD_NETWORK_AMEX);
new contants:
ReactNativePayments.CARD_NETWORK_*
ReactNativePayments.THEME_LIGHT
ReactNativePayments.THEME_DARK

new methods:
setTheme(int Theme);
setLightTheme();
setDarkTheme();
addAllowedCardNetwork();
Copy link
Owner

@naoufal naoufal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋 Thanks for the PR @AppWerft!

I added a few comments and questions. Once those changes are in, we'll be set to merge this in.

.build();
break;
default:
// TODO warning
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you have planned for a warning?

@@ -54,6 +66,10 @@

public static final String REACT_CLASS = "ReactNativePayments";

private int theme = WalletConstants.THEME_LIGHT;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that this is the default theme?


constants.put("PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY", PaymentMethodTokenizationType.PAYMENT_GATEWAY); // Adyen,Braintree,Stripe,Vantiv
constants.put("PAYMENT_METHOD_TOKENIZATION_TYPE_NETWORK_TOKEN", PaymentMethodTokenizationType.NETWORK_TOKEN);
// constants.put("PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT", WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed?

this.theme = theme;
}
@ReactMethod
public void setLightTheme(int theme) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's drop the theme parameter here since it isn't being used.

// Public Methods
// ---------------------------------------------------------------------------------------------
@ReactMethod
public void setTheme(int theme) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Developers shouldn't have to interactive with the native module to set the theme.

Instead, I'd expose this via the configuration data on paymentMethodData. That way users decide the theme prior to initializing the PaymentRequest.

return parametersBuilder.build();
String publicKey = "";
switch( tokenizationParameters.getString("tokenizationType")) {
/*case WalletConstants.PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize there was a Direct Type.

Is it worth uncommenting and adding it to the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants