SQIPCardEntryViewControllerDelegate
@protocol SQIPCardEntryViewControllerDelegate
The delegate of a SQIPCardEntryViewController instance must adopt the SQIPCardEntryViewControllerDelegate protocol.
-
Invoked after the customer has submitted their card information. Your implementation should send the provided card details to your server to perform any additional work (for example, charging the card). After you are finished processing the card, notify the card entry view controller of the result so it can be displayed to the customer.
If your server successfully processed the card, call the completion handler with
nilas the only argument. A success animation will be displayed to the customer, andcardEntryViewController:didCompleteWithStatus:will be called, at which point you should dismiss the card entry view controller.If your application encountered an error while processing the card, call the completion handler with the error. Its
localizedDescriptionwill be displayed to the customer in the card entry view controller. The customer will have an opportunity to edit their card information and re-submit.Declaration
Objective-C
- (void)cardEntryViewController: (nonnull SQIPCardEntryViewController *)cardEntryViewController didObtainCardDetails:(nonnull SQIPCardDetails *)cardDetails completionHandler: (void (^_Nonnull)(NSError *_Nullable))completionHandler;Parameters
cardEntryViewControllerThe SQIPCardEntryViewController instance.
cardDetailsDetails about the entered card, including the nonce.
completionHandlerThe completion handler to be called once you have finished processing the card.
-
Invoked when the card entry form has been completed. The
statusparameter indicates whether card entry succeeded or was cancelled. Use this method to dismiss the card entry view controller and update any other app state.Declaration
Objective-C
- (void)cardEntryViewController: (nonnull SQIPCardEntryViewController *)cardEntryViewController didCompleteWithStatus:(SQIPCardEntryCompletionStatus)status;Parameters
cardEntryViewControllerThe SQIPCardEntryViewController instance.
statusThe card entry completion status.
SQIPCardEntryViewControllerDelegate Protocol Reference