Beispiel #1
0
        public ActionResult AlepayCallback(string transactionCode, string errorCode, string cancel)
        {
            AnperoService ws = new AnperoService();

            PaymentConfig[] pc = ws.GetPaymentAPIConfig(StoreID, TokenKey);
            if (pc != null && pc.Length > 0)
            {
                for (int i = 0; i < pc.Length; i++)
                {
                    if (pc[i].Name.ToUpper() == "AL")
                    {
                        AlepayCheckout checkout          = new AlepayCheckout();
                        var            transactionDetail = checkout.GetTransactionDetail(transactionCode, pc[i].Token, pc[i].ChecksumKey);
                        if (Convert.ToInt32(transactionDetail.code) == 0)
                        {
                            //ResponseCheckOrder result = objNLChecout.GetTransactionDetail(info);
                            string rs = "Giao dịch Thành công, đơn hàng của quý khách đang được xử lý nhanh chóng";
                            rs += "<br>";
                            rs += "Trạng thái: " + transactionDetail.reason;
                            rs += "<br>";
                            rs += "Số tiền thanh toán: " + Anpero.StringHelpper.ConVertToMoneyFormatInt(transactionDetail.amount);
                            rs += "<br>";

                            rs += "Phí thanh toán: " + Anpero.StringHelpper.ConVertToMoneyFormatInt((int)transactionDetail.payerFee);
                            rs += "<br>";
                            rs += "Mã giao dịch Alepay: " + transactionDetail.transactionCode;
                            rs += "<br>";
                            rs += "Mã đơn hàng: " + transactionDetail.orderCode;
                            rs += "<br>";
                            rs += "Tên người thanh toán: " + transactionDetail.buyerName;
                            rs += "<br>";
                            rs += "Số điện thoại: " + transactionDetail.buyerPhone;
                            rs += "<br>";
                            rs += "Chu kỳ trả góp: " + transactionDetail.month;
                            rs += "<br>";
                            rs += "Tên ngân hàng trả góp: " + transactionDetail.bankName;


                            //update and add cash book
                            ws.UpdateOrderStatus(StoreID, TokenKey, Convert.ToInt32(transactionDetail.orderCode), Convert.ToInt32(transactionDetail.amount), "Alepay (Mã giao dịch " + transactionDetail.transactionCode + ")<br />" + rs);
                            ViewBag.Msg = rs;
                        }
                    }
                }
            }

            return(View("Index"));
        }
Beispiel #2
0
        public ActionResult NLCallback(String Token)
        {
            AnperoService ws = new AnperoService();

            PaymentConfig[] pc = ws.GetPaymentAPIConfig(StoreID, TokenKey);
            if (pc != null && pc.Length > 0)
            {
                for (int i = 0; i < pc.Length; i++)
                {
                    if (pc[i].Name.ToUpper() == "NL")
                    {
                        RequestCheckOrder info = new RequestCheckOrder();
                        //for test
                        //info.Merchant_id = "24338";
                        //info.Merchant_password = "******";
                        info.Merchant_id       = pc[i].MerchantId;
                        info.Merchant_password = pc[i].MerchantPassword;
                        info.Token             = Token;
                        APICheckoutV3      objNLChecout = new APICheckoutV3();
                        ResponseCheckOrder result       = objNLChecout.GetTransactionDetail(info);
                        string             rs           = "Giao dịch Thành công, đơn hàng của quý khách đang được xử lý nhanh chóng";
                        rs += result.description;
                        rs += "<br>";
                        rs += "Số tiền thanh toán: " + result.paymentAmount;
                        rs += "<br>";
                        rs += "Mã giao dịch Ngân Lượng: " + result.transactionId;
                        rs += "<br>";
                        rs += "Mã đơn hàng: " + result.order_code;
                        rs += "<br>";
                        rs += "Tên người thanh toán: " + result.payerName;
                        //update and add cash book
                        ws.UpdateOrderStatus(StoreID, TokenKey, Convert.ToInt32(result.order_code), Convert.ToInt32(result.paymentAmount), "Ngân Lượng (Mã giao dịch Ngân Lượng " + result.transactionId + ")<br />" + rs);
                        ViewBag.Msg = rs;
                    }
                }
            }

            return(View("Index"));
        }