(這邊只先列出必要的參數,若想要想新增自訂欄位供User使用,都可再去擴充原本的class,先不在這邊做贅述。)
先來個pseudo code:
[HttpPost("QueryPayOrder")]
public async Task<ActionResult<OrderPayQueryReq>> QueryPayStatusAsync(OrderPayQueryReq orderInfo)
{
orderInfo = new OrderPayQueryReq()
{
//以下輸入為示意
//ShopNo="NA0249_001",
APIService = APIService.OrderPayQuery,
//Sign = "A3EAEE3B361B7E7E9B0F6422B954ECA5D54CEC6EAB0880CB484AA6FDA4154331",
//Message = "",
//Nonce = "NjM2NjA0MzI4ODIyODguMzo3NzI0ZDg4ZmI5Nzc2YzQ1MTNhYzg2MTk3NDBlYTRhNGU0N2IxM2Q2M2JkMTIwOGU5YzZhMGFmNGY5MjA5YzVm",
//PayToken = "",
};
try
{
OrderPayQueryReq result = await _orderService.PostQpayApiAsync(orderInfo, APIService.OrderPayQuery);
return result;
}
catch (Exception e)
{
//throw e;
return StatusCode(500);
}
}