@protocol STPAddCardViewControllerDelegate <NSObject>
STPAddCardViewControllerDelegate is notified when an
successfully creates a card token or is cancelled. It has internal error-handling
logic, so there’s no error case to deal with.
Called when the user cancels adding a card. You should dismiss (or pop) the view controller at this point.
- (void)addCardViewControllerDidCancel: (nonnull STPAddCardViewController *)addCardViewController;
func addCardViewControllerDidCancel(_ addCardViewController: STPAddCardViewController)
the view controller that has been cancelled
This is called when the user successfully adds a card and Stripe returns a Payment Method.
You should send the PaymentMethod to your backend to store it on a customer, and then call the provided
completionblock when that call is finished. If an error occurs while talking to your backend, call
completion(error), otherwise, dismiss (or pop) the view controller.
- (void)addCardViewController: (nonnull STPAddCardViewController *)addCardViewController didCreatePaymentMethod:(nonnull STPPaymentMethod *)paymentMethod completion:(nonnull STPErrorBlock)completion;
the view controller that successfully created a token
the Payment Method that was created. - see: STPPaymentMethod
call this callback when you’re done sending the token to your backend