示例#1
0
        public void Initialize()
        {
            //https://www.ecpay.com.tw/Content/files/ecpay_030.pdf
            //目前測試是B2C的部分
            _setting = new ECPayLogisticsSettings
            {
                MerchantID = "2000132",
                HashKey    = "5294y06JbISpM5x9",
                HashIV     = "v77hoKGq4kWxNNIS "
            };

            //initialize client
            _client = new ECPayLogisticsClient(_setting);
        }
示例#2
0
        public ECPayLogisticsClient(ECPayLogisticsSettings settings)
        {
            _webClient = new HttpClient();

            //Check setting before
            if (string.IsNullOrEmpty(settings.MerchantID) || settings.MerchantID.Length > 10)
            {
                throw new Exception("MerchantID can't be null or length > 10!");
            }
            if (string.IsNullOrEmpty(settings.HashKey) || string.IsNullOrEmpty(settings.HashIV))
            {
                throw new Exception("HashKey or HashIV can't be null or empty!");
            }

            _settings = settings;
        }