Exemplo n.º 1
0
        public DEDirectDebitTransactionRequest()
        {
            Transaction oTransaction = new Transaction();

            DE_DirectDebitTxType oDE_DirectDebitTxType = new DE_DirectDebitTxType();

            oDE_DirectDebitTxType.StoreId = "120995000";
            oDE_DirectDebitTxType.Type    = DE_DirectDebitTxTypeType.sale;

            DE_DirectDebitData oDE_DirectDebitData = new DE_DirectDebitData();

            oDE_DirectDebitData.ItemsElementName     = new ItemsChoiceType2[] { ItemsChoiceType2.BIC, ItemsChoiceType2.IBAN };
            oDE_DirectDebitData.Items                = new String[] { "PBNKDEFFXXX", "DE34500100600032121604" };
            oDE_DirectDebitData.MandateType          = MandateType.SINGLE;
            oDE_DirectDebitData.MandateTypeSpecified = true;
            oDE_DirectDebitData.DateOfMandate        = DateTime.Now.ToString("yyyyMMdd");

            oTransaction.Items = new Object[] { oDE_DirectDebitTxType, oDE_DirectDebitData };

            Payment oPayment = new Payment();

            oPayment.SubTotal                = 10;
            oPayment.ValueAddedTax           = 2;
            oPayment.ValueAddedTaxSpecified  = true;
            oPayment.DeliveryAmount          = 1;
            oPayment.DeliveryAmountSpecified = true;
            oPayment.ChargeTotal             = 13;
            oPayment.Currency                = "978";

            oTransaction.Payment = oPayment;

            Billing oBilling = new Billing();

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

            oTransaction.Billing = oBilling;

            ClientLocale oClientLocale = new ClientLocale();

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

            oTransaction.ClientLocale = oClientLocale;

            DEDirectDebitTransactionOrderRequest      = new IPGApiOrderRequest();
            DEDirectDebitTransactionOrderRequest.Item = oTransaction;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Method returns string value of DE_DirectDebitTxType object
        /// </summary>
        /// <param name="oDE_DirectDebitTxType">DE_DirectDebitTxType object to create string from</param>
        /// <returns>string value containing all DE_DirectDebitTxType values</returns>
        public static string DE_DirectDebitTxTypeToString(this DE_DirectDebitTxType oDE_DirectDebitTxType)
        {
            if (oDE_DirectDebitTxType == null)
            {
                return("");
            }

            var items = new Dictionary <string, string>()
            {
                { "StoreId", oDE_DirectDebitTxType.StoreId },
                { "Type", oDE_DirectDebitTxType.Type.ToString() },
            };

            return(items.NotNullDataToString() + Environment.NewLine);
        }