TerminalFactory
public final class TerminalFactory
A factory for CardTerminal objects.
It allows an application to obtain a TerminalFactory by calling
shared(type:params:provider:)
method and use this TerminalFactory object
to access the CardTerminals by calling the terminals()
method.
Each TerminalFactory has a type
indicating how it was implemented. It must
be specified when the implementation is obtained using a
shared(type:params:provider:)
method and can be retrieved via the type
property.
TerminalFactory utilizes an extensible service provider framework.
Service providers that wish to add a new implementation should see the
TerminalFactorySpi
class for more information.
See also
See also
Version
1.0
Date
8 Dec 2017
-
Returns the provider of this TerminalFactory.
Declaration
Swift
public let provider: Provider
-
Returns the type of this TerminalFactory. This is the value that was specified in the shared() method that returned this object.
Declaration
Swift
public let type: String
-
Returns a TerminalFactory of the specified type that is initialized with the specified parameters.
The
TerminalFactory
is initialized with the specified parameters object. The type of parameters needed may vary between different types ofTerminalFactory
s.Throws
CardError.noSuchAlgorithm
if a TerminalFactorySpi implementation of the specified type is not available from the specified ProviderDeclaration
Swift
public static func shared(type: String, params: Any, provider: Provider) throws -> TerminalFactory
Parameters
type
the type of the requested TerminalFactory
params
the parameters to pass to the TerminalFactorySpi implementation, or nil if no parameters are needed
provider
the provider
Return Value
a TerminalFactory of the specified type
-
Returns a new CardTerminals object encapsulating the terminals supported by this factory. See the class comment of the
CardTerminals
class regarding how the returned objects can be shared and reused.Declaration
Swift
public func terminals() -> CardTerminals
Return Value
a new CardTerminals object encapsulating the terminals supported by this factory.