#mykola-paymentintent-paymentmethod

1 messages ยท Page 1 of 1 (latest)

hallow galleonBOT
elfin spruce
#

Hello, happy to help. Which payment methods are you expecting to see on that sheet?

still forge
#

hey there, we just spoke about this problem today. I upgrated the stripe-react-native to 0.29.0 but still not able to see the payment methods that a connected account has

elfin spruce
#

Interesting. That is what I was about to ask. So from our earlier message it sounds like Link and PayPal should be showing up on that sheet #1131192617560973353 message

#

Looking in to what may be happening here

still forge
#

we can take only paypal. If we can get it showing, it will be great.

#

The both payment methods are allowed right now

hallow galleonBOT
still forge
#

Last request /v1/payment_intents with req_wccP6py2LLca83

elfin spruce
still forge
#

OK we can just take some one else payment method

#

How about thouse one?

elfin spruce
#

Can you try doing this with an EUR payment? I think a lot of those support EUR but not USD

still forge
#

how can I change it to EUR payment?

#

did you mean currency?

silver kiln
#

yes the currency of the PaymentIntent

#

mykola-paymentintent-paymentmethod

still forge
#
        const paymentIntent = await this.stripeService.paymentIntents.create(
            {
                amount: Number(10) * 100,
                currency: 'eur',

                automatic_payment_methods: {
                    enabled: true
                }
            },
            {
                stripeAccount: connected_account_id
            }
        )


#

its already there with EUR currency

silver kiln
#

How are you initalizing Stripe client-side exactly?

still forge
#

UI or backend?

#

ah client...

#

App.js

    <StripeProvider
      publishableKey="pk_xxx"
      stripeAccountId="acct_xxx"
    >
      ....
    </StripeProvider>

PaymentScreen.js

import { fetchPaymentSheetParams } from '@/store/basket/requests'
import React, { useEffect, useState } from 'react'
import { SafeAreaView, Button, Alert } from 'react-native'

import { useStripe } from '@stripe/stripe-react-native'

export const PaymentScreen = ({ navigation }) => {
  const orderId = navigation.getParam('orderId')

  const { initPaymentSheet, presentPaymentSheet } = useStripe()
  const [loading, setLoading] = useState(false)

  const initializePaymentSheet = async () => {
    const {
      paymentIntent,
      ephemeralKey,
      customer,
      publishableKey,
    } = await fetchPaymentSheetParams(orderId)

    console.log('paymentIntent', paymentIntent)

    const { error } = await initPaymentSheet({
      merchantDisplayName: 'Example, Inc.',
      customerId: customer,
      customerEphemeralKeySecret: ephemeralKey,
      paymentIntentClientSecret: paymentIntent,
      testEnv: true,

      // Set `allowsDelayedPaymentMethods` to true if your business can handle payment
      //methods that complete payment after a delay, like SEPA Debit and Sofort.
      allowsDelayedPaymentMethods: true,
      defaultBillingDetails: {
        name: 'Jane Doe',
      },
    })
    if (!error) {
      setLoading(true)
    }
  }

  const openPaymentSheet = async () => {
    const { error } = await presentPaymentSheet()

    if (error) {
      Alert.alert(`Error code: ${error.code}`, error.message)
    } else {
      Alert.alert('Success', 'Your order is confirmed!')
    }
  }

  useEffect(() => {
    initializePaymentSheet()
  }, [])

  return (
    <SafeAreaView>
      <Button
        variant="primary"
        disabled={!loading}
        title="Checkout"
        onPress={openPaymentSheet}
      />
    </SafeAreaView>
  )
}

silver kiln
#

thanks looking

#

ah nevermind you have that already duh

still forge
#

jup

#

publishableKey should be a key from account, that connected account belongs, right?

    <StripeProvider
      publishableKey="pk_xxx"
      stripeAccountId="acct_xxx"
    >
       <PaymentScreeen/>
    </StripeProvider>

#

this one

silver kiln
#

Can you try passing returnURL? You don't seem to set it

still forge
#

Yes! You're right.

#

And PayPal also there, nice!

silver kiln
#

I'm super confused how you get Paypal when it doesn't work with Direct Charges ๐Ÿ˜…

still forge
#

yes @elfin spruce said me the same ๐Ÿ™‚

#

but anyway, thanks a lot you guys, you are making great job

silver kiln
#

Glad we could help ๐Ÿ™‚

still forge
#

๐Ÿ˜

silver kiln
#

lol

#

sometimes... I'm baffled by our API ๐Ÿ˜‚