PaymentManager
@objcMembers
public class PaymentManager : NSObject
Provides access for sending and receiving data from the remote system.
-
Singleton to be able to re-use the Payment Manager.
Declaration
Swift
public static let shared: PaymentManager
-
Starts a new transaction by creating a new connection to the remote system.
Usage Example:
let notification = { notification in print(notification.status) print(notification.transactionReference) } [...] let paymentResponse = PaymentResponseHandler(notificationReceived: notification, actionReceived: action, receiptReceived: receipt, resultReceived: result, paymentComplete: paymentComplete, errorReceived: errorReceived) PaymentManager.shared.startPayment(request: cardSale, handler: paymentResponse)
Declaration
Swift
public func startPayment(request: PaymentRequest, handler: PaymentResponseHandler?)
Parameters
request
the PaymentRequest object holding information on the payment to start.
handler
a PaymentResponseHandler callback that will be executed for the lifetime of the connection to the remote system to deliver events.
-
Starts a new query result request by creating a new connection to the remote system..
Declaration
Swift
public func queryPayment(request: PaymentQuery, handler: PaymentResponseHandler?)
Parameters
request
a message holding information on the query result
handler
a PaymentResponseHandler callback that will be executed for the lifetime of the connection to the remote system to deliver events.
-
Starts a new settle result request by creating a new connection to the remote system..
Declaration
Swift
public func settlePayment(request: CardSettlement, handler: PaymentResponseHandler?)
Parameters
request
a message holding information on the settle result
handler
a PaymentResponseHandler callback that will be executed for the lifetime of the connection to the remote system to deliver events.
-
Starts a new cancel payment request by creating a new connection to the remote system..
Declaration
Swift
public func cancelPayment(request: CardPaymentCancel, handler: PaymentResponseHandler?)
Parameters
request
a message holding information on the cancel request
handler
a PaymentResponseHandler callback that will be executed for the lifetime of the connection to the remote system to deliver events.