#0Bietnua-ios

1 messages · Page 1 of 1 (latest)

mossy ferry
#

hi there! could you explain the context a little bit, which parts of our SDK are you using currently?

glass wave
#

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

mossy ferry
#

ok, so are using a Stripe UI then , the STPPaymentContext?

glass wave
#

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

mossy ferry
#

what does "save" mean exactly? I'm not really following, where would you like to save it?

glass wave
#

I wanna override selectedPaymentOption in payment context

#

I saw saveLastSelectedPaymentMethodID

#

in customerContext

#

but it's private

mossy ferry
glass wave
#

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

mossy ferry
#

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.

mossy ferry
glass wave
#

customerContext

#

I don't use STPPaymentOptionsViewController to show the pm list

mossy ferry
#

hmm ok! but yeah, that won't work.

glass wave
#

yes

mossy ferry
#

you can't set the selected option yourself

#

you have to present the options VC and have the user select one

glass wave
#

I see

mossy ferry
#

if you just want to process the payment and you already know the pm_xxx, you wouldn't use the STPPaymentContext at all

glass wave
#

so seem I need to handle it as well

mossy ferry
#

you'd just use STPPaymentHandler.confirmPayment directly