Structs
The following structs are available globally.
-
JudoError
The JudoError object holds all the information about errors that occurred within the SDK or at any stage when making a call to the judo API
See moreDeclaration
Swift
public struct JudoError: ErrorType
-
Response
Response object is created out of the JSON response of the judo API for seamless handling of values returned in any call.
The response object can hold multiple transaction objects and supports pagination if available.
In most cases (successful Payment, Pre-auth or RegisterCard operation) a Response object will hold one TransactionData object. Supporting CollectionType protocol, you can access the elements by subscripting
See morelet transactionData = response[0]
or using the available variableresponse.first
as a more readable approach.Declaration
Swift
public struct Response: GeneratorType, ArrayLiteralConvertible
-
Declaration
Swift
public struct PaymentToken
-
Consumer
Consumer stores information about a reference and a consumer token to be used in any kind of token transaction.
See moreDeclaration
Swift
public struct Consumer
-
TransactionData
TransactionData is an object that references all information in correspondance with a Transaction with the judo API
See moreDeclaration
Swift
public struct TransactionData
-
Judo Model Error object
See moreDeclaration
Swift
public struct JudoModelError
-
Address object for card transactions
The Address object stores information around the address that is related to a card
See moreDeclaration
Swift
public struct Address
-
A class which can be used to easily customize the SDKs view
See moreDeclaration
Swift
public struct Theme
-
The Session struct is a wrapper for the REST API calls
See moreDeclaration
Swift
public struct Session
-
Pagination
Struct to save state of a paginated response
Declaration
Swift
public struct Pagination
-
Referencing a transaction
the Reference object is supposed to simplify storing reference data like consumer, payment references and metadata dictionary that can hold an arbitrary set of key value based information
you create a reference object by calling the initializer with a reference of your consumer.
If you have used the reference to register a card, make sure that the consumer reference stays the same for making token based transactions
guard let references = Reference(consumerRef: "consumer0053252") else { return }
the Reference initializer returns an optional because of the payment reference which is being generated using the
identifierForVendor()
method onUIDevice.currentDevice()
. The method returns an optional value and thus can return nil in certain device states.If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.
See moreDeclaration
Swift
public struct Reference