Example #1
0
        public override String ProcessCard(int OrderNumber, int CustomerID, Decimal OrderTotal, bool useLiveTransactions, TransactionModeEnum TransactionMode, Address UseBillingAddress, String CardExtraCode, Address UseShippingAddress, String CAVV, String ECI, String XID, out String AVSResult, out String AuthorizationResult, out String AuthorizationCode, out String AuthorizationTransID, out String TransactionCommandOut, out String TransactionResponse)
        {
            String AVSAddr = String.Empty;
            String AVSZip  = String.Empty;

            AuthorizationCode     = String.Empty;
            AuthorizationResult   = String.Empty;
            AuthorizationTransID  = String.Empty;
            AVSResult             = String.Empty;
            TransactionCommandOut = String.Empty;
            TransactionResponse   = String.Empty;

            // Generate payment request
            Customer customer = new Customer(CustomerID, true);

            GatewayMoneybookers.IPaymentType paymentType;
            if (TransactionMode == TransactionModeEnum.auth)
            {
                paymentType = GatewayMoneybookers.PaymentType.Preauthorisation;
            }
            else
            {
                paymentType = GatewayMoneybookers.PaymentType.Debit;
            }

            string customerIpAddress = CommonLogic.CustomerIpAddress();

            if (customerIpAddress == "::1")
            {
                customerIpAddress = "127.0.0.1";
            }
            else if (customerIpAddress.Contains(":"))
            {
                throw new Exception("The Skrill (Moneybookers) payment gateway does not support IPv6.");
            }

            string cardType = UseBillingAddress.CardType;

            if (cardType.ToUpper() == "MASTERCARD")
            {
                cardType = "MASTER";
            }

            string          result;
            CustomerSession customerSession = new CustomerSession(CustomerID);

            if (customerSession.SessionUSInt("Moneybookers_3DSecure_OrderNumber") == OrderNumber)
            {
                result = ProcessOrderThrough3DSecure(OrderNumber, CustomerID, OrderTotal, TransactionMode, UseBillingAddress, CardExtraCode, ref AuthorizationResult, ref AuthorizationCode, ref AuthorizationTransID, ref TransactionCommandOut, ref TransactionResponse, customer, paymentType, customerIpAddress, cardType, customerSession);
            }
            else
            {
                result = ProcessOrderThroughGateway(OrderNumber, CustomerID, OrderTotal, TransactionMode, UseBillingAddress, CardExtraCode, ref AuthorizationResult, ref AuthorizationCode, ref AuthorizationTransID, ref TransactionCommandOut, ref TransactionResponse, customer, paymentType, customerIpAddress, cardType);
            }

            return(result);
        }