#mykola-paymentintent-paymentmethod
1 messages ยท Page 1 of 1 (latest)
Hello, happy to help. Which payment methods are you expecting to see on that sheet?
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
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
we can take only paypal. If we can get it showing, it will be great.
The both payment methods are allowed right now
Last request /v1/payment_intents with req_wccP6py2LLca83
Ah from our PayPayl docs it looks like we don't currently support PayPal with our Direct Charges flow which is what is being used in your requests https://stripe.com/docs/payments/paypal#connect
Can you try doing this with an EUR payment? I think a lot of those support EUR but not USD
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
How are you initalizing Stripe client-side exactly?
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>
)
}
thanks looking
https://stripe.dev/stripe-react-native/api-reference/modules/PaymentSheet.html#SetupParams this has a parameter named allowsDelayedPaymentMethods can you try setting this to true?
ah nevermind you have that already duh
jup
publishableKey should be a key from account, that connected account belongs, right?
<StripeProvider
publishableKey="pk_xxx"
stripeAccountId="acct_xxx"
>
<PaymentScreeen/>
</StripeProvider>
this one
Can you try passing returnURL? You don't seem to set it
I'm super confused how you get Paypal when it doesn't work with Direct Charges ๐
yes @elfin spruce said me the same ๐
but anyway, thanks a lot you guys, you are making great job
Glad we could help ๐
๐