Skip to content

Commit

Permalink
#4
Browse files Browse the repository at this point in the history
  • Loading branch information
matmiranda committed Aug 18, 2023
1 parent 0b6d315 commit 5059128
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 9 deletions.
20 changes: 20 additions & 0 deletions PagBank/Model/AuthenticationMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace PagBank.Model
{
public class AuthenticationMethod
{
[JsonPropertyName("type"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }
[JsonPropertyName("id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Td { get; set; }
[JsonPropertyName("cavv"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Cavv { get; set; }
[JsonPropertyName("eci"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Eci { get; set; }
[JsonPropertyName("xid"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Xid { get; set; }
[JsonPropertyName("version"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Version { get; set; }
[JsonPropertyName("dstrans_id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DstransId { get; set; }
}
}
12 changes: 12 additions & 0 deletions PagBank/Model/Boleto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace PagBank.Model
{
public class Boleto
{
[JsonPropertyName("instruction_lines"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public InstructionLines? InstructionLines { get; set; }
[JsonPropertyName("holder"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Holder? Holder { get; set; }
[JsonPropertyName("due_date"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DueDate { get; set; }
}
}
14 changes: 11 additions & 3 deletions PagBank/Model/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ public class Card
[JsonPropertyName("number"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Number { get; set; }
[JsonPropertyName("exp_month"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ExpMonth { get; set; }
public int? ExpMonth { get; set; }
[JsonPropertyName("exp_year"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ExpYear { get; set; }
public int? ExpYear { get; set; }
[JsonPropertyName("security_code"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SecuritCode { get; set; }
[JsonPropertyName("holder"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Holder? Holder { get; set; }
[JsonPropertyName("store"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Store { get; set; }
[JsonPropertyName("token_data"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public TokenData? Token_data { get; set; }
[JsonPropertyName("id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Id { get; set; }
[JsonPropertyName("encrypted"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Encrypted { get; set; }
[JsonPropertyName("network_token"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NetworkToken { get; set; }
}
}
}
2 changes: 2 additions & 0 deletions PagBank/Model/Charge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ public class Charge
public PaymentMethod? PaymentMethod { get; set; }
[JsonPropertyName("splits"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Splits? Splits { get; set; }
[JsonPropertyName("notification_urls"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NotificationUrls { get; set; }
}
}
8 changes: 7 additions & 1 deletion PagBank/Model/Holder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ public class Holder
{
[JsonPropertyName("name"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Name { get; set; }
[JsonPropertyName("address"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Address? Address { get; set; }
[JsonPropertyName("tax_id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? TaxId { get; set; }
[JsonPropertyName("email"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Email { get; set; }
}
}
}
10 changes: 10 additions & 0 deletions PagBank/Model/InstructionLines.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace PagBank.Model
{
public class InstructionLines
{
[JsonPropertyName("line_1"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Line1 { get; set; }
[JsonPropertyName("line_2"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Line2 { get; set; }
}
}
2 changes: 1 addition & 1 deletion PagBank/Model/Item.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public class Item
[JsonPropertyName("unit_amount"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? UnitAmount { get; set; }
}
}
}
8 changes: 7 additions & 1 deletion PagBank/Model/PaymentMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@ public class PaymentMethod
public bool? Capture { get; set; }
[JsonPropertyName("card"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Card? Card { get; set; }
[JsonPropertyName("authentication_method"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthenticationMethod? AuthenticationMethod { get; set; }
[JsonPropertyName("boleto"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Boleto? Boleto { get; set; }
[JsonPropertyName("soft_descriptor"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? SoftDescriptor { get; set; }
}
}
}
2 changes: 1 addition & 1 deletion PagBank/Model/Phone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ public class Phone
[JsonPropertyName("type"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Type { get; set; }
}
}
}
10 changes: 10 additions & 0 deletions PagBank/Model/QrCodes.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace PagBank.Model
{
public class QrCodes
{
[JsonPropertyName("amount"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Amount? Amount { get; set; }
[JsonPropertyName("expiration_date"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ExpirationDate { get; set; }
}
}
4 changes: 3 additions & 1 deletion PagBank/Model/Request/PagBankBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,7 @@ public class PagBankBody
public string? Token { get; set; }
[JsonPropertyName("charges"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Charge>? Charges { get; set; }
[JsonPropertyName("qr_codes"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<QrCodes>? QrCodes { get; set; }
}
}
}
16 changes: 16 additions & 0 deletions PagBank/Model/TokenData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace PagBank.Model
{
public class TokenData
{
[JsonPropertyName("requestor_id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? RequestorId { get; set; }
[JsonPropertyName("wallet"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Wallet { get; set; }
[JsonPropertyName("cryptogram"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Cryptogram { get; set; }
[JsonPropertyName("ecommerce_domain"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? EcommerceDomain { get; set; }
[JsonPropertyName("assurance_level"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? AssuranceLevel { get; set; }
}
}
2 changes: 1 addition & 1 deletion PagBank/PagBank.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<Authors>Matheus Miranda, PagBank</Authors>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageTags>pagbank;dotnet</PackageTags>
Expand Down

0 comments on commit 5059128

Please sign in to comment.