#RockstarsNFT - Customer Update

1 messages · Page 1 of 1 (latest)

sullen plinth
#

Hello! Generally speaking it's not possible to update a Customer from the frontend. Can you tell me what exactly you're trying to do?

#

Also, it might help to know what frontend Stripe libraries/SDKs you're using?

cinder carbon
#

we're trying to save/update billing details like address, state, and country when charging a card

#

however we don't want those fields passing through our backend for compliance reasons

sullen plinth
#

Do you need those details on the Customer itself? They should be present on the Payment Method, which is created client-side.

cinder carbon
#

not sure I fully follow. the issue is that we render our own form as a combination of the CreditCardElement, the CvcElement, and the CardExpiryElement. we then are going to use custom fields to collect address, state, and country, because we always need to collect that info, even if it's not strictly needed to charge the card

#

but when we submit it all, we'd like to update the customer object

sullen plinth
#

Stripe Elements creates a Payment Method from the information entered, and you can add the billing details from your custom fields client-side when that happens. Are you using stripe.confirmCardPayment or stripe.createPaymentMethod?

cinder carbon
#

we actually haven't implemented it yet. currently we createToken(cardElement,.. and then send it to our backend to charge the card

#

but we now want to charge the card from the frontend

sullen plinth
#

So are you switching to Payment Intents?

cinder carbon
#

yes that seems to be the case (i say seems because I'm the one figuring this out and that's what I see happening from your docs but I'm not sure lol)

sullen plinth
#

Let's back up a bit. So you have a legacy Charges/Tokens integration and now you want to update it to use Payment Intents and Payment Methods, correct?

cinder carbon
#

yes, so that we can charge the customer without passing anything through our servers

sullen plinth
cinder carbon
#

and as a part of that process, we want to store customer billing info not strictly needed to charge the card, so we can't assume it will show up in the PaymentElement

#

nope, did not change upon it. but i will now

sullen plinth
#

That example sets only the name, but you can set the other properties the same way.