123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using SinochemPosClient;
- using SinochemPosClient.Models;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Wayne.Lib.Log;
- namespace SinochemInternetPlusApp
- {
- public class PosManager
- {
- private readonly string UrlPrefix = App.AppSettings["SinochemPosUrlPrefix"];
- private readonly string TrxNotifyApi = App.AppSettings["SinochemPosNotifyApi"];
- public TrxNotificationResponse NotifyPosSuccessfulTrx(EpsTransactionModel epsTrxModel, DebugLogger debugLogger)
- {
- PosCommunicator<TrxNotificationRequest, TrxNotificationResponse> communicator =
- new PosCommunicator<TrxNotificationRequest, TrxNotificationResponse>(UrlPrefix + TrxNotifyApi);
- TrxNotificationRequest request = new TrxNotificationRequest
- {
- ticketId = epsTrxModel.ttc,
- person = "pump",
- cardNo = epsTrxModel.card_no,
- cardType = "1",
- oilName = epsTrxModel.youpin,
- units = epsTrxModel.qty,
- price = epsTrxModel.danjia,
- totalAmount = epsTrxModel.amount,
- amount = epsTrxModel.real_pay_amount,
- oilLiuShuiNo = epsTrxModel.liushuino,
- gunNum = epsTrxModel.jihao.ToString(),
- oilTime = epsTrxModel.xf_time,
- cardDiscount = epsTrxModel.amount - epsTrxModel.real_pay_amount,
- promDiscount = 0.00,
- payMethod = "01",
- transId = epsTrxModel.bill_id
- };
- debugLogger.Add("Send TrxNotify to Pos: \n" + request.ToString());
- communicator.SendRequest(request);
- debugLogger.Add("Got TrxNotify response: " + communicator.Response?.ToString());
- return communicator.Response;
- }
- }
- }
|