package com.fs.pay.pay;


import com.fs.pay.pay.domain.*;
import com.fs.pay.pay.dto.*;
import com.fs.pay.pay.service.impl.PayApiServiceImpl;

public class test {
    public static void main(String[] args) {
        //测试
        tui();
    }

    //获取订单信息
    public static void get(){
        PayApiServiceImpl payService = new PayApiServiceImpl();
        OrderQueryDTO o = new OrderQueryDTO();
//        o.setLowOrderId("payment-1696809795736043520");
        o.setUpOrderId("91759384058468634624");
        OrderResult order = payService.getOrder(o);
        System.out.println(order);
    }


    //查询退款
    public static void getTui(){
        PayApiServiceImpl payService = new PayApiServiceImpl();
        RefundOrderDTO o = new RefundOrderDTO();
        o.setRefundNo("refund-1759384058195869696");
        QueryRefundResult refundOrder = payService.getRefundOrder(o);
        System.out.println(refundOrder);
    }
    //查询退款列表
    public static void getTuiList(){
        PayApiServiceImpl payService = new PayApiServiceImpl();
        RefundOrderListDTO o = new RefundOrderListDTO();
        o.setUpOrderId("91702858656661639168");
        QueryRefundListResult refundOrderList = payService.getRefundOrderList(o);
        System.out.println(refundOrderList);
    }

    //退款
    public static void tui(){
        PayApiServiceImpl payService = new PayApiServiceImpl();
        RefundDTO refundDTO = new RefundDTO();
        refundDTO.setLowRefundNo("refund-1769963820127617024");
        refundDTO.setUpOrderId("91769963820878532608");
        refundDTO.setRefundMoney("0.1");
        RefundResult refund = payService.refund(refundDTO);
        System.out.println(refund);
    }



    //创建微信订单
    public static void createWx(){
        PayApiServiceImpl payService = new PayApiServiceImpl();
        WxJspayDTO p = new WxJspayDTO();
        // 使用setter方法为对象赋值
        p.setPayMoney("0.01");
        p.setLowOrderId("orderWx123456121");
        p.setBody("商品描述");
        p.setIsMinipg("1");
        p.setReturnUrl("http://dp2xf5.natappfree.cc/his/pay/xcx");
        p.setOpenId("oim255fXLTU65z1u_92YSw1LwfcA");
        p.setAttach("附加信息");
        p.setStoreid("0");
        CreateWxOrderResult wxOrder = payService.createWxOrder(p);
        System.out.println(wxOrder);
    }

}
