Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Stripe PaymentIntents #448

Closed
Reacye opened this issue Mar 8, 2019 · 220 comments
Closed

Stripe PaymentIntents #448

Reacye opened this issue Mar 8, 2019 · 220 comments

Comments

@Reacye
Copy link

Reacye commented Mar 8, 2019

Are you going to insert support for new Stripe PaymentIntents API?

@otusweb
Copy link

otusweb commented Mar 25, 2019

I've already +1 one this, and if you plan on supporting this, I'm curious about the timeline as the September 2019 deadline is fast approaching.

@enda-phorest
Copy link

Any update on this?

@cybergrind
Copy link
Member

@enda-phorest integration doesn't look very hard. But probably tipsi team will implement it only if there are no other options. Probably someone will need it before that and send a PR

@ghost
Copy link

ghost commented May 21, 2019

Any update ?

@Ivan-Kachan-Computools
Copy link

Also wondering if there is any update?

@dziter
Copy link

dziter commented Jun 10, 2019

Hi everyone,

Two days ago, I have sent a message to Stripe to get some update about SCA compliance and integration with or without third-party.

To resume, the answer is pretty clear: check with Tipsi OR do your own integration.

@TipsiTeam: Do you plan tu support this feature before September?

« Hello,

This is Mitch with Stripes SCA team stepping in here, I hope this email finds you well.

Reading through your chat here I see you are using React Native and want to know how to get your integration set up to be SCA compliant. One thing to mention is that most of our third party integration have not completed their SCA updates yet. Partially because not everything is fully moved over yet on our end either. Most are waiting until all of the products and features are done being updated before they change their set up. This puts a lot of companies like you in a bind because you rely on these third parties but they are not ready yet.

So first and foremost I would reach out to Tipsi about this and find out what their plans are. Then I would using that information plan on what you are going to do to be ready when September rolls around.

Stripe offers a few easy integration options such as Checkout which now uses payment intents to allow for 3DS and SCA compliance:

https://stripe.com/docs/payments/checkout

But instead of redoing your whole integration first as I said reach out to Tipsi and see what they plan to do and then go from there. If you have further questions I'm always happy to help.

Best wishes, »

@cybergrind
Copy link
Member

@dziter our answer remains unchanged:
we will do integration if we don't get any PR from the community.

Because our major market is the US we don't have tight deadlines for it as other companies who are working in the EU. So there is no ETA from our team, we will do it when we have time for it.

@enda-phorest
Copy link

Thanks for the update @dziter and @cybergrind.
For more EU focused companies, a PR from the community seems more realistic if you have no ETA at Tipsi.

@adambutler
Copy link

First of all a huge thanks @cybergrind and the tipsi team for your hard work on this project.

As a UK based product that relies on Stripe we're being forced to move from using the Charge API to the Payment Intents API due to strong customer authentication.

Having read the comments above I totally understand that adding support for Payment Intents isn't a priority for tipsi. However, given the popularity of this library (7,108 weekly downloads at time of writing this) having no clear roadmap for this is quite concerning since literally, our whole business won't be able to operate from September 14th without this migration.

Personally, I'd love to be in a position to contribute a PR but as a super small team of two with no Objective-C or Java experience, this wouldn't really be practical.

Again, to reiterate I get that this isn't at all a tipsi's problem. The library is clearly used by so many companies and products that will be affected. I think we collectively need to devise a clear roadmap and solution to this problem to ensure that all these businesses aren't affected.

Given the breadth of people dependent and that it is currently the only react native library for Stripe I'd be inclined to ask Stripe directly if they are able to contribute. Alternatively, has anyone else got experience in crowdfunding the work needed to add support to this open source project?

I hope you don't mind but I'm copying in some of the top two recent contributors from each of stripe-node, stripe-android and stripe-ios to see if they are able to support (@ob-stripe @remi-stripe @mshafrir-stripe @ksun2-stripe @yuki-stripe @csabol-stripe).

@trag-stripe
Copy link
Contributor

@adambutler thanks for raising this, all valid and time-sensitive points. +1 to thanking @cybergrind and team for maintaining tipsi for the react native community + Stripe customers. We know this project is a lot to maintain and open source contributions are why react native developers are able to quickly implement payments.

We're talking internally today on setting a plan and will get back to this thread in short order.

@cybergrind
Copy link
Member

@trag-stripe API changes itself isn't that hard.
E2E tests are the issue:

So implementing new APIs is 15% of the time, fixing and writing tests - 85%. So it probably will consume at least full week of the one developer and we cannot make this commitment right now.

@trag-stripe
Copy link
Contributor

Ok, thanks for the context - makes sense that payment methods, intents, and the required tests need to been seen as all part of the overall work that's required. We had a kick off this morning and are planning to submit relevant PRs to contribute to tipsi-stripe. (Work & progress will be over the next few weeks)

@adambutler
Copy link

high five

👏 Amazing response from both the tipsi and Stripe teams. Thank you.

@tomrevansecho
Copy link

I have implemented payments intents based off Tipsi for our app. Happy to review PRs when added properly.

@e-nouri-work
Copy link

@tomrevansecho do you have a fork for what you did please ?

@tomrevansecho
Copy link

Unfortunately no due as I wasn't sure about the level of PCI compliance and have used native components from Stripe SDK for both iOS and Android. I wrote the bridge for both iOS and Android and this project was a huge help, is some tidy up still to do.

I would love to contribute back, its finding the time is the hard part. The Stripe docs were not the easiest to follow but I was lucky I had already done the web implementation, so I didn't require any further backend changes for this.

The biggest thing to implement is the action for further verification, this was the Android implementation roughly.

` @ReactMethod
public void handleCardAction(ReadableMap params, Promise promise) {

    String paymentIntentClientSecret = params.getString(FIELD_PAYMENT_INTENT_CLIENT_SECRET);

    if (paymentIntentClientSecret != null) {

        try {
            final PaymentIntentParams retrievePaymentIntentParams =
                    PaymentIntentParams.createRetrievePaymentIntentParams(
                            paymentIntentClientSecret);

            AsyncTask.execute(() -> {
                try {
                    // retrieve the PaymentIntent on a background thread
                    final PaymentIntent paymentIntent =
                            mStripe.retrievePaymentIntentSynchronous(
                                    retrievePaymentIntentParams,
                                    BuildConfig.StripeKey);

                    if (paymentIntent != null && paymentIntent.requiresAction()) {

                        Uri redirectUrl = paymentIntent.getRedirectUrl();
                        if (redirectUrl != null) {
                            if (getCurrentActivity() == null) {
                                promise.reject(
                                        getErrorCode(mErrorCodes, "paymentIntentRetrieveFailed"),
                                        getDescription(mErrorCodes, "paymentIntentRetrieveFailed")
                                );
                            } else {
                                mPromise = promise;
                            }

                            getCurrentActivity().startActivity(
                                    new Intent(Intent.ACTION_VIEW, redirectUrl));
                        }
                    } else {
                        promise.resolve(paymentIntent.getId());
                    }
                } catch (Exception ex) {
                    promise.reject(toErrorCode(ex), ex.getMessage());
                }
            });
        } catch (Exception ex) {
            promise.reject(toErrorCode(ex), ex.getMessage());
        }
    } else {
        promise.reject(
                getErrorCode(mErrorCodes, "paymentIntentParameterMissing"),
                getDescription(mErrorCodes, "paymentIntentParameterMissing")
        );
    }
}`

and for iOS:

` @objc func handleCardAction(_ params: Dictionary<String, String>, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {

if let paymentIntentClientSecret = params[RNStripeManager.field_payment_intent_client_secret] {
  
  STPAPIClient.shared().retrievePaymentIntent(withClientSecret: paymentIntentClientSecret) { [weak self] (paymentIntent, error) in
    if let paymentIntent = paymentIntent, paymentIntent.status == STPPaymentIntentStatus.requiresAction {
      
      guard let redirectContext = STPRedirectContext(paymentIntent: paymentIntent, completion: { clientSecret, redirectError in
        
        guard redirectError == nil else {
          rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
          return
        }
        
        // Completion block when any redirect flow is done
        STPAPIClient.shared().retrievePaymentIntent(withClientSecret: paymentIntentClientSecret) { confirmPaymentIntent, error in
          if let confirmPaymentIntent = confirmPaymentIntent, confirmPaymentIntent.status == STPPaymentIntentStatus.requiresConfirmation {
            
            resolver(confirmPaymentIntent.stripeId)
            
          } else {
            rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
          }
        }
      }) else {
        
        // Unsupported by Stripe
        rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
        return
      }
      
      if let strongSelf = self {
        strongSelf.redirectContext = redirectContext
        
        // TODO - ... bad practice
        let appDelegate = UIApplication.shared.delegate as! AppDelegate
        redirectContext.startRedirectFlow(from: appDelegate.window.rootViewController!)
      } else {
        rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
      }
    } else {
      rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
    }
  }
} else {
  rejecter(RNStripeManager.error_code, RNStripeManager.error_stripe_unknown, nil);
}

}`

I will try and can get some time but I can't promise anything - happy to review any PRs if anyone makes an earlier start.

@bamdadd
Copy link

bamdadd commented Jul 8, 2019

is anyone still working on PaymentIntent for tipsi-stripe?

@enda-phorest
Copy link

Comment from trag-stripe above indicates that Stripe will kindly do a PR for this issue quite soon.

@matthiasleitner
Copy link

@trag-stripe can you provide any updates on this?

@trag-stripe
Copy link
Contributor

Hi @enda-phorest / @bamdadd / @matthiasleitner - mini update here:

PaymentIntent / SCA support has been in active developement for the last two weeks - point developer on our team is @mindlapse. Context: Beyond PaymentIntents, there were a few pre-existing issues we agreed to resolve around CI Builds and migrating to the latest versions of our Mobile SDKs.

You can track the key PRs here as they land: https://github.com/tipsi/tipsi-stripe/pulls/mindlapse

@bamdadd
Copy link

bamdadd commented Jul 10, 2019

@trag-stripe thank you very much for the mini update. We can't wait for this piece of work and excited that Stripe is getting involved directly !

@mindlapse do you think you can point us to a particular PR for supports on PaymentIntents ?

@matthiasleitner
Copy link

@trag-stripe thanks for the update! @mindlapse As the deadline for SCA is approaching would be glad if you could share some details about your internal timeline.

Happy to support on certain PRs if possible.

@fbartho
Copy link
Collaborator

fbartho commented Jul 16, 2019

I'm thrilled to hear that you're working on this @trag-stripe / @mindlapse! Do you recommend using a particular branch? or are they merging right into Tipsi-Master? We're kicking off our backend work, and we want to start adopting tipsi-stripe (we don't currently have stripe in our RN app). So I would love to use the right codebase!

@bamdadd
Copy link

bamdadd commented Jul 17, 2019

Please give us an update

@mindlapse
Copy link
Collaborator

Ideally we'll be bringing the payment intent changes into master. At the moment we're working through quite a few Travis pipeline/Android emulator/Appium issues to unblock the PRs, and the biggest priority once those are resolved is to bring in the PaymentIntent changes.

@fbartho I know you're interested in a preview build so I'll look to get one set up soon!

@brooksyd2
Copy link

I'm excited to hear that development on support for the Payment Intents API is in progress. Thanks to all those working on it, particulary @mindlapse for taking point.

The Tipsi libary is a key part of our mobile products, and so as you can imagine i've ben keenly tracking this Issue for a resolution.

Could you please share an upate with where you are, and if possible share the outstanding PR's? I am happy to contribute where possible to getting this over the line given it's importance to us (and many others I'm sure), so let us know if there is anything the community can do to help.

@mindlapse
Copy link
Collaborator

Hi all,
Really glad to see the interest, there are a couple of gaps where we could use some help.

  • (in progress by @mindlapse) Stabilizing the android CI pipeline
  • (in progress by @mindlapse) Adding 'AppInfo' changes for Android that identify tipsi-stripe as the client for transactions made through it
  • Adding the same 'AppInfo' changes as above, except for iOS
  • Stabilizing the iOS build pipeline (i.e. so that it doesn't time out from inactivity)
  • Integrating the above into a branch that contains changes for Payment Intents
  • Updating the example app with demo pages using test cards that demonstrate supported payment intent use cases
  • Enhancing the CI pipeline test suite to validate that the test pages operate as expected (and that the existing test suite continues to pass)

Our biggest gap at the moment is with the iOS pipeline - we're seeing timeouts on Travis. We need someone to look at the iOS pipeline, and to determine if the timeout can be solved on Travis open source build machines, or if we need to move to something like real device testing or a provider that specializes in mobile app testing like SauceLabs. The GitHub Sponsors program may be a good option to help cover the subscription costs if we go that route.

In terms of PRs, there is #470 which contains changes related to payment intents, these changes will need to go through a review and will need a test suite created and the example app updated. The changes are really appreciated - I'm looking forward to helping review them.

My focus today is on finishing up the stabilization of the android pipeline, which is nearly ready (i.e. with emulation that doesn't timeout) and I expect to have a PR for those changes soon.

So that's the update! Thank you for checking in - if you know someone who can volunteer with the iOS pipeline and iOS AppInfo changes, that would be really helpful with moving this forward.

@kavindadilshan
Copy link

TypeError: _tipsiStripe.default.authenticatePaymentIntent

i have error

@jcohenho
Copy link

jcohenho commented Jun 4, 2020

Please add me to the beta! I'll be using it for a personal app project of mine.

@fbartho
Copy link
Collaborator

fbartho commented Jun 4, 2020

@jcohenho please read my comment upthread!: #448 (comment)

@kavindadilshan @thozh please open new issues, as these appear to be specific problems with your installs.

@jcohenho
Copy link

jcohenho commented Jun 4, 2020

@fbartho Thank you. Are there docs for the public beta?

@fbartho
Copy link
Collaborator

fbartho commented Jun 4, 2020

All docs and all code are in the experimental branch!

@meliodev
Copy link

meliodev commented Jun 15, 2020

I get sometimes this error. But, once I open the file 'node_modules/tipsi-stripe/srce/Stripe.js', it automatically works. I don't understand the cause of this strange behaviour. Has anybody had this issue ?

@rahultrivedy How were you able to get past the issue mentioned here on android:

@jessmitch42 I do, I'm unable to make it work in my app. I have that exact error:

TypeError: _tipsiStripe.default.confirmPaymentIntent is not a function

@rohitashPrajapati
Copy link

I am also facing a similar issue sometimes. Not knowing what exactly is causing this issue.

_tipsiStripe.default.confirmPaymentIntent is not a function

@meliodev
Copy link

meliodev commented Jun 17, 2020

confirmPaymentIntent

I think I found a quick fix solution.
On the file you are using that method, just add the following line:

import X from '../../node_modules/tipsi-stripe/src/Stripe'

( '../../node_modules/tipsi-stripe/src/Stripe' is the relative path to Stripe.js)

@fbartho
Copy link
Collaborator

fbartho commented Jun 17, 2020

For everyone fighting with the _tipsiStripe.default.confirmPaymentIntent is not a function issue -- in all cases that we have investigated, it was a situation with an incorrect Install & Linkage of the Library and in at least one case a conflict from multiple copies of tipsi-stripe being installed (because it was using npm or something?).

This could be the wrong version of React-Native, or not fully completing the manual linkage steps, or a babel or metro configuration issue.

@rohitashPrajapati / @meliodev --

  1. Which beta of tipsi-stripe are you using?
  2. Which version of React-Native are you using?
  3. Which version of babel are you using? & metro?
  4. Are you trying to do this with expo? (expo is not supported currently)

@ifier
Copy link

ifier commented Jul 21, 2020

Any updates?
How can we use 3D secure and PaymentIntents with tipsi-stripe?

@fbartho
Copy link
Collaborator

fbartho commented Jul 21, 2020

@ifier have you tried the beta? tipsi-stripe@8.0.0-beta.10 has had those features for months now -- what appears to be the problem?

(if you read my other comments, you could have been using this since last September)

@ifier
Copy link

ifier commented Jul 21, 2020

@fbartho
Thank you. I'm currently on "tipsi-stripe": "^7.5.3" and used createSourceWithParams to receive threeDSecure: required and then start createSourceWithParams with type threeDSecure. (two createSourceWithParams invoked)

I guess I will use Intents soon with tipsi-stripe@8.0.0-beta.10 or experimental cause I need to support Europe as well.

@fbartho
Copy link
Collaborator

fbartho commented Jul 21, 2020

@ifier Sounds good! Yeah, I would highly recommend starting the migration soon then. Intents supports 3DSecure2 worldwide, so you can migrate before you launch in Europe.

Right now 8.0.0-beta.10 is deployed from the head of experimental. If any further bug fixes or features are needed, you can monitor the work on the #532 -- but there's nothing I'm currently expecting to merge in the short-term!

@Clonescody
Copy link

Hey guys, I've been trying to use the beta-10 version to create a paymentMethod and a paymentIntent, but none of the functions are working. Whenever I call stripe.createPaymentMethod({ card: { token } }) with token coming from

const token = await stripe.paymentRequestWithNativePay(
        {
          // requiredBillingAddressFields: ['all'],
          // requiredShippingAddressFields: ['all'],
        },
        [
          {
            label: "Company",
            amount: '14.90',
          },
        ]
      );

I get the following error :

JSON value '{
    card =     {
        brand = Visa;
        cardId = "card_1HP9vGCA7AFLBlK1UbM8CB6m";
        country = US;
        dynamicLast4 = 4242;
        expMonth = 12;
        expYear = 2020;
        funding = credit;
        isApplePayCard = 1;
        last4 = 4242;
    };
    created = 1599583439;
    extra =     {
        billingContact = "<null>";
        shippingContact = "<null>";
        shippingMethod = "<null>";
    };
    livemode = 0;
    tokenId = "tok_1HP9vHCA7AFLBlK1MxBFXwzs";
}' of type NSMutableDictionary cannot be converted to NSString

I know this is an experimental version, but I was wondering if this feature was still a WIP or if the issue was on my side ?

Thanks so much guys, any reply appreciated 🙏

@fbartho
Copy link
Collaborator

fbartho commented Sep 8, 2020

@Clonescody -- this would have been better as a separate Github Issue/Help request.

I suspect you're confused around what's returned by paymentRequestWithNativePay -- if you look at the payload, and the error message, our tipsi-stripe library on iOS is telling you that it received a hash/dictionary, for a parameter that should have been a string.

What happens if you call stripe.createPaymentMethod({ card: { token: token.tokenId } }) ?

@Clonescody
Copy link

Hey @fbartho, I must have tunnel vision a lot to miss that I'm sorry ...

Thank you so much for your reply anyways :)

@julietteSparkmate
Copy link

I am currently trying to use Stripe w/ React-Native and found out that Tipsi was my best option, however I can't use confirmPaymentIntent : [TypeError: undefined is not a function (near '..._tipsiStripe.default.confirmPaymentIntent...')]
I have tried to import Stripe from the node_module as suggested by @meliodev and to uninstall (clear cache, rm -rf node_module and check packages version...) as @fbartho suggested... Nothing so far.... Am I missing something ? Additional configurations, checks, or else ? Thanks!

@fbartho
Copy link
Collaborator

fbartho commented Dec 9, 2020

@julietteSparkmate:

  • Are you using Expo? (you must eject expo to use tipsi-stripe)
  • Are you using version 8.0.0-beta.11?
  • What versions of react-native are you using? >= 0.59.x required, 0.62 or later recommended.
  • What platform iOS,Android, both?

@julietteSparkmate
Copy link

Thank you @fbartho for this quick answer.

  • Tipsi-stripe is working since we can use createTokenWithCard(), however we have expo in our dependencies.
  • We are using 8.0.0-beta.11
  • React native ~0.61.5
  • Both

@fbartho
Copy link
Collaborator

fbartho commented Dec 10, 2020

@julietteSparkmate -- Did you follow the expo eject workflow documented here? https://docs.expo.io/bare/customizing/

Have you inspected your yarn.lock / package-lock.json file to see what version of tipsi-stripe is actually installed?

I ask becausetipsi-stripe@7.5.x had createTokenWithCard but did not have confirmPaymentIntent so it's possible that something is accidentally forcing you to have tipsi-stripe on an older version?

Additionally, Expo has a fork of tipsi-stripe that doesn't support confirmPaymentIntent so make sure you don't have any conflicting *payments* libraries installed. https://docs.expo.io/versions/latest/sdk/payments/

Expo users often have conflicts that were acknowledged to be caused by expo. Since I don't work for Expo (nor for tipsi, nor for Stripe) and don't use expo myself, and expo devs do not actively communicate with tipsi-stripe, it's difficult for me to provide support here.

@julietteSparkmate
Copy link

Thanks for the advice, we ended up fixing the problem with a simple missing word in the react-native-unimodules installation... It seems to be working perfectly now ! 🍾

@trag-stripe
Copy link
Contributor

💳 2020-12-23 - Stripe React Native Updates :atom:

Hi everyone watching this epically long saga issue,

If you're interested in upcoming releases for {Stripe + React Native}, please take a moment and fill out the Stripe React Native Interest Form. This upcoming year is going to be full of goodies for you and we'll want your feedback, tips, and requests along the way.

As always, thanks for building with our payment APIs!

@chris_trag
Stripe Developers

💬 twitter/@StripeDev
📺 youtube/StripeDevelopers

@Joshandrews43
Copy link

@trag-stripe I know this is probably the wrong place for this, but is there any chance we would get a pure JS SDK for react native so people wouldn't need to eject from Expo? Expo offers a ton of great features and speeds up development significantly for a lot of things.

@cybergrind
Copy link
Member

@trag-stripe that's great news! I put deprecation on the main page and glad that I can end my duty here :D
Ping me when you will have a public repo link so I could update the description.

@fbartho thank you for all the help!

@virus2016
Copy link

@trag-stripe I know this is probably the wrong place for this, but is there any chance we would get a pure JS SDK for react native so people wouldn't need to eject from Expo? Expo offers a ton of great features and speeds up development significantly for a lot of things.

There are some issues here as in Apple Pay and Google pay with Expo. I don't think they will be able to offer native pay using their platform at the moment because of restrictions from both sides. You must declare a merchant for both for builds so their preview tool will not work.

Apple especially is requiring you to offer Apple Pay inside your app now if you take payment so apps maybe rejected.

Hopefully someone with more information can correct me if I'm outdated or wrong.

@trag-stripe
Copy link
Contributor

Hi folks - checking back in here: Your official Stripe react native library is finally live!

Special thanks for the 500+ devs who gave us feedback during private beta. For now, please try the project out and filing issues if you have questions.

Regarding everyone's questions re: Expo -> we're working with them now that the library is public. More to come, including dozens of supported payment methods, digital wallets, a new payment UI option, and currencies.

@cybergrind - we can now update the repo with these details, thanks!

@fbartho
Copy link
Collaborator

fbartho commented Jun 20, 2023

@fbartho fbartho closed this as completed Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests