Reference
public struct Reference
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 on UIDevice.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.
-
Your reference for this consumer
Declaration
Swift
public let yourConsumerReference: String
-
Your reference for this payment
Declaration
Swift
public let yourPaymentReference: String
-
An object containing any additional data you wish to tag this payment with. The property name and value are both limited to 50 characters, and the whole object cannot be more than 1024 characters
Declaration
Swift
public let yourPaymentMetaData: [String : String]?
-
Convenience initializer that will generate a unique payment reference
Declaration
Swift
public init?(consumerRef: String, metaData: [String : String]? = nil)
Parameters
consumerRef
The consumer reference for a Reference
metaData
An optional field for any arbitrary data that is tied to a certrain transaction
Return Value
a Reference object