diff --git a/StarkBank/StarkBank.sln b/StarkBank/StarkBank.sln index 764e3ef..4e66743 100644 --- a/StarkBank/StarkBank.sln +++ b/StarkBank/StarkBank.sln @@ -36,6 +36,6 @@ Global $6.TabsToSpaces = True $6.scope = text/plain description = SDK to facilitate .NET integrations with Stark Bank - version = 2.16.1 + version = 2.16.3 EndGlobalSection EndGlobal diff --git a/StarkBank/StarkBank/BrcodePayment/BrcodePayment.cs b/StarkBank/StarkBank/BrcodePayment/BrcodePayment.cs index b4abe34..0a2f0a3 100644 --- a/StarkBank/StarkBank/BrcodePayment/BrcodePayment.cs +++ b/StarkBank/StarkBank/BrcodePayment/BrcodePayment.cs @@ -46,6 +46,7 @@ public partial class BrcodePayment : Resource public string Type { get; } public List TransactionIds { get; } public int? Fee { get; } + public Dictionary Metadata { get; } public DateTime? Created { get; } public DateTime? Updated { get; } @@ -85,7 +86,7 @@ public partial class BrcodePayment : Resource /// public BrcodePayment(string brcode, string taxID, string description, string id = null, long? amount = null, DateTime? scheduled = null, List tags = null, List rules = null, string name = null, - string status = null, string type = null, List transactionIds = null, int? fee = null, + string status = null, string type = null, List transactionIds = null, int? fee = null, Dictionary metadata = null, DateTime? created = null, DateTime? updated = null ) : base(id) { @@ -101,6 +102,7 @@ public BrcodePayment(string brcode, string taxID, string description, string id Type = type; TransactionIds = transactionIds; Fee = fee; + Metadata = metadata; Created = created; Updated = updated; } @@ -377,6 +379,7 @@ internal static Resource ResourceMaker(dynamic json) List transactionIds = new List(); transactionIds = json.transactionIds?.ToObject>(); int? fee = json.fee; + Dictionary metadata = json.metadata.ToObject>(); string createdString = json.created; DateTime? created = StarkCore.Utils.Checks.CheckNullableDateTime(createdString); string updatedString = json.updated; @@ -384,7 +387,7 @@ internal static Resource ResourceMaker(dynamic json) return new BrcodePayment( id: id, brcode: brcode, taxID: taxID, description: description, amount: amount, scheduled: scheduled, tags: tags, - rules: rules, name: name, status: status, type: type, transactionIds: transactionIds, fee: fee, created: created, + rules: rules, name: name, status: status, type: type, transactionIds: transactionIds, fee: fee, metadata: metadata, created: created, updated: updated ); } diff --git a/StarkBank/StarkBank/PaymentPreview/BrcodePreview.cs b/StarkBank/StarkBank/PaymentPreview/BrcodePreview.cs index cae7f33..301144f 100644 --- a/StarkBank/StarkBank/PaymentPreview/BrcodePreview.cs +++ b/StarkBank/StarkBank/PaymentPreview/BrcodePreview.cs @@ -25,6 +25,7 @@ public partial class PaymentPreview /// ReductionAmount [long]: Current value reduction value in cents that this payment is expecting. ex: 123 (= R$1,23) /// DiscountAmount [long]: Current discount value in cents that this payment is expecting. ex: 123 (= R$1,23) /// ReconciliationID [string]: Reconciliation ID linked to this payment. ex: "txId", "payment-123" + /// KeyID [string]: Payment receiver Pix key. ex: "tony@starkbank.com", "72246143004", "20018183000180", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9" /// /// public class BrcodePreview : StarkCore.Utils.SubResource @@ -42,6 +43,7 @@ public class BrcodePreview : StarkCore.Utils.SubResource public long ReductionAmount { get; } public long DiscountAmount { get; } public string ReconciliationID { get; } + public string KeyID { get; } /// /// BrcodePreview object @@ -65,10 +67,11 @@ public class BrcodePreview : StarkCore.Utils.SubResource /// ReconciliationID [string]: Reconciliation ID linked to this payment. ex: "txId", "payment-123" /// /// - public BrcodePreview(string status, string name, string taxID, string bankCode, + public BrcodePreview(string status, string name, string taxID, string bankCode, string accountType, bool allowChange, long amount, long nominalAmount, long interestAmount, - long fineAmount, long reductionAmount, long discountAmount, string reconciliationID - ) { + long fineAmount, long reductionAmount, long discountAmount, string reconciliationID, string keyID + ) + { Status = status; Name = name; TaxID = taxID; @@ -82,6 +85,7 @@ public BrcodePreview(string status, string name, string taxID, string bankCode, ReductionAmount = reductionAmount; DiscountAmount = discountAmount; ReconciliationID = reconciliationID; + KeyID = keyID; } internal static (string resourceName, StarkCore.Utils.Api.ResourceMaker resourceMaker) SubResource() @@ -104,12 +108,14 @@ public static StarkCore.Utils.SubResource ResourceMaker(dynamic json) long reductionAmount = json.reductionAmount; long discountAmount = json.discountAmount; string reconciliationID = json.reconciliationId; + string keyID = json.keyId; return new BrcodePreview( status: status, name: name, taxID: taxID, bankCode: bankCode, accountType: accountType, allowChange: allowChange, amount: amount, nominalAmount: nominalAmount, interestAmount: interestAmount, fineAmount: fineAmount, - reductionAmount: reductionAmount, discountAmount: discountAmount, reconciliationID: reconciliationID + reductionAmount: reductionAmount, discountAmount: discountAmount, + reconciliationID: reconciliationID, keyID: keyID ); } } diff --git a/StarkBank/StarkBank/StarkBank.csproj b/StarkBank/StarkBank/StarkBank.csproj index 29cbc22..de1c097 100644 --- a/StarkBank/StarkBank/StarkBank.csproj +++ b/StarkBank/StarkBank/StarkBank.csproj @@ -2,9 +2,10 @@ netstandard2.0;netstandard2.1 - 2.16.1 - 2.16.1 - 2.16.1 + TarcBank + 2.16.3 + 2.16.3 + 2.16.3 diff --git a/StarkBank/StarkBank/Utils/Rest.cs b/StarkBank/StarkBank/Utils/Rest.cs index 44d3090..3504e8a 100644 --- a/StarkBank/StarkBank/Utils/Rest.cs +++ b/StarkBank/StarkBank/Utils/Rest.cs @@ -16,7 +16,7 @@ public class Rest static string host = StarkHost.bank; static string apiVersion = "v2"; - static string sdkVersion = "2.16.1"; + static string sdkVersion = "2.16.3"; public static IEnumerable GetList(User user = null, string resourceName = null, Api.ResourceMaker resourceMaker = null, Dictionary query = null) { diff --git a/StarkBank/StarkBankTests/StarkBankTests.csproj b/StarkBank/StarkBankTests/StarkBankTests.csproj index c8fd8a4..1bf43e3 100644 --- a/StarkBank/StarkBankTests/StarkBankTests.csproj +++ b/StarkBank/StarkBankTests/StarkBankTests.csproj @@ -3,7 +3,7 @@ netcoreapp3.1 false - 2.16.1 + 2.16.3