OPPCheckoutProviderDelegate

@protocol OPPCheckoutProviderDelegate <NSObject>

A protocol for additional checkout callbacks.

  • Called before submitting a transaction to the Server. Use this callback to recreate checkout for specific payment brand or abort transaction.

    Declaration

    Objective-C

    - (void)checkoutProvider:(nonnull OPPCheckoutProvider *)checkoutProvider
          continueSubmitting:(nonnull OPPTransaction *)transaction
                  completion:
                      (nonnull void (^)(NSString *_Nullable, BOOL))completion;

    Swift

    optional func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, continueSubmitting transaction: OPPTransaction) async -> (String?, Bool)

    Parameters

    checkoutProvider

    The instance of OPPCheckoutProvider that is calling delegate method.

    transaction

    The transaction with masked sensitive data.

    completion

    The completion block you should call to continue submitting transaction or abort it. In case of abortion checkout will be closed with error OPPErrorCodeTransactionAborted.

  • Called when card holder text field was changed or pressed Pay button on the payment detail view. Use this callback to override the internal card holder validation.

    Declaration

    Objective-C

    - (BOOL)checkoutProvider:(nonnull OPPCheckoutProvider *)checkoutProvider
          validateCardHolder:(nullable NSString *)cardHolder;

    Swift

    optional func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, validateCardHolder cardHolder: String?) -> Bool

    Parameters

    checkoutProvider

    The instance of OPPCheckoutProvider that is calling delegate method.

    cardHolder

    The card holder value.

    Return Value

    YES if the card holder is valid, otherwise NO.