Ejemplo n.º 1
0
 public KashFlow.CompanyDetails ToData()
 {
     return(new KashFlow.CompanyDetails()
     {
         Address1 = Address1,
         Address2 = Address2,
         Address3 = Address3,
         Address4 = Address4,
         BusinessType = BusinessType,
         BusinessType1 = BusinessType1,
         BusinessType1Name = BusinessName1,
         BusinessType2 = BusinessType2,
         BusinessType2Name = BusinessName2,
         BusinessType3 = BusinessType3,
         BusinessType3Name = BusinessName3,
         CompanyName = CompanyName,
         CurrencyId = CurrencyID,
         CurrencyName = CurrencyName,
         CurrencyPosition = CurrencyPosition.ToString(),
         CurrencySymbol = CurrencySymbol,
         Mobile = Mobile,
         PaymentTerms = PaymentTerms,
         PaymentTermsType = PaymentTermsType.ToString(),
         Postcode = Postcode,
         PrimaryContact = PrimaryContact,
         PrimaryEmail = PrimaryEmail,
         Telephone = Telephone,
         UsDate = IsUsingAmericanDate ? "Yes" : "No",
         VatRegistered = IsVATRegistered ? "Yes" : "No",
         VatRegistrationNumber = VATRegistrationNumber
     });
 }
Ejemplo n.º 2
0
        /// <summary>
        /// API call example for UpdateInvoice
        /// </summary>
        /// <param name="context"></param>
        private void UpdateInvoice(HttpContext context)
        {
            // Collect input params
            String           invoiceId     = context.Request.Params["invoiceId"];
            String           merchantEmail = context.Request.Params["merchantEmail"];
            String           payerEmail    = context.Request.Params["payerEmail"];
            PaymentTermsType paymentTerms  = (PaymentTermsType)Enum.Parse(
                typeof(PaymentTermsType), context.Request.Params["paymentTerms"]);
            String item_name1      = context.Request.Params["item_name1"];
            String item_quantity1  = context.Request.Params["item_quantity1"];
            String item_unitPrice1 = context.Request.Params["item_unitPrice1"];
            String item_name2      = context.Request.Params["item_name2"];
            String item_quantity2  = context.Request.Params["item_quantity2"];
            String item_unitPrice2 = context.Request.Params["item_unitPrice2"];
            String currencyCode    = context.Request.Params["currencyCode"];

            InvoiceItemListType itemList = new InvoiceItemListType();

            itemList.item = new List <InvoiceItemType>();
            itemList.item.Add(new InvoiceItemType(
                                  item_name1,
                                  decimal.Parse(item_quantity1),
                                  decimal.Parse(item_unitPrice1)));
            itemList.item.Add(new InvoiceItemType(
                                  item_name2,
                                  decimal.Parse(item_quantity2),
                                  decimal.Parse(item_unitPrice2)));
            InvoiceType invoice = new InvoiceType(merchantEmail, payerEmail, itemList,
                                                  currencyCode, paymentTerms);
            UpdateInvoiceRequest request = new UpdateInvoiceRequest(
                new RequestEnvelope(ERROR_LANGUAGE), invoiceId, invoice);

            // Create service object and make the API call
            InvoiceService        service;
            UpdateInvoiceResponse response;

            try
            {
                service  = getService(context);
                response = service.UpdateInvoice(request);
            }
            catch (Exception e)
            {
                context.Response.Write(e.Message);
                return;
            }

            // Display response values.
            Dictionary <string, string> keyResponseParams = new Dictionary <string, string>();

            keyResponseParams.Add("API status", response.responseEnvelope.ack.ToString());
            keyResponseParams.Add("correlationId", response.responseEnvelope.correlationId);
            keyResponseParams.Add("invoiceId", response.invoiceID);
            keyResponseParams.Add("invoiceNumber", response.invoiceNumber);
            keyResponseParams.Add("invoiceUrl", response.invoiceURL);
            keyResponseParams.Add("totalAmount", response.totalAmount.ToString());
            displayResponse(context, "UpdateInvoice", keyResponseParams, service.getLastRequest(),
                            service.getLastResponse(), response.error, null);
        }
 public TransportServiceDescriptionType()
 {
     this.transportationServiceField         = new ObservableCollection <TransportationServiceType>();
     this.validityPeriodField                = new PeriodType();
     this.serviceChargePaymentTermsField     = new PaymentTermsType();
     this.transportServiceProviderPartyField = new PartyType();
     this.transportServiceDescriptionRequestDocumentReferenceField = new DocumentReferenceType();
     this.receiverPartyField      = new PartyType();
     this.senderPartyField        = new PartyType();
     this.signatureField          = new ObservableCollection <SignatureType>();
     this.responseCodeField       = new ResponseCodeType();
     this.serviceNameField        = new ServiceNameType();
     this.noteField               = new ObservableCollection <NoteType>();
     this.issueTimeField          = new IssueTimeType();
     this.issueDateField          = new IssueDateType();
     this.uUIDField               = new UUIDType();
     this.copyIndicatorField      = new CopyIndicatorType();
     this.idField                 = new IDType();
     this.profileExecutionIDField = new ProfileExecutionIDType();
     this.profileIDField          = new ProfileIDType();
     this.customizationIDField    = new CustomizationIDType();
     this.uBLVersionIDField       = new UBLVersionIDType();
     this.uBLExtensionsField      = new ObservableCollection <UBLExtensionType>();
 }
Ejemplo n.º 4
0
 /**
  	  * Constructor with arguments
  	  */
 public InvoiceType(string merchantEmail, string payerEmail, InvoiceItemListType itemList, string currencyCode, PaymentTermsType? paymentTerms)
 {
     this.merchantEmail = merchantEmail;
     this.payerEmail = payerEmail;
     this.itemList = itemList;
     this.currencyCode = currencyCode;
     this.paymentTerms = paymentTerms;
 }