diff --git a/CHANGELOG.md b/CHANGELOG.md index 6255541..8c66a78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed +## [1.7.0] - 2018-08-22 + +### Added + +- Payment: Get a list of payment transactions + +### Fixed + +- Smart.Transaction: cancel returns always false, now it returns the Transaction object (with the changed status) + ## [1.6.0] - 2018-06-14 ### Added @@ -171,4 +181,7 @@ First release [1.3.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.2.0...1.3.0 [1.4.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.3.0...1.4.0 [1.4.1]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.4.0...1.4.1 -[1.5.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.4.1...1.5.0 \ No newline at end of file +[1.5.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.4.1...1.5.0 +[1.6.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.5.0...1.6.0 +[1.7.0]: https://github.com/secucard/secucard-connect-net-sdk/compare/1.6.0...1.7.0 + diff --git a/lib/Secucard.Connect/Product/General/Model/User.cs b/lib/Secucard.Connect/Product/General/Model/User.cs new file mode 100644 index 0000000..2d11bd6 --- /dev/null +++ b/lib/Secucard.Connect/Product/General/Model/User.cs @@ -0,0 +1,35 @@ +namespace Secucard.Connect.Product.General.Model +{ + using System.Runtime.Serialization; + using Secucard.Connect.Product.Common.Model; + + [DataContract] + public class User : SecuObject + { + [DataMember(Name = "salutation")] + public string Salutation { get; set; } + + [DataMember(Name = "title")] + public string Title { get; set; } + + [DataMember(Name = "forename")] + public string Forename { get; set; } + + [DataMember(Name = "surname")] + public string Surname { get; set; } + + [DataMember(Name = "companyname")] + public string CompanyName { get; set; } + + public override string ToString() + { + return "User{" + + ", companyName='" + CompanyName + '\'' + + ", title='" + Title + '\'' + + ", salutation='" + Salutation + '\'' + + ", forename='" + Forename + '\'' + + ", surname='" + Surname + '\'' + + "} " + base.ToString(); + } + } +} \ No newline at end of file diff --git a/lib/Secucard.Connect/Product/Payment/Model/PaymentTransaction.cs b/lib/Secucard.Connect/Product/Payment/Model/PaymentTransaction.cs new file mode 100644 index 0000000..50d4075 --- /dev/null +++ b/lib/Secucard.Connect/Product/Payment/Model/PaymentTransaction.cs @@ -0,0 +1,94 @@ +namespace Secucard.Connect.Product.Payment.Model +{ + using System; + using System.Runtime.Serialization; + using Secucard.Connect.Net.Util; + using Secucard.Connect.Product.Common.Model; + using Secucard.Connect.Product.General.Model; + + [DataContract] + public class PaymentTransaction : SecuObject + { + [DataMember(Name = "merchant")] + public Merchant Merchant { get; set; } + + [DataMember(Name = "trans_id")] + public int TransId { get; set; } + + [DataMember(Name = "product_id")] + public int ProductId { get; set; } + + [DataMember(Name = "product")] + public string Product { get; set; } + + [DataMember(Name = "product_raw")] + public string ProductRaw { get; set; } + + [DataMember(Name = "zahlungsmittel_id")] + public int ZahlungsmittelId { get; set; } + + [DataMember(Name = "contract_id")] + public int ContractId { get; set; } + + [DataMember(Name = "amount")] + public int Amount { get; set; } + + [DataMember(Name = "currency")] + public string Currency { get; set; } + + [DataMember(Name = "created")] + public string FormattedCreated + { + get { return this.Created.ToDateTimeZone(); } + set { this.Created = value.ToDateTime(); } + } + + public DateTime? Created { get; set; } + + [DataMember(Name = "updated")] + public string FormattedUpdated + { + get { return this.Updated.ToDateTimeZone(); } + set { this.Updated = value.ToDateTime(); } + } + + public DateTime? Updated { get; set; } + + [DataMember(Name = "description")] + public string Description { get; set; } + + [DataMember(Name = "description_raw")] + public string DescriptionRaw { get; set; } + + [DataMember(Name = "status")] + public int Status { get; set; } + + [DataMember(Name = "status_text")] + public string StatusText { get; set; } + + [DataMember(Name = "customer")] + public User Customer { get; set; } + + public override string ToString() + { + return "PaymentTransaction{" + + "Merchant='" + this.Merchant + "', " + + "TransId='" + this.TransId + "', " + + "ProductId='" + this.ProductId + "', " + + "Product='" + this.Product + "', " + + "ProductRaw='" + this.ProductRaw + "', " + + "ZahlungsmittelId='" + this.ZahlungsmittelId + "', " + + "ContractId='" + this.ContractId + "', " + + "Amount='" + this.Amount + "', " + + "Currency='" + this.Currency + "', " + + "FormattedCreated='" + this.FormattedCreated + "', " + + "FormattedUpdated='" + this.FormattedUpdated + "', " + + "Description='" + this.Description + "', " + + "DescriptionRaw='" + this.DescriptionRaw + "', " + + "Status='" + this.Status + "', " + + "StatusText='" + this.StatusText + "', " + + "Customer='" + this.Customer + "'" + + "} " + base.ToString(); + } + } +} \ No newline at end of file diff --git a/lib/Secucard.Connect/Product/Payment/Payment.cs b/lib/Secucard.Connect/Product/Payment/Payment.cs index 7195396..211627a 100644 --- a/lib/Secucard.Connect/Product/Payment/Payment.cs +++ b/lib/Secucard.Connect/Product/Payment/Payment.cs @@ -18,5 +18,7 @@ public class Payment public SecupayCreditcardsService Secupaycreditcards { get; set; } public SecupayInvoicesService Secupayinvoices { get; set; } + + public PaymentTransactionsService PaymentTransactions { get; set; } } } \ No newline at end of file diff --git a/lib/Secucard.Connect/Product/Payment/PaymentTransactionsService.cs b/lib/Secucard.Connect/Product/Payment/PaymentTransactionsService.cs new file mode 100644 index 0000000..2a74d3f --- /dev/null +++ b/lib/Secucard.Connect/Product/Payment/PaymentTransactionsService.cs @@ -0,0 +1,16 @@ +namespace Secucard.Connect.Product.Payment +{ + using Secucard.Connect.Client; + using Secucard.Connect.Product.Payment.Model; + + public class PaymentTransactionsService : ProductService + { + public static readonly ServiceMetaData MetaData = new ServiceMetaData("payment", + "transactions"); + + protected override ServiceMetaData GetMetaData() + { + return MetaData; + } + } +} \ No newline at end of file diff --git a/lib/Secucard.Connect/Product/Smart/TransactionsService.cs b/lib/Secucard.Connect/Product/Smart/TransactionsService.cs index 0f83715..2d2d218 100644 --- a/lib/Secucard.Connect/Product/Smart/TransactionsService.cs +++ b/lib/Secucard.Connect/Product/Smart/TransactionsService.cs @@ -72,9 +72,9 @@ If STOMP server communication is disabled then you have to use REST /// /// Cancel the specific transaction by id /// - public bool Cancel(string transactionId) + public Transaction Cancel(string transactionId) { - return ExecuteToBool(transactionId, "cancel", null, null, null); + return Execute(transactionId, "cancel", null, null, null); } /// diff --git a/lib/Secucard.Connect/Properties/AssemblyInfo.cs b/lib/Secucard.Connect/Properties/AssemblyInfo.cs index 355aca4..ba5be9d 100644 --- a/lib/Secucard.Connect/Properties/AssemblyInfo.cs +++ b/lib/Secucard.Connect/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.0.0")] -[assembly: AssemblyFileVersion("1.6.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.7.0.0")] +[assembly: AssemblyFileVersion("1.7.0.0")] \ No newline at end of file diff --git a/lib/Secucard.Connect/Secucard.Connect.csproj b/lib/Secucard.Connect/Secucard.Connect.csproj index 126a62d..684590f 100644 --- a/lib/Secucard.Connect/Secucard.Connect.csproj +++ b/lib/Secucard.Connect/Secucard.Connect.csproj @@ -99,6 +99,7 @@ + @@ -143,6 +144,8 @@ + + @@ -262,9 +265,7 @@ - - - + Always diff --git a/lib/Secucard.Connect/SecucardConnect.cs b/lib/Secucard.Connect/SecucardConnect.cs index 30d391c..9fef211 100644 --- a/lib/Secucard.Connect/SecucardConnect.cs +++ b/lib/Secucard.Connect/SecucardConnect.cs @@ -25,7 +25,7 @@ namespace Secucard.Connect /// public class SecucardConnect { - public const string Version = "1.6.0"; + public const string Version = "1.7.0"; private readonly ClientConfiguration _configuration; private readonly ClientContext _context; private readonly Dictionary _serviceDict; @@ -255,7 +255,8 @@ private void WireServiceInstances() Secupaydebits = GetService(), Secupayprepays = GetService(), Contracts = GetService(), - Secupayinvoices = GetService() + Secupayinvoices = GetService(), + PaymentTransactions = GetService() }; Loyalty = new Loyalty