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
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.transactionThe transaction with masked sensitive data.
completionThe 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?) -> BoolParameters
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.cardHolderThe card holder value.
Return Value
YESif the card holder is valid, otherwiseNO.
-
Called when the user taps the ‘Done’ button on SFSafariViewController.
Declaration
Objective-C
- (void)checkoutProviderDidFinishSafariViewController: (nonnull OPPCheckoutProvider *)checkoutProvider;Swift
optional func checkoutProviderDidFinishSafariViewController(_ checkoutProvider: OPPCheckoutProvider)Parameters
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.
-
Called when a new shipping method was selected. The delegate must invoke the completion block with an updated array of
PKPaymentSummaryItemobjects.Declaration
Objective-C
- (void)checkoutProvider:(nonnull OPPCheckoutProvider *)checkoutProvider applePayDidSelectShippingMethod:(nonnull PKShippingMethod *)shippingMethod handler:(nonnull void (^)( OPPApplePayRequestShippingMethodUpdate *_Nonnull))completion;Swift
optional func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, applePayDidSelect shippingMethod: PKShippingMethod) async -> OPPApplePayRequestShippingMethodUpdateParameters
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.shippingMethodThe shipping method for this transaction.
completionThe completion block you should call to update the shipping costs based on the shipping method.
-
Called when a new shipping address was selected. The delegate must invoke the completion block with an updated array of
PKPaymentSummaryItemobjects.Declaration
Objective-C
- (void)checkoutProvider:(nonnull OPPCheckoutProvider *)checkoutProvider applePayDidSelectShippingContact:(nonnull PKContact *)contact handler:(nonnull void (^)( OPPApplePayRequestShippingContactUpdate *_Nonnull))completion;Swift
optional func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, applePayDidSelectShippingContact contact: PKContact) async -> OPPApplePayRequestShippingContactUpdateParameters
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.contactThe contact information needed for shipping.
completionThe completion block you should call to update the shipping address.
-
Called when the payment request was authorized. The delegate must invoke the completion block with an appropriate authorization status.
Declaration
Objective-C
- (void)checkoutProvider:(nonnull OPPCheckoutProvider *)checkoutProvider applePayDidAuthorizePayment:(nonnull PKPayment *)payment handler:(nonnull void (^)( OPPApplePayRequestAuthorizationResult *_Nonnull))completion;Swift
optional func checkoutProvider(_ checkoutProvider: OPPCheckoutProvider, applePayDidAuthorizePayment payment: PKPayment) async -> OPPApplePayRequestAuthorizationResultParameters
checkoutProviderThe instance of
OPPCheckoutProviderthat is calling delegate method.paymentThe result of authorizing a payment request and contains payment information, encrypted in the payment token.
completionThe completion block you should call with an appropriate authorization status.
OPPCheckoutProviderDelegate Protocol Reference