Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #3037

Merged
merged 25 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
51c8dac
Update generated code for v1407
stripe-openapi[bot] Dec 12, 2024
3672758
Update generated code for v1408
stripe-openapi[bot] Dec 13, 2024
52ced27
Update generated code for v1409
stripe-openapi[bot] Dec 13, 2024
5d6f43e
Update generated code for v1410
stripe-openapi[bot] Dec 13, 2024
c2640c5
Update generated code for v1411
stripe-openapi[bot] Dec 14, 2024
3851e9e
Update generated code for v1413
stripe-openapi[bot] Dec 16, 2024
eb21e06
Update generated code for v1414
stripe-openapi[bot] Dec 16, 2024
2075710
Update generated code for v1416
stripe-openapi[bot] Dec 18, 2024
d847a85
Update generated code (#3036)
stripe-openapi[bot] Dec 18, 2024
e78194c
Bump version to 47.2.0
jar-stripe Dec 18, 2024
e76acfb
Merge upstream and update generated code for v1417
stripe-openapi[bot] Dec 19, 2024
9d57993
Added pull request template (#3038)
jar-stripe Dec 19, 2024
a18e87f
corrected our readme to accurate describe the .NET versions we suppor…
jar-stripe Dec 19, 2024
53d6b64
Merge upstream and update generated code for v1418
stripe-openapi[bot] Dec 19, 2024
fd256df
Update generated code for v1423
stripe-openapi[bot] Dec 23, 2024
d6d38a7
Update generated code for v1429
stripe-openapi[bot] Jan 2, 2025
6f83873
Update generated code for v1430
stripe-openapi[bot] Jan 3, 2025
b7fb5eb
Remove debug build and test from CI (#3042)
jar-stripe Jan 6, 2025
adc2b73
Merge upstream and update generated code for v1431
stripe-openapi[bot] Jan 7, 2025
646b1f9
Update generated code for v1432
stripe-openapi[bot] Jan 7, 2025
55b0679
Update generated code for v1433
stripe-openapi[bot] Jan 7, 2025
2d134cd
Update generated code for v1435
stripe-openapi[bot] Jan 8, 2025
00a4abc
Update generated code for v1436
stripe-openapi[bot] Jan 8, 2025
90e57f6
Add justfile, remove coveralls (#3040)
xavdid-stripe Jan 9, 2025
6d044b4
Merge upstream and update generated code for v1438
stripe-openapi[bot] Jan 9, 2025
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
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
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. -->
90 changes: 25 additions & 65 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: extractions/setup-just@v2
- uses: actions/checkout@master

- name: Setup .NET
Expand All @@ -44,55 +45,14 @@ jobs:
- name: Build Release
run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true

- name: Build Debug
run: dotnet build src -c Debug

- uses: stripe/openapi/actions/stripe-mock@master

- name: Run test suite
run: make ci-test

- name: Run test suite (Debug)
run: make ci-test-debug

- name: Collect coverage
run: dotnet test --no-build -c Debug -f netcoreapp3.1 src/StripeTests/StripeTests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:ExcludeByAttribute=CompilerGenerated

- name: Get branch name (merge)
if: github.event_name != 'pull_request'
run: echo "commitBranch=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
run: echo "commitBranch=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV

- name: Send code coverage report to coveralls.io
if: env.COVERALLS_REPO_TOKEN
run: |
export ARGS="--opencover \
-i src/StripeTests/coverage.netcoreapp3.1.opencover.xml \
--repoToken $COVERALLS_REPO_TOKEN \
--useRelativePaths \
--commitId $commitId \
--commitBranch $commitBranch \
--commitAuthor $commitAuthor \
--jobId $jobId"
if [ ! -z "${pullRequestId}" ];
then
export ARGS="$ARGS \
--pullRequest $pullRequestId"
fi
dotnet tool run csmacnz.Coveralls $ARGS
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
commitId: ${{ github.sha }}
commitAuthor: ${{ github.actor }}
jobId: ${{ github.run_id }}
pullRequestId: ${{ github.event.pull_request.number }}
run: just ci-test

- name: Pack
run: dotnet pack src/Stripe.net -c Release --no-build --output nuget
- name: 'Upload Artifact'
- name: "Upload Artifact"
uses: actions/upload-artifact@v4
with:
name: nuget
Expand All @@ -103,32 +63,32 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Run backcompat check
run: dotnet pack src/Stripe.net -p:RunBaselineCheck=true
- uses: actions/checkout@master
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Run backcompat check
run: dotnet pack src/Stripe.net -p:RunBaselineCheck=true

publish:
name: Publish
if: (((github.event_name == 'push') || (github.event_name == 'workflow_dispatch')) && startsWith(github.ref, 'refs/tags/v') && endsWith(github.actor, '-stripe'))
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
name: nuget
path: nuget
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Publish NuGet packages to NuGet
run: dotnet nuget push nuget/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source "nuget.org"
- uses: stripe/openapi/actions/notify-release@master
if: always()
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
name: nuget
path: nuget
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Publish NuGet packages to NuGet
run: dotnet nuget push nuget/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source "nuget.org"
- uses: stripe/openapi/actions/notify-release@master
if: always()
with:
bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 47.2.0 - 2024-12-18
* [#3036](https://github.com/stripe/stripe-dotnet/pull/3036) This release changes the pinned API version to `2024-12-18.acacia`.
* Add support for `NetworkAdviceCode` and `NetworkDeclineCode` on `ChargeOutcome`, `InvoiceLastFinalizationError`, `PaymentIntentLastPaymentError`, `SetupAttemptSetupError`, `SetupIntentLastSetupError`, and `StripeError`
* Add support for `CreditsApplicationInvoiceVoided` on `BillingCreditBalanceTransactionCredit`
* Change type of `BillingCreditBalanceTransactionCreditType` from `literal('credits_granted')` to `enum('credits_application_invoice_voided'|'credits_granted')`
* Add support for `AllowRedisplay` on `Card` and `Source`
* Add support for `RegulatedStatus` on `Card`, `ChargePaymentMethodDetailsCard`, `ConfirmationTokenPaymentMethodPreviewCard`, and `PaymentMethodCard`
* Add support for `Funding` on `ChargePaymentMethodDetailsAmazonPay` and `ChargePaymentMethodDetailsRevolutPay`
* Add support for `NetworkTransactionId` on `ChargePaymentMethodDetailsCard`
* Add support for `ReferencePrefix` on `CheckoutSessionPaymentMethodOptionsBacsDebitMandateOptionsOptions`, `CheckoutSessionPaymentMethodOptionsBacsDebitMandateOptions`, `CheckoutSessionPaymentMethodOptionsSepaDebitMandateOptionsOptions`, `CheckoutSessionPaymentMethodOptionsSepaDebitMandateOptions`, `PaymentIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions`, `PaymentIntentPaymentMethodOptionsBacsDebitMandateOptions`, `PaymentIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions`, `PaymentIntentPaymentMethodOptionsSepaDebitMandateOptions`, `SetupIntentPaymentMethodOptionsBacsDebitMandateOptionsOptions`, `SetupIntentPaymentMethodOptionsBacsDebitMandateOptions`, `SetupIntentPaymentMethodOptionsSepaDebitMandateOptionsOptions`, and `SetupIntentPaymentMethodOptionsSepaDebitMandateOptions`
* Add support for `VisaCompliance` on `DisputeEvidenceDetailsEnhancedEligibility`, `DisputeEvidenceEnhancedEvidenceOptions`, and `DisputeEvidenceEnhancedEvidence`
* Add support for `AccountHolderAddress` and `BankAddress` on `FundingInstructionsBankTransferFinancialAddressesIban`, `FundingInstructionsBankTransferFinancialAddressesSortCode`, `FundingInstructionsBankTransferFinancialAddressesSpei`, `FundingInstructionsBankTransferFinancialAddressesZengin`, `PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressesIban`, `PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressesSortCode`, `PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressesSpei`, and `PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressesZengin`
* Add support for `AccountHolderName` on `FundingInstructionsBankTransferFinancialAddressesSpei` and `PaymentIntentNextActionDisplayBankTransferInstructionsFinancialAddressesSpei`
* Add support for `DisabledReason` on `InvoiceAutomaticTax`, `SubscriptionAutomaticTax`, `SubscriptionScheduleDefaultSettingsAutomaticTax`, and `SubscriptionSchedulePhasesAutomaticTax`
* Add support for `TaxId` on `IssuingAuthorizationMerchantData` and `IssuingTransactionMerchantData`
* Add support for `TrialPeriodDays` on `PaymentLinkSubscriptionDataOptions`
* Add support for `Al`, `Am`, `Ao`, `Ba`, `Bb`, `Bs`, `Cd`, `Gn`, `Kh`, `Me`, `Mk`, `Mr`, `Np`, `Pe`, `Sn`, `Sr`, `Tj`, `Ug`, `Uy`, `Zm`, and `Zw` on `TaxRegistrationCountryOptionsOptions` and `TaxRegistrationCountryOptions`

## 47.2.0-beta.3 - 2024-12-12
* [#3035](https://github.com/stripe/stripe-dotnet/pull/3035) Update generated code for beta
* Add support for `AllowRedisplay` on `Card` and `Source`
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands.

.PHONY: update-version codegen-format test ci-test
update-version:
@echo "$(VERSION)" > VERSION
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1406
v1438
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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]"
Expand All @@ -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");

Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
37 changes: 37 additions & 0 deletions justfile
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
20 changes: 20 additions & 0 deletions src/Stripe.net/Entities/Accounts/AccountCompany.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ public class AccountCompany : StripeEntity<AccountCompany>
#endif
public bool DirectorsProvided { get; set; }

/// <summary>
/// This hash is used to attest that the director information provided to Stripe is both
/// current and correct.
/// </summary>
[JsonProperty("directorship_declaration")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("directorship_declaration")]
#endif
public AccountCompanyDirectorshipDeclaration DirectorshipDeclaration { get; set; }

/// <summary>
/// Whether the company's executives have been provided. This Boolean will be <c>true</c> if
/// you've manually indicated that all executives are provided via <a
Expand Down Expand Up @@ -128,6 +138,16 @@ public class AccountCompany : StripeEntity<AccountCompany>
#endif
public AccountCompanyOwnershipDeclaration OwnershipDeclaration { get; set; }

/// <summary>
/// One of: <c>qualified_entity_exceeds_ownership_threshold</c>, or
/// <c>qualifies_as_financial_institution</c>.
/// </summary>
[JsonProperty("ownership_exemption_reason")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("ownership_exemption_reason")]
#endif
public string OwnershipExemptionReason { get; set; }

/// <summary>
/// The company's phone number (used for verification).
/// </summary>
Expand Down
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; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ConfigurationFeaturesSubscriptionCancel : StripeEntity<Configuratio
/// <summary>
/// Whether to create prorations when canceling subscriptions. Possible values are
/// <c>none</c> and <c>create_prorations</c>.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// One of: <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
#if NET6_0_OR_GREATER
Expand Down
11 changes: 11 additions & 0 deletions src/Stripe.net/Entities/Cards/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@ public Account Account
#endif
public string Brand { get; set; }

/// <summary>
/// The <a href="https://stripe.com/docs/card-product-codes">product code</a> that
/// identifies the specific program or product associated with a card. (For internal use
/// only and not typically available in standard API requests.).
/// </summary>
[JsonProperty("brand_product")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("brand_product")]
#endif
public string BrandProduct { get; set; }

/// <summary>
/// Two-letter ISO code representing the country of the card. You could use this attribute
/// to get a sense of the international breakdown of cards you've collected.
Expand Down
Loading
Loading