#priya_code
1 messages ยท Page 1 of 1 (latest)
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.
- priya_elements-appearance, 11 hours ago, 50 messages
๐ 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.
Is the country the only thing you need?
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
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?
So it will be on the payment method object then
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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; ...... }
Ah so you need to get a css variable within javascript
Can you try this approach: https://stackoverflow.com/a/36088890/17627350
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
okay