#priya_code

1 messages ยท Page 1 of 1 (latest)

torpid daggerBOT
stark axleBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

torpid daggerBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1218180432101904415

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

stark axleBOT
mystic belfry
#

Is the country the only thing you need?

stone obsidian
#

yep

#

I want to send the country_code to the backend

mystic belfry
#

There's no way to grab it from the front-end, but if the customer selects a country, then it will be attached to the payment method's billing details

stone obsidian
#

const { error, paymentMethod } = await stripe.createPaymentMethod({
elements,
params: {
billing_details: {
name: ${buyerFirstName} ${buyerLastName},
email: buyerEmail,
},
},
});

Even if i am creating a custom payment method in frontend?

mystic belfry
#

So it will be on the payment method object then

stone obsidian
#

ok perfect

#

Thank you

#

I had one more question actually

#

I asked that yesterday in last thread but the developer wasn't much aware of css

#

Can you try help there?

#

I just need a confirmation if it's possible or not

mystic belfry
#

I can try ๐Ÿ˜ƒ

#

What's the question?

stone obsidian
#

So the below code works perfectly fine wherein I am trying to change the color of the error message
const options: StripeElementsOptions = {
mode: 'payment',
amount: 20000,
currency: 'eur',
appearance: {
theme: 'stripe',
variables: {
colorPrimary: '#3a66e5',
},
rules: {
'.Error': {
color: '#B2443E',
fontSize: '12px',
},
'.Input--invalid': {
borderColor: '#B2443E',
},
},
},
paymentMethodCreation: 'manual',
payment_method_types: [
'card',
'bancontact',
'eps',
'giropay',
'ideal',
'sepa_debit',
'sofort',
'demo_pay',
],
};

#

Now the ask is that I have these color codes in the global css file of mine and want to use it directly here like below

const options: StripeElementsOptions = { mode: 'payment', amount: 20000, currency: 'eur', appearance: { theme: 'stripe', variables: { colorPrimary: '#3a66e5', }, rules: { '.Error': { color: 'var(--color-coral-black)', fontSize: '12px', }, '.Input--invalid': { borderColor: '#B2443E', }, }, }, paymentMethodCreation: 'manual', payment_method_types: [ 'card', 'bancontact', 'eps', 'giropay', 'ideal', 'sepa_debit', 'sofort', 'demo_pay', ], };

#

But it is not getting applied. Can you please help!

#

I can see the var getting passed to the ui but the variable it seems is undefined

#

I have imported the global file directly to this file as well. Even then it's not working.

#

Globals.css is as below

:root { --color-blue-lighter: #a2cbff; ...... }

mystic belfry
#

Ah so you need to get a css variable within javascript

#

Not really a stripe question, but I'll try to help

#

Honestly I recommend just storing this as a variable within your javascript too though

stone obsidian
#

okay