package org.ta.pddserver;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.ta.pddserver.model.enums.IdentityErrorType;
import org.ta.pddserver.utils.WorldexUtil;

import java.util.HashMap;
import java.util.Map;

@Slf4j
public class WordexAPITest {
    private static final String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiIsImtpZCI6ImtleUlkIn0.eyJpc3MiOiJhcGkud29ybGRleC5rciIsImF1ZCI6InVzZXIiLCJzdWIiOiJ0b2tlbiIsImp0aSI6ImhqcGRkankiLCJpYXQiOjE3NjE4MTI0ODEsIm5iZiI6MTc2MTgxMjQyMSwiZXhwIjoxNzYxODg0NDgxfQ.xeukpmS86euu44XzyQ8USM2tMCdXIqCXhjoe1QrpgcB2O5dHkY3_ixAWNmL2c7SnDOWL0kHanLX-h668zDQiHQ";

    @Test
    public void testLogin() {
        JSONObject jsonObject = WorldexUtil.login();
        if (jsonObject != null) {
            String token = jsonObject.getString("token");
            log.info("token:{}", token);
            return;
        }
        log.error("login failed");

        //
    }

    @org.junit.Test
    public void verify() {
        org.ta.pddserver.model.enums.IdentityErrorType type = WorldexUtil.verifyIdentity("KIM OKSANA", "01065354555", "P200000801351");
        log.info("type:{}", type);
    }

    @Test
    public void noticePddOrderOut() {
        WorldexUtil.noticePddOrderOut("PP26010402873517676929454-1");
//        WorldexUtil.noticePddOrderOut("PP26010205944167635732568-1");
//        WorldexUtil.noticePddOrderOut("PP26010220645203155256157-1");
//        WorldexUtil.noticePddOrderOut("PP26010220645203155256157-2");

    }
}
