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

Final PR from aspect-apps #8

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

Conversation

0xamogh
Copy link

@0xamogh 0xamogh commented Sep 6, 2020

  • Setup Intents for iOS and Android
  • Updated methods to support payments from saved Cards

@0xamogh
Copy link
Author

0xamogh commented Sep 6, 2020

@viktorasl
Copy link
Member

Looks solid! Code reviewing it now!

@@ -49,6 +49,7 @@ android {
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
multiDexEnabled true
Copy link
Member

Choose a reason for hiding this comment

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

is this just a precaution or did you face any issues?

@@ -0,0 +1,32 @@
export interface InitParams {
Copy link
Member

Choose a reason for hiding this comment

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

build artifacts (build/*) should be gitignored

@@ -0,0 +1,6525 @@
{
Copy link
Member

Choose a reason for hiding this comment

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

In RN community yarn is more popular package manager therefore there already is yarn.lock file. I think we should avoid having two lock files because it will be hard to have them in sync.

.gitignore Outdated
# BUCK
buck-out/
\.buckd/
*.keystore
Copy link
Member

Choose a reason for hiding this comment

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

What's the intention behind this removal?

Choose a reason for hiding this comment

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

Not sure, one of our devs may have removed it @amogh-jrules @ChesterSim

@lukebrandonfarrell
Copy link

Hey @viktorasl, thanks for the in-depth review :) I think @amogh-jrules or @ChesterSim will be able to address some of these issues.

I believe we did run into issues with Multidex

async confirmSetup(clientSecret: string, cardParams: CardParams): Promise<SetupIntentResult>{
const nativeSetupIntentResult = await StripePayments.confirmSetup(clientSecret, cardParams);
const cardNumber = cardParams.number;
const cardType = creditCardType(cardNumber);
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if retrieval of card type (brand) should be part of this library. There are a few reasons:

  • Stripe already has method to get card type, of course it it's a separate method, but that looks like a valid separation of concerns
  • I'd like to avoid dependencies (except obviously stripe)

Thinking further about use cases - after confirmation list of cards will still be fetched from back-end (to get full list of cards) therefore it's not necessary to have this IMHO

Choose a reason for hiding this comment

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

@viktorasl we could move the card type retrieval to use the native stripe method as part of this method or a separate method.

Copy link
Member

Choose a reason for hiding this comment

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

separate method would be more appropriate I think

@0xamogh
Copy link
Author

0xamogh commented Sep 23, 2020

Apologies for the late response, the gitignore changes have been made, we were having some trouble installing it locally

@rawatnaresh
Copy link

how can I use this branch in my project? I did yarn add https://github.com/aspect-apps/react-native-stripe-payments but when I ran the project I got an error saying: Error: There was an unexpected error -- try again in a few seconds. switching to the master branch works as expected.

I really need some of the features from this branch, I even tried manually creating the native modules and using it like:

  • added pod 'Stripe', '~> 19.0' to the Podfile
  • copied StripePayment.m and StripePayments.h into /ios and used it in my js code like
NativeModules.StripePayments.init('publishable_key')
...
NativeModules.StripePayments.confirmSetup('client_secret_from_backend', cardParams)

but got the same error 😕 . Cleaned build folder, reinstalled Pods, restarted the metro server and ran again, but same error. I must be missing something but not sure what.

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.

7 participants