Package 

Class BsLogDeferredPaymentEvent.Builder


  • 
    public final class BsLogDeferredPaymentEvent.Builder
    
                        

    BsLogDeferredPaymentEvent is to log events for payments, when they undergo processing and processed completed or canceled. This log is for use cases whe we have Buy Now and Pay Later which means that customers can buy the items now and pay the amount on a later date.

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

      • setPaymentId

         final <ERROR CLASS> setPaymentId(String payment_id)

        setPaymentId is required to set the id for the payment 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

      • setPaymentAction

         final <ERROR CLASS> setPaymentAction(PaymentAction action)

        setPaymentAction is used to specify the action performed on the payments screen, there can be multiple types of actions that can include init payment process, cancel payment processing or upload receipt to bank deposit. By default SDK provides enum class to use as PaymentAction. Below function can be used to set action using enum.

      • setPaymentAction

         final <ERROR CLASS> setPaymentAction(String action)

        setPaymentAction is used to specify the action performed on the payments screen, there can be multiple types of actions that can include init payment process, cancel payment processing or upload receipt to bank deposit. By default SDK provides enum class to use as PaymentAction. Below function can be used to set action using string but remember to note that string provided must be in accordance to the enums.

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

      • setAccountBalance

         final <ERROR CLASS> setAccountBalance(Float account_balance)

        setAccountBalance is required to log the current balance of the user. Amount format should be in accordance to the currency selected.

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

      • isSuccessful

         final <ERROR CLASS> isSuccessful(Boolean is_successful)

        isSuccessful is required to log if the payment is processed successfully or not.

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