objective c - Stripe iOS SDK - Format for State and Country While Creating Token -


i'm wondering format state , country should passing in stpcardparams while creating token in stripe ios sdk.

in code, have following:

        stpcardparams *card = [[stpcardparams alloc] init];         card.number = self.paymentview.cardparams.number;          card.expmonth = self.paymentview.cardparams.expmonth;         card.expyear = self.paymentview.cardparams.expyear;         card.cvc = self.paymentview.cardparams.cvc;         card.addresszip = self.zipfield.text;         card.addressline1 = self.addressfield.text;         card.addresscity = self.cityfield.text;         card.addresscountry = self.countryfield.text;         card.addressstate = self.statefield.text;          [[stpapiclient sharedclient] createtokenwithcard:card completion:^(stptoken *token, nserror *error) { ...... 

my question is, should formatting user's input state , country.

for example, should be:

"california, united states of america" or "ca, us"

it should permissive it, i'd suggest peering tests within ios sdk.

specifically, https://github.com/stripe/stripe-ios/blob/master/tests/tests/stpcardtest.m#l45

and https://github.com/stripe/stripe-ios/blob/master/tests/tests/stpcardfunctionaltest.m#l19

my personal choice might format "ca, us" (two letter iso code how stripe stores countries).

https://stripe.com/docs/api#card_object-country


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

laravel - Undefined property: Illuminate\Pagination\LengthAwarePaginator::$id (View: F:\project\resources\views\admin\carousels\index.blade.php) -