#wrong_man

1 messages · Page 1 of 1 (latest)

warped shoreBOT
north sun
#

hi! well if you send raw card numbers to the API from your backend server than you do need to be PCI compliant and submit those docs yes

quasi timber
#

well i never had to do anything of the sort. have used stripe for years

#

anyway, the alternative is to submit them via the frontend, which is also not safe

#

or well, is as safe as the alternative

north sun
quasi timber
#

but you understand, i can easily hijack the card numbers from all the elemets and checkout

north sun
#

do you think it's a false positive and you don't actually send raw PANs?

quasi timber
#

if i wanted to do something shady

#

oh its not about the actual sending of the data

quasi timber
#

in this case the python one

north sun
#

but your own Python code still has the raw card numbers in your variables right?

quasi timber
#

sure, so does my JS code using elements and checkout

north sun
#

then that means you are in PCI scope

north sun
#

if you are saying you do use Elements/Checkut and think it's a false positive that we're asking you to submit your PCI docs, I'd be happy to chdeck your account quickly.

quasi timber
north sun
quasi timber
north sun
#

sounds perfect! anything I can help you with there in terms of the implementation?

quasi timber
north sun
#

but your own code can't do that.

quasi timber
#

if i can access it here, i can acces it my websites js code

north sun
#

no you can;t

quasi timber
#

🤦‍♂️

north sun
#

that <input> is in an iframe on a different domain from your JS code so it won't work

#

I don't want to argue with you but this is the fundamental principle of our most important product

quasi timber
#

what iframe?

north sun
#

the one you cropped out just above the <html> tag

#

anyway. anything I can help you with there in terms of the implementation?

quasi timber
#

yes

#

sorry i got sidetracked

#

can i submit it like this:
var card =stripe.createPaymentMethod('card',cardElement);

#

?

#

because since i can submit test cards via the (test) API i cant actually tell if this is the way i'm supposed to do it

north sun
#

the way you're supposed to do this is confirming a PaymentIntent on the frontend(https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements). But it is possible to create a PaymentMethod on the frontend (the code you mention) and then pass that object's ID pm_xxx to the payment_method parameter when confirming a PaymentIntent on the backend, it's just not recommended since it makes 3D Secure difficult to handle.

quasi timber
#

no no

#

this is before seting up intents

#

just adding a card to my user

north sun
#

then same idea. Except you'd confirm a _Setup_Intent instead of a PaymentIntent, on the frontend, to save a card to a customer.

quasi timber
#

but i dont want to send the client_secret to the frontend

#

scratch that

#

i dont want to have to recreate code for seting up intents, code i already have setup on the backend

#

i would like to re-use my already existing code as much as possible, which means basically just adding cards on the frontend, then setting up the intents on the backend

#

and continue the flow on the frontend

#

this should be a perfectly valid use-case

#

so i would pass the pm_XXto my backend, and attach it to the user (on stripe)

north sun
#

then as I said, But it is possible to create a PaymentMethod on the frontend (the code you mention) and then pass that object's ID pm_xxx to the payment_method parameter when confirming a [SetupIntent] on the backend

quasi timber
#

perfect

north sun
#

i.e. SetupIntent with customer=cus_xxx confirm=true payment_method=pm_xxx

#

I don't recommend that but you can do it if you must as part of migrating a legacy system