#Nash - Charges API

1 messages · Page 1 of 1 (latest)

rough blaze
#

Hey there, whats the flow you're trying to achieve here? These checks are still available, but the sequence can be a bit different.

Note these are also available via Radar to handle automatically rather than in code, if prefered.

lost oyster
#

Hi! I think we want it in code. Flow is the following:

#
  1. On form submit, we create an intent and a customer.
  2. We confirmCarPayment once we get the clientSecret back from the intent.
#

I guess, I want to check on these variables before step 2.

#

Is it fine if I created a token with createToken and passed that to our backend for the sole purpose of these checks?

rough blaze
#

Yes, though if you're switching I'd also suggest using Payment Methods (createPaymentMethod) and then you can attach that to a customer

lost oyster
#

That's the thing. I'm not switching. Keep using intents as described above, but in step 1, I would pass the token with the request to our backend so we can check these.

rough blaze
#

Alternatively you can use separate auth & capture to confirm directly but allow yourself a chance to inspect that outcome before capturing the payment:

lost oyster
#

Yeah that would add more complexity than needed at this point.

#

So I'm thinking create a token just for these checks. Just want to make sure it's kosher if I do so while using intents.

#

I won't be attaching that to customer or anything.

#

Just use it to retrieve card and do some checks.

#

to link customer to payment, I'll just update the intent with the customer id as described in docs.

rough blaze
#

Those checks won't be available unless attached to a customer to trigger an auth

lost oyster
#

ah I see.

#

If I attach payment token to customer, can I update intent with that customer as well?

#

So customer has payment token attached. Then intent has same customer attached.

rough blaze
#

Yes, in fact you must provide that customer on the payment intent or you'll encounter an API error, which will tell you the card/PM is attached to cus_123

lost oyster