public InitiateClearingRequest()
        {
            InitiateClearing oInitiateClearing = new InitiateClearing();

            oInitiateClearing.StoreId = "120995000";

            ClientLocale oClientLocale = new ClientLocale();

            oClientLocale.Country  = "UK";
            oClientLocale.Language = "en";

            WSIPGClient.WebReference.Action oAction = new WSIPGClient.WebReference.Action();
            oAction.Item         = oInitiateClearing;
            oAction.ClientLocale = oClientLocale;

            InitiateClearingActionRequest      = new IPGApiActionRequest();
            InitiateClearingActionRequest.Item = oAction;
        }
Пример #2
0
        public InquiryOrderRequest()
        {
            InquiryOrder oInquiryOrder = new InquiryOrder();

            oInquiryOrder.StoreId = "120995000";
            oInquiryOrder.OrderId = "C-0cc41568-aef6-45bb-8b26-5d1d5733191d";

            ClientLocale oClientLocale = new ClientLocale();

            oClientLocale.Country  = "UK";
            oClientLocale.Language = "en";

            WSIPGClient.WebReference.Action oAction;
            oAction              = new WSIPGClient.WebReference.Action();
            oAction.Item         = oInquiryOrder;
            oAction.ClientLocale = oClientLocale;

            InquiryOrderActionRequest      = new IPGApiActionRequest();
            InquiryOrderActionRequest.Item = oAction;
        }
        /// <summary>
        /// Method returns string value of StoreHostedData object
        /// </summary>
        /// <param name="oAction">Action object ot create string from</param>
        /// <returns>string value containing all StoreHostedData values</returns>
        public static string ActionToString(this WSIPGClient.WebReference.Action oAction)
        {
            if (oAction == null)
            {
                return("");
            }

            var result = new StringBuilder();

            result.Append(Environment.NewLine + "Action Information : " + Environment.NewLine);

            //ClientLocale
            result.Append(oAction.ClientLocale.ClientLocaleToString());

            switch (oAction.Item.GetType().Name.ToLower())
            {
            case "initiateclearing":
            {
                result.Append(((InitiateClearing)oAction.Item).InitiateClearingToString());
                break;
            }

            case "inquiryorder":
            {
                result.Append(((InquiryOrder)oAction.Item).InquiryOrderToString());
                break;
            }

            case "storehosteddata":
            {
                result.Append(((StoreHostedData)oAction.Item).StoreHostedDataToString());
                break;
            }

            case "recurringpayment":
            {
                result.Append(((RecurringPayment)oAction.Item).RecurringPaymentToString());
                break;
            }

            case "validate":
            {
                result.Append(((Validate)oAction.Item).ValidateToString());
                break;
            }

            case "getexternaltransactionstatus":
            {
                result.Append(((GetExternalTransactionStatus)oAction.Item).GetExternalTransactionStatusToString());
                break;
            }

            case "getexternalconsumerinformation":
            {
                result.Append(((GetExternalConsumerInformation)oAction.Item).GetExternalConsumerInformationToString());
                break;
            }

            case "sendemailnotification":
            {
                result.Append(((SendEMailNotification)oAction.Item).SendEMailNotificationToString());
                break;
            }

            case "getlasttransactions":
            {
                result.Append(((GetLastTransactions)oAction.Item).GetLastTransactionsToString());
                break;
            }

            case "manageproducts":
            {
                result.Append(((ManageProducts)oAction.Item).ManageProductsToString());
                break;
            }

            case "manageproductstock":
            {
                result.Append(((ManageProductStock)oAction.Item).ManageProductStockToString());
                break;
            }

            case "getlastorders":
            {
                result.Append(((GetLastOrders)oAction.Item).GetLastOrdersToString());
                break;
            }

            case "requestcardratefordcc":
            {
                result.Append(((RequestCardRateForDCC)oAction.Item).RequestCardRateForDCCToString());
                break;
            }

            case "requestmerchantratefordynamicpricing":
            {
                result.Append(((RequestMerchantRateForDynamicPricing)oAction.Item).RequestMerchantRateForDynamicPricingToString());
                break;
            }
            }

            return(result.ToString());
        }
Пример #4
0
        public RecurringPaymentRequest()
        {
            RecurringPayment oRecurringPayment = new RecurringPayment();

            oRecurringPayment.StoreId  = "120995000";
            oRecurringPayment.Function = Function.install;

            RecurringPaymentInformation oRecurringPaymentInformation = new RecurringPaymentInformation();

            oRecurringPaymentInformation.InstallmentCount           = "12";
            oRecurringPaymentInformation.InstallmentFrequency       = "1";
            oRecurringPaymentInformation.InstallmentPeriod          = RecurringPaymentInformationInstallmentPeriod.month;
            oRecurringPaymentInformation.InstallmentPeriodSpecified = true;
            DateTime dateNow = DateTime.Now.AddDays(5);

            oRecurringPaymentInformation.RecurringStartDate = dateNow.ToString("yyyyMMdd");
            oRecurringPaymentInformation.MaximumFailures    = "3";

            oRecurringPayment.RecurringPaymentInformation = oRecurringPaymentInformation;

            CreditCardData oCreditCardData = new CreditCardData();

            oCreditCardData.Brand            = CreditCardDataBrand.VISA;
            oCreditCardData.BrandSpecified   = true;
            oCreditCardData.ItemsElementName = new ItemsChoiceType[] { ItemsChoiceType.CardNumber, ItemsChoiceType.ExpMonth, ItemsChoiceType.ExpYear, ItemsChoiceType.CardCodeValue };
            oCreditCardData.Items            = new Object[] { "4035874000424977", "12", "18", "977" };

            oRecurringPayment.CreditCardData = oCreditCardData;

            Payment oPayment = new Payment();

            oPayment.SubTotal    = 13;
            oPayment.ChargeTotal = 13;
            oPayment.Currency    = "978";

            oRecurringPayment.Payment = oPayment;

            Billing oBilling = new Billing();

            oBilling.Name     = "Name";
            oBilling.Address1 = "Address";
            oBilling.City     = "City";
            oBilling.State    = "State";
            oBilling.Zip      = "Zip";
            oBilling.Country  = "Country";

            oRecurringPayment.Billing = oBilling;

            ClientLocale oClientLocale = new ClientLocale();

            oClientLocale.Country  = "UK";
            oClientLocale.Language = "en";

            WSIPGClient.WebReference.Action oAction;
            oAction              = new WSIPGClient.WebReference.Action();
            oAction.Item         = oRecurringPayment;
            oAction.ClientLocale = oClientLocale;

            RecurringPaymentActionRequest      = new IPGApiActionRequest();
            RecurringPaymentActionRequest.Item = oAction;
        }