#sohaib-ahmad_api

1 messages ¡ Page 1 of 1 (latest)

violet frigateBOT
#

👋 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.

upper kernel
#

Hi there, tokens API is already deprecated and you shouldn't use it anymore

balmy anvil
#

then how i can make make payment method

upper kernel
#

Use Payment Methods APIs

balmy anvil
#

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

upper kernel
balmy anvil
#

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"
}

upper kernel
#

I don't know what you mean by "child parameters". As I told you earlier, Your application shouldn't use raw PAN data directly.

balmy anvil
#

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.

upper kernel
violet frigateBOT
balmy anvil
#

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

wintry fox
#

are you a PCI compliant business who is allowed to store and manage card numbers?

balmy anvil
#

not yet, i am working with testing enviroment. beform handling real payments i want to test it on test enviroment

wintry fox
#

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.

balmy anvil
#

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
        )
wintry fox
#

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