I've added a simple payment system into my Expo managed workflow app, but it acts quirky. The payments do perfectly work (even with the live keys, charging actual money) in development mode. Anyways, I noticed the payment system simply stops working as expected after compilation. This is how the app is integrating the payment module:
import { PaymentsStripe as Stripe } from 'expo-payments-stripe';// irrelevant code componentDidMount = async () => { try { await Stripe.setOptionsAsync({ publishableKey: 'PUBLIC_KEY', }); } catch (err) { alert(err); } }// irrelevant code try { const token = await Stripe.createTokenWithCardAsync(params); alert(token); console.log(token); this.queryServer(token); } catch (err) { // throw err; alert(err); }// irrelevant code
Although there are no errors being shown in development mode, after being compiled, the installed app alerts the first following error: TypeError: undefined is not an object (evaluating: 'v.init')
, which is followed by this next alert error: TypeError: undefined is not an object (evaluating 'v.createTokenWithCard')
.
I saw some people complaining about the fact that the expo-payments-stripe
module does not work in the managed workflow, but, as I read from the Expo documentation (https://docs.expo.io/versions/latest/sdk/payments/), it only is the case it does not work for ios in the managed workflow, Android should be fine. Maybe I got it wrong?