#sohaib-ahmad_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/1267382976144998485
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, tokens API is already deprecated and you shouldn't use it anymore
then how i can make make payment method
Use Payment Methods APIs
More details in https://docs.stripe.com/payments/payment-methods/transitioning
one more thing how we can creat card with these details
{
"card_number":"4242424242424242",
"exp_month":"08",
"exp_year":"2030",
"cvc":"123"
}
in card create there is no api which accept payload like this
No you shouldn't do that. Your application shouldn't use the raw PAN data unless you want to get SAQ D PCI compliant. https://docs.stripe.com/security/guide#validating-pci-compliance
this won't work either??
stripe.Customer.create_source(
"cus_9s6XGDTHzA66Po",
source="tok_visa",
)
if i send these as child parameters
{
"card_number":"4242424242424242",
"exp_month":"08",
"exp_year":"2030",
"cvc":"123"
}
I don't know what you mean by "child parameters". As I told you earlier, Your application shouldn't use raw PAN data directly.
sorry like this
stripe.PaymentMethod.create(
type="card",
card={
"number": "4242424242424242",
"exp_month": 8,
"exp_year": 2026,
"cvc": "314",
},
then how i can create payment method without using PAN data.
No you don't need to explicilty create a payment method, Stripe will create for you. If your primary objective is to accept a payment. You should read this guide https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements
with all due respect , given guidelines are not helping me, i will break down to you my requirment
i had list of cards
upon card selection i want to create a payment method( how would i do that, is there any end point?)
after that on place order button i want to create a api call to server with payment method and price.
my issue lies with payment methods
not yet, i am working with testing enviroment. beform handling real payments i want to test it on test enviroment
are you are aware that most businesses are not compliant in this way and never need to handle raw card numbers? It's not required.
It's best to forget about the concept of collecting/sending card numbers yourself and instead focus on the recommended integations that use Stripe-hosted forms. You should just use our recommended integartion my colleague linked. Let me know if you have specific questions about that.
how can i create payment method on client side with card details of my own . so i can get token to pass to make my payment successfull.
intent = stripe.PaymentIntent.create(
amount=amount,
currency='usd',
automatic_payment_methods={"enabled": True},
payment_method="pm_card_visa",
# confirmation_method='manual',
confirm=True,
return_url = return_url
)
how can i create payment method on client side with card details of my own
usually you do not do that at all, since that requires you to be PCI compliant.
if you want to do that you need to contact support first and get approved and get instructions : https://support.stripe.com/questions/enabling-access-to-raw-card-data-apis
Or you can do it the normal way : https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements where Elements collects the card details. If you need a flow where you submit a token to a backend to attempt a payment, look at https://docs.stripe.com/payments/finalize-payments-on-the-server