package com.xty.base.vm

import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.MutableLiveData
import com.xty.network.model.PayBean
import com.xty.network.model.RespBody
import org.json.JSONObject

class PayVm : BaseVm() , LifecycleObserver {

    val payObservable by lazy { MutableLiveData<RespBody<PayBean>>() }


    fun payWatch(orderNo:String,channelName:String){
        startHttp {
            var json = JSONObject()
            json.put("orderNo", orderNo)
            json.put("channelName", channelName)

            var response = apiInterface().toPay(retrofits.getRequestBody(json.toString()))
            response.getCodeStatus(payObservable, nowData)

        }
    }
}