Package com.ft.mcp.viewModel

Types

| FTMCCouponViewModel | class FTMCCouponViewModel : AndroidViewModel
Copyright © 2019 FinTiv. All rights reserved. |
| FTMCRegistrationViewModel | class FTMCRegistrationViewModel : AndroidViewModel
Copyright © 2019 FinTiv. All rights reserved. |
| FTMCSessionViewModel | class FTMCSessionViewModel : AndroidViewModel
Fintiv Mobile Commerce Session ViewModel |
| FTMCStampViewModel | class FTMCStampViewModel : AndroidViewModel
Fintiv Mobile Commerce FTMCStampViewModel ViewModel |

FTMCCouponViewModel

class FTMCCouponViewModel : AndroidViewModel

Copyright © 2019 FinTiv. All rights reserved.

Constructors

| init | FTMCCouponViewModel(context:Application)
Copyright © 2019 FinTiv. All rights reserved. |

Properties

| coupon | var coupon: MutableLiveData<FTMCCoupon> |
| coupons | var coupons: MutableLiveData<List<FTMCCoupon>> |
| error | var error: MutableLiveData<String> |
| qrCode | var qrCode: MutableLiveData<String> |
| removed | var removed: MutableLiveData<Boolean> |

Functions

| addCouponToPerson | fun addCouponToPerson(couponId:String):Unit
Adds a FTMCCoupon to the logged user provided the FTMCCoupon identifier observe coupons field to get the responsefun addCouponToPerson(coupon:FTMCCoupon):Unit
Adds a FTMCCoupon to the logged user provided the FTMCCoupon instance observe coupon field to get the response |
| addCouponsToPerson | fun addCouponsToPerson(coupons:List<FTMCCoupon>):Unit
Adds a FTMCCoupon to the logged user provided an available FTMCCoupons observe coupons field to get the responsefun addCouponsToPerson(vararg couponsId:String):Unit
Adds coupons to a person given an array of coupon identifiers observe coupons field to get the response |
| getAvailableCoupons | fun getAvailableCoupons():Unit
Returns an array of available coupons for the vendor, observe coupons field to get the response |
| getPersonCoupons | fun getPersonCoupons():
Unit
Returns an array of coupons the currently logged person has been added to, observe coupons field to get the response |
| removeCouponInstances | fun removeCouponInstances(couponInstances:List<FTMCCoupon>):Unit
fun removeCouponInstances(vararg couponInstancesId:
String):Unit
Remove coupons from a Person observe removed field to get the response and observe error field to get the error response |
| reportCouponRedemption | fun reportCouponRedemption(coupon:FTMCCoupon):Unit
Reports a coupon instance has been redeemed observe qrCode field to get the response ans show qr code view and observe error field to get the error response |

FTMCRegistrationViewModel

class FTMCRegistrationViewModel : AndroidViewModel

Copyright © 2019 FinTiv. All rights reserved.

Constructors

| init | FTMCRegistrationViewModel(context:Application)
Copyright © 2019 FinTiv. All rights reserved. |

Properties

| error | var error: MutableLiveData<String> |
| person | var person: MutableLiveData<FTMCPerson> |

Functions

| registerPersonWith | fun registerPersonWith(name:String, lastName:String, email:String, password:String, logging:Boolean= true):Unit
Registers a person onto the mobile commerce platform observe person field to get the response and observe error field to get the error response |

FTMCSessionViewModel

class FTMCSessionViewModel : AndroidViewModel

Fintiv Mobile Commerce Session ViewModel

Constructors

| init | FTMCSessionViewModel(context:Application)
Fintiv Mobile Commerce Session ViewModel |

Properties

| error | var error: MutableLiveData<String> |
| token | var token: MutableLiveData<FTMCPersonToken> |

Functions

| loginWith | fun loginWith(username:String, password:String):Unit
Logs person in given a username & password, observe token field to get the response and observe error field to get the error response |

FTMCStampViewModel

class FTMCStampViewModel : AndroidViewModel

Fintiv Mobile Commerce FTMCStampViewModel ViewModel

Constructors

| init | FTMCStampViewModel(context:Application)
Fintiv Mobile Commerce FTMCStampViewModel ViewModel |

Properties

| added | var added: MutableLiveData<Boolean> |
| cardInstance | var cardInstance: MutableLiveData<FTMCCardInstanceRewards |
| removed | var removed: MutableLiveData<Boolean> |
| stamp | var stamp: MutableLiveData<FTMCStamp> |
| stampCards | var stampCards: MutableLiveData<List<FTMCStampCard>> |

Functions

| addStampCardToPerson | fun addStampCardToPerson(stamp:FTMCStampCard):Unit
Adds a stamp to a person’s stamp instances observe added field to get the response |
| addStampCardToUser | fun addStampCardToUser(stampIdentifier:String):Unit
Adds a stamp to a person’s stamp instances observe added field to get the response |
| getAvailableStampCards | fun getAvailableStampCards():Unit
Gets available stamp observe catalogs field to get the response |
| getStampsForStampCard | fun getStampsForStampCard(stampCard:FTMCStampCard):Unit
Gets stamps for a stamp card observe stamp field to get the response |
| getUserStampCards | fun getUserStampCards():Unit
Gets the currently logged person’s stamp instances observe catalogs field to get the response |
| removeStampCardInstanceFromPerson | fun removeStampCardInstanceFromPerson(stamp:FTMCStampCardInstance):Unit
fun removeStampCardInstanceFromPerson(stampIdentifier:String):Unit
Removes a card stamp instance from the person observe removed field to get the response |
| reportStampEvent | fun reportStampEvent(stamp:FTMCStampCard, stampValue:String, reward:FTMCRewardInstance? = null):Unit
Reports adding of a stamp to a stamp card or reward instance redemption event observe cardInstance field to get the response |