react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

Road to 1.0

Open nabilfreeman opened this issue 3 years ago • 9 comments

Hi everybody, Nabil here. I'll be a maintainer on this library going forward.

In a couple of days we'll release version 0.8 of this library which will support autolinking (RN 0.61+) and various bug fixes.

Going forward I'm working on a few improvements to this library with my team:

🚢 0.8

✅ JS tests

  • A lot of JS tests had been previously written and disabled due to many of them failing.
  • We'll complete these tests and fix any bugs that come up.

✅ Flattened project structure

  • The addons sub-packages are no longer needed to build the apps using CocoaPods so I'll move everything back up to the top level.
  • The advantage of this is that you can easily point your package.json to a git fork or branch for easier development without Lerna etc.
  • This will prevent outstanding PRs from being merged, so I've reviewed all and merged in before this.
  • I promise to help manually merge in valuable work from the outstanding PRs (I think they all need further questions or work to be ready).

✅ RN 0.63 Example Project

  • I've also made a brand new example project here: https://github.com/freeman-industries/react-native-payments-example-ios for iOS.
  • This uses RN 0.63 and explains how to support Stripe / Braintree which are only a few lines each.
  • I'll delete the old example projects (but keep the ones which aren't migrated yet, Android and Web).

0.9

🚧 Stripe Intents support for EU developers

  • Setup/PaymentIntent which can be used both with Apple/Google Pay and manual card entry.
  • You'll need a back-end to implement the handshake for this.
  • Legacy Stripe will continue to be supported without any breaking changes.

Complete example projects

  • New example projects for Android and Web

1.0

Native unit tests

  • After speccing the native libraries we'll be able to add unit tests to these, so it's even easier for contributors to know that things will keep working.

Updated guides

  • We'll make clear workflow-focused guides for using this library, for example "Apple Pay with Braintree", "Google Pay with Stripe Intents", "3D Secure card entry with Stripe Intents" etc.
  • We'll improve the existing JS API spec and document the native libraries for contributors to easily follow.

Future

IAP

  • We'll need Apple In-App Purchases in mid 2021 at my business, @lesalonapp.
  • There is a great library that already exists for this: https://github.com/dooboolab/react-native-iap.
  • We'll experiment and see if there is any need for another implementation here.

Native Components

  • Following in the footsteps of PKPaymentButton exposing Stripe Elements components could be helpful for some.
  • It really depends on if the vision for this library evolves into the comprehensive RN Payments library instead of just biometric payments.
  • I think it would attract a lot of developers to React Native but would require a lot of process and a large community of maintainers to pull off.

More gateways

  • I've seen requests for adding other Merchant Gateways in addition to Stripe and Braintree.
  • I totally support this, but it's difficult for me to work on these as we don't have any need for them at my business so can't really do real world testing and maintenance.

Thanks for reading! Comments appreciated. We are looking for people to help us out with the above. If you would like to take on any of these from 0.9 onwards, please get in touch.

Speak soon Nabs

nabilfreeman avatar Nov 16 '20 18:11 nabilfreeman

Thanks a lot @nabilfreeman !!

ccanalesdote avatar Nov 16 '20 19:11 ccanalesdote

Thanks @nabilfreeman ! Any ETA on the new release?

topisark avatar Nov 18 '20 09:11 topisark

@topisark this evening, UK time. As long as nothing game-breaking comes up!

nabilfreeman avatar Nov 18 '20 10:11 nabilfreeman

Removed from 1.0: paymentMethodTokenizationParameters is very wordy but compliant with PaymentRequest, so we definitely won't change this.

Refactor of modules

  • PaymentRequest conforms to the W3C spec so I'd like to keep it safe and isolate it more from the public key / merchant ID config that is currently added to it (unless I'm wrong in thinking these aren't standard spec).
  • This would be a breaking change but quite a minor one.

nabilfreeman avatar Nov 18 '20 22:11 nabilfreeman

Removed from 0.9: I don't fully understand the Google Pay tokenization process but it uses private/public keys and it doesn't appear that you need the SDKs. More to come.

Tokenization in Android

???

  • NB I don't think I understood Google Pay well enough when speccing this one, might not be necessary....
  • Currently the Google Pay implementation doesn't handle any of the post-auth tokenization, Stripe/Braintree is left as an exercise to the developer.
  • We are aiming for feature parity with the iOS native library so you can get exactly the same I/O from PaymentRequest.show on both platforms.

nabilfreeman avatar Nov 18 '20 22:11 nabilfreeman

Stripe Intents pushed back to 0.9

I've pushed back Stripe Intents support by a few days as my team needs more time to finish. We'll focus on this for 0.9 and release as soon as possible so people have time before Jan 1st 2021 to make any changes.

nabilfreeman avatar Nov 18 '20 22:11 nabilfreeman

@nabilfreeman Great to see you taking on to move forward with this project! I was wondering if you guys are opened to give it an official typescript support? I'm more than happy to give a swing at it.

jinshin1013 avatar Dec 15 '20 23:12 jinshin1013

Hi @jinshin1013, yes definitely. There is currently partial support for Flow, I'd be happy with TypeScript as the project isn't that React heavy and to be honest going through the motions and documenting and typing everything is just what the codebase needs at this point!

Want to suggest a plan for implementation? I can help you out as well if it's a lot of work.

nabilfreeman avatar Dec 19 '20 09:12 nabilfreeman

Thanks for all the work on this @nabilfreeman!

Editing my previous comment, Payment Intents already worked with this package for me. For anyone looking for how to use this with their existing Payment Intents setup (in the US at least) -

Instead of using a stripe payment method ID (node server example):

stripe.paymentIntents.create({
        payment_method: paymentMethodId,
       ...
        })

Pass the Apple token in as such (node server side):

stripe.paymentIntents.create({
          type: 'card',
          card: {
            token: appleTokenizedCard,
          },
        ...
        })

mrondin1 avatar Jan 22 '21 20:01 mrondin1