#tuanpham-payments
1 messages · Page 1 of 1 (latest)
first step would be to use https://stripe.com/docs/payments/save-and-reuse
after that it depends exactly how you're using Connect and where you want the information to be stored.
hmm, I have a question. I'm doing like I create a payment method for the platform account and save this info . After that, when my customer wants to use this card, I take it from data and create a new payment method with this stripe account id . Is this good way to achieve what I wonder ?
Is it alright if I call function initStripe 1 time in 1 component A to confirmPayment and other time in component B to create paymentMethod ?
I'm not sure that works, that's one of the problems with cloning
it can be complicated or impossible to make it work in some of our libraries like React since it requires you to use two different 'instances' of the Stripe client, one for the platform and one for the connected account. I haven't tested this recently so I don't remember if it can work for react-stripe-js or not
Hmm, I think I will try your recommendation first. Any way to custom your CardField style ? I want set it display:flex and flex-direction: column but it does not work
https://stripe.com/docs/js/appendix/style are the fields/options you can set
or are you using React Native?
I don't really know what the flex styles would do, but maybe we don't support them. It might help to share the exact code you used(you said you tried and it didn't work) and maybe we'll have an idea
okay
<CardField
postalCodeEnabled={true}
placeholders={{
number: "4242 4242 4242 4242",
}}
cardStyle={{}}
// style={styles.cardField}
style={{
width: "100%",
height: 200,
marginVertical: 30,
display: "flex",
flexDirection: "column",
}}
onCardChange={(cardDetails) => {
console.log("cardDetails", cardDetails);
}}
onFocus={(focusedField) => {
console.log("focusField", focusedField);
}}
/>
I'm trying to make the cardfield style is the same as your CardForm
because I want to reuse my payment method
try adding the flex types to the component one level above, maybe
<View
style={{
paddingHorizontal: 20,
display: "flex",
flexDirection: "column",
}}
>
<CardField
postalCodeEnabled={true}
placeholders={{
number: "4242 4242 4242 4242",
}}
cardStyle={{}}
// style={styles.cardField}
style={{
width: "100%",
height: 200,
marginVertical: 30,
display: "flex",
flexDirection: "column",
}}
onCardChange={(cardDetails) => {
console.log("cardDetails", cardDetails);
}}
onFocus={(focusedField) => {
console.log("focusField", focusedField);
}}
/>
</View>
above it is View, and it does not work.
I'm sorry for this styling code error but I do not understand it indeed.
👋 taking over for my colleague. Let me catch up.
do you mean to style it?
what are you trying to achieve in terms of styling? could you do a visual mockup just so I could visualize what you're trying to achieve?
In that case you could use separate elements
can you give me this doc ?
yes just a sec I'm trying to look them up
yup