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

Add Payments UI bindings (Payment Sheet) #1

Closed
bg-stripe opened this issue Jan 6, 2021 · 17 comments · Fixed by #74
Closed

Add Payments UI bindings (Payment Sheet) #1

bg-stripe opened this issue Jan 6, 2021 · 17 comments · Fixed by #74
Labels
enhancement New feature or request P0 Address these issues first

Comments

@bg-stripe
Copy link

bg-stripe commented Jan 6, 2021

We'd like to add bindings for our new native mobile payments UI (currently in an early beta). Please also include docs.

We'd like to review the integration (docs) in detail before we merge this one.

@bg-stripe bg-stripe changed the title Add Payments UI bindings Add Mobile Payments UI bindings Jan 6, 2021
@bg-stripe bg-stripe changed the title Add Mobile Payments UI bindings Add Payments UI bindings Jan 6, 2021
@trag-stripe trag-stripe added this to the v1 milestone Jan 12, 2021
@trag-stripe trag-stripe added the enhancement New feature or request label Jan 12, 2021
@bg-stripe bg-stripe added the P0 Address these issues first label Jan 13, 2021
@bg-stripe
Copy link
Author

Note that this is currently only available on iOS. First Android release is coming next week.

We'd still like to see this implemented iOS-only for now (this week). Once you've finished & we've approved the PR, we'd like to cut a release of stripe-react-native with iOS-only support of our new payments UI, so that we can share with potential beta users.

@bg-stripe
Copy link
Author

update: Android & iOS are both available now.

@mshafrir-stripe
Copy link
Collaborator

Please let me know if you have any questions about the Android integration.

@arekkubaczkowski
Copy link
Collaborator

@thorsten-stripe Should we implement card scanning feature as well? https://stripe.com/docs/mobile/payments-ui-beta#card-scanning

@thorsten-stripe
Copy link
Contributor

@arekkubaczkowski yes, please. Do you see any issue with that?

@arekkubaczkowski
Copy link
Collaborator

@thorsten-stripe I think not but I could't find this option inside of payment sheet

@thorsten-stripe
Copy link
Contributor

Maybe @bg-stripe can help clarify? Also, is card scanning available for both iOS and Android? In the docs it I only see iOS mentioned. cc @mshafrir-stripe

@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Feb 18, 2021

ok I have just found it, so basically there isn't required any implementation from our side, the only one thing which is needed it's setting permissions in the app which uses SDK

@mshafrir-stripe
Copy link
Collaborator

Card scanning is currently only available on iOS. We have no concrete roadmap for adding card scanning on Android.

@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Feb 19, 2021

@mshafrir-stripe I have a question regarding PaymentSheet constructor activity param which is ComponentActivity.
what's behind the use this rather than android.app.Activity class?
As it's not available in React Native module I think it could be very tricky or even impossible to implement.
Is there any chance to use just Activity?

@mshafrir-stripe
Copy link
Collaborator

mshafrir-stripe commented Feb 19, 2021

@arekkubaczkowski can you extend AppCompatActivity or FragmentActivity? They are both subclasses of ComponentActivity. We won't be able to change the requirement of ComponentActivity.

Looks like ReactActivity is an AppCompatActivity.

@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Feb 23, 2021

@mshafrir-stripe sorry I mis-investigated my problem at the beginning.
It turned out that we are not able to create an instance of PaymentSheet inside of react native module due to improper activity state which is set RESUMED once the RN module is initialized so it's "too late" for it.
According your documentation the instance of PaymentSheet should be created before an activity is started and I've found that it is due to registering some contracts in activity, for example:

activity.registerForActivityResult(
        PaymentOptionContract()
    ) 

A potential solution is to require an extra step from the user with creating an instance of PaymentSheet inside of onCreate method in MainActivity.
Ofc this has its drawbacks like one instance during the whole lifetime of the application but I don't see any other solutions at the moment. I assume that there is no alternative way of implementation on your side but I would like to hear your opinion about that.

@thorsten-stripe we can discuss it on our meeting today

@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Feb 23, 2021

but there appears couple of issues... PaymentSheet constructor requires paymentResultCallback which cannot be initialized by user so there would be needed some change in your implementation which allows to initialize callbacks after the instance is created.
Another problem is auto linking which will not work in this case and user will have to install Stripe library manually

@arekkubaczkowski
Copy link
Collaborator

@mshafrir-stripe I've faced with certain issue with choosing payment method - when I add some card it's not saved so everytime when I call presentPaymentOptions I have to add a new card.

paymentsheet.mov

@mshafrir-stripe
Copy link
Collaborator

@arekkubaczkowski thanks for flagging. Good news, @michelleb-stripe is working on fixing this.

@bg-stripe
Copy link
Author

Update: We're planning to release a production-ready release (beta-2) of the Android Payment UI bindings. This release will include the above fixes, and we plan to ship it at the end of this week. (cc @mshafrir-stripe @michelleb-stripe )

@bg-stripe bg-stripe changed the title Add Payments UI bindings Add Payments UI bindings (Payment Sheet) Mar 24, 2021
@bg-stripe
Copy link
Author

Update: We've had to delay our our Android SDK beta-2 release, but should be able to ship a new Android SDK release in a couple weeks.

@arekkubaczkowski – We discussed as a team, and decided that since Payment Sheet is still a beta product, we don't want to merge #74 into main, even after we release beta-2. Instead, we should keep it on a branch, and provide instructions for installing the branch in the integration guide.

Week of April 5 plan:

  • Stripe releases Android SDK beta-2 for Payment Sheet
  • Update Payment UI #74 to use the new Android SDK beta-2 branch
  • Rename the branch for Payment UI #74 to payment-sheet
  • Add installation instructions for branch to integration guide in Payment UI #74

(cc @michelleb-stripe @mshafrir-stripe @thorsten-stripe @yuki-stripe )

SAzzerPlayer pushed a commit to SAzzerPlayer/stripe-react-native that referenced this issue Jun 14, 2021
Fix PaymentConfiguration initializing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P0 Address these issues first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants