Ejemplo n.º 1
0
    private void ProcessPayPalStandardIPN()
    {
        OrderNotifyService order = new OrderNotifyService(Invoice);
        Order details            = DataAccessContext.OrderRepository.GetOne(order.OrderID);

        if (String.IsNullOrEmpty(details.GatewayPaymentStatus))
        {
            order.SendOrderEmail();
        }

        details.GatewayOrderID       = Invoice;
        details.GatewayPaymentStatus = PaymentStatus;
        DataAccessContext.OrderRepository.Save(details);

        // Create the IPN Transaction
        switch (PaymentStatus.ToLower())
        {
        case "completed":
        case "canceled_reversal":
            order.ProcessPaymentComplete();
            break;

        case "refunded":
        case "reversed":
            order.ProcessPaymentFailed();
            break;
        }
    }
Ejemplo n.º 2
0
    private void SaveDataKPayment()
    {
        string result = "IsApproved:" + IsApproved.ToString() + ", ";

        result += String.Format("RespCode:{0}, ", RespCode);
        result += String.Format("AuthCode:{0}, ", AuthCode);
        result += String.Format("UAID:{0}, ", UAID);
        result += String.Format("CardType:{0}", CardType);

        PaymentLog paymentLog = new PaymentLog();

        paymentLog.OrderID         = BankInvoiceID;
        paymentLog.PaymentResponse = result;
        paymentLog.PaymentGateway  = GetPaymentName();
        paymentLog.PaymentType     = String.Empty;
        DataAccessContext.PaymentLogRepository.Save(paymentLog);
        //PaymentLogAccess.Create( BankInvoiceID, result, GetPaymentName(), "" );

        OrderNotifyService order = new OrderNotifyService(BankInvoiceID);

        if (IsApproved)
        {
            order.SendOrderEmail();
            order.ProcessPaymentComplete();

            Response.Redirect(String.Format("~/CheckoutComplete.aspx?OrderID={0}&IsTransaction=True", BankInvoiceID));
        }
        else
        {
            order.ProcessPaymentFailed();

            Response.Redirect(String.Format("~/CheckoutNotComplete.aspx?OrderID={0}", BankInvoiceID));
        }
    }
Ejemplo n.º 3
0
    private void ProcessRBSWorldPayIPN()
    {
        OrderNotifyService order = new OrderNotifyService(Invoice);

        Order orderDetails = DataAccessContext.OrderRepository.GetOne(order.OrderID);

        if (PaymentStatus.ToUpper() == "Y")
        {
            order.SendOrderEmail();
        }

        //OrdersAccess.UpdateGatewayOrderID( Invoice, TransID );
        //OrdersAccess.UpdateGatewayStatusByGatewayOrderID( TransID, PaymentStatus );

        orderDetails.GatewayOrderID       = TransID;
        orderDetails.GatewayPaymentStatus = PaymentStatus;
        VerifyAvsAndCvv(orderDetails);
        string retURL = UrlPath.StorefrontUrl;

        // Create the IPN Transaction
        if (PaymentStatus.ToUpper() == "Y")
        {
            uxCheckoutHeaderLabel.Text = "Thank you for your order.";
            uxCheckoutDetailLabel.Text = "To view order information, please click the link below.";
            order.ProcessPaymentComplete();
            uxCheckoutLink.NavigateUrl
                = String.Format(UrlPath.StorefrontUrl + "CheckoutComplete.aspx?OrderID={0}",
                                order.OrderID + "&IsTransaction=true");
            uxUrlHidden.Value
                = String.Format(UrlPath.StorefrontUrl + "CheckoutComplete.aspx?OrderID={0}",
                                order.OrderID + "&IsTransaction=true");
            uxHomeLink.Visible = false;

            retURL = String.Format(UrlPath.StorefrontUrl + "CheckoutComplete.aspx?OrderID={0}",
                                   order.OrderID + "&IsTransaction=true");
        }
        else
        {
            uxCheckoutHeaderLabel.Text = "Order Not Complete";
            uxCheckoutDetailLabel.Text = "Your Order cannot be completed.<br/><br/>Please verify your payment information and try checkout again.";
            order.ProcessPaymentFailed();
            uxCheckoutLink.NavigateUrl
                = String.Format(UrlPath.StorefrontUrl + "CheckoutNotComplete.aspx?OrderID={0}", order.OrderID);
            uxUrlHidden.Value
                = String.Format(UrlPath.StorefrontUrl + "CheckoutNotComplete.aspx?OrderID={0}", order.OrderID);
            uxCheckoutLink.Visible = false;
            uxHomeLink.NavigateUrl = UrlPath.StorefrontUrl;

            retURL = String.Format(UrlPath.StorefrontUrl + "CheckoutNotComplete.aspx?OrderID={0}", order.OrderID);
        }

        HtmlMeta meta = new HtmlMeta();

        meta.ID        = "meta" + "refresh";
        meta.HttpEquiv = "refresh";
        meta.Content   = "0;URL=" + retURL;
        Page.Header.Controls.Add(meta);
    }