コード例 #1
0
        /// <summary>
        /// Creates the payment args.
        /// </summary>
        /// <param name="checkoutFlowInfo">The checkout flow info.</param>
        /// <returns></returns>
        public virtual ExecutePaymentArgs CreatePaymentArgs(CheckoutFlowInfo checkoutFlowInfo)
        {
            AurigaPaymentArgs args = new AurigaPaymentArgs();
            ExtendedCheckoutFlowInfo info = checkoutFlowInfo as ExtendedCheckoutFlowInfo;
            if (info != null)
            {
                args.CancelUrl = info.CancelUrl;
                args.ResponseUrl = info.ResponseUrl;
                args.PersonNumber = info.CustomerSsn;
                args.ClientLanguage = CurrentState.Current.WebSite.Culture.Name;
                args.ExecuteScript = new AurigaPaymentArgs.ExecuteScriptHandler(info.ExecuteScript);

                //store end-users IP address
                HttpContext currentContext = HttpContext.Current;
                if (currentContext != null && currentContext.Request != null)
                    args.UserHostAddress = HttpContext.Current.Request.UserHostAddress;

                //set the payment mode if its being set, otherwise leave it at its default value.
                if (checkoutFlowInfo.ExecutePaymentMode != ExecutePaymentMode.Unset)
                    args.PaymentMode = checkoutFlowInfo.ExecutePaymentMode;
            }
            return args;
        }
コード例 #2
0
    protected void Complete(object sender, EventArgs e)
    {
        if (m_orderID != null && m_paymentInfoID != null)
        {
            Order order = ModuleECommerce.Instance.Orders.GetOrder(m_orderID.Value, FoundationContext.Token);
            PaymentInfo paymentInfo = order.PaymentInfo[m_paymentInfoID.Value];
            IPaymentProvider iPaymentProvider = paymentInfo.PaymentProvider;

            AurigaPaymentArgs args = new AurigaPaymentArgs(c_textboxSSN.Text, UrlConstants.PAYMENT_SUCCESS, UrlConstants.PAYMENT_CANCEL, FoundationContext.Culture.Name);
            args.PaymentMode = m_paymentMode.HasValue ? m_paymentMode.Value : ExecutePaymentMode.Charge;
            args.UserHostAddress = Request.UserHostAddress;
            args.ExecuteScript = new AurigaPaymentArgs.ExecuteScriptHandler(ExecuteScript);

            AurigaPaymentResult result = (AurigaPaymentResult)iPaymentProvider.ExecutePayment(args, FoundationContext.Token);
            if (!result.Success)
            {
                Response.Redirect(UrlConstants.VIEW_PAYMENT + "?" + ParameterConstants.ECOM_SELECTED_NAVBAR_PAGE + "="
                    + ((int)Litium.Studio.UI.ECommerce.Common.Enums.FilterType.Payments).ToString() + "&"
                    + ParameterConstants.FROM_PAYMENT + "=true&"
                    + ParameterConstants.ECOM_ORDER_ID + "=" + m_orderID.Value + "&"
                    + ParameterConstants.ECOM_PAYMENT_INFO_ID + "=" + paymentInfo.ID + "&"
                    + ParameterConstants.QUERY_STRING_NAVIGATE_FROM + "=2");
            }
        }
    }