当前位置: 首页>>代码示例>>C#>>正文


C# Transaction.SetRequestParameter方法代码示例

本文整理汇总了C#中Transaction.SetRequestParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.SetRequestParameter方法的具体用法?C# Transaction.SetRequestParameter怎么用?C# Transaction.SetRequestParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transaction的用法示例。


在下文中一共展示了Transaction.SetRequestParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process

        public VoidPaymentResponse Process(VoidPaymentRequest request)
        {
            Transaction tx = new Transaction();

            tx.TestMode = request.Test;

            tx.SetRequestParameter("VPSProtocol", "3.00");
            tx.SetRequestParameter("TxType", "VOID");

            tx.SetRequestParameter("Vendor", request.Vendor);
            tx.SetRequestParameter("VendorTxCode", request.VendorTxCode);
            tx.SetRequestParameter("VPSTxId", request.VPSTxId);
            tx.SetRequestParameter("SecurityKey", request.SecurityKey);
            tx.SetRequestParameter("TxAuthNo", request.TxAuthNo);

            tx.SendVoid();

            // Receive Response
            var response = new VoidPaymentResponse();

            response.VPSProtocol = tx.GetResponseParameter("VPSProtocol");
            response.TxType = "VOID";

            response.Status = tx.GetResponseParameter("Status");
            response.StatusDetail = tx.GetResponseParameter("StatusDetail");

            if (!String.IsNullOrEmpty(response.StatusDetail))
                response.StatusDetail = response.StatusDetail.Replace("'", "`");

            return response;
        }
开发者ID:richardys,项目名称:SagePay.Net,代码行数:31,代码来源:VoidPayment.cs

示例2: Process

        public RefundPaymentResponse Process(RefundPaymentRequest request)
        {
            Transaction tx = new Transaction();

            tx.TestMode = request.Test;

            tx.SetRequestParameter("VPSProtocol", "3.00");
            tx.SetRequestParameter("TxType", "REFUND");

            tx.SetRequestParameter("Vendor", request.Vendor);
            tx.SetRequestParameter("VendorTxCode", request.VendorTxCode);

            tx.SetRequestParameter("Amount", request.Amount.ToString());
            tx.SetRequestParameter("Currency", request.Currency);
            tx.SetRequestParameter("Description", request.Description);

            tx.SetRequestParameter("RelatedVPSTxId", request.RelatedVPSTxId);
            tx.SetRequestParameter("RelatedVendorTxCode", request.RelatedVendorTxCode);
            tx.SetRequestParameter("RelatedSecurityKey", request.RelatedSecurityKey);
            tx.SetRequestParameter("RelatedTxAuthNo", request.RelatedTxAuthNo);

            tx.SendRefund();

            // Receive Response
            var response = new RefundPaymentResponse();

            response.VPSProtocol = tx.GetResponseParameter("VPSProtocol");
            response.TxType = "REFUND";

            response.Status = tx.GetResponseParameter("Status");
            response.StatusDetail = tx.GetResponseParameter("StatusDetail");
            response.VpsTxId = tx.GetResponseParameter("VPSTxID");
            response.TxAuthNo = tx.GetResponseParameter("TxAuthNo");

            if (!String.IsNullOrEmpty(response.StatusDetail))
                response.StatusDetail = response.StatusDetail.Replace("'", "`");

            return response;
        }
开发者ID:richardys,项目名称:SagePay.Net,代码行数:39,代码来源:RefundPayment.cs

示例3: Process

        public NewPaymentResponse Process(NewPaymentRequest request)
        {
            Transaction tx = new Transaction();

            tx.TestMode = request.Test;

            tx.SetRequestParameter("VPSProtocol", "3.00");
            tx.SetRequestParameter("TxType", "PAYMENT");

            tx.SetRequestParameter("Vendor", request.Vendor);
            tx.SetRequestParameter("VendorTxCode", request.VendorTxCode);

            tx.SetRequestParameter("Amount", request.Amount.ToString());
            tx.SetRequestParameter("Currency", request.Currency);
            tx.SetRequestParameter("Description", request.Description);
            tx.SetRequestParameter("CardHolder", request.CardHolder);
            tx.SetRequestParameter("CardNumber", request.CardNumber);
            tx.SetRequestParameter("ExpiryDate", request.ExpiryDate);
            tx.SetRequestParameter("CV2", request.CV2);
            tx.SetRequestParameter("CardType", request.CardType);
            tx.SetRequestParameter("CustomerName", request.CustomerName);

            tx.SetRequestParameter("BillingSurname", request.BillingSurname);
            tx.SetRequestParameter("BillingFirstnames", request.BillingFirstnames);            
            tx.SetRequestParameter("BillingAddress1", request.BillingAddress1);
            tx.SetRequestParameter("BillingAddress2", request.BillingAddress2);
            tx.SetRequestParameter("BillingCity", request.BillingCity);
            tx.SetRequestParameter("BillingPostCode", request.BillingPostCode);
            if (request.BillingCountry == "US" & !String.IsNullOrEmpty(request.BillingState))       tx.SetRequestParameter("BillingState", request.BillingState);            
            tx.SetRequestParameter("BillingCountry", request.BillingCountry);
            tx.SetRequestParameter("BillingPhone", request.BillingPhone);

            tx.SetRequestParameter("DeliverySurname", request.DeliverySurname);
            tx.SetRequestParameter("DeliveryFirstnames", request.DeliveryFirstnames);            
            tx.SetRequestParameter("DeliveryAddress1", request.DeliveryAddress1);
            tx.SetRequestParameter("DeliveryAddress2", request.DeliveryAddress2);
            tx.SetRequestParameter("DeliveryCity", request.DeliveryCity);
            tx.SetRequestParameter("DeliveryPostCode", request.DeliveryPostCode);
            if (request.DeliveryCountry == "US" & !String.IsNullOrEmpty(request.DeliveryState))     tx.SetRequestParameter("DeliveryState", request.DeliveryState);            
            tx.SetRequestParameter("DeliveryCountry", request.DeliveryCountry);
            tx.SetRequestParameter("DeliveryPhone", request.DeliveryPhone);

            tx.SetRequestParameter("CustomerEmail", request.CustomerEmail);            
            tx.SetRequestParameter("ApplyAVSCV2", request.ApplyAVSCV2);
            tx.SetRequestParameter("ClientIPAddress", request.ClientIPAddress);
            tx.SetRequestParameter("Apply3DSecure", request.Apply3DSecure);
            tx.SetRequestParameter("AccountType", request.AccountType);
            tx.SetRequestParameter("BillingAgreement", request.BillingAgreement ? "1" : "0");
            tx.SetRequestParameter("CreateToken", request.CreateToken ? "1" : "0");
            tx.SetRequestParameter("StoreToken", request.StoreToken ? "1" : "0");
            tx.SetRequestParameter("Basket", request.BasketXML);
            tx.SetRequestParameter("Website", request.Website);

            tx.SendPayment();

            // Receive Response
            var response = new NewPaymentResponse();

            response.VPSProtocol = tx.GetResponseParameter("VPSProtocol");
            response.TxType = "PAYMENT";

            response.VpsTxId = tx.GetResponseParameter("VPSTxID");
            response.SecurityKey = tx.GetResponseParameter("SecurityKey");
            response.Status = tx.GetResponseParameter("Status");
            response.StatusDetail = tx.GetResponseParameter("StatusDetail");
            response.TxAuthNo = tx.GetResponseParameter("TxAuthNo");

            response.Cavv = tx.GetResponseParameter("CAVV");
            response.Md = tx.GetResponseParameter("MD");
            response.AcsUrl = tx.GetResponseParameter("ACSURL");
            response.PaReq = tx.GetResponseParameter("PAReq");

            response.AvsCv2 = tx.GetResponseParameter("AVSCV2");
            response.AddressResult = tx.GetResponseParameter("AddressResult");
            response.PostCodeResult = tx.GetResponseParameter("PostCodeResult");
            response.Cv2Result = tx.GetResponseParameter("CV2Result");
            response.Status3dSecure = tx.GetResponseParameter("3DSECURESTATUS");

            if (!String.IsNullOrEmpty(response.StatusDetail))
                response.StatusDetail = response.StatusDetail.Replace("'", "`");

            return response;
        }
开发者ID:richardys,项目名称:SagePay.Net,代码行数:83,代码来源:NewPayment.cs

示例4: Process

        public RepeatPaymentResponse Process(RepeatPaymentRequest request)
        {
            Transaction tx = new Transaction();

            tx.TestMode = request.Test;

            tx.SetRequestParameter("VPSProtocol", "3.00");
            tx.SetRequestParameter("TxType", "REPEAT");

            tx.SetRequestParameter("Vendor", request.Vendor);
            tx.SetRequestParameter("VendorTxCode", request.VendorTxCode);

            tx.SetRequestParameter("Amount", request.Amount.ToString());
            tx.SetRequestParameter("Currency", request.Currency);
            tx.SetRequestParameter("Description", request.Description);

            tx.SetRequestParameter("RelatedVPSTxId", request.RelatedVPSTxId);
            tx.SetRequestParameter("RelatedVendorTxCode", request.RelatedVendorTxCode);
            tx.SetRequestParameter("RelatedSecurityKey", request.RelatedSecurityKey);
            tx.SetRequestParameter("RelatedTxAuthNo", request.RelatedTxAuthNo);

            tx.SendRepeatPayment();

            // Receive Response
            var response = new RepeatPaymentResponse();

            response.VPSProtocol = tx.GetResponseParameter("VPSProtocol");
            response.TxType = "REPEAT";

            response.Status = tx.GetResponseParameter("Status");
            response.StatusDetail = tx.GetResponseParameter("StatusDetail");
            response.VpsTxId = tx.GetResponseParameter("VPSTxID");
            response.SecurityKey = tx.GetResponseParameter("SecurityKey");
            response.TxAuthNo = tx.GetResponseParameter("TxAuthNo");

            response.AvsCv2 = tx.GetResponseParameter("AVSCV2");
            response.AddressResult = tx.GetResponseParameter("AddressResult");
            response.PostCodeResult = tx.GetResponseParameter("PostCodeResult");
            response.Cv2Result = tx.GetResponseParameter("CV2Result");

            response.BankAuthCode = tx.GetResponseParameter("BankAuthCode");
            response.DeclineCode = tx.GetResponseParameter("DeclineCode");

            if (!String.IsNullOrEmpty(response.StatusDetail))
                response.StatusDetail = response.StatusDetail.Replace("'", "`");

            return response;
        }
开发者ID:richardys,项目名称:SagePay.Net,代码行数:48,代码来源:RepeatPayment.cs


注:本文中的Transaction.SetRequestParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。