コード例 #1
0
        public Response SaveReceipt(string token, [FromBody] PurchaseReceiptData receiptData)
        {
            Response response = new Response();

            if (string.IsNullOrEmpty(token) || !token.Equals(_token))
            {
                response.code = "404";
                response.message = "Invild token";
            }
            else
            {
                bool status = PurchaseHelper.SavePurchaseReceipt(receiptData);
                if (status) response.code = "200";
                else
                {
                    response.code = "500";
                    response.message = "process failed";
                }
            }
            return response;
        }