FTMCRegistrationController

Contents

public struct FTMCRegistrationController

Fintiv Mobile Commerce Registration Controller

Methods

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

Parameters

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

FTMCSessionController

Contents

public struct FTMCSessionController

Fintiv Mobile Commerce Session Controller

Methods

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

Parameters

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

Parameters

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

FTMCCouponController

Contents

public struct FTMCCouponController

Fintiv Mobile Commerce Coupon Controller

Methods

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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

Parameters

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)

Parameters

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)

FTMCServicesController

Contents

public struct FTMCServicesController

Fintiv Mobile Commerce Services Controller

Methods

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

Parameters

Name Description
completion a FTMCResult<FTMCServiceCatalog, NetworkError> enumerator

FTMCStampController

Contents

public struct FTMCStampController

Fintiv Mobile Commerce Stamp Controller

Methods

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)

Parameters

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)

Parameters

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

Parameters

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)

Parameters

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)

Parameters

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

Parameters

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)

Parameters

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)