stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.09k stars 976 forks source link

STPShippingAddressViewController does not use billing address if instrument is not an STPCard #1209

Closed karlr-stripe closed 5 years ago

karlr-stripe commented 5 years ago

Summary

The Shipping view controller has a button "Use billing" that will copy the billing address of a card, to avoid the user needing to enter that information twice when e.g. going through the flow of using the STPPaymentContext to complete a payment. For example, with

STPPaymentConfiguration.shared().requiredShippingAddressFields = [.postalAddress]
STPPaymentConfiguration.shared().requiredBillingAddressFields = STPBillingAddressFields.full

However, it looks like this only works if using Card objects, and not Source(or PaymentMethods):

https://github.com/stripe/stripe-ios/blob/1c5505f30e035adf482e02112180ff859959a08b/Stripe/STPShippingAddressViewController.m#L51-L56

If you're not using Cards, then the option won't appear, which makes it less convenient for customers to check out.

Code to reproduce

STPPaymentConfiguration.shared().requiredShippingAddressFields = [.postalAddress]
STPPaymentConfiguration.shared().requiredBillingAddressFields = STPBillingAddressFields.full
STPPaymentConfiguration.shared().createCardSources = true

and integrate the STPPaymentContext.

iOS version

11.4

Installation method

Carthage

SDK version

15.0.1

Other information

yuki-stripe commented 5 years ago

@karlr-stripe Thanks for filing - tracking internally here https://jira.corp.stripe.com/browse/IOS-1278

yuki-stripe commented 5 years ago

Fixed in https://github.com/stripe/stripe-ios/pull/1278