Skip to content

Commit d58d93c

Browse files
Fixed Payment-related DTOs.
1 parent 1318e3a commit d58d93c

10 files changed

+290
-25
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Asaas .NET SDK 1.1.3
1+
# Asaas .NET SDK 1.1.4
22

33
Welcome to the official Asaas API SDK for .NET 8 documentation.
44

@@ -7,7 +7,7 @@ This guide will help you get started with integrating and using the Asaas SDK in
77
## Versions
88

99
- API version: `3.0.0`
10-
- SDK version: `1.1.3`
10+
- SDK version: `1.1.4`
1111
- .NET version: `8.0`
1212

1313
## About the API
@@ -40,21 +40,21 @@ This SDK is compatible with: `.NET 8.0` or higher
4040
### Using .NET CLI
4141

4242
```bash
43-
dotnet add package TorinoInfo.AsaasSdk --version 1.1.3
43+
dotnet add package TorinoInfo.AsaasSdk --version 1.1.4
4444
```
4545

4646
### Using Package Manager Console
4747

4848
```powershell
49-
Install-Package TorinoInfo.AsaasSdk -Version 1.1.3
49+
Install-Package TorinoInfo.AsaasSdk -Version 1.1.4
5050
```
5151

5252
### Using PackageReference
5353

5454
Add the following to your `.csproj` file:
5555

5656
```xml
57-
<PackageReference Include="TorinoInfo.AsaasSdk" Version="1.1.3" />
57+
<PackageReference Include="TorinoInfo.AsaasSdk" Version="1.1.4" />
5858
```
5959

6060
## Authentication

src/Asaas.Sdk.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Nullable>enable</Nullable>
77
<LangVersion>latest</LangVersion>
88
<PackageId>TorinoInfo.AsaasSdk</PackageId>
9-
<PackageVersion>1.1.3</PackageVersion>
10-
<Version>1.1.3</Version>
9+
<PackageVersion>1.1.4</PackageVersion>
10+
<Version>1.1.4</Version>
1111
<Authors>Marco Ribeiro</Authors>
1212
<Company>Torino Informática</Company>
1313
<Description>A .NET 8 SDK for Asaas Payment Gateway API</Description>
@@ -19,6 +19,7 @@
1919
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2020
<NoWarn>CS1591;CS1584</NoWarn>
2121
<PackageReleaseNotes>
22+
* 1.1.4 - Fixed Payment-related DTOs.
2223
* 1.1.3 - Fixed MunicipalServiceDto.
2324
* 1.1.2 - Implemented missing methods in FiscalService.
2425
* 1.1.1 - Added missing DTOs for a few services.

src/Config/AsaasSdkConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class AsaasSdkConfig
88
/// <summary>
99
/// User agent string for HTTP requests
1010
/// </summary>
11-
public string UserAgent { get; set; } = "asaas-sdk-dotnet/1.1.3";
11+
public string UserAgent { get; set; } = "asaas-sdk-dotnet/1.1.4";
1212

1313
/// <summary>
1414
/// Base URL for API requests
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace Asaas.Sdk.Models;
4+
5+
/// <summary>
6+
/// Automatic redirection information after the payment of the link payment
7+
/// </summary>
8+
public class PaymentCallbackRequestDto
9+
{
10+
/// <summary>
11+
/// URL that the customer will be redirected to after successful payment of the invoice or payment link
12+
/// </summary>
13+
[JsonPropertyName("successUrl")]
14+
public string? SuccessUrl { get; set; }
15+
16+
/// <summary>
17+
/// Define whether the customer will be automatically redirected or will just be informed with a button to return to the website. The default is true, if you want to disable it, enter false
18+
/// </summary>
19+
[JsonPropertyName("autoRedirect")]
20+
public bool? AutoRedirect { get; set; }
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace Asaas.Sdk.Models;
4+
5+
/// <summary>
6+
/// Fine information for payment after due date
7+
/// </summary>
8+
public class PaymentFineRequestDto
9+
{
10+
/// <summary>
11+
/// Percentage of fine on the amount of the charge for payment after the due date
12+
/// </summary>
13+
[JsonPropertyName("value")]
14+
public decimal? Value { get; set; }
15+
16+
/// <summary>
17+
/// Fine type (FIXED or PERCENTAGE)
18+
/// </summary>
19+
[JsonPropertyName("type")]
20+
public string? Type { get; set; }
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace Asaas.Sdk.Models;
4+
5+
/// <summary>
6+
/// Interest information for payment after due date
7+
/// </summary>
8+
public class PaymentInterestRequestDto
9+
{
10+
/// <summary>
11+
/// Percentage of interest per month on the amount charged for payment after maturity
12+
/// </summary>
13+
[JsonPropertyName("value")]
14+
public decimal? Value { get; set; }
15+
}

src/Models/PaymentSaveRequestDto.cs

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,98 @@ namespace Asaas.Sdk.Models;
88
public class PaymentSaveRequestDto
99
{
1010
/// <summary>
11-
/// Customer identifier
11+
/// Unique customer identifier in Asaas
1212
/// </summary>
1313
[JsonPropertyName("customer")]
1414
public string? Customer { get; set; }
1515

1616
/// <summary>
17-
/// Billing type
17+
/// Payment billing type
1818
/// </summary>
1919
[JsonPropertyName("billingType")]
2020
public string? BillingType { get; set; }
2121

2222
/// <summary>
23-
/// Payment value
23+
/// Payment amount
2424
/// </summary>
2525
[JsonPropertyName("value")]
2626
public decimal Value { get; set; }
2727

2828
/// <summary>
29-
/// Due date
29+
/// Payment due date
3030
/// </summary>
3131
[JsonPropertyName("dueDate")]
3232
public string? DueDate { get; set; }
3333

3434
/// <summary>
35-
/// Description
35+
/// Payment description (max. 500 characters)
3636
/// </summary>
3737
[JsonPropertyName("description")]
3838
public string? Description { get; set; }
3939

4040
/// <summary>
41-
/// External reference
41+
/// Days after registration cancellation deadline (only for bank slip)
42+
/// </summary>
43+
[JsonPropertyName("daysAfterDueDateToRegistrationCancellation")]
44+
public long? DaysAfterDueDateToRegistrationCancellation { get; set; }
45+
46+
/// <summary>
47+
/// Free search field
4248
/// </summary>
4349
[JsonPropertyName("externalReference")]
4450
public string? ExternalReference { get; set; }
51+
52+
/// <summary>
53+
/// Number of installments (only in the case of installment payment)
54+
/// </summary>
55+
[JsonPropertyName("installmentCount")]
56+
public long? InstallmentCount { get; set; }
57+
58+
/// <summary>
59+
/// Enter the total amount of a charge that will be paid in installments (only in the case of an installment charge). If this field is sent, the installmentValue is not necessary, the calculation per installment will be automatic.
60+
/// </summary>
61+
[JsonPropertyName("totalValue")]
62+
public decimal? TotalValue { get; set; }
63+
64+
/// <summary>
65+
/// Value of each installment (only in the case of installment payment). Send this field if you want to define the value of each installment.
66+
/// </summary>
67+
[JsonPropertyName("installmentValue")]
68+
public decimal? InstallmentValue { get; set; }
69+
70+
/// <summary>
71+
/// Discount information
72+
/// </summary>
73+
[JsonPropertyName("discount")]
74+
public PaymentDiscountDto? Discount { get; set; }
75+
76+
/// <summary>
77+
/// Interest information for payment after due date
78+
/// </summary>
79+
[JsonPropertyName("interest")]
80+
public PaymentInterestRequestDto? Interest { get; set; }
81+
82+
/// <summary>
83+
/// Fine information for payment after due date
84+
/// </summary>
85+
[JsonPropertyName("fine")]
86+
public PaymentFineRequestDto? Fine { get; set; }
87+
88+
/// <summary>
89+
/// Define whether the payment will be sent via post
90+
/// </summary>
91+
[JsonPropertyName("postalService")]
92+
public bool? PostalService { get; set; }
93+
94+
/// <summary>
95+
/// Split Settings
96+
/// </summary>
97+
[JsonPropertyName("split")]
98+
public List<PaymentSplitRequestDto>? Split { get; set; }
99+
100+
/// <summary>
101+
/// Automatic redirection information after the payment of the link payment
102+
/// </summary>
103+
[JsonPropertyName("callback")]
104+
public PaymentCallbackRequestDto? Callback { get; set; }
45105
}

src/Models/PaymentSaveWithCreditCardRequestDto.cs

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,101 @@ namespace Asaas.Sdk.Models;
88
public class PaymentSaveWithCreditCardRequestDto
99
{
1010
/// <summary>
11-
/// Customer identifier
11+
/// Unique customer identifier in Asaas
1212
/// </summary>
1313
[JsonPropertyName("customer")]
1414
public string? Customer { get; set; }
1515

1616
/// <summary>
17-
/// Billing type
17+
/// Payment billing type
1818
/// </summary>
1919
[JsonPropertyName("billingType")]
2020
public string? BillingType { get; set; }
2121

2222
/// <summary>
23-
/// Payment value
23+
/// Payment amount
2424
/// </summary>
2525
[JsonPropertyName("value")]
2626
public decimal Value { get; set; }
2727

2828
/// <summary>
29-
/// Due date
29+
/// Payment due date
3030
/// </summary>
3131
[JsonPropertyName("dueDate")]
3232
public string? DueDate { get; set; }
3333

3434
/// <summary>
35-
/// Description
35+
/// Payment description (max. 500 characters)
3636
/// </summary>
3737
[JsonPropertyName("description")]
3838
public string? Description { get; set; }
3939

4040
/// <summary>
41-
/// External reference
41+
/// Days after registration cancellation deadline (only for bank slip)
42+
/// </summary>
43+
[JsonPropertyName("daysAfterDueDateToRegistrationCancellation")]
44+
public long? DaysAfterDueDateToRegistrationCancellation { get; set; }
45+
46+
/// <summary>
47+
/// Free search field
4248
/// </summary>
4349
[JsonPropertyName("externalReference")]
4450
public string? ExternalReference { get; set; }
4551

52+
/// <summary>
53+
/// Number of installments (only in the case of installment payment)
54+
/// </summary>
55+
[JsonPropertyName("installmentCount")]
56+
public long? InstallmentCount { get; set; }
57+
58+
/// <summary>
59+
/// Enter the total amount of a charge that will be paid in installments (only in the case of an installment charge). If this field is sent, the installmentValue is not necessary, the calculation per installment will be automatic.
60+
/// </summary>
61+
[JsonPropertyName("totalValue")]
62+
public decimal? TotalValue { get; set; }
63+
64+
/// <summary>
65+
/// Value of each installment (only in the case of installment payment). Send this field if you want to define the value of each installment.
66+
/// </summary>
67+
[JsonPropertyName("installmentValue")]
68+
public decimal? InstallmentValue { get; set; }
69+
70+
/// <summary>
71+
/// Discount information
72+
/// </summary>
73+
[JsonPropertyName("discount")]
74+
public PaymentDiscountDto? Discount { get; set; }
75+
76+
/// <summary>
77+
/// Interest information for payment after due date
78+
/// </summary>
79+
[JsonPropertyName("interest")]
80+
public PaymentInterestRequestDto? Interest { get; set; }
81+
82+
/// <summary>
83+
/// Fine information for payment after due date
84+
/// </summary>
85+
[JsonPropertyName("fine")]
86+
public PaymentFineRequestDto? Fine { get; set; }
87+
88+
/// <summary>
89+
/// Define whether the payment will be sent via post
90+
/// </summary>
91+
[JsonPropertyName("postalService")]
92+
public bool? PostalService { get; set; }
93+
94+
/// <summary>
95+
/// Split Settings
96+
/// </summary>
97+
[JsonPropertyName("split")]
98+
public List<PaymentSplitRequestDto>? Split { get; set; }
99+
100+
/// <summary>
101+
/// Automatic redirection information after the payment of the link payment
102+
/// </summary>
103+
[JsonPropertyName("callback")]
104+
public PaymentCallbackRequestDto? Callback { get; set; }
105+
46106
/// <summary>
47107
/// Credit card holder name
48108
/// </summary>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System.Text.Json.Serialization;
2+
3+
namespace Asaas.Sdk.Models;
4+
5+
/// <summary>
6+
/// Split Settings
7+
/// </summary>
8+
public class PaymentSplitRequestDto
9+
{
10+
/// <summary>
11+
/// Asaas wallet identifier that will be transferred
12+
/// </summary>
13+
[JsonPropertyName("walletId")]
14+
public string? WalletId { get; set; }
15+
16+
/// <summary>
17+
/// Fixed amount to be transferred to the account when the payment is received
18+
/// </summary>
19+
[JsonPropertyName("fixedValue")]
20+
public decimal? FixedValue { get; set; }
21+
22+
/// <summary>
23+
/// Percentage of the net value of the charge to be transferred when received
24+
/// </summary>
25+
[JsonPropertyName("percentualValue")]
26+
public decimal? PercentualValue { get; set; }
27+
28+
/// <summary>
29+
/// (Instalments only). Amount that will be split relative to the total amount that will be paid in installments.
30+
/// </summary>
31+
[JsonPropertyName("totalFixedValue")]
32+
public decimal? TotalFixedValue { get; set; }
33+
34+
/// <summary>
35+
/// Split identifier in your system
36+
/// </summary>
37+
[JsonPropertyName("externalReference")]
38+
public string? ExternalReference { get; set; }
39+
40+
/// <summary>
41+
/// Split description
42+
/// </summary>
43+
[JsonPropertyName("description")]
44+
public string? Description { get; set; }
45+
}

0 commit comments

Comments
 (0)