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

Apple Pay Token #915

Closed
achall9 opened this issue Apr 29, 2022 · 12 comments · Fixed by #1164
Closed

Apple Pay Token #915

achall9 opened this issue Apr 29, 2022 · 12 comments · Fixed by #1164

Comments

@achall9
Copy link

achall9 commented Apr 29, 2022

Is your feature request related to a problem? Please describe.
It would be great to create a one-time use apple pay token so I can authorize a charge and capture the payment at a future time once.

Describe the solution you'd like
I would like the presentApplePay sheet to return a token as well as paymentMethod and Error.

Describe alternatives you've considered
The alternative is using the intent API but it is not possible currently for us.

@ashar-sarwar-viabletree

any update on this ?

@russmenum
Copy link

Any news here trying to migrate from tipsi-stripe and the lack of Native Pay tokens like we had there may be a problem.

The migration guide assume no one was using

const applePaytoken = await Stripe.paymentRequestWithApplePay(items, optionsApplePayToken)

or

const androidPaytoken = await Stripe.paymentRequestWithAndroidPay(optionsAndroidPay)

Based on the doc I am not following how to send a

body = {
        ...body,
        NativePayToken: returnedNativePay?.tokenId,
      }

Like you got from applePaytoken or androidPaytoken in the above example like you did from tipsi-stripe

None of the "after" links in the migration guide work so some clarity is missing.

So there is no clerity if const { error, paymentMethod } = await presentApplePay() and or const { error: presentError } = await presentGooglePay() return this token we had with tipsi-stripe?

@charliecruzan-stripe
Copy link
Collaborator

This work is in progress here: #1164 :)

@russmenum
Copy link

This work is in progress here: #1164 :)

I saw that linked to at the top, and that it is failing review at this time... So is this tipsi-stripe supported feature not available at this time in stripe-react-native?

And assuming it becomes available? Would it only be in the latest ver? I ask because of the

compileSdkVersion = ??
targetSdkVersion = ??

ongoing issue where not all versions of this library are available to an app because of the need to target the current minimum standard rather than necessarily the latest targets and compile on Android? Particularly with respect to expo install @stripe/stripe-react-native limitations?

While I can understand WIP, many of us are basically under a forced migration from tipsi-stripe , so a lack of features it had is an issue, because it breaks payment for our apps.

Presuming, I understand correctly that this is just not here right now: is there a snack or doc any where of a more complete migration to get the same net result to complete migration where this was used? With the links in the migration guide broken, I am guessing at some parts due to a lack of doc. Was able to find the missing

const {
        isGooglePaySupported,
      } = useGooglePay();

That was actually not in the migration guide because the link to the docs where it was worked, but with the other links not working it is difficult to resolve how to work around these kinds of not 1:1

@charliecruzan-stripe
Copy link
Collaborator

Getting the Stripe token using Apple Pay and Google Pay is not supported right now, that's correct.

Once that feature is available, it would only be available on the version it's released on, and for each version thereafter

If you are using the expo managed workflow and not using eas build, then yes you are limited since you cannot change any of your native library versions at all.

Question though- how are you using tipsi-stripe if you're using Expo? It is not available in the managed workflow.

@russmenum
Copy link

Question though- how are you using tipsi-stripe if you're using Expo? It is not available in the managed workflow.

This is a messy app core update. Have an app that was EXPO EJECTED way back in the days of "expo": "^38.0.0", when there was no STRIPE for EXPO at all, but has reached the pro con of trying to update RN and other things on it, or building a fresh npx create-react-native-app and address all the not 1:1 of splicing the old app with new dependencies like stripe-react-native instead of tipsi-stripe. We do use some of the EXPO stuff so create-react-native-app is a good middle ground. Technically pre ejected even though they do not use that word any more in that you have the .iOS/, .android/, android/build.gradle, and so on.

You have access to both RN and EXPO paths going this way:

"scripts": {
    "start_expo": "expo start --dev-client",
    "start": "react-native start",
    "android_expo": "expo run:android",
    "android": "react-native run-android",
    "ios_expo": "expo run:ios",
    "ios": "react-native run-ios",
    "web": "expo start --web"
  }

But the main thing that drove this upgrade is certain things won't work with compileSdkVersion = ?? because EXPO or others designed them for lower targets. In a perfect world, every thing would be compileSdkVersion = 33 today, but that is not practical.

On paper, I can change anything in this workflow; in practice, there are still some lingering limits. I do not even know what they are in this frankinstine untill I can resolve all the "Unable to resolve..." red screens from the slice like stripe-react-nativeso the new app can launch to be debugged and tested.

@russmenum
Copy link

@charliecruzan-stripe do we have any idea on the time line for that pull request and getting the same native pay functionality TIPSI had to be part of @stripe/stripe-react-native our migration is largely done.

So the hold up for out iOS app is sole the lack of features TIPSI supported.

Android side is the whole API 31 Vs 32 but as Google Pay will need the tokens over there no point in working that until @stripe/stripe-react-native is ready to fully replace TIPSI

@russmenum
Copy link

What is the status of this WIP?

@SavageWilliam
Copy link

This work is in progress here: #1164 :)

+1 :)

@charliecruzan-stripe
Copy link
Collaborator

This was released in v0.22.0

@SavageWilliam
Copy link

This was released in v0.22.0

I've upgraded to 0.22.0, however createPlatformPayToken doesn't seem to be returned from usePlatformPay as per the example?

@charliecruzan-stripe
Copy link
Collaborator

@SavageWilliam createPlatformPayToken isn't released just yet, that was added in as a fix. We'll be releasing that later this week 😄

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

Successfully merging a pull request may close this issue.

5 participants