#0Bietnua-ios
1 messages · Page 1 of 1 (latest)
hi there! could you explain the context a little bit, which parts of our SDK are you using currently?
I don't use UI from Stripe anymore so I build UI by myself
I can show payment method list
I can have payment method id
and payment method object
how I can save it as selected payment method manually
this one: selectedPaymentOption in paymentContext
ok, so are using a Stripe UI then , the STPPaymentContext?
I don't use Payment Method list from Stripe
I build UI by myself
so my question
how can I save selected pm with pm id
or pm object
what does "save" mean exactly? I'm not really following, where would you like to save it?
I wanna override selectedPaymentOption in payment context
I saw saveLastSelectedPaymentMethodID
in customerContext
but it's private
well selectedPaymentOption is the option that the user picks. I.e you present the STPPaymentContext and they pick one. I'm not sure what "override" means. Do you maybe mean https://stripe.dev/stripe-ios/docs/Classes/STPPaymentContext.html#/c:@M@Stripe@objc(cs)STPPaymentContext(py)defaultPaymentMethod , so you can set which is the default payment method shown as selected when the UI opens?
I get the list pm, I show on UI, when user select any pm, I wanna save it as last selected pm same as saveLastSelectedPaymentMethodID
you say
I don't use Payment Method list from Stripe
but you also say you use the STPPaymentContext, which is a Stripe component that shows a list of payment methods, so I'm afraid you're losing me.
where?
hmm ok! but yeah, that won't work.
yes
you can't set the selected option yourself
you have to present the options VC and have the user select one
I see
if you just want to process the payment and you already know the pm_xxx, you wouldn't use the STPPaymentContext at all
so seem I need to handle it as well
you'd just use STPPaymentHandler.confirmPayment directly