Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion StarkBank/StarkBank.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions StarkBank/StarkBank/BrcodePayment/BrcodePayment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public partial class BrcodePayment : Resource
public string Type { get; }
public List<string> TransactionIds { get; }
public int? Fee { get; }
public Dictionary<string, object> Metadata { get; }
public DateTime? Created { get; }
public DateTime? Updated { get; }

Expand Down Expand Up @@ -85,7 +86,7 @@ public partial class BrcodePayment : Resource
/// </summary>
public BrcodePayment(string brcode, string taxID, string description, string id = null, long? amount = null,
DateTime? scheduled = null, List<string> tags = null, List<Rule> rules = null, string name = null,
string status = null, string type = null, List<string> transactionIds = null, int? fee = null,
string status = null, string type = null, List<string> transactionIds = null, int? fee = null, Dictionary<string, object> metadata = null,
DateTime? created = null, DateTime? updated = null
) : base(id)
{
Expand All @@ -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;
}
Expand Down Expand Up @@ -377,14 +379,15 @@ internal static Resource ResourceMaker(dynamic json)
List<string> transactionIds = new List<string>();
transactionIds = json.transactionIds?.ToObject<List<string>>();
int? fee = json.fee;
Dictionary<string, object> metadata = json.metadata.ToObject<Dictionary<string, object>>();
string createdString = json.created;
DateTime? created = StarkCore.Utils.Checks.CheckNullableDateTime(createdString);
string updatedString = json.updated;
DateTime? updated = StarkCore.Utils.Checks.CheckNullableDateTime(updatedString);

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
);
}
Expand Down
14 changes: 10 additions & 4 deletions StarkBank/StarkBank/PaymentPreview/BrcodePreview.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public partial class PaymentPreview
/// <item>ReductionAmount [long]: Current value reduction value in cents that this payment is expecting. ex: 123 (= R$1,23)</item>
/// <item>DiscountAmount [long]: Current discount value in cents that this payment is expecting. ex: 123 (= R$1,23)</item>
/// <item>ReconciliationID [string]: Reconciliation ID linked to this payment. ex: "txId", "payment-123"</item>
/// <item>KeyID [string]: Payment receiver Pix key. ex: "[email protected]", "72246143004", "20018183000180", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9"</item>
/// </list>
/// </summary>
public class BrcodePreview : StarkCore.Utils.SubResource
Expand All @@ -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; }

/// <summary>
/// BrcodePreview object
Expand All @@ -65,10 +67,11 @@ public class BrcodePreview : StarkCore.Utils.SubResource
/// <item>ReconciliationID [string]: Reconciliation ID linked to this payment. ex: "txId", "payment-123"</item>
/// </list>
/// </summary>
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;
Expand All @@ -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()
Expand All @@ -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
);
}
}
Expand Down
7 changes: 4 additions & 3 deletions StarkBank/StarkBank/StarkBank.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<Version>2.16.1</Version>
<ReleaseVersion>2.16.1</ReleaseVersion>
<PackageVersion>2.16.1</PackageVersion>
<PackageId>TarcBank</PackageId>
<Version>2.16.3</Version>
<ReleaseVersion>2.16.3</ReleaseVersion>
<PackageVersion>2.16.3</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion StarkBank/StarkBank/Utils/Rest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SubResource> GetList(User user = null, string resourceName = null, Api.ResourceMaker resourceMaker = null, Dictionary<string, object> query = null)
{
Expand Down
2 changes: 1 addition & 1 deletion StarkBank/StarkBankTests/StarkBankTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<ReleaseVersion>2.16.1</ReleaseVersion>
<ReleaseVersion>2.16.3</ReleaseVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
Expand Down