capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

Will this work without having issues of SSL on mobile devices #118

Closed stickypages closed 2 years ago

stickypages commented 2 years ago

I implemented Stripe in my app, but it won't work on mobile devices because there is no SSL for payments. Then I found your plugin, and curious to know how does this work-around security (SSL) on native app devices?

Just a bit new to mobile payment implementation here. Thanks!

hideokamoto commented 2 years ago

Just using the Stripe SDK or Stripe Element.

https://stripe.com/payments/elements

stickypages commented 2 years ago

So you don't think I will run into issues with SSL/HTTPS with payments using your plugin? Because I'm using Stripe Elements right now with Payment Intent, and it mentions in the logs that cannot serve this over HTTP/LocalHost.

What am I missing?

hideokamoto commented 2 years ago

In the mobile device, we're using Stripe official SDK to provide a payment sheet. https://stripe.com/docs/payments/quickstart

And the Stripe docs does not says about SSL.

Could you share us more detail what you suffering? If you share us the step of reproduce, we can check it in our env.

stickypages commented 2 years ago

I am not using your plugin yet, but wanted to ask about the SSL before converting my code to use your plugin. I will give it a try and hope that it works smooth. Thanks for the heads-up, I will report back in case someone else is looking for this.

hideokamoto commented 2 years ago

Ok thank. If you get any error that comes from SSL, please report us in here.I’ll check it and help to resolve if.

FYI

If you want to get certain answer before using the plugin, please contact to the Stripe support team. You can ask them like the question. “Is the Stripe iOS/Android SDK needs to use SSL?”

Because the plugin is using these SDKs in a native devices. So the behavior may be almost same as these Native SDKs.

stickypages commented 2 years ago

Awesome thanks for the heads-up. That's great. I was just using the JS url import of Stripe. I will give this a shot, fingers crossed.

stickypages commented 2 years ago

@hideokamoto So far I'm continuing to get error on "Missing Argument" Make sure to call mount() with valid DOM element. No Card input. Seems to be working fine on mobile (android)

I am using Vue.js (Nuxt). and have the defineComponents where I init Vue

import { defineCustomElements } from '@stripe-elements/stripe-elements/loader'
defineCustomElements(window).then((res) => {
  console.log('defineCustomElements', res) // returns NULL
})

On the page I am calling Stripe. I use... is there something else i'm missing for setup? If I close the modal, and then re-open it, the card number displays. (Currently testing Web)

onMounted(() => {
    await Stripe.initialize({
        publishableKey: 'pk_test_51JPFp9KFs....................'
    })
})

I thought I would test this same code on Android I still am getting Stripe errors (perhaps from the Stripe Elements web implementation?)

W/Capacitor/Console: File: https://js.stripe.com/v3 - Line 1 - Msg: Unrecognized feature: 'payment'.
2021-11-01 14:25:22.197 5968-5968/myapp W/Capacitor/Console: File: https://js.stripe.com/v3 - Line 1 - Msg: You may test your Stripe.js integration over HTTP. However, live Stripe.js integrations must use HTTPS.

When I submit payment, it returns with FATAL EXCEPTION, and crashes app.

Attempt to invoke virtual method 'void com.getcapacitor.PluginCall.resolve(com.getcapacitor.JSObject)' on a null object reference
....
com.getcapacitor.community.stripe.paymentsheet.PaymentSheetExecutor.onPaymentSheetResult(PaymentSheetExecutor.java:105)

Was also missing the SVG Close. But I implemented my own. Just for reference.

image

image

image

stickypages commented 2 years ago

I am testing locally, I thought it might be related to using HTTP, so I setup a SSL cert for local development, could this be an issue using a local (self-signed) CERT vs, a properly signed one?

stickypages commented 2 years ago

Just thought I would share my latest findings. Would appreciate any knowledge on how to get the credit card input to show up. I've been at this for days and cannot get the sheet to fully show up on Web version.

after screenshot, i removed the 'automatic' style image

stickypages commented 2 years ago

I have now found out that I had a conflict within one of my Nuxt Stripe Modules. I have removed it and it solved the card information for not showing.

stickypages commented 2 years ago

Just wanted to give a 'heads-up'. I was able to get it all to work. getting accurate messages from Stripe and updating the database just fine without SSL issues.

hideokamoto commented 2 years ago

Thanks for trying to use this plugin in the Vue application! Probably it's the first application that uses this plugin and Vue :)

If possible, could you share the application repo? We're interested in the use case in Vue.

stickypages commented 2 years ago

Hey, I cannot share the repo unfortunately, because it's private. But I will try to put together what I did.

hideokamoto commented 2 years ago

Thanks!! It's really helpful for us:)

ciccilleju commented 2 years ago

hello, i hope it can be helpful:

image

They (stripe customer service) confirmed that I need to go over https for those wallet payments, while credit card payment works fine on http even if they suggest to use https.

And if I run the app on my Ionic /capacitor 3 App, i can only see the credit card, if i run on a webserver with https that's what I see:

image

image

stickypages commented 2 years ago

So the question is.... is the transaction secure or not?

rdlabo commented 2 years ago

@ciccilleju Sorry, this is not plugin funtion.

rdlabo commented 2 years ago

Is this issue resolved? This don't has any update, so will close. If be update, please re-open. Thanks.