#kaustuva-le-react

1 messages · Page 1 of 1 (latest)

main stump
#

yeah, this can be really tricky or sometimes impossible. I'd need to see your full code

urban flume
#

On index:
`this.setState({
stripePlatform: await loadStripe(data.stripe_publishable_key),
stripe: await loadStripe(data.stripe_publishable_key, {
stripeAccount: data.stripe_account,
})
})

<Elements stripe={stripe}>
<StripeWidgets
...,
stripePlatform={stripePlatform}
/>
</Elements>`

On StripeWidgets:
`stripe=useStripe()
elements=useElements()

const {error, paymentMethod} = await props.stripePlatform.createPaymentMethod({
type: 'card',
card: elements.getElement(CardElement),
billing_details: {
name: props.customer_name || nameOnCard,
},
})`

#

The same code was working fine earlier with two objects

#

versions used:
"@stripe/react-stripe-js": "1.7.0",
"@stripe/stripe-js": "1.23.0",

main stump
#

it's a lot easier to work on this over an email