public class STPShippingAddressViewController : STPCoreTableViewController
extension STPShippingAddressViewController : STPAddressViewModelDelegate, UITableViewDelegate, UITableViewDataSource, STPShippingMethodsViewControllerDelegate
This view controller contains a shipping address collection form. It renders a right bar button item that submits the form, so it must be shown inside a
UINavigationController. Depending on your configuration’s shippingType, the view controller may present a shipping method selection form after the user enters an address.
A convenience initializer; equivalent to calling
init(configuration: STPPaymentConfiguration.shared theme: STPTheme.defaultTheme currency:"" shippingAddress:nil selectedShippingMethod:nil prefilledInformation:nil).
@objc public convenience init()
Initializes a new
STPShippingAddressViewControllerwith the given payment context and sets the payment context as its delegate.
@objc(initWithPaymentContext:) public convenience init(paymentContext: STPPaymentContext)
The payment context to use.
Initializes a new
STPShippingAddressCardViewControllerwith the provided parameters.
@objc(initWithConfiguration:theme:currency:shippingAddress:selectedShippingMethod:prefilledInformation:) public init( configuration: STPPaymentConfiguration, theme: STPTheme, currency: String?, shippingAddress: STPAddress?, selectedShippingMethod: PKShippingMethod?, prefilledInformation: STPUserInformation? )
The configuration to use (this determines the required shipping address fields and shipping type). - seealso: STPPaymentConfiguration
The theme to use to inform the view controller’s visual appearance. - seealso: STPTheme
The currency to use when displaying amounts for shipping methods. The default is USD.
If set, the shipping address view controller will be pre-filled with this address. - seealso: STPAddress
If set, the shipping methods view controller will use this method as the selected shipping method. If
selectedShippingMethodis nil, the first shipping method in the array of methods returned by your delegate will be selected.
If set, the shipping address view controller will be pre-filled with this information. - seealso: STPUserInformation
If you’re pushing
STPShippingAddressViewControlleronto an existing
UINavigationController‘s stack, you should use this method to dismiss it, since it may have pushed an additional shipping method view controller onto the navigation controller’s stack.
@objc(dismissWithCompletion:) public func dismiss(withCompletion completion: STPVoidBlock?)
The callback to run after the view controller is dismissed. You may specify nil for this parameter.