Contents
init()
registerPersonWith(_:loggingIn:completion:)
public struct FTMCRegistrationController
Fintiv Mobile Commerce Registration Controller
init()
public init()
Designated initializer
registerPersonWith(_:loggingIn:completion:)public func registerPersonWith(_ item : FTMCPersonItem, loggingIn logging : Bool = true, completion : CompletionWithType<FTMCPersonToken>? )
Registers a person onto the mobile commerce platform
- Parameters:
- item: PersonItem structure to register
- logging: Bolean defining whether to start a session immediatly after registration, defaults to tru
- completion: a FTMCResult<PersonToken, NetworkError> enum, PersonToken.token == nil is loggingIn = false, true otherwise
Name | Description |
---|---|
item | PersonItem structure to register |
logging | Bolean defining whether to start a session immediatly after registration, defaults to tru |
completion | a FTMCResult<PersonToken, NetworkError> enum, PersonToken.token == nil is loggingIn = false, true otherwise |
Contents
init()
loginWith(username:password:completion:)
loginWithItem(_:completion:)
logout()
public struct FTMCSessionController
Fintiv Mobile Commerce Session Controller
init()
public init()
Designated initializer
loginWith(username:password:completion:)
public func loginWith(username : String, password : String, completion : CompletionWithType<FTMCToken>?)
Logs person in given a username & password
- Parameters:
- username: person username
- password: person password
- completion: a FTMCResult<FTMCToken, NetworkError> enumerator
Name | Description |
---|---|
username | person username |
password | person password |
completion | a FTMCResult<FTMCToken, NetworkError> enumerator |
loginWithItem(_:completion:)
public func loginWithItem(_ loginItem : FTMCLoginItem, completion : CompletionWithType<FTMCToken>?)
Logs person in given a person Login item
- Parameters:
- loginItem: person’s login item structure
- completion: a FTMCResult<FTMreject(error)CToken, NetworkError> enumerator
Name | Description |
---|---|
loginItem | person’s login item structure |
completion | a FTMCResult<FTMreject(error)CToken, NetworkError> enumerator |
logout()
public func logout()
Logs currently logged person out
Contents
init()
getAvailableCoupons(prefetchImages:completion:)
getPersonCoupons(prefetchImages:completion:)
addCouponToPerson(couponId:preheatImages:completion:)
addCouponToPerson(coupon:preheatImages:completion:)
addCouponsToPerson(coupons:preheatImages:completion:)
addCouponsToPerson(couponsId:preheatImages:completion:)
removeCouponInstances(couponInstances:completion:)
removeCouponInstances(couponInstancesId:completion:)
reportCouponRedemption(couponInstance:completion:)
public struct FTMCCouponController
Fintiv Mobile Commerce Coupon Controller
init()
public init()
designated initialize
getAvailableCoupons(prefetchImages:completion:)
public func getAvailableCoupons(prefetchImages : Bool = false, completion : CompletionWithType<[FTMCCoupon]>?)
Returns an array of available coupons for the vendor
- Parameters:
- prefetchImages: boolean determining if images for each coupon should start downloading in the background, defaults to false
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator
Name | Description |
---|---|
prefetchImages | boolean determining if images for each coupon should start downloading in the background, defaults to false |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator |
getPersonCoupons(prefetchImages:completion:)
public func getPersonCoupons(prefetchImages : Bool, completion : CompletionWithType<[FTMCCoupon]>?)
Returns an array of coupons the currently logged person has been added to
- Parameters:
- prefetchImages: boolean determining if images for each coupon should start downloading in the background, defaults to false
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available
Name | Description |
---|---|
prefetchImages | boolean determining if images for each coupon should start downloading in the background, defaults to false |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available |
addCouponToPerson(couponId:preheatImages:completion:)
public func addCouponToPerson(couponId : String, preheatImages : Bool = false, completion : CompletionWithType<[FTMCCoupon]>?)
Adds a coupon to the logged user provided the coupon identifier
- Parameters:
- couponId: coupon identifier to be added to the person
- preheatImages: boolean determining if images for each coupon should start downloading in the background
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available
Name | Description |
---|---|
couponId | coupon identifier to be added to the person |
preheatImages | boolean determining if images for each coupon should start downloading in the background |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available |
addCouponToPerson(coupon:preheatImages:completion:)
public func addCouponToPerson(coupon : FTMCCoupon, preheatImages : Bool = false, completion : CompletionWithType<[FTMCCoupon]>?)
Adds a coupon to the logged user provided an available coupons
- Parameters:
- coupon: the coupon to add to the person
- preheatImages: boolean determining if images for each coupon should start downloading in the background
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available
Name | Description |
---|---|
coupon | the coupon to add to the person |
preheatImages | boolean determining if images for each coupon should start downloading in the background |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available |
addCouponsToPerson(coupons:preheatImages:completion:)
public func addCouponsToPerson(coupons : [FTMCCoupon], preheatImages : Bool = false, completion : CompletionWithType<[FTMCCoupon]>?)
Adds an array of coupons to a person
- Parameters:
- coupons: array of FTMCCoupon to add to the logged person
- preheatImages: boolean determining if images for each coupon should start downloading in the background
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available
Name | Description |
---|---|
coupons | array of FTMCCoupon to add to the logged person |
preheatImages | boolean determining if images for each coupon should start downloading in the background |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available |
addCouponsToPerson(couponsId:preheatImages:completion:)
public func addCouponsToPerson(couponsId : [String], preheatImages : Bool = false, completion : CompletionWithType<[FTMCCoupon]>?)
Adds coupons to a person given an array of coupon identifiers
- Parameters:
- couponsId: array of coupons identifiers to add to the person
- preheatImages: boolean determining if images for each coupon should start downloading in the background
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available
Name | Description |
---|---|
couponsId | array of coupons identifiers to add to the person |
preheatImages | boolean determining if images for each coupon should start downloading in the background |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available |
removeCouponInstances(couponInstances:completion:)
public func removeCouponInstances(couponInstances : FTMCCouponInstance..., completion : CompletionWithType<[FTMCCoupon]>?)
Remove coupons from a Person
- Parameters:
- couponInstances: array of coupon instances
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available after removing a coupon
Name | Description |
---|---|
couponInstances | array of coupon instances |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available after removing a coupon |
removeCouponInstances(couponInstancesId:completion:)
public func removeCouponInstances(couponInstancesId : [String], completion : CompletionWithType<[FTMCCoupon]>?)
Remove coupons from a Person
- Parameters:
- couponInstancesId: array of coupon strings
- completion: a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available after removing a coupon
Name | Description |
---|---|
couponInstancesId | array of coupon strings |
completion | a FTMCResult<[FTMCCoupon], NetworkError> enumerator, on .success(let coupons), returns array of coupons the person currently has available after removing a coupon |
reportCouponRedemption(couponInstance:completion:)
public func reportCouponRedemption(couponInstance : FTMCCouponInstance, completion : CompletionWithType<[FTMCCoupon]>?)
Reports a coupon instance has been redeemed
Must be called by client code once the coupon image and/or code has been presented to the merchant
- Parameters:
- couponInstance: The coupon instance that was redemeed
- completion: a completion block with .success([FTMCCoupon]) with the updated list of the person’s coupons or .failure(NetworkError)
Name | Description |
---|---|
couponInstance | The coupon instance that was redemeed |
completion | a completion block with .success([FTMCCoupon]) with the updated list of the person’s coupons or .failure(NetworkError) |
Contents
init()
getServiceCatalog(completion:)
public struct FTMCServicesController
Fintiv Mobile Commerce Services Controller
init()
public init()
Designated initializer
getServiceCatalog(completion:)
public func getServiceCatalog(completion : CompletionWithType<FTMCServiceCatalog>?)
Gets the catalog of available services
- Parameter completion: a FTMCResult<FTMCServiceCatalog, NetworkError> enumerator
Name | Description |
---|---|
completion | a FTMCResult<FTMCServiceCatalog, NetworkError> enumerator |
Contents
init()
getAvailableStampCards(_:)
addStampCardToPerson(stamp:completion:)
addStampCardToUser(stampIdentifier:completion:)
getUserStampCards(_:)
removeStampCardInstanceFromPerson(stamp:completion:)
removeStampCardInstanceFromPerson(stampIdentifier:completion:)
getStampsForStampCard(_:completion:)
reportStampEvent(forStamp:eventType:value:rewardIfRedeeming:completion:)
public struct FTMCStampController
Fintiv Mobile Commerce Stamp Controller
init()
public init()
Designated initializer
getAvailableStampCards(_:)
public func getAvailableStampCards(_ completion : CompletionWithType<Set<FTMCStampCard>>?)
Gets available stamp
- completion: a FTMCResult with .success(let Set<FTMCStampCard>)
addStampCardToPerson(stamp:completion:)
public func addStampCardToPerson(stamp : FTMCStampCard, completion : CompletionWithType<Void>?)
Adds a stamp to a person’s stamp instances
- Parameters:
- stamp: the FTMCStampCard to add to the person
- completion: a FTMCResult with .success(let Bool)
Name | Description |
---|---|
stamp | the FTMCStampCard to add to the person |
completion | a FTMCResult with .success(let Bool) |
addStampCardToUser(stampIdentifier:completion:)
public func addStampCardToUser(stampIdentifier : String, completion : CompletionWithType<Void>?)
Adds a stamp to a person’s stamp instances
- Parameters:
- stampIdentifier: stamp card identifier
- completion: a FTMCResult with .success(let Bool)
Name | Description |
---|---|
stampIdentifier | stamp card identifier |
completion | a FTMCResult with .success(let Bool) |
getUserStampCards(_:)
public func getUserStampCards(_ completion : CompletionWithType<Set<FTMCStampCard>>?)
Gets the currently logged person’s stamp instances
- Parameter completion: a FTMCResult with .success(let Set<FTMCStampCard>), where each card’s .instace != nil
Name | Description |
---|---|
completion | a FTMCResult with .success(let Set<FTMCStampCard>), where each card’s .instace != nil |
removeStampCardInstanceFromPerson(stamp:completion:)
public func removeStampCardInstanceFromPerson(stamp : FTMCStampCardInstance, completion : CompletionWithType<Void>?)
Removes a card stamp instance from the person
- Parameters:
- stamp: the card stamp instance to be removed from the currently logged person’s stamp cards
- completion: a FTMCResult with .success(Void)
Name | Description |
---|---|
stamp | the card stamp instance to be removed from the currently logged person’s stamp cards |
completion | a FTMCResult with .success(Void) |
removeStampCardInstanceFromPerson(stampIdentifier:completion:)
public func removeStampCardInstanceFromPerson(stampIdentifier : String, completion : CompletionWithType<Void>?)
Removes a card stamp instance from the person
- Parameters:
- stampIdentifier: the card stamp instance identifier to be removed from the currently logged person’s stamp cards
- completion: a FTMCResult with .success(let Bool)
Name | Description |
---|---|
stampIdentifier | the card stamp instance identifier to be removed from the currently logged person’s stamp cards |
completion | a FTMCResult with .success(let Bool) |
getStampsForStampCard(_:completion:)
public func getStampsForStampCard(_ stampCard : FTMCStampCard, completion : CompletionWithType<FTMCStampCard>?)
Gets stamps for a stamp card
on success, mutates the stamp card by setting its stamps array
- Parameters:
- stampCard: the stamp card to fetch the stamps for
- completion: a FTMCResult with .success(let FTMCStampCard) where the card’s .stamps : [FTMCStamp] have been set
Name | Description |
---|---|
stampCard | the stamp card to fetch the stamps for |
completion | a FTMCResult with .success(let FTMCStampCard) where the card’s .stamps : [FTMCStamp] have been set |
reportStampEvent(forStamp:eventType:value:rewardIfRedeeming:completion:)
public func reportStampEvent(forStamp stamp : FTMCStampCard, eventType : FTMCStampEventType, value : String, rewardIfRedeeming reward : FTMCRewardInstance?, completion : CompletionWithType<FTMCStampCard>?)
Reports adding of a stamp to a stamp card or reward instance redemption event
- Parameters:
- stamp: the stamp card instance used for both adding a stamp to the card or the redeeming a card
- eventType: whether the event being reporting is adding a stamp or redeeming a reward
- value: the stamp or reward instance value obtained from the merchant, normally from a QR scan, based on the eventType parameter
- reward: the reward instance being redeeming if eventType == .redeem
- completion: a completion block with .success(update stampCard) or .failure(NetworkError)
Name | Description |
---|---|
stamp | the stamp card instance used for both adding a stamp to the card or the redeeming a card |
eventType | whether the event being reporting is adding a stamp or redeeming a reward |
value | the stamp or reward instance value obtained from the merchant, normally from a QR scan, based on the eventType parameter |
reward | the reward instance being redeeming if eventType == .redeem |
completion | a completion block with .success(update stampCard) or .failure(NetworkError) |