-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3037 from stripe/latest-codegen-beta
Update generated code for beta
- Loading branch information
Showing
99 changed files
with
2,044 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### Why? | ||
<!-- Describe why this change is being made. Briefly include history and context, high-level what this PR does, and what the world looks like afterward. --> | ||
|
||
### What? | ||
<!-- | ||
List out the key changes made in this PR, e.g. | ||
- implements the antimatter particle trace in the nitronium microfilament drive | ||
- updated tests --> | ||
|
||
### See Also | ||
<!-- Include any links or additional information that help explain this change. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1406 | ||
v1438 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
[![Build Status](https://github.com/stripe/stripe-dotnet/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-dotnet/actions?query=branch%3Amaster) | ||
[![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-dotnet/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-dotnet?branch=master) | ||
|
||
The official [Stripe][stripe] .NET library, supporting .NET Standard 2.0+, .NET Core 2.0+, and .NET Framework 4.6.1+. | ||
The official [Stripe][stripe] .NET library, supporting .NET Standard 2.0+, .NET Core 3.1+, and .NET Framework 4.6.1+. | ||
|
||
## Installation | ||
|
||
|
@@ -30,10 +30,10 @@ From within Visual Studio: | |
|
||
1. Open the Solution Explorer. | ||
2. Right-click on a project within your solution. | ||
3. Click on *Manage NuGet Packages...* | ||
4. Click on the *Browse* tab and search for "Stripe.net". | ||
3. Click on _Manage NuGet Packages..._ | ||
4. Click on the _Browse_ tab and search for "Stripe.net". | ||
5. Click on the Stripe.net package, select the appropriate version in the | ||
right-tab and click *Install*. | ||
right-tab and click _Install_. | ||
|
||
## Documentation | ||
|
||
|
@@ -49,15 +49,15 @@ Stripe authenticates API requests using your account’s secret key, which you c | |
|
||
Use `StripeConfiguration.ApiKey` property to set the secret key. | ||
|
||
``` C# | ||
```C# | ||
StripeConfiguration.ApiKey = "sk_test_..."; | ||
``` | ||
|
||
### Creating a resource | ||
|
||
The `Create` method of the service class can be used to create a new resource: | ||
|
||
``` C# | ||
```C# | ||
var options = new CustomerCreateOptions | ||
{ | ||
Email = "[email protected]" | ||
|
@@ -74,7 +74,7 @@ Console.WriteLine(customer.Email); | |
|
||
The `Retrieve` method of the service class can be used to retrieve a resource: | ||
|
||
``` C# | ||
```C# | ||
var service = new CustomerService(); | ||
Customer customer = service.Get("cus_1234"); | ||
|
||
|
@@ -370,10 +370,13 @@ go install github.com/stripe/stripe-mock@latest | |
stripe-mock | ||
``` | ||
|
||
Lastly, we use [just](https://github.com/casey/just) for running common development tasks. You can also read the `justfile` and run those commands directly. | ||
|
||
Run all tests from the `src/StripeTests` directory: | ||
|
||
```sh | ||
dotnet test src | ||
just test | ||
# or: dotnet test src | ||
``` | ||
|
||
Run some tests, filtering by name: | ||
|
@@ -393,7 +396,8 @@ must be formatted before PRs are submitted, otherwise CI will fail. Run the | |
formatter with: | ||
|
||
```sh | ||
dotnet format src/Stripe.net.sln | ||
just format | ||
# or: dotnet format src/Stripe.net.sln | ||
``` | ||
|
||
For any requests, bug or comments, please [open an issue][issues] or [submit a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
set quiet | ||
|
||
import? '../sdk-codegen/justfile' | ||
|
||
_default: | ||
just --list --unsorted | ||
|
||
# base test command that other, more specific commands use | ||
[no-quiet] | ||
[no-exit-message] | ||
_test no_build framework config: | ||
dotnet test {{no_build}} {{framework}} src/StripeTests/StripeTests.csproj -c {{config}} | ||
|
||
# ⭐ run tests in debug mode | ||
test: (_test "" "-f net8.0" "Debug") | ||
|
||
# skip build and don't specify the dotnet framework | ||
ci-test: (_test "--no-build" "" "Release") | ||
|
||
# ⭐ format all files | ||
format *args: | ||
# This sets TargetFramework because of a race condition in dotnet format when it tries to format to multiple targets at a time, which could lead to code with compiler errors after it completes | ||
TargetFramework=net5.0 dotnet format src/Stripe.net/Stripe.net.csproj --severity warn {{args}} | ||
|
||
# for backwards compatibility; ideally removed later | ||
[private] | ||
alias codegen-format := format | ||
|
||
# verify, but don't modify, the project's formatting | ||
format-check: (format "--verify-no-changes") | ||
|
||
# called by tooling | ||
[private] | ||
update-version version: | ||
echo "{{ version }}" > VERSION | ||
perl -pi -e 's|<Version>[.\-\d\w]+</Version>|<Version>{{ version }}</Version>|' src/Stripe.net/Stripe.net.csproj | ||
perl -pi -e 's|Current = "[.\-\d\w]+";|Current = "{{ version }}";|' src/Stripe.net/Constants/Version.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/Stripe.net/Entities/Accounts/AccountCompanyDirectorshipDeclaration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// File generated from our OpenAPI spec | ||
namespace Stripe | ||
{ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Stripe.Infrastructure; | ||
#if NET6_0_OR_GREATER | ||
using STJS = System.Text.Json.Serialization; | ||
#endif | ||
|
||
public class AccountCompanyDirectorshipDeclaration : StripeEntity<AccountCompanyDirectorshipDeclaration> | ||
{ | ||
/// <summary> | ||
/// The Unix timestamp marking when the directorship declaration attestation was made. | ||
/// </summary> | ||
[JsonProperty("date")] | ||
[JsonConverter(typeof(UnixDateTimeConverter))] | ||
#if NET6_0_OR_GREATER | ||
[STJS.JsonPropertyName("date")] | ||
[STJS.JsonConverter(typeof(STJUnixDateTimeConverter))] | ||
#endif | ||
public DateTime? Date { get; set; } | ||
|
||
/// <summary> | ||
/// The IP address from which the directorship declaration attestation was made. | ||
/// </summary> | ||
[JsonProperty("ip")] | ||
#if NET6_0_OR_GREATER | ||
[STJS.JsonPropertyName("ip")] | ||
#endif | ||
public string Ip { get; set; } | ||
|
||
/// <summary> | ||
/// The user-agent string from the browser where the directorship declaration attestation | ||
/// was made. | ||
/// </summary> | ||
[JsonProperty("user_agent")] | ||
#if NET6_0_OR_GREATER | ||
[STJS.JsonPropertyName("user_agent")] | ||
#endif | ||
public string UserAgent { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.