#inderjit-janjua_api
1 messages · Page 1 of 1 (latest)
👋 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/1299264694686711818
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
{
"error": {
"message": "Sending credit card numbers directly to the Stripe API is generally unsafe. We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing. To enable raw card data APIs in test mode, see https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis.",
"request_log_url": "https://dashboard.stripe.com/acct_1Q3EE0IhGlazgPxz/test/logs/req_HfGOsMmFcGkeLu?t=1729839305",
"type": "invalid_request_error"
}
}
A Payment Method object is for example your credit card. A PaymentIntent is the intent to make payment.
Okay that makes sense
do you have a specific question about the error message you're seeing? Like what the link mentions, you should be using Stripe components to collect payment method details and not pass raw card details via the API
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
So I made a POST {{url}}/v1/payment_methods call in Postman
Obviously i'm doing it wrong because i'm passing in credit card data
What should I pass on the request body
tok_visa
What should the key be
For this value
nothing really, why are you creating the PaymentMethod in your backend? You should be collecting the PaymentMethod details in the frontend using a Stripe component / element, see the available integration flows here : https://docs.stripe.com/payments/accept-a-payment
Is it "visa"
I agree and you're right
I like getting the flow right
In Postman
Before I proceed coding
Its personal preference
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such PaymentMethod: 'pm_card_visa'",
"param": "payment_method",
"request_log_url": "https://dashboard.stripe.com/acct_1Q3EE0IhGlazgPxz/test/logs/req_WaCdF1lWPyxlEc?t=1729840374",
"type": "invalid_request_error"
}
}
I'm aiming to create a payment method
Maybe lets take a step back, again, why are you trying to create a PaymentMethod in this manner? Cause like I've mentioned previously, this isn't how you should be creating a PaymentMethod.
Okay so my goal is to create a subscription
Before I do that I do:
Create Customer
Create Payment Method
Attach Payment Method to Customer
Create Product
Create Price
Create Subscription
This works as expected
Create Customer
Create Product
Create Price
Im working on this:
Create Payment Method
Attach Payment Method to Customer
are the subscriptions meant to be created on the connected account?
Yes
O wait
I think I messed up
You might be right about that
Connected account has offers
The customers stipe account should have the subscription
I want to distinguish between selected items and unselected items, for example, add a background color to one of the categories. Is it possible to support this?
You should follow this guide : https://docs.stripe.com/billing/subscriptions/build-subscriptions. If you want the objects to be created / processed on the connected account, then you should include the StripeAccount header with all the requests
The appearance API can be found here : https://docs.stripe.com/elements/appearance-api - which lists out what can be modified for the Payment Element
I'll recommend following the guide and building out a POC first, then it'll be easier to understand how it works
@icy wyvern Hey brother you can create your own question using the #help channel
oh oops, i didn't realize that was from someone else. Thanks for helping me redirect!