#sc0rp10npy_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.
- sc0rp10npy_code, 30 minutes ago, 24 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/1275533001387933859
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
its in reference to this
so i did this
the code is this
the output i get is this
{
"id": "seti_1PpxRLJ8kO80VBO8xBNStkXc",
"object": "setup_intent",
"automatic_payment_methods": null,
"cancellation_reason": null,
"client_secret": "seti_1PpxRLJ8kO80VBO8xBNStkXc_secret_QhM91gKk97sCYNHYrb1hH6BVoB8v9vG",
"created": 1724180999,
"description": null,
"last_setup_error": null,
"livemode": false,
"next_action": null,
"payment_method": "pm_1PpxS6J8kO80VBO88LhYuTWh",
"payment_method_configuration_details": null,
"payment_method_types": [
"card"
],
"status": "succeeded",
"usage": "off_session"
}
the api
"payment_method": "pm_1PpxS6J8kO80VBO88LhYuTWh" is the tokenized payment method token
so next time to charge user i have to use this id?
Yes
You can use the style object and customize the css for the card element: https://docs.stripe.com/js/appendix/style
ahh
also
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
export default async function handler(req, res) {
if (req.method === 'POST') {
try {
const setupIntent = await stripe.setupIntents.create({
payment_method_types: ['card'],
customer: '',
usage: 'off_session',
});
res.status(200).json({ clientSecret: setupIntent.client_secret });
} catch (err) {
res.status(500).json({ error: err.message });
}
} else {
res.status(405).end('Method Not Allowed');
}
}
where can I get the list of parameter option i have in here?
What do you mean by list of parameter option?
for this part
const setupIntent = await stripe.setupIntents.create({
payment_method_types: ['card'],
customer: '',
usage: 'off_session',
});
what all parameters/attributes are there in .create?
You can check the API reference: https://docs.stripe.com/api/setup_intents/create
ah thanks
is there a UI card generator? maybe any unofficial one?
Not that I know of, no..
is it possible to add borders to this? its not mentioned
Border to what? If you mean around the card element, then you can add a border to the parent element where you're mounting the card element
is it possible to make it look like this?
owner is not required from above image
because rn it doesn't look like a very legit type form
You could use split card element for this where you create each input separately using: https://docs.stripe.com/js/element/other_element?type=cardNumber
Is there a reason you're using card element? It is considered legacy and we recommend using PaymentElement instead: https://docs.stripe.com/payments/payment-element
i am implementing using prebuilt page now, i just found the option in url