#0Bietnua — iOS update a card

1 messages · Page 1 of 1 (latest)

maiden dune
mint lance
#

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.

cloud zodiac
#

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

mint lance
#

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?

cloud zodiac
#

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

mint lance
#

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

cloud zodiac
#

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

mint lance
#

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?

cloud zodiac
#

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

mint lance
#

Do you have any example code to do that? I mean for update current payment info

cloud zodiac
#

is your code using the older Tokens / Cards?

or the newer PaymentMethods?

mint lance
#

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

cloud zodiac
#

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

mint lance
#

we allow user to change name, exp month and year

cloud zodiac
#

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

mint lance
#

so you mean when we wanna update current card, we need to remove existing first?

cloud zodiac
#

so no, there are 2 cases

#

my read is you only wanna do 2/ which is straightforward!

mint lance
#

yes

#

only 2

#

How can we do it via iOS SDK?

cloud zodiac
#

set up your own fields

#

collect the exp and name

#

pass it to your server

#

the iOS SDK ~doesn't do this really

mint lance
#

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

cloud zodiac
#

np!