#PoopFace - save card setupintent
1 messages ยท Page 1 of 1 (latest)
I also wonder, if i can use the saved customer.id to perform payments later on ?
How are you collecting the card details? Have they already been collected at that point in the code?
In our docs we typically reccommend passing the SetupIntent's client secret to your client side app and collectingt eh details from there https://stripe.com/docs/payments/save-and-reuse#web-collect-payment-details
This will create a payment method that is attached to the customer
I am making the backend, as rest api,, so i expect the frontend (flutter) to give to the back
so i should pass the client_secret which i can get from the session i created up aka (setupIntents) to the frontend : client_secret: 'seti_1Km1XJB4NnMxVIufNd8XV6DK_secret_LSxSXV83aoTLFFZq7VYZQk9e221Z6Qa',
yeah cool ๐
res.json({
setupIntent: setupIntent.client_secret,
ephemeralKey: ephemeralKey.secret,
customer: customer.id,
publishableKey:
'pk_test_51KltjSB4NnMxVIufNEaVoOm3EdwkEt9nlqhsSdg6NOfuokrsdq3MSMOQhEFlcWOTvFCRpOYf9kwol59AvGbSG52y00n3R3DT9S'
})```
should i pass the ephemeralKey also ?
Yes, if you are using an iOS or Android integration I think you will need the ephemeral key to confirm the setup intent
Is there a specific guide that you are following at the moment?
about the customer ID, it should be unique for everyone and saved to the db,, when should it be changed ?
Yes, I am following the docs ๐
Whoops that sounded a bit mean in retrospect. I more meant that I wanted to follow along with what you are doing so I didn't miss something
oh
The Customer ID will always stay the same. If you are assosciating them with one of your customers in your DB you can probably keep the same one
- [ ] Validate user's credit card before opening/creating a request, without charging.
- [ ] Save user's credit card to stripe.
- [ ] Before choosing a mod, make sure that card contains the money !!
- [ ] Hold the payment amount.
- [ ] Release the money when MOD scans the QR code.
- [ ] Add money to user's account
- [ ] User can take his money after it reaches X
what do you recommend, I am doing this for the graduation project
for now, i am still trying to save credit cards,, I don't know how to test, without the frontend, i can create simple frontend and test or use the cli ?
Hi ๐ I'm stepping in for @wispy eagle
Can you tell me where in the linked doc you are getting confused? Which section number?
Hello Snufkin
I just don't know where to start, i am reading the docs all over the place
can i pay with the customer id i saved in the db ?
I read you can use the cutomerId and the payment_method
oh btw, how to check if the card is valid before saving it (setup intents)
or it's handled by the frontend ?
That's part of what the Setup Intent is for. There will be (some) validation when you submit the payment details
Or do you mean something like bad expiration dates. cvvs?
maybe card is expired or ...
btw, sorry for asking lots of questions :D,, how can i get the balance of the customer ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What do you mean "balance of a customer"? This retrieves a customer object
If you attempt to pass in an expired card the front-end and Stripe back-end will reject the request.
i mean the balance of the card i saved, Like i want to check if the user have money in their account ?
You cannot
hmm, so how can i do this : Before choosing a mod, make sure that card contains the money !!
do you know freelancer websites, the website ensures the process by holding the money as middleware, then releasing it when i job is done,,, I want to know if the card contains money >= the mod (the one who accepted the job with X dollars)
I cannot offer you any advice on anything that is beyond what Stripe offers
I just wonder if i can do this with stripe
If you take a separate auth and capture approach, you can first get authorization to charge a set amount and then charge it later. We document that here: https://stripe.com/docs/payments/place-a-hold-on-a-payment-method
what happens if the customer doesn't have enough money ?
I also read about this : https://stripe.com/docs/billing/customer/balance
That's a credit balance, different thing
If the customer doesn't have enough money the authorization fails
hmm, so I don't have to check user's credit card, instead i try to capture the amount, and if it fails then he is broke lol
Well if it fails the issuing bank has decided not to authorize the charge
Please read the doc, it's spelled out clearly
oh sorry, which section ?
The whole thing