本文整理汇总了C#中Nop.Services.Payments.PostProcessPaymentRequest类的典型用法代码示例。如果您正苦于以下问题:C# PostProcessPaymentRequest类的具体用法?C# PostProcessPaymentRequest怎么用?C# PostProcessPaymentRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PostProcessPaymentRequest类属于Nop.Services.Payments命名空间,在下文中一共展示了PostProcessPaymentRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
int reffNumber = postProcessPaymentRequest.Order.Id;
if (_bPayPaymentSettings.RefNumberBaseOn.Equals("CustomerNumber", StringComparison.InvariantCultureIgnoreCase))
{
reffNumber = postProcessPaymentRequest.Order.CustomerId;
}
//Generate BPAY CRN
string bPayReff = BPayHelper.GenerateBPayCRN(reffNumber.ToString());
var order = _orderService.GetOrderById(postProcessPaymentRequest.Order.Id);
if (order != null)
{
var sb = new StringBuilder();
sb.AppendLine("BPay Payment Detail:");
sb.AppendLine("Biller Code: "+ _bPayPaymentSettings.BillerCode);
sb.AppendLine("Ref : " + bPayReff);
//order note
order.OrderNotes.Add(new OrderNote()
{
Note = sb.ToString(),
DisplayToCustomer = true,
CreatedOnUtc = DateTime.UtcNow
});
_orderService.UpdateOrder(order);
}
}
示例2: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
/// public void
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
//Todo: اگر مشخصات اولیه درگاه ثبت نشده باشد، نباید خطا داشته باشیم.
var order = postProcessPaymentRequest.Order;
#region [Call bpMellat Web Service]
var orderTotal = Math.Round(order.OrderTotal, 2);
var mellatOrderId = _mellatPaymentSettings.OrderId;
var terminalId = _mellatPaymentSettings.TerminalId;
var userName = _mellatPaymentSettings.UserName;
var userPassword = _mellatPaymentSettings.UserPassword;
var price = Convert.ToInt64(orderTotal);
const string description = "خرید از بازار اینترنتی";
var callBackUrl = _webHelper.GetStoreLocation(false)
+ "Plugins/PaymentMellat/CallBack?OrderId="
+ order.Id;
do
{
BypassCertificateError();
var payDate = DateTime.Now.Year +
DateTime.Now.Month.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0') +
DateTime.Now.Day.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0');
var payTime = DateTime.Now.Hour.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0') +
DateTime.Now.Minute.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0') +
DateTime.Now.Second.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0');
var bpService = new ir.shaparak.bpm.PaymentGatewayImplService();
var result = bpService.bpPayRequest(Int64.Parse(terminalId),
userName,
userPassword,
mellatOrderId,
price,
payDate,
payTime,
description,
callBackUrl,
0);
string url, comment;
var resultArray = result.Split(',');
if (resultArray[0] == "0") // آماده برای انتقال به بانک
{
order.CaptureTransactionId = mellatOrderId.ToString(CultureInfo.InvariantCulture);
_orderService.UpdateOrder(order);
UpdateOrderId(++mellatOrderId, null);
url = (_webHelper.GetStoreLocation(false)
+ "Plugins/PaymentMellat/Pay?result="
+ resultArray[1]);
_httpContext.Response.Redirect(url, true);
}
switch (result)
{
case "41": // Order Id Already Exist
mellatOrderId++;
break;
case "421":// Invalid IP
comment = Utility.ErrorCode("bpPayRequest", result);
url = (_webHelper.GetStoreLocation(false)
+ string.Format("Plugins/PaymentMellat/Error?result={0}&cashRefId={1}&insRefId={2}&cachOrder={3}&insOrder={4}&id={5}"
, comment, "", "", mellatOrderId, "", order.Id));
_httpContext.Response.Redirect(url, true);
break;
default: // Other Errors
comment = Utility.ErrorCode("bpPayRequest");
url = (_webHelper.GetStoreLocation(false)
+ string.Format("Plugins/PaymentMellat/Error?result={0}&cashRefId={1}&insRefId={2}&cachOrder={3}&insOrder={4}&id={5}"
, comment, "", "", mellatOrderId, "", order.Id));
_httpContext.Response.Redirect(url, true);
break;
}
}
while (true);
#endregion
}
示例3: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
//��ѯ��֧���Ƿ����
WxPayApi.OrderQuery()
string service = "create_direct_pay_by_user";
string seller_email = _weixinPayPaymentSettings.SellerEmail;
string sign_type = "MD5";
string key = _weixinPayPaymentSettings.Key;
string partner = _weixinPayPaymentSettings.Partner;
string input_charset = "utf-8";
string show_url = _webHelper.GetStoreLocation(false);
string out_trade_no = postProcessPaymentRequest.Order.OrderGuid.ToString();
string subject = string.IsNullOrEmpty(_weixinPayPaymentSettings.InvoiceSubject) ? _storeContext.CurrentStore.Name : _weixinPayPaymentSettings.InvoiceSubject;
//string body = _weixinPayPaymentSettings.InvoiceBody;
string body = "";
foreach (var item in postProcessPaymentRequest.Order.OrderItems)
{
if (item.Product.Name.Length > 100)
body += item.Product.Name.Substring(0, 100) + "...,";
else
body += item.Product.Name + ",";
}
body = body.Substring(0, body.Length - 1);
if (body.Length > 999)
{
body = body.Substring(0, 996) + "...";
}
string total_fee = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
string notify_url = _webHelper.GetStoreLocation(false) + "Plugins/PaymentWeiXinPay/Notify";
string return_url = _webHelper.GetStoreLocation(false) + "Plugins/PaymentWeiXinPay/Return";
var paymethod = "directPay"; //bankPay:����֧���� directPay:֧������ʱ����
var defaultBank = "";
var customInfo = postProcessPaymentRequest.Order.DeserializeCustomValues();
if (customInfo != null && customInfo.Count > 0)
{
if (customInfo.ContainsKey(WeiXinPayPaymentSystemNames.SelectedAlipayPayMethod))
{
paymethod = customInfo[WeiXinPayPaymentSystemNames.SelectedAlipayPayMethod].ToString();
if (!string.IsNullOrEmpty(paymethod) && paymethod != WeiXinPayPaymentSystemNames.DirectPay)
{
//Ĭ������
defaultBank = paymethod;//������ݵ�paymethod������directPay,���ʾʹ������֧����paymethod��ʾ���б���
//Ĭ��֧����ʽ
paymethod = WeiXinPayPaymentSystemNames.BankPay;
}
}
}
IList<string> paraList = new List<string>();
paraList.Add("service=" + service);
paraList.Add("partner=" + partner);
paraList.Add("seller_email=" + seller_email);
paraList.Add("out_trade_no=" + out_trade_no);
paraList.Add("subject=" + subject);
paraList.Add("body=" + body);
paraList.Add("total_fee=" + total_fee);
paraList.Add("show_url=" + show_url);
paraList.Add("return_url=" + return_url);
paraList.Add("notify_url=" + notify_url);
paraList.Add("payment_type=1");
paraList.Add("paymethod=" + paymethod);
if (!string.IsNullOrEmpty(defaultBank))
{
paraList.Add("defaultbank=" + defaultBank);
}
paraList.Add("_input_charset=" + input_charset);
string aliay_url = CreatUrl(
paraList.ToArray(),
input_charset,
key
);
var post = new RemotePost();
post.FormName = "weixinpaysubmit";
post.Url = "https://mapi.weixinpay.com/gateway.do?_input_charset=utf-8";
post.Method = "POST";
post.Add("service", service);
post.Add("partner", partner);
post.Add("seller_email", seller_email);
post.Add("out_trade_no", out_trade_no);
post.Add("subject", subject);
post.Add("body", body);
post.Add("total_fee", total_fee);
post.Add("show_url", show_url);
post.Add("return_url", return_url);
post.Add("notify_url", notify_url);
//.........这里部分代码省略.........
示例4: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
// we don't use this
}
示例5: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
var builder = new StringBuilder();
var helper = new PaymentExpressHelper(_PaymentExpressPaymentSettings.PxUrl, _PaymentExpressPaymentSettings.PxUserId, _PaymentExpressPaymentSettings.PxPassword);
RequestInput input = new RequestInput();
input.AmountInput = postProcessPaymentRequest.Order.OrderTotal.ToString("F");
input.CurrencyInput = _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode;
input.MerchantReference = postProcessPaymentRequest.Order.Id.ToString();
input.TxnType = "Purchase";
input.UrlFail = _webHelper.GetStoreLocation(false) + "Plugins/PaymentPaymentExpress/CancelOrder";
input.UrlSuccess = _webHelper.GetStoreLocation(false) + "Plugins/PaymentPaymentExpress/PaymentComplete";
input.TxnId = postProcessPaymentRequest.Order.Id.ToString();
RequestOutput output = helper.GenerateRequest(input);
if (output.valid == "1")
{
// Redirect user to payment page
_httpContext.Response.Redirect(output.Url);
}
else
{
string errorStr = string.Format("Failed to process Payment Express request. Message {0}", output.URI);
_logger.Error(errorStr);
throw new Exception("There was an issue connecting with our Payment Provider.");
}
}
示例6: ConfirmFastCheckout
public ActionResult ConfirmFastCheckout(CheckoutDTO checkoutInfo)
{
checkoutInfo.UpdateShippingMethod();
var customer = _workContext.CurrentCustomer;
#region validation
//validation
var cart = customer.ShoppingCartItems.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart).ToList();
if (cart.Count == 0)
throw new Exception("Your cart is empty");
if (!UseOnePageCheckout())
throw new Exception("One page checkout is disabled");
if ((customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed))
throw new Exception("Anonymous checkout is not allowed");
//prevent 2 orders being placed within an X seconds time frame
if (!IsMinimumOrderPlacementIntervalValid(customer))
throw new Exception(_localizationService.GetResource("Checkout.MinOrderPlacementInterval"));
#endregion
// 1. SaveBilling
customer.SetBillingAddress(null);
// 2. Shipping Address
if (checkoutInfo.ShippingMethod == ShippingType.courier)
{
Address addressForShipping;
string addr = checkoutInfo.Address.Trim();
Address existingAddress = customer.Addresses.FirstOrDefault(a => a.Address1.Trim().Equals(addr, StringComparison.CurrentCultureIgnoreCase));
if (existingAddress == null)
{
addressForShipping = new Address
{
CreatedOnUtc = DateTime.UtcNow,
Address1 = checkoutInfo.Address,
PhoneNumber = checkoutInfo.MobilePhone,
Email = customer.Email
};
customer.AddAddress(addressForShipping);
}
else
{
addressForShipping = existingAddress;
}
customer.SetShippingAddress(addressForShipping);
}
//3. Shipping method
var shippingOptions = _shippingService.GetShippingOptions(cart, _workContext.CurrentCustomer.ShippingAddress, "Shipping.FixedRate");
var shippingMethod = checkoutInfo.ShippingMethod == ShippingType.courier ? shippingOptions.ShippingOptions[1] : shippingOptions.ShippingOptions[0];
_customerService.SaveCustomerAttribute<ShippingOption>(customer, SystemCustomerAttributeNames.LastShippingOption, shippingMethod);
// 4. Payment method
string paymentMethodSysName = "Payments.CashOnDelivery";
customer.SelectedPaymentMethodSystemName = paymentMethodSysName;
_customerService.UpdateCustomer(_workContext.CurrentCustomer);
// Ordering...
IPaymentMethod paymentMethod = _paymentService.LoadPaymentMethodBySystemName(paymentMethodSysName);
var paymentControllerType = paymentMethod.GetControllerType();
var paymentController = DependencyResolver.Current.GetService(paymentControllerType) as BaseNopPaymentController;
var processPaymentRequest = paymentController.GetPaymentInfo(new FormCollection());
processPaymentRequest.CustomerId = customer.Id;
processPaymentRequest.PaymentMethodSystemName = customer.SelectedPaymentMethodSystemName;
var placeOrderResult = _orderProcessingService.PlaceOrder(processPaymentRequest);
var order = placeOrderResult.PlacedOrder;
if (placeOrderResult.Success)
{
var postProcessPaymentRequest = new PostProcessPaymentRequest()
{
Order = order
};
_paymentService.PostProcessPayment(postProcessPaymentRequest);
}
else
{
throw new Exception("Не удалось создать заказ.");
}
// Add comments: Note and Modile Phone
if (!string.IsNullOrWhiteSpace(checkoutInfo.Comments))
{
order.OrderNotes.Add(new OrderNote
{
Note = checkoutInfo.Comments,
DisplayToCustomer = true,
CreatedOnUtc = DateTime.UtcNow
});
}
//.........这里部分代码省略.........
示例7: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
var myUtility = new PayuHelper();
var orderId= postProcessPaymentRequest.Order.Id;
var remotePostHelper = new RemotePost();
remotePostHelper.FormName = "PayuForm";
remotePostHelper.Url = _PayuPaymentSettings.PayUri;
remotePostHelper.Add("key", _PayuPaymentSettings.MerchantId.ToString());
remotePostHelper.Add("amount", postProcessPaymentRequest.Order.TotalTransactionAmount.ToString(new CultureInfo("en-US", false).NumberFormat));
remotePostHelper.Add("productinfo", "productinfo");
remotePostHelper.Add("Currency", _currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId).CurrencyCode);
remotePostHelper.Add("Order_Id", orderId.ToString());
remotePostHelper.Add("txnid", postProcessPaymentRequest.Order.OrderGuid.ToString());
remotePostHelper.Add("surl", _webHelper.GetStoreLocation(true) + "PaymentPayu/Return");
remotePostHelper.Add("furl", _webHelper.GetStoreLocation(true) + "PaymentPayu/Return");
remotePostHelper.Add("hash", myUtility.getchecksum(_PayuPaymentSettings.MerchantId.ToString(),
postProcessPaymentRequest.Order.OrderGuid.ToString(), postProcessPaymentRequest.Order.TotalTransactionAmount.ToString(new CultureInfo("en-US", false).NumberFormat),
"productinfo",postProcessPaymentRequest.Order.BillingAddress.FirstName.ToString(),
postProcessPaymentRequest.Order.BillingAddress.Email.ToString(),_PayuPaymentSettings.Key));
//Billing details
remotePostHelper.Add("firstname", postProcessPaymentRequest.Order.BillingAddress.FirstName.ToString());
remotePostHelper.Add("billing_cust_address", postProcessPaymentRequest.Order.BillingAddress.Address1);
remotePostHelper.Add("phone", postProcessPaymentRequest.Order.BillingAddress.PhoneNumber);
remotePostHelper.Add("email", postProcessPaymentRequest.Order.BillingAddress.Email.ToString());
remotePostHelper.Add("billing_cust_city", postProcessPaymentRequest.Order.BillingAddress.City);
var billingStateProvince = postProcessPaymentRequest.Order.BillingAddress.StateProvince;
if (billingStateProvince != null)
remotePostHelper.Add("billing_cust_state", billingStateProvince.Abbreviation);
else
remotePostHelper.Add("billing_cust_state", "");
remotePostHelper.Add("billing_zip_code", postProcessPaymentRequest.Order.BillingAddress.ZipPostalCode);
var billingCountry = postProcessPaymentRequest.Order.BillingAddress.Country;
if (billingCountry != null)
remotePostHelper.Add("billing_cust_country", billingCountry.ThreeLetterIsoCode);
else
remotePostHelper.Add("billing_cust_country", "");
//Delivery details
if (postProcessPaymentRequest.Order.ShippingStatus != ShippingStatus.ShippingNotRequired)
{
remotePostHelper.Add("delivery_cust_name", postProcessPaymentRequest.Order.ShippingAddress.FirstName);
remotePostHelper.Add("delivery_cust_address", postProcessPaymentRequest.Order.ShippingAddress.Address1);
remotePostHelper.Add("delivery_cust_notes", string.Empty);
remotePostHelper.Add("delivery_cust_tel", postProcessPaymentRequest.Order.ShippingAddress.PhoneNumber);
remotePostHelper.Add("delivery_cust_city", postProcessPaymentRequest.Order.ShippingAddress.City);
var deliveryStateProvince = postProcessPaymentRequest.Order.ShippingAddress.StateProvince;
if (deliveryStateProvince != null)
remotePostHelper.Add("delivery_cust_state", deliveryStateProvince.Abbreviation);
else
remotePostHelper.Add("delivery_cust_state", "");
remotePostHelper.Add("delivery_zip_code", postProcessPaymentRequest.Order.ShippingAddress.ZipPostalCode);
var deliveryCountry = postProcessPaymentRequest.Order.ShippingAddress.Country;
if (deliveryCountry != null)
remotePostHelper.Add("delivery_cust_country", deliveryCountry.ThreeLetterIsoCode);
else
remotePostHelper.Add("delivery_cust_country", "");
}
// remotePostHelper.Add("Merchant_Param", _PayuPaymentSettings.MerchantParam);
remotePostHelper.Post();
}
示例8: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
RemotePost post = new RemotePost();
post.FormName = "chinabanksubmit";
post.Url = "https://pay3.chinabank.com.cn/PayGate";
post.Method = "POST";
//��Ҫ�Ľ�����Ϣ
string v_amount; // �������
string v_moneytype; // ����
string v_md5info; // ��ƴ�մ�MD5˽Կ���ܺ��ֵ
string v_mid; // �̻���
string v_url; // ����ҳ��ַ
string v_oid; // �Ƽ������Ź��ɸ�ʽΪ ������-�̻���-Сʱ������
//�ջ���Ϣ
string v_rcvname; // �ջ���
string v_rcvaddr; // �ջ���ַ
string v_rcvtel; // �ջ��˵绰
string v_rcvpost; // �ջ����ʱ�
string v_rcvemail; // �ջ����ʼ�
string v_rcvmobile; // �ջ����ֻ���
//��������Ϣ
string v_ordername; // ����������
string v_orderaddr; // �����˵�ַ
string v_ordertel; // �����˵绰
string v_orderpost; // �������ʱ�
string v_orderemail; // �������ʼ�
string v_ordermobile; // �������ֻ���
//������ע
string remark1;
string remark2;
v_mid = _chinabankPayPaymentSettings.Vmid;
v_url = _webHelper.GetStoreLocation(false) + "Plugins/PaymentChinabank/Notify";
string key = _chinabankPayPaymentSettings.Key;
v_oid = postProcessPaymentRequest.Order.Id.ToString();
if (v_oid == null || v_oid.Equals(""))
{
DateTime dt = DateTime.Now;
string v_ymd = dt.ToString("yyyyMMdd"); // yyyyMMdd
string timeStr = dt.ToString("HHmmss"); // HHmmss
v_oid = v_ymd + v_mid + timeStr;
}
v_amount = postProcessPaymentRequest.Order.OrderTotal.ToString("0.00", CultureInfo.InvariantCulture);
v_moneytype = "CNY";
string text = v_amount + v_moneytype + v_oid + v_mid + v_url + key; // ƴ�ռ��ܴ�
v_md5info = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(text, "md5").ToUpper();
//�ջ���Ϣ
v_rcvname = String.Empty;
v_rcvaddr = postProcessPaymentRequest.Order.BillingAddress.Address1;
v_rcvtel = postProcessPaymentRequest.Order.BillingAddress.PhoneNumber;
v_rcvpost = postProcessPaymentRequest.Order.BillingAddress.ZipPostalCode;
v_rcvemail = postProcessPaymentRequest.Order.BillingAddress.Email;
v_rcvmobile = postProcessPaymentRequest.Order.BillingAddress.PhoneNumber;
//��������Ϣ
v_ordername = String.Empty;
v_orderaddr = postProcessPaymentRequest.Order.ShippingAddress.Address1;
v_ordertel = postProcessPaymentRequest.Order.ShippingAddress.PhoneNumber;
v_orderpost = postProcessPaymentRequest.Order.ShippingAddress.ZipPostalCode;
v_orderemail = postProcessPaymentRequest.Order.ShippingAddress.Email;
v_ordermobile = postProcessPaymentRequest.Order.ShippingAddress.PhoneNumber;
//������Ϣ
remark1 = "";
remark2 = "";
post.Add("v_md5info", v_md5info);
post.Add("v_mid", v_mid);
post.Add("v_oid", v_oid);
post.Add("v_amount", v_amount);
post.Add("v_moneytype", v_moneytype);
post.Add("v_url", v_url);
post.Add("v_rcvname", v_rcvname);
post.Add("v_rcvaddr", v_rcvaddr);
post.Add("v_rcvtel", v_rcvtel);
post.Add("v_rcvpost", v_rcvpost);
post.Add("v_rcvemail", v_rcvemail);
post.Add("v_rcvmobile", v_rcvmobile);
post.Add("v_ordername", v_ordername);
post.Add("v_orderaddr", v_orderaddr);
post.Add("v_ordertel", v_ordertel);
post.Add("v_orderpost", v_orderpost);
post.Add("v_orderemail", v_orderemail);
post.Add("v_ordermobile", v_ordermobile);
post.Add("remark1", remark1);
post.Add("remark2", remark2);
post.Post();
}
示例9: PostProcessPayment
//.........这里部分代码省略.........
// // Stting Customer Details
// // Order of Parameters => First Name,LastName ,Office Address Object,Home Address Object,Mobile No,RegistrationDate, flag for matching bill to address and ship to address
// oCustomer.setCustomerDetails(postProcessPaymentRequest.Order.Customer.SystemName, "", oOfficeAddress, oHomeAddress, "", "13-06-2007", "Y");
// //Setting Merchant Dise Details
// // Order of Parameters => Item Purchased,Quantity,Brand,ModelNumber,Buyers Name,flag value for matching CardName and BuyerName
// oMerchanDise.setMerchanDiseDetails("Computer", "2", "Intel", "P4", "Sandeep Patil", "Y");
// //Setting Session Details
// // Order of Parameters => Remote Address, Cookies Value Browser Country,Browser Local Language,Browser Local Lang Variant,Browser User Agent'
// oSession.setSessionDetails(getRemoteAddr(), getSecureCookie(HttpContext.Current.Request), "", HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"], "", HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"]);
// //Settingr AirLine Transaction Details
// //Order of Parameters => Booking Date,FlightDate,Flight Time,Flight Number,Passenger Name,Number Of Tickets,flag for matching card name and customer name,PNR,sector from,sector to'
// oAirLine.setAirLineTransactionDetails("10-06-2007", "22-06-2007", "13:20", "119", "Sandeep", "1", "Y", "25c", "Pune", "Mumbai");
// SFAClient objSFAClient = new SFAClient("c:\\inetpub\\wwwroot\\SFAClient\\Config\\");
// objPGResponse = objSFAClient.postSSL(objMPI, objMerchant, oBillToAddress, oShipToAddress, oPGreservData, oCustomer, oSession, oAirLine, oMerchanDise);
// if (objPGResponse.RedirectionUrl != "" & objPGResponse.RedirectionUrl != null)
// {
// string strResponseURL = objPGResponse.RedirectionUrl;
// HttpContext.Current.Response.Redirect(strResponseURL);
// }
// else
// {
// HttpContext.Current.Response.Write("Response Code:" + objPGResponse.RespCode);
// HttpContext.Current.Response.Write("Response message:" + objPGResponse.RespMessage);
// }
//}
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
PGResponse objPGResponse = new PGResponse();
CustomerDetails oCustomer = new CustomerDetails();
SessionDetail oSession = new SessionDetail();
AirLineTransaction oAirLine = new AirLineTransaction();
MerchanDise oMerchanDise = new MerchanDise();
SFA.CardInfo objCardInfo = new SFA.CardInfo();
SFA.Merchant objMerchant = new SFA.Merchant();
ShipToAddress objShipToAddress = new ShipToAddress();
BillToAddress oBillToAddress = new BillToAddress();
ShipToAddress oShipToAddress = new ShipToAddress();
MPIData objMPI = new MPIData();
PGReserveData oPGreservData = new PGReserveData();
Address oHomeAddress = new Address();
Address oOfficeAddress = new Address();
// For getting unique MerchantTxnID
// Only for testing purpose.
// In actual scenario the merchant has to pass his transactionID
DateTime oldTime = new DateTime(1970, 01, 01, 00, 00, 00);
DateTime currentTime = DateTime.Now;
TimeSpan structTimespan = currentTime - oldTime;
string lMrtTxnID = ((long)structTimespan.TotalMilliseconds).ToString();
var merchantId = _EmiPaymentSettings.MerchantId.ToString();
var orderId = postProcessPaymentRequest.Order.Id;
var Id = orderId.ToString();
var amount = postProcessPaymentRequest.Order.TotalTransactionAmount.ToString(new CultureInfo("en-US", false).NumberFormat);
示例10: PostProcessPayment
/// <summary>
/// Post process payment (used by payment gateways that require redirecting to a third-party URL)
/// </summary>
/// <param name="postProcessPaymentRequest">Payment info required for an order processing</param>
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
bool isSecure = _webHelper.IsCurrentConnectionSecured();
string redirectUrl = _webHelper.GetStoreLocation(isSecure).Trim() + "ppa/payment/" + postProcessPaymentRequest.Order.Id;
// Check license
bool isLicensed = this._licenseService.IsLicensed(HttpContext.Current.Request.Url.Host);
if (!isLicensed && postProcessPaymentRequest.Order.OrderTotal > 5.00M)
{
redirectUrl = _webHelper.GetStoreLocation(isSecure).Trim() + "ppa/license";
}
_httpContext.Response.Redirect(redirectUrl);
}
开发者ID:CloudberrySoftware,项目名称:PayPalAdvanced-Payments-Plugin,代码行数:18,代码来源:PayPalAdvancedPaymentProcessor.cs
示例11: GetPaymentLink
public ActionResult GetPaymentLink(int orderId)
{
var order = _orderService.GetOrderById(orderId);
var postProcessPaymentRequest = new PostProcessPaymentRequest()
{
Order = order
};
_paymentService.PostProcessPayment(postProcessPaymentRequest);
if (_webHelper.IsRequestBeingRedirected || _webHelper.IsPostBeingDone)
{
//redirection or POST has been done in PostProcessPayment
return Content("Redirected");
}
else
{
//if no redirection has been done (to a third-party payment page)
//theoretically it's not possible
return Redirect("~/");
}
}
示例12: ConfirmOrder
//.........这里部分代码省略.........
.LimitPerStore(_storeContext.CurrentStore.Id)
.ToList();
}
//validation
//var cart = _workContext.CurrentCustomer.ShoppingCartItems
// .Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart)
// .LimitPerStore(_storeContext.CurrentStore.Id)
// .ToList();
if (cart.Count == 0)
return RedirectToRoute("ShoppingCart");
if (_orderSettings.OnePageCheckoutEnabled)
return RedirectToRoute("CheckoutOnePage");
if ((_workContext.CurrentCustomer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed))
return new HttpUnauthorizedResult();
//model
var model = PrepareConfirmOrderModel(cart);
try
{
var processPaymentRequest = _httpContext.Session["OrderPaymentInfo"] as ProcessPaymentRequest;
if (processPaymentRequest == null)
{
//Check whether payment workflow is required
if (IsPaymentWorkflowRequired(cart))
return RedirectToRoute("CheckoutPaymentInfo");
processPaymentRequest = new ProcessPaymentRequest();
}
//prevent 2 orders being placed within an X seconds time frame
if (!IsMinimumOrderPlacementIntervalValid(_workContext.CurrentCustomer))
throw new Exception(_localizationService.GetResource("Checkout.MinOrderPlacementInterval"));
//place order
processPaymentRequest.StoreId = _storeContext.CurrentStore.Id;
processPaymentRequest.CustomerId = _workContext.CurrentCustomer.Id;
processPaymentRequest.PaymentMethodSystemName = _workContext.CurrentCustomer.GetAttribute<string>(
SystemCustomerAttributeNames.SelectedPaymentMethod,
_genericAttributeService, _storeContext.CurrentStore.Id);
if (deliveryDate == null)
{ processPaymentRequest.EstimateDeliveryDate = DateTime.UtcNow; }
else
{ processPaymentRequest.EstimateDeliveryDate = Convert.ToDateTime(deliveryDate); }
processPaymentRequest.CustomerNote = customerNote.ToString();
var placeOrderResult = _orderProcessingService.PlaceOrder(processPaymentRequest);
if (placeOrderResult.Success)
{
_httpContext.Session["OrderPaymentInfo"] = null;
var postProcessPaymentRequest = new PostProcessPaymentRequest
{
Order = placeOrderResult.PlacedOrder
};
_paymentService.PostProcessPayment(postProcessPaymentRequest);
if (_webHelper.IsRequestBeingRedirected || _webHelper.IsPostBeingDone)
{
//redirection or POST has been done in PostProcessPayment
return Content("Redirected");
}
//if (deliveryDate == null)
// deliveryDate = DateTime.Today.ToLongDateString();
var shippingOptions = _workContext.CurrentCustomer.GetAttribute<List<ShippingOption>>(SystemCustomerAttributeNames.OfferedShippingOptions, _storeContext.CurrentStore.Id);
//handle selected pickup date and location
if (pickupDate != null && pickupDate != "")
{
DateTime pickup = Convert.ToDateTime(pickupDate);
_shippingService.SetPickupDateAndLocation(placeOrderResult.PlacedOrder.Id, pickup,
Convert.ToInt32(pickupLocation));
}
////handle selected delivery date
//if (deliveryDate != null && deliveryDate != "")
//{
// DateTime delivery = Convert.ToDateTime(deliveryDate);
// _shippingService.SetDeliveryDate(placeOrderResult.PlacedOrder.Id, delivery);
//}
return RedirectToRoute("CheckoutCompleted", new { orderId = placeOrderResult.PlacedOrder.Id });
}
foreach (var error in placeOrderResult.Errors)
model.Warnings.Add(error);
}
catch (Exception exc)
{
_logger.Warning(exc.Message, exc);
model.Warnings.Add(exc.Message);
}
//If we got this far, something failed, redisplay form
return View(model);
}
示例13: PostProcessPayment
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
var customer = _customerService.GetCustomerById(postProcessPaymentRequest.Order.CustomerId);
var post = new RemotePost();
var processPaymentRequest = _httpContext.Session["OrderPaymentInfo"] as ProcessPaymentRequest;
post.FormName = "YandexKassaPaymentForm";
post.Url = GetYandexKassaUrl();
post.Method = "POST";
post.Add("shopId", _yandexKassaSettings.ShopId.ToString());
post.Add("scid", _yandexKassaSettings.Scid.ToString());
post.Add("sum", String.Format(CultureInfo.InvariantCulture, "{0:0.00}", postProcessPaymentRequest.Order.OrderTotal));
post.Add("customerNumber", postProcessPaymentRequest.Order.BillingAddress.Email);
post.Add("orderNumber", postProcessPaymentRequest.Order.Id.ToString());
post.Add("shopSuccessURL", String.Format("{0}Plugins/PaymentYandexKassa/Return", _webHelper.GetStoreLocation(false)));
post.Add("shopFailURL", String.Format("{0}Plugins/PaymentYandexKassa/Return", _webHelper.GetStoreLocation(false)) );
post.Add("cps_email", customer.Email);
post.Add("cps_phone", customer.BillingAddress.PhoneNumber);
post.Add("paymentType", postProcessPaymentRequest.Order.SubscriptionTransactionId);
post.Add("custName", postProcessPaymentRequest.Order.BillingAddress.LastName + postProcessPaymentRequest.Order.BillingAddress.FirstName);
post.Add("custAddr", customer.BillingAddress.Address1);
post.Add("custEMail", postProcessPaymentRequest.Order.BillingAddress.Email);
post.Add("orderDetails", "without");
post.Post();
}
示例14: PostProcessPayment
public void PostProcessPayment(PostProcessPaymentRequest postProcessPaymentRequest)
{
var builder = new StringBuilder();
string merchant = _robokassaSettings.Login;
string merchantpass = _robokassaSettings.Password1;
string desc = _robokassaSettings.PaymentDescription;
string signature = String.Format("{0}:{1}:{2}:{3}", merchant, postProcessPaymentRequest.Order.OrderTotal.ToString().Replace(",","."), postProcessPaymentRequest.Order.Id, merchantpass);
string currency = "rub";
string culture = "ru";
builder.Append(_robokassaSettings.ApiURL);
builder.AppendFormat("?MrchLogin={0}", merchant);
builder.AppendFormat("&OutSum={0}", postProcessPaymentRequest.Order.OrderTotal.ToString().Replace(",", "."));
builder.AppendFormat("&InvId={0}", postProcessPaymentRequest.Order.Id);
builder.AppendFormat("&Desc={0}", HttpUtility.UrlEncode(desc));
builder.AppendFormat("&SignatureValue={0}", MD5Helper.GetMD5Hash(signature));
builder.AppendFormat("&sIncCurrLabel={0}", currency);
builder.AppendFormat("&Email={0}", postProcessPaymentRequest.Order.BillingAddress.Email);
builder.AppendFormat("&sCulture={0}", culture);
_httpContext.Response.Redirect(builder.ToString());
}
示例15: OpcCompleteRedirectionPayment1
//Customization Propeers info (changed by ravi)
public ActionResult OpcCompleteRedirectionPayment1()
{
try
{
var Orginalcart = _workContext.CurrentCustomer.ShoppingCartItems
.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart)
.Where(sci => sci.StoreId == _storeContext.CurrentStore.Id)
.ToList();
if (Orginalcart.Count == 0)
throw new Exception("Your cart is empty");
//place order
var processPaymentRequest = _httpContext.Session["OrderPaymentInfo"] as ProcessPaymentRequest;
if (processPaymentRequest == null)
{
//Check whether payment workflow is required
if (IsPaymentWorkflowRequired(Orginalcart))
{
throw new Exception("Payment information is not entered");
}
else
processPaymentRequest = new ProcessPaymentRequest();
}
processPaymentRequest.StoreId = _storeContext.CurrentStore.Id;
processPaymentRequest.CustomerId = _workContext.CurrentCustomer.Id;
processPaymentRequest.PaymentMethodSystemName = _workContext.CurrentCustomer.GetAttribute<string>(
SystemCustomerAttributeNames.SelectedPaymentMethod,
_genericAttributeService, _storeContext.CurrentStore.Id);
TempOrder tempOrderObj = new TempOrder();
tempOrderObj.TempOrderGuid = Guid.NewGuid();
this.Session["orderGuid"] = tempOrderObj.TempOrderGuid;
_tempOrderService.InsertTempOrder(tempOrderObj);
this.Session["orderobj"] = processPaymentRequest;
var placeOrderResult = _payPalOrderProcessingService.PaypalOrderDetails(processPaymentRequest);
TempData["OrderCancelValue"] = 1;
//_shoppingCartService.AddToCart(, )
var customer = _workContext.CurrentCustomer;
var paymentMethodSystemName = processPaymentRequest.PaymentMethodSystemName;/*customer.GetAttribute<string>(
SystemCustomerAttributeNames.SelectedPaymentMethod,
_genericAttributeService, _storeContext.CurrentStore.Id); */
var paymentMethod = _paymentService.LoadPaymentMethodBySystemName(paymentMethodSystemName);
Guid ogid = processPaymentRequest.OrderGuid;
//int oid = processPaymentRequest.InitialOrderId;
//Order odObject = _orderService.GetOrderByGuid(ogid);
IList<ShoppingCartItem> cart = null;
cart = Orginalcart.ToList();
/*cart = _workContext.CurrentCustomer.ShoppingCartItems
.Where(sci => sci.ShoppingCartType == ShoppingCartType.ShoppingCart)
.Where(sci => sci.StoreId == _storeContext.CurrentStore.Id)
.ToList(); */
/* var postProcessPaymentRequest = new PostProcessPaymentRequest()
{
Order = odObject//new Order { PaymentStatus = PaymentStatus.Pending, PaymentMethodSystemName = paymentMethodSystemName }
}; */
var postProcessPaymentRequest = new PostProcessPaymentRequest();
Order or = new Order();
or = placeOrderResult.PlacedOrder;
or.PaymentMethodSystemName = paymentMethodSystemName;
or.PaymentStatus = PaymentStatus.Pending;
or.OrderDiscount = placeOrderResult.PlacedOrder.OrderDiscount;
or.OrderGuid = tempOrderObj.TempOrderGuid;
or.Id = _tempOrderService.GetTempOrderByGuid(tempOrderObj.TempOrderGuid).Id;
postProcessPaymentRequest.Order = or;
//postProcessPaymentRequest.Cart = Orginalcart;
// _orderProcessingService.ReOrder(or);
//.........这里部分代码省略.........
开发者ID:propeersinfo,项目名称:nopcommerce-PayPalStandard-3.70,代码行数:101,代码来源:PaymentPayPalStandardController.cs