SBExternalAccountTransaction
Objective-C
@interface SBExternalAccountTransaction : NSObject <NSCopying>
Swift
class SBExternalAccountTransaction : NSObject, NSCopying
Protocol outlining all the properties of an external account transaction
-
Optional - field for transaction unique identifer
Declaration
Objective-C
@property (nonatomic, strong) NSString *ID;
Swift
var id: String! { get set }
-
Date that transaction occurred
Declaration
Objective-C
@property (nonatomic, strong) NSDate *date;
Swift
var date: Date! { get set }
-
Optional - Date that transaction had finished processing and was posted for client to see
Declaration
Objective-C
@property (nonatomic, strong) NSDate *postedDate;
Swift
var postedDate: Date! { get set }
-
Amount of transaction
Declaration
Objective-C
@property (nonatomic) CGFloat amount;
Swift
var amount: CGFloat { get set }
-
Currency code of transaction
Declaration
Objective-C
@property (nonatomic) CurrencyCode currencyCode;
Swift
var currencyCode: CurrencyCode { get set }
-
Optional - A description of transaction
Declaration
Objective-C
@property (nonatomic, strong) NSString *summary;
Swift
var summary: String! { get set }
-
Optional - Masked number of account used to make transaction. (Most likely a 12 digit number. e.g. ************6789)
Declaration
Objective-C
@property (nonatomic, strong) NSString *maskedAccountNumber;
Swift
var maskedAccountNumber: String! { get set }
-
Optional - Name of merchant
Declaration
Objective-C
@property (nonatomic, strong) NSString *merchantName;
Swift
var merchantName: String! { get set }
-
Unique identifier of Sensibill SBReceipt, if receipt was matched to transaction.
Declaration
Objective-C
@property (nonatomic, strong) NSString *receiptID;
Swift
var receiptID: String! { get set }
-
Initializer for mandatory fields
Declaration
Objective-C
- (id)initWithAmount:(double)amount currencyCode:(CurrencyCode)currencyCode date:(NSDate *)date;
Swift
init!(amount: Double, currencyCode: CurrencyCode, date: Date!)
Parameters
amount
transaction amount
currencyCode
currency of transaction represented as CurrencyCode
date
Date that transaction occured
-
-initWithAmount:
currencyCode: date: transactionID: postedDate: summary: maskedAccountNumber: merchantName: Initializer for optional fields
Declaration
Objective-C
- (id)initWithAmount:(double)amount currencyCode:(CurrencyCode)currencyCode date:(NSDate *)date transactionID:(NSString *)transactionID postedDate:(NSDate *)postedDate summary:(NSString *)summary maskedAccountNumber:(NSString *)maskedAccountNumber merchantName:(NSString *)merchantName;
Swift
init!(amount: Double, currencyCode: CurrencyCode, date: Date!, transactionID: String!, postedDate: Date!, summary: String!, maskedAccountNumber: String!, merchantName: String!)
Parameters
amount
transaction amount
currencyCode
currency of transaction represented as CurrencyCode
date
Date transaction occured
transactionID
external transaction identifier, used for transaction linking
postedDate
Date that transaction with processed/posted
summary
Extra description of transaction
maskedAccountNumber
The masked number of the card used to make the transaction.
merchantName
Name of merchant
-
Converts string to type CurrencyCode
Declaration
Objective-C
+ (CurrencyCode)convertToCurrencyForString:(NSString *)inputString;
Swift
class func convertToCurrency(for inputString: String!) -> CurrencyCode
Parameters
inputString
string to be converted to CurrencyCode type
Return Value
CurrencyCode the currency type that string parameter matches. @remark Returns unknown if match not found
-
Converts type CurrencyCode to string
Declaration
Objective-C
- (NSString *)convertToStringForCurrency:(CurrencyCode)currency;
Swift
func convertToString(forCurrency currency: CurrencyCode) -> String!
Parameters
currency
currency code to be converted to string
Return Value
NSString string representation of currency code
-
Function to determine if this external account transaction is the same as another
Declaration
Objective-C
- (BOOL)isEqualToExternalAccountTransaction: (SBExternalAccountTransaction *)transaction;
Swift
func isEqual(to transaction: SBExternalAccountTransaction!) -> Bool
Parameters
transaction
External Account Transaction that will be compared
Return Value
BOOL true if external account transaction passed is the same, false if not the same