PaymentResponseHandler
@objcMembers
public class PaymentResponseHandler : NSObject
Manage payment responses.
-
When a Notification message is received.
Declaration
Swift
public private(set) var notificationReceived: ((PaymentNotification) -> Void)? { get }
-
When a Action message is received.
Declaration
Swift
public private(set) var actionReceived: ((PaymentActionRequired) -> Void)? { get }
-
When a Receipt message is received.
Declaration
Swift
public private(set) var receiptReceived: ((PaymentReceipt) -> Void)? { get }
-
When a Result message is received.
Declaration
Swift
public private(set) var resultReceived: ((PaymentResult) -> Void)? { get }
-
When payment is complete
Declaration
Swift
public private(set) var paymentComplete: (() -> Void)? { get }
-
When an unexpected error occur.
Declaration
Swift
public private(set) var errorReceived: ((UnhandledError) -> Void)? { get }
-
init(notificationReceived:
actionReceived: receiptReceived: resultReceived: paymentComplete: errorReceived: ) Initialise the handler to receive messages from the server.
Declaration
Swift
public init(notificationReceived: ((PaymentNotification) -> Void)? = nil, actionReceived: ((PaymentActionRequired) -> Void)? = nil, receiptReceived: ((PaymentReceipt) -> Void)? = nil, resultReceived: ((PaymentResult) -> Void)? = nil, paymentComplete: (() -> Void)? = nil, errorReceived: ((UnhandledError) -> Void)? = nil)
Parameters
notificationReceived
an optional PaymentNotification handler to receive server notifications about the transaction.
actionReceived
an optional PaymentActionRequired handler to receive server actions about the transaction.
receiptReceived
an optional PaymentReceipt handler to receive receipts for the transaction
resultReceived
an optional PaymentResult handler to receive the final result of the transaction.
paymentComplete
an optional handler to receive confirmation the payment processing is complete.
errorReceived
an optional UnhandledError handler.
-
Continue an existing transaction when an action was requested and requires the merchant attention.
Declaration
Swift
public func sendActionConfirmation(_ response: PaymentAction)
Parameters
response
the PaymentAction object holding information on the response given by the merchant.
-
Abort an in-flight payment.
Declaration
Swift
public func abortPayment(_ request: PaymentAbort)
Parameters
request
the PaymentAbort object holding merchant’s transaction reference.
-
Proceed with the payment of a previous CardCheckPayment request.
Declaration
Swift
public func proceedWithPayment(_ request: CardPaymentRequest)
Parameters
request
the CardPaymentRequest object holding information on the payment to proceed.