This is a helper class for handling redirect sources.
+
+
Init an instance with the redirect flow source you want to handle,
+ then choose a redirect method. The context will fire the completion handler
+ when the redirect completes.
+
+
Due to the nature of iOS, very little concrete information can be gained
+ during this process, as all actions take place in either the Safari app
+ or the sandboxed SFSafariViewController class. The context attempts to
+ detect when the user has completed the necessary redirect action by listening
+ for both app foregrounds and url callbacks received in the app delegate.
+ However, it is possible the when the redirect is completed, the user may
+ have not actually completed the necessary actions to authorize the charge.
+
+
You can use STPAPIClient to listen for state changes on the source
+ object as a way to identify whether the user action succeeded or not.
+ - see: [STPAPIClient startPollingSourceWithId:clientSecret:timeout:completion:]
+
+
You should not use either this class, nor STPAPIClient, as a way
+ to determine when you should charge the source. Use Stripe webhooks on your
+ backend server to listen for source state changes and to make the charge.
You must ensure that the returnURL set up in the created source
+correctly goes to your app so that users can be returned once
+they complete the redirect in the web broswer.
+
+
+
+
+
Note
+
Firing of the completion block does not necessarily mean the user successfully
+performed the redirect action. You can re-fetch the source object using
+its id and clientSecret, and poll for status updates on it to determine if
+the source was sucessfully made chargeable.
You must ensure that your app delegate listens for the returnURL that you
+ set on your source object, and forwards it to the Stripe SDK so that the
+ context can be notified when the redirect is completed and dismiss the
+ view controller. See [Stripe handleStripeURLCallbackWithURL:]
+
+
The context will listen for both received URLs and app open notifications
+ and fire its completion block when either the URL is received, or the next
+ time the app is foregrounded.
+
+
If the app is running on iOS 9+ it will initiate the flow by presenting
+ a SFSafariViewController instance from the pass in view controller.
+ Otherwise, if the app is running on iOS 8 it will initiate the flow by
+ bouncing the user out to the Safari app. If you want more manual control
+ over the redirect method, you can use startSafariViewControllerRedirectFlowFromViewController
+ or startSafariAppRedirectFlow
+
+
+
Note
+
This method does nothing if the context is not in the STPRedirectContextStateNotStarted state.
Starts a redirect flow by presenting an SFSafariViewController in your app
+ from the passed in view controller.
+
+
You must ensure that your app delegate listens for the returnURL that you
+ set on your source object, and forwards it to the Stripe SDK so that the
+ context can be notified when the redirect is completed and dismiss the
+ view controller. See [Stripe handleStripeURLCallbackWithURL:]
+
+
The context will listen for both received URLs and app open notifications
+ and fire its completion block when either the URL is received, or the next
+ time the app is foregrounded.
+
+
+
Note
+
This method does nothing if the context is not in the STPRedirectContextStateNotStarted state.
Starts a redirect flow by calling openURL to bounce the user out to
+ the Safari app.
+
+
The context will listen for app open notifications and fire its completion
+ block the next time the user re-opens the app (either manually or via url)
+
+
+
Note
+ This method does nothing if the context is not in the STPRedirectContextStateNotStarted state.
+
+
This is a helper class for handling redirect sources.
+
+
Init an instance with the redirect flow source you want to handle,
+ then choose a redirect method. The context will fire the completion handler
+ when the redirect completes.
+
+
Due to the nature of iOS, very little concrete information can be gained
+ during this process, as all actions take place in either the Safari app
+ or the sandboxed SFSafariViewController class. The context attempts to
+ detect when the user has completed the necessary redirect action by listening
+ for both app foregrounds and url callbacks received in the app delegate.
+ However, it is possible the when the redirect is completed, the user may
+ have not actually completed the necessary actions to authorize the charge.
+
+
You can use STPAPIClient to listen for state changes on the source
+ object as a way to identify whether the user action succeeded or not.
+ - see: [STPAPIClient startPollingSourceWithId:clientSecret:timeout:completion:]
+
+
You should not use either this class, nor STPAPIClient, as a way
+ to determine when you should charge the source. Use Stripe webhooks on your
+ backend server to listen for source state changes and to make the charge.
The image to be uploaded. The maximum allowed file size is 4MB
+ for identity documents and 8MB for evidence disputes. Cannot be nil.
+ Your image will be automatically resized down if you pass in one that
+ is too large
+
+
+
+
+
+
+
+ purpose
+
+
+
+
+
The purpose of this file. This can be either an identifing
+ document or an evidence dispute.
+
+
+
+
+
+
+
+ completion
+
+
+
+
+
The callback to run with the returned Stripe file
+ (and any errors that may have occurred).
Returns the error image used for a card brand.
+Override this method in a subclass if you would like to provide custom images.
+- parameter: cardBrand The brand of card entered.
+- returns: The error image used for a card brand.
If paymentContext:didFailToLoadWithError: is called on your delegate, you can in turn call this method to try loading again (if that hasn’t been called, calling this will do nothing). If retrying in turn fails, paymentContext:didFailToLoadWithError: will be called again (and you can again call this to keep retrying, etc).
+
If paymentContext:didFailToLoadWithError: is called on your delegate, you
+can in turn call this method to try loading again (if that hasn’t been called,
+calling this will do nothing). If retrying in turn fails, paymentContext:didFailToLoadWithError:
+will be called again (and you can again call this to keep retrying, etc).
This creates, configures, and appropriately presents an STPPaymentMethodsViewController on top of the payment context’s hostViewController. It’ll be dismissed automatically when the user is done selecting their payment method.
+
This creates, configures, and appropriately presents an STPPaymentMethodsViewController
+on top of the payment context’s hostViewController. It’ll be dismissed automatically
+when the user is done selecting their payment method.
+
+
+
Note
+ This method will do nothing if it is called while STPPaymentContext is
+ already showing a view controller or in the middle of requesting a payment.
+
+
This creates, configures, and appropriately pushes an STPPaymentMethodsViewController onto the navigation stack of the context’s hostViewController. It’ll be popped automatically when the user is done selecting their payment method.
+
This creates, configures, and appropriately pushes an STPPaymentMethodsViewController
+ onto the navigation stack of the context’s hostViewController. It’ll be popped
+ automatically when the user is done selecting their payment method.
+
+
+
Note
+ This method will do nothing if it is called while STPPaymentContext is
+ already showing a view controller or in the middle of requesting a payment.
+
+
This creates, configures, and appropriately presents a view controller for collecting shipping address and shipping method on top of the payment context’s hostViewController. It’ll be dismissed automatically when the user is done entering their shipping info.
+
This creates, configures, and appropriately presents a view controller for
+ collecting shipping address and shipping method on top of the payment context’s
+ hostViewController. It’ll be dismissed automatically when the user is done
+ entering their shipping info.
+
+
+
Note
+ This method will do nothing if it is called while STPPaymentContext is
+ already showing a view controller or in the middle of requesting a payment.
+
+
This creates, configures, and appropriately pushes a view controller for collecting shipping address and shipping method onto the navigation stack of the context’s hostViewController. It’ll be popped automatically when the user is done entering their shipping info.
+
This creates, configures, and appropriately pushes a view controller for
+ collecting shipping address and shipping method onto the navigation stack of
+ the context’s hostViewController. It’ll be popped automatically when the
+ user is done entering their shipping info.
+
+
+
Note
+ This method will do nothing if it is called while STPPaymentContext is
+ already showing a view controller, or in the middle of requesting a payment.
+
+
Requests payment from the user. This may need to present some supplemental UI to the user, in which case it will be presented on the payment context’s hostViewController. For instance, if they’ve selected Apple Pay as their payment method, calling this method will show the payment sheet. If the user has a card on file, this will use that without presenting any additional UI. After this is called, the paymentContext:didCreatePaymentResult:completion: and paymentContext:didFinishWithStatus:error: methods will be called on the context’s delegate.
+
Requests payment from the user. This may need to present some supplemental UI
+ to the user, in which case it will be presented on the payment context’s
+ hostViewController. For instance, if they’ve selected Apple Pay as their
+ payment method, calling this method will show the payment sheet. If the user
+ has a card on file, this will use that without presenting any additional UI.
+ After this is called, the paymentContext:didCreatePaymentResult:completion:
+ and paymentContext:didFinishWithStatus:error: methods will be called on the
+ context’s delegate.
+
+
+
Note
+ This method will do nothing if it is called while STPPaymentContext is
+ already showing a view controller, or in the middle of requesting a payment.
+
+