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 nil as the only argument. A success animation will be displayed to the customer, and cardEntryViewController: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 localizedDescription will 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;

    Swift

    func cardEntryViewController(_ cardEntryViewController: SQIPCardEntryViewController, didObtain cardDetails: SQIPCardDetails, completionHandler: @escaping (Error?) -> Void)

    Parameters

    cardEntryViewController

    The SQIPCardEntryViewController instance.

    cardDetails

    Details about the entered card, including the nonce.

    completionHandler

    The completion handler to be called once you have finished processing the card.

  • Invoked when the card entry form has been completed. The status parameter 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;

    Swift

    func cardEntryViewController(_ cardEntryViewController: SQIPCardEntryViewController, didCompleteWith status: SQIPCardEntryCompletionStatus)

    Parameters

    cardEntryViewController

    The SQIPCardEntryViewController instance.

    status

    The card entry completion status.