import { ref, unref} from "vue";
import {useRouter} from "@/hooks/useRouter";

export function usePay() {
    const payPopupRef = ref()
    const { push } = useRouter()

    function openPay(orderId) {
        unref(payPopupRef).show(orderId)
    }


    function paySuccess() {
        push({url: '/pages/payStatus/index?type=1'})
    }

    return {
        payPopupRef,
        openPay,
        paySuccess
    }
}
