コード例 #1
0
ファイル: XeroAPI.cs プロジェクト: RXY0805/3dsafetyToXeroDemo
 // Make payment against the invoice
 public void InvoicePay(string invoiceId, decimal paidAmount)
 {
     Payment payment = new Payment();
     Invoice payingInvoice = _api.Invoices.Find(new Guid(invoiceId));
     payment.Invoice = payingInvoice;
     Account payingAccount = new Account();
     payingAccount.Code = "880";
     payment.Account = payingAccount;
     payment.Amount = paidAmount;
     payment.Date = DateTime.Now;
     _api.Payments.Create(payment);
 }
コード例 #2
0
ファイル: XeroHelper.cs プロジェクト: DougHulme/webapi
        public static bool updateorcreatexeropayment(PaymentReadOnly Upayment, string clientxeroid)
        {
            XeroCoreApi xeroapp = getxeroapp();

            Xero.Api.Core.Model.Payment Xpayment = new Xero.Api.Core.Model.Payment();
            Xpayment.Amount    = Convert.ToDecimal(Upayment.Amount);
            Xpayment.Date      = Convert.ToDateTime(Upayment.CreatedDate);
            Xpayment.Status    = Xero.Api.Core.Model.Status.PaymentStatus.Authorised;
            Xpayment.Type      = Xero.Api.Core.Model.Types.PaymentType.AccountsReceivable;
            Xpayment.Account   = xeroapp.Accounts.Where("Name==\"Stripe Payment Account\"").Find().First();
            Xpayment.Reference = "from Unms";
            foreach (PaymentCoverReadOnly pc in Upayment.PaymentCovers)
            {
                string invnumber = UNMSHelper.getinvoicenumberbyid(Convert.ToDouble(pc.InvoiceId));
                Xpayment.Invoice = xeroapp.Invoices.Where("InvoiceNumber=\"" + invnumber + "\"").Find().FirstOrDefault();
            }
            Xero.Api.Core.Model.Payment Xpaymentreturned = xeroapp.Update(Xpayment);
            return(true);
        }
コード例 #3
0
ファイル: PaymentsTest.cs プロジェクト: ChrisRomp/Xero-Net
        protected Payment CreatePayment(decimal invoiceAmount, DateTime date, decimal amount, bool isReconciled = false)
        {
            var invoice = Given_an_invoice(invoiceAmount, Account.Code);
            var bankCode = BankAccount.Code;

            var payment = new Payment
            {
                Invoice = new Invoice { Number = invoice.Number },
                Account = new Account { Code = bankCode },
                Date = date,
                Amount = amount
            };

            if (isReconciled)
            {
                payment.IsReconciled = true;
            }

            return payment;
        }
コード例 #4
0
ファイル: PaymentsTest.cs プロジェクト: ChrisRomp/Xero-Net
        protected void Given_this_payment_is_deleted(Payment payment)
        {
            var deleteThisPayment = new Payment { Status = PaymentStatus.Deleted, Id = payment.Id };

            Api.Payments.Update(deleteThisPayment);
        }
コード例 #5
0
ファイル: XeroCoreApi.cs プロジェクト: johnnyoshika/Xero-Net
 public Payment Update(Payment item)
 {
     return Payments.Update(item);
 }
コード例 #6
0
ファイル: XeroCoreApi.cs プロジェクト: johnnyoshika/Xero-Net
 public Payment Create(Payment item)
 {
     return Payments.Create(item);
 }
コード例 #7
0
ファイル: XeroCoreApi.cs プロジェクト: yadyn/Xero-Net
 public Task<Payment> CreateAsync(Payment item)
 {
     return Payments.CreateAsync(item);
 }
コード例 #8
0
ファイル: PaymentsTest.cs プロジェクト: yadyn/Xero-Net
        protected Task Given_this_payment_is_deleted(Payment payment)
        {
            var deleteThisPayment = new Payment { Status = PaymentStatus.Deleted, Id = payment.Id };

            return Api.Payments.UpdateAsync(deleteThisPayment);
        }