-
public final class BsLogCancelCheckoutEvent.BuilderBsLogCancelOrderEvent is used to log the event when the order/cart is canceled.
-
-
Constructor Summary
Constructors Constructor Description BsLogCancelCheckoutEvent.Builder(Context context, String checkout_id, String type, <ERROR CLASS><ItemTypeModel> item_list, String reason, Object meta, Boolean update_immediately)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>init(Context context)init is required to pass context to the SDK method and log the event. final <ERROR CLASS>setCheckoutId(String checkout_id)setCheckoutId can be used to log the orderId the event is logged for. final <ERROR CLASS>setCancelType(CancelType cancelType)setCancelType can be used to log the type of the checkout that is being cancelled. final <ERROR CLASS>setCancelType(String cancelType)final <ERROR CLASS>addItem(ItemTypeModel itemModel)addItem can be used to add the item being orders in to the checkout list. final <ERROR CLASS>addItem(String itemJsonString)addItem can be used to pass the whole item as a Json String object as well. final <ERROR CLASS>)>addItemList(<ERROR CLASS><ItemTypeModel> itemList)addItemList can be used to add the whole list to the log at once, the format should be ArrayList<ItemTypeModel> to log the event successfully. final <ERROR CLASS>addItemList(String itemListString)addItemList can be used to add the whole list to the log at once, the format should be ArrayList<ItemTypeModel> to log the event successfully. final <ERROR CLASS>setCancelReason(String reason)setCancelReason is required to define the reason for which the item is being cancelled. final <ERROR CLASS>setMeta(Object meta)You can pass any type of value in setMeta. final <ERROR CLASS>updateImmediately(Boolean update_immediately)updateImmediately is responsible for updating the values ot the backend immediately. final <ERROR CLASS>build()build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources. -
-
Method Detail
-
init
final <ERROR CLASS> init(Context context)
init is required to pass context to the SDK method and log the event. if not provided, it will throw an exception on runtime.
-
setCheckoutId
final <ERROR CLASS> setCheckoutId(String checkout_id)
setCheckoutId can be used to log the orderId the event is logged for. if the order ID is not there then it is recommended to include the unique cartId for the cart items so that they can be tracked. In case the cart Id is also not there, you can use the userId as a unique element for the order.
-
setCancelType
final <ERROR CLASS> setCancelType(CancelType cancelType)
setCancelType can be used to log the type of the checkout that is being cancelled. It can be order or card but should reflect the correct type in correspondence to the id provided.
-
setCancelType
final <ERROR CLASS> setCancelType(String cancelType)
-
addItem
final <ERROR CLASS> addItem(ItemTypeModel itemModel)
addItem can be used to add the item being orders in to the checkout list. This log can be used to add one item to the log at a time. Order item should be in a valid format. With elements of the order as: ItemTypeModel(itemID, type) You can add multiple addOrder functions to one event to include all the items in the order.
-
addItem
final <ERROR CLASS> addItem(String itemJsonString)
addItem can be used to pass the whole item as a Json String object as well. You can use the POJO ItemTypeModel to parse the data int he required format and pass that to this function as a string to log the event. You can use Gson to convert the object to string but SDK will parse the Json string back to POJO so pass it in the log. This method should be used with caution and is suitable for react native bridge.
-
addItemList
final <ERROR CLASS> )>addItemList(<ERROR CLASS><ItemTypeModel> itemList)
addItemList can be used to add the whole list to the log at once, the format should be ArrayList<ItemTypeModel> to log the event successfully. Order item should be in a valid format. With elements of the orderObject as: ItemTypeModel(itemID, type) You should use only one addItemList with event or else the list will only save the later one.
-
addItemList
final <ERROR CLASS> addItemList(String itemListString)
addItemList can be used to add the whole list to the log at once, the format should be ArrayList<ItemTypeModel> to log the event successfully. But the input param is of type string , this is special use case for react native logs where list can be passed as Json string and can be used to log the event. Order item should be in a valid format. With elements of the orderObject as: ItemTypeModel(itemID, type) You should use only one addItemList with event or else the list will only save the later one.
-
setCancelReason
final <ERROR CLASS> setCancelReason(String reason)
setCancelReason is required to define the reason for which the item is being cancelled.
-
setMeta
final <ERROR CLASS> setMeta(Object meta)
You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.
-
updateImmediately
final <ERROR CLASS> updateImmediately(Boolean update_immediately)
updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.
-
build
final <ERROR CLASS> build()
build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.
-
-
-
-