SessionDelegate
@objc
public protocol SessionDelegate : AnyObject, NSObjectProtocol
Payment delegate.
-
Notifies the receiver that payment has succeed, passing
charge
andsession
which has initiated payment as arguments.Declaration
Swift
@objc(paymentSucceed:onSession:) optional func paymentSucceed(_ charge: Charge, on session: SessionProtocol)
-
Notifies the receiver that authorization has succeed, passing
authorize
andsession
which has initiated authorization as arguments.Declaration
Swift
@objc(authorizationSucceed:onSession:) optional func authorizationSucceed(_ authorize: Authorize, on session: SessionProtocol)
-
Notifies the receiver that the card was saved.
Declaration
Swift
@objc(cardSaved:onSession:) optional func cardSaved(_ cardVerification: CardVerification, on session: SessionProtocol)
-
Notifies the receiver that the card was tokenized.
Declaration
Swift
@objc(cardTokenized:onSession:customerRequestedToSaveTheCard:) optional func cardTokenized(_ token: Token, on session: SessionProtocol, customerRequestedToSaveTheCard saveCard: Bool)
-
Notifies the receiver that charge has failed, passing
session
which has initiated the payment.If
error
isnil
, then look intocharge
object to find the cause of the issue.Declaration
Swift
@objc(paymentFailedWithCharge:error:onSession:) optional func paymentFailed(with charge: Charge?, error: TapSDKError?, on session: SessionProtocol)
-
Notifies the receiver that authorization has failed, passing
session
which has initiated the authorization.If
error
isnil
, then look intoauthorize
object to find the cause of the issue.Declaration
Swift
@objc(authorizationFailedWithAuthorize:error:onSession:) optional func authorizationFailed(with authorize: Authorize?, error: TapSDKError?, on session: SessionProtocol)
-
Notifies the receiver that card saving process has failed.
If
error
isnil
, then look intocardVerification
object to find the cause of the issue.Declaration
Swift
@objc(cardSavingFailedWithCardVerification:error:onSession:) optional func cardSavingFailed(with cardVerification: CardVerification?, error: TapSDKError?, on session: SessionProtocol)
-
Notifies the receiver that card tokenization process has failed.
Declaration
Swift
@objc(cardTokenizationFailedWithError:onSession:) optional func cardTokenizationFailed(with error: TapSDKError, on session: SessionProtocol)
-
Notifies the receiver that session is about to start and has not yet shown the SDK UI.
You might want to use this method if you are not using
PayButton
in your application and want to show a loader before SDK UI appears on the screen.Declaration
Swift
@objc optional func sessionIsStarting(_ session: SessionProtocol)
-
Notifies the receiver that session has successfully started and shown the SDK UI on the screen.
You might want to use this method if you are not using
PayButton
in your application and want to hide a loader after SDK UI has appeared on the screen.Declaration
Swift
@objc optional func sessionHasStarted(_ session: SessionProtocol)
-
Notifies the receiver that session has failed to start and will not show the SDK UI on the screen.
You might want to use this method if you are not using
PayButton
in your application and want to hide a loader because the session has failed. For the actual failure cause please implement other methods from this protocol and listen to the callbacks.Declaration
Swift
@objc optional func sessionHasFailedToStart(_ session: SessionProtocol)
-
Notifies the receiver that session has been cancelled by the user.
Declaration
Swift
@objc optional func sessionCancelled(_ session: SessionProtocol)