#PoopFace - save card setupintent

1 messages ยท Page 1 of 1 (latest)

wispy eagle
narrow sigil
#

I also wonder, if i can use the saved customer.id to perform payments later on ?

wispy eagle
#

How are you collecting the card details? Have they already been collected at that point in the code?

#

This will create a payment method that is attached to the customer

narrow sigil
#

I am making the backend, as rest api,, so i expect the frontend (flutter) to give to the back

narrow sigil
#

yeah cool ๐Ÿ˜„

  res.json({
    setupIntent: setupIntent.client_secret,
    ephemeralKey: ephemeralKey.secret,
    customer: customer.id,
    publishableKey: 

'pk_test_51KltjSB4NnMxVIufNEaVoOm3EdwkEt9nlqhsSdg6NOfuokrsdq3MSMOQhEFlcWOTvFCRpOYf9kwol59AvGbSG52y00n3R3DT9S'

  })```
#

should i pass the ephemeralKey also ?

wispy eagle
#

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?

narrow sigil
#

about the customer ID, it should be unique for everyone and saved to the db,, when should it be changed ?

narrow sigil
wispy eagle
#

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

narrow sigil
#

oh

wispy eagle
#

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

narrow sigil
#
      - [ ] 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
narrow sigil
#

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 ?

digital adder
#

Hi ๐Ÿ‘‹ I'm stepping in for @wispy eagle

#

Can you tell me where in the linked doc you are getting confused? Which section number?

narrow sigil
#

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 ?

digital adder
#

Only if it's a Stripe customer ID

#

And let's start at the top of Setup Intents

narrow sigil
#

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 ?

digital adder
#

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?

narrow sigil
#

maybe card is expired or ...

#

btw, sorry for asking lots of questions :D,, how can i get the balance of the customer ?

digital adder
#

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.

narrow sigil
#

i mean the balance of the card i saved, Like i want to check if the user have money in their account ?

digital adder
#

You cannot

narrow sigil
#

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)

digital adder
#

I cannot offer you any advice on anything that is beyond what Stripe offers

narrow sigil
#

I just wonder if i can do this with stripe

digital adder
narrow sigil
#

what happens if the customer doesn't have enough money ?

digital adder
#

That's a credit balance, different thing

#

If the customer doesn't have enough money the authorization fails

narrow sigil
digital adder
#

Well if it fails the issuing bank has decided not to authorize the charge

narrow sigil
#

oh, i forgot about auth

#

what happens then ?

digital adder
#

Please read the doc, it's spelled out clearly

narrow sigil
#

oh sorry, which section ?

digital adder
#

The whole thing

narrow sigil
#

I got it

#

thank you ๐Ÿ˜„