コード例 #1
0
        /// <summary>
        ///     This method copies the common contents
        ///     from shipping to billing address.
        /// </summary>
        /// <returns>Billing Address object</returns>
        /// <remarks>
        ///     This method can be used to
        ///     populate the shipping addresses directly
        ///     from the billing addresses when
        ///     both are the same.
        /// </remarks>
        /// <example>
        ///     <code lang="C#" escaped="false">
        ///
        ///         ................
        ///         //Ship is the object of
        ///         //ShipTo populated with
        ///         //the shipping addresses.
        ///         ................
        ///
        ///
        ///         BillTo Bill;
        ///
        ///         //Populate billing addresses
        ///         //from shipping addresses.
        ///         Bill = Ship.Copy();
        ///
        ///         ................
        ///
        ///  </code>
        ///     <code lang="Visual Basic" escaped="false">
        ///
        ///         ................
        ///         'Ship is the object of
        ///         'ShipTo populated with
        ///         'the shipping addresses.
        ///         ................
        ///
        ///
        ///         BillTo Bill;
        ///
        ///         'Populate billing addresses
        ///         'from shipping addresses.
        ///         Bill = Ship.Copy()
        ///
        ///         ................
        ///
        ///  </code>
        /// </example>
        /// <seealso cref="BillTo" />
        public BillTo Copy()
        {
            var copyObject = new BillTo
            {
                AddressCity       = AddressCity,
                AddressCountry    = AddressCountry,
                AddressEmail      = AddressEmail,
                AddressFax        = AddressFax,
                AddressFirstName  = AddressFirstName,
                AddressLastName   = AddressLastName,
                AddressMiddleName = AddressMiddleName,
                AddressPhone2     = AddressPhone2,
                AddressPhone      = AddressPhone,
                AddressState      = AddressState,
                AddressStreet     = AddressStreet,
                AddressStreet2    = AddressStreet2,
                AddressZip        = AddressZip
            };

            return(copyObject);
        }
コード例 #2
0
        /// <summary>
        ///     Generates the transaction request.
        /// </summary>
        internal override void GenerateRequest()
        {
            try
            {
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamInvnum, InvNum));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamAmt, Amt));
                // if no Amt passed, skip CurrencyCode.
                if (Amt != null)
                {
                    RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamCurrency,
                                                                        Amt.CurrencyCode));
                }
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamTaxexempt, TaxExempt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamTaxamt, TaxAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDutyamt, DutyAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamFreightamt, FreightAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamHandlingamt, HandlingAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamShippingamt, ShippingAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDiscount, Discount));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDesc, Desc));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamComment1, Comment1));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamComment2, Comment2));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDesc1, Desc1));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDesc2, Desc2));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDesc3, Desc3));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamDesc4, Desc4));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamCustref, CustRef));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamPonum, PoNum));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamVatregnum, VatRegNum));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamVattaxamt, VatTaxAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamLocaltaxamt, LocalTaxAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamNationaltaxamt,
                                                                    NationalTaxAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamAlttaxamt, AltTaxAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamCommcode, CommCode));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamVattaxpercent,
                                                                    VatTaxPercent));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamInvoicedate, InvoiceDate));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamStarttime, StartTime));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamEndtime, EndTime));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamOrderdate, OrderDate));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamOrdertime, OrderTime));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamRecurring, Recurring));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamItemamt, ItemAmt));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamOrderdesc, OrderDesc));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamRecurringtype,
                                                                    RecurringType));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamMerchdescr, MerchDescr));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamMerchsvc, MerchSvc));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamOrderid, OrderId));
                RequestBuffer.Append(PayflowUtility.AppendToRequest(PayflowConstants.ParamEchodata, EchoData));
                if (BillTo != null)
                {
                    BillTo.RequestBuffer = RequestBuffer;
                    BillTo.GenerateRequest();
                }

                if (ShipTo != null)
                {
                    ShipTo.RequestBuffer = RequestBuffer;
                    ShipTo.GenerateRequest();
                }

                if (BrowserInfo != null)
                {
                    BrowserInfo.RequestBuffer = RequestBuffer;
                    BrowserInfo.GenerateRequest();
                }

                if (CustomerInfo != null)
                {
                    CustomerInfo.RequestBuffer = RequestBuffer;
                    CustomerInfo.GenerateRequest();
                }

                if (_mItemList != null && _mItemList.Count > 0)
                {
                    GenerateItemRequest();
                }
                if (UserItem != null)
                {
                    UserItem.RequestBuffer = RequestBuffer;
                    UserItem.GenerateRequest();
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception ex)
            {
                var dEx = new DataObjectException(ex);
                throw dEx;
            }

            //catch
            //{
            //    throw new Exception();
            //}
        }