public async Task <HttpResponseMessage> test() { var sp = new StorePickup { MerchantID = "2000132", GoodsAmount = 110, IsCollection = "N", LogisticsSubType = "UNIMART", LogisticsType = "CVS", MerchantTradeDate = $"{DateTime.Now.ToString()}", ReceiverCellPhone = "0983337029", ReceiverName = "Superuser", ReceiverStoreID = "991182", SenderCellPhone = "0912345678", SenderName = "六加天", SenderPhone = "041234567", ServerReplyURL = "http://example.com", HashKey = "5294y06JbISpM5x9", HashIV = "v77hoKGq4kWxNNIS", PlatformID = "" }; _storePickup.EnableSecurityProtocol = true; var html = await _storePickup.PostAsyncForECPay(ECPayTestURL.SHIPPING_ORDER, sp); var result = ObjectConvert <StatusNotification> .QueryStringToJson(html.Response); return(Request.CreateResponse(new { result })); }
public async Task <HttpResponseMessage> StorePickup(int orderId, StorePickup value) { //預設值 不能做更改 value.MerchantID = Merchant.MerchantID; value.HashKey = Merchant.HashKey; value.HashIV = Merchant.HashIV; value.SenderName = Merchant.SenderName; value.SenderPhone = Merchant.SenderPhone; value.SenderCellPhone = Merchant.SenderCellphone; value.MerchantTradeDate = DateTime.Now.ToString(); value.IsCollection = Merchant.IsCollection ? "Y" : "N"; value.ServerReplyURL = $"{Http}://{Host}/api/ECPay/ECPay/Message?orderId={orderId}"; _storePickup.EnableSecurityProtocol = true; var request = await _storePickup.PostAsyncForECPay(Links.Create, value); if (request.Success) { if (request.Response.Substring(0, 1) != "0" && request.Response.Substring(0, 2) != "10") { var json = ObjectConvert <StatusNotification> .QueryStringToJson(request.Response); if (json.RtnCode == 300) { string info = await TradeInfo(json); if (int.TryParse(info, out int temp)) { _orderRepository.UpdateOrder(orderId, json.AllPayLogisticsID, "080", temp); } var ptd = new PrintTradeDocument { MerchantID = Merchant.MerchantID, AllPayLogisticsID = json.AllPayLogisticsID, PlatformID = "", HashKey = Merchant.HashKey, HashIV = Merchant.HashIV }; string printHtml = _tradeDocument.PrintForECPay(Links.TradeDocument, ptd); return(Request.CreateResponse(new { html = printHtml })); } else { return(Request.CreateResponse(new { message = json.RtnMsg })); } } else { return(Request.CreateResponse(new { message = request.Response })); } } else { return(Request.CreateResponse(new { message = request.Message })); } }
// Start is called before the first frame update void Awake() { instance = this; StorePickup storeSkill1Script = storeSkill1.GetComponent <StorePickup>(); StorePickup storeSkill2Script = storeSkill2.GetComponent <StorePickup>(); storeSkill1Script.skill.skillPrice = storeSkill1Script.price; storeSkill2Script.skill.skillPrice = storeSkill2Script.price; }