This repository has been archived by the owner on Apr 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #372 from MJMortimer/f-batchpayments
Add BatchPayments functionality
- Loading branch information
Showing
13 changed files
with
181 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Xero.Api.Core.Endpoints.Base; | ||
using Xero.Api.Core.Model; | ||
using Xero.Api.Core.Request; | ||
using Xero.Api.Core.Response; | ||
using Xero.Api.Infrastructure.Http; | ||
|
||
namespace Xero.Api.Core.Endpoints | ||
{ | ||
public interface IBatchPaymentsEndpoint | ||
: IXeroCreateEndpoint<BatchPaymentsEndpoint, BatchPayment, BatchPaymentsRequest, BatchPaymentsResponse> | ||
{ | ||
|
||
} | ||
|
||
public class BatchPaymentsEndpoint | ||
: XeroCreateEndpoint<BatchPaymentsEndpoint, BatchPayment, BatchPaymentsRequest, BatchPaymentsResponse>, IBatchPaymentsEndpoint | ||
{ | ||
public BatchPaymentsEndpoint(XeroHttpClient client) : | ||
base(client, "/api.xro/2.0/BatchPayments") | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.Serialization; | ||
using Xero.Api.Common; | ||
using Xero.Api.Core.Model.Status; | ||
using Xero.Api.Core.Model.Types; | ||
|
||
namespace Xero.Api.Core.Model | ||
{ | ||
[DataContract(Namespace = "")] | ||
public class BatchPayment : HasUpdatedDate, IHasId | ||
{ | ||
[DataMember(Name = "BatchPaymentID", EmitDefaultValue = false)] | ||
public Guid Id { get; set; } | ||
|
||
[DataMember(Name = "Type", EmitDefaultValue = false)] | ||
public BatchPaymentType? Type { get; set; } | ||
|
||
[DataMember(Name = "Status", EmitDefaultValue = false)] | ||
public BatchPaymentStatus? Status { get; set; } | ||
|
||
[DataMember(Name = "Account")] | ||
public Account Account { get; set; } | ||
|
||
[DataMember(Name = "Particulars", EmitDefaultValue = false)] | ||
public string Particulars { get; set; } | ||
|
||
[DataMember(Name = "Code", EmitDefaultValue = false)] | ||
public string Code { get; set; } | ||
|
||
[DataMember(Name = "Reference", EmitDefaultValue = false)] | ||
public string Reference { get; set; } | ||
|
||
[DataMember(Name = "Details", EmitDefaultValue = false)] | ||
public string Details { get; set; } | ||
|
||
[DataMember(Name = "Narrative", EmitDefaultValue = false)] | ||
public string Narrative { get; set; } | ||
|
||
[DataMember(Name = "Date", EmitDefaultValue = false)] | ||
public DateTime? Date { get; set; } | ||
|
||
[DataMember(Name = "Payments")] | ||
public List<BatchPaymentPayment> Payments { get; set; } | ||
|
||
[DataMember(Name = "TotalAmount", EmitDefaultValue = false)] | ||
public decimal? Total { get; set; } | ||
|
||
[DataMember(Name = "IsReconciled", EmitDefaultValue = false)] | ||
public bool? IsReconciled { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
using Xero.Api.Common; | ||
|
||
namespace Xero.Api.Core.Model | ||
{ | ||
[DataContract(Namespace = "", Name = "Payment")] | ||
public class BatchPaymentPayment : CoreData | ||
{ | ||
[DataMember(Name = "Invoice")] | ||
public Invoice Invoice { get; set; } | ||
|
||
[DataMember(Name = "PaymentID", EmitDefaultValue = false)] | ||
public Guid? PaymentId { get; set; } | ||
|
||
[DataMember(Name = "BankAccountNumber", EmitDefaultValue = false)] | ||
public string BankAccountNumber { get; set; } | ||
|
||
[DataMember(Name = "Particulars", EmitDefaultValue = false)] | ||
public string Particulars { get; set; } | ||
|
||
[DataMember(Name = "Code", EmitDefaultValue = false)] | ||
public string Code { get; set; } | ||
|
||
[DataMember(Name = "Reference", EmitDefaultValue = false)] | ||
public string Reference { get; set; } | ||
|
||
[DataMember(Name = "Details", EmitDefaultValue = false)] | ||
public string Details { get; set; } | ||
|
||
[DataMember(Name = "Narrative", EmitDefaultValue = false)] | ||
public string Narrative { get; set; } | ||
|
||
[DataMember(Name = "Amount", EmitDefaultValue = false)] | ||
public decimal? Amount { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Xero.Api.Core.Model.Status | ||
{ | ||
[DataContract(Namespace = "")] | ||
public enum BatchPaymentStatus | ||
{ | ||
[EnumMember(Value = "AUTHORISED")] | ||
Authorised, | ||
[EnumMember(Value = "DELETED")] | ||
Deleted | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Xero.Api.Core.Model.Types | ||
{ | ||
[DataContract(Namespace = "")] | ||
public enum BatchPaymentType | ||
{ | ||
[EnumMember(Value = "PAYBATCH")] | ||
PayBatch, | ||
[EnumMember(Value = "RECBATCH")] | ||
RecBatch | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Runtime.Serialization; | ||
using Xero.Api.Common; | ||
using Xero.Api.Core.Model; | ||
|
||
namespace Xero.Api.Core.Request | ||
{ | ||
[CollectionDataContract(Namespace = "", Name = "BatchPayments")] | ||
public class BatchPaymentsRequest : XeroRequest<BatchPayment> | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
using Xero.Api.Common; | ||
using Xero.Api.Core.Model; | ||
|
||
namespace Xero.Api.Core.Response | ||
{ | ||
public class BatchPaymentsResponse : XeroResponse<BatchPayment> | ||
{ | ||
public List<BatchPayment> BatchPayments { get; set; } | ||
|
||
public override IList<BatchPayment> Values | ||
{ | ||
get { return BatchPayments; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters