Package 

Class BsLogPaymentMethodEvent.Builder


  • 
    public final class BsLogPaymentMethodEvent.Builder
    
                        

    BsLogPaymentMethodEvent is to log events for payments. Which method of the payment is selected for the order.

    • 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> setOrderId(String order_id) setOrderId is required to set the id for the order in log, Id should be in string and must be in accordance to the catalog provided.
      final <ERROR CLASS> setPaymentMethod(PaymentMethod payment_method) setPaymentMethod is required to set the type of the payment is being selected
      final <ERROR CLASS> setPaymentMethod(String payment_method)
      final <ERROR CLASS> setCurrency(String currency) setCurrency is required to log the currency for for the payment logged.
      final <ERROR CLASS> setPaymentAmount(Float payment_amount) setPaymentAmount is required to log the total price of the payment being logged.
      final <ERROR CLASS> setPaymentAmount(Integer payment_amount)
      final <ERROR CLASS> setPaymentAmount(Double payment_amount)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.

      • setOrderId

         final <ERROR CLASS> setOrderId(String order_id)

        setOrderId is required to set the id for the order in log, Id should be in string and must be in accordance to the catalog provided.

      • setPaymentMethod

         final <ERROR CLASS> setPaymentMethod(PaymentMethod payment_method)

        setPaymentMethod is required to set the type of the payment is being selected

      • setCurrency

         final <ERROR CLASS> setCurrency(String currency)

        setCurrency is required to log the currency for for the payment logged. Currency should be in ISO 4217 format. For Ease, SDK provides the enums to log the currency so that it would be easy to log. You can also use the string function to provide the currency. Below is the function for the logging currency using String. Remember to use the same strings as provided in the enums or else the event will be discarded.

      • setPaymentAmount

         final <ERROR CLASS> setPaymentAmount(Float payment_amount)

        setPaymentAmount is required to log the total price of the payment being logged. Amount format should be in accordance to the currency selected.

      • 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.