#0Bietnua — iOS update a card
1 messages · Page 1 of 1 (latest)
Hi
Our product wanna provide the option for user to update payment info
such as exp month and year
are we able to do this via SDK?
if not I will ask our backend guy to help
and are we able to set the name on card also, I remember Stripe doesn't require name on card
That's all of my question.
catching up here, one sec
yes you can do this in the SDK
just use STPCardFormView to collect card details and create a PaymentMethod from it
and you then pass it on to your backend to attach to a Customer
but we wanna handle UI by ourself
so right now we don't use any UI component from Stripe
so seem we can't update card without using stripe UI component, right?
you'll be under PCI burden then
if you build your own UI
so seem we can't update card without using stripe UI component, right?
theoretically you can but that means you handle pages and pages of PCI compliance burden on your end cause your code is touching raw card details
yes, right now we wanna show the payment list with our style and able to show default payment method
the UI from Stripe doesn't show default payment method
what we use from Stripe now is Add card screen
yes, right now we wanna show the payment list with our style and able to show default payment method
so that you can show in your own UI
since you are not touching raw card details there
you're just fetching PaymentMethods and listing them
just that card details entry has to be Stripe's UI
oh I see
so if we use card details from Stripe, we are able to update payment method info, right?
or you mean card details entry is add card screen?
or you mean card details entry is add card screen?
this
this will collect card details for you and create a PaymentMethod
then you manually make a request (with that PaymentMethod ID) on your backend to update the Customer's card / update PaymentMethod info
Do you have any example code to do that? I mean for update current payment info
is your code using the older Tokens / Cards?
or the newer PaymentMethods?
Right now I use PaymentMethods only
So I able to get listPaymentMethodsForCustomer via customerContext
next steps, I will show that list on our UI
then when user click on any payment method
we are able user to modify the info then click save
I just stuck on update payment info only, another one is easy now
ah I see
so the approach isn't to modify an existing card
but really
1/ create a new card PaymentMethod (through Add Card ViewController)
2/ attach that card to the Customer
3/ remove the existing card if you mean to replace
we allow user to change name, exp month and year
ah that works then
we allow user to change name, exp month and year
and you'd need your own UI for that and there are no PCI issues there
cause it isn't the card number itself
so you mean when we wanna update current card, we need to remove existing first?
so no, there are 2 cases
1/ update the card number OR replace card_1 with card_2
doesn't look like you want this (I originally thought you did)
for this you'd do #959115690835607552 message
2/ update just card name, and expiry
this works, you use your own UI and collect those details
then update the Customer's PaymentMethod with: https://stripe.com/docs/api/payment_methods/update#update_payment_method-card
my read is you only wanna do 2/ which is straightforward!
set up your own fields
collect the exp and name
pass it to your server
your server calls the endpoint in #959115690835607552 message
the iOS SDK ~doesn't do this really
oh, so we can't do it via SDK only
is that right?
I just wanna confirm SDK can handle it or not
so seem SDK can't do it without calling to API
sounds good. Thanks
np!