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

stripe-dotnet v20.0 #1293

Merged
merged 36 commits into from
Oct 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4af3f6b
Fix the Source/PaymentSource abstraction
remi-stripe Aug 21, 2018
22fbc31
Rewrite parameter encoding logic
ob-stripe Sep 10, 2018
4f00615
Rename event to match type name and add a related one.
remi-stripe Sep 12, 2018
a86d176
Handle DateTimes directly in the encoder
ob-stripe Sep 13, 2018
3a4518d
Remove StripeDeleted entirely.
remi-stripe Sep 13, 2018
4ddd7d8
Rename two properties that start with a lower case letter
remi-stripe Sep 13, 2018
b10cbdf
Rename all resources and classes to remove the Stripe prefix
remi-stripe Aug 21, 2018
9c6e4e3
Fix services
ob-stripe Sep 16, 2018
5380c9d
Service interfaces
ob-stripe Sep 4, 2018
d954683
Ensure that all value types in options classes are nullable
ob-stripe Sep 26, 2018
6fa813d
Upgrade to API version 2018-09-24
ob-stripe Sep 27, 2018
104a310
Move all nested options to their own class
remi-stripe Sep 26, 2018
d835375
Rename LiveMode to Livemode
remi-stripe Sep 28, 2018
cf8d6b8
Sanitize files (remove UTF-8 BOMs, add missing final newlines)
ob-stripe Sep 28, 2018
9256668
Move all services to BasicService
remi-stripe Sep 29, 2018
5362f66
Remove +x flag from source files
ob-stripe Sep 29, 2018
32c2539
Sort service methods alphabetically
ob-stripe Sep 29, 2018
30cd25a
Mock for verifying requests
ob-stripe Sep 30, 2018
a65ae41
Better URL handling in services
ob-stripe Sep 29, 2018
b08692b
Group resources with sub-resources under one folder
remi-stripe Sep 29, 2018
7bd0552
Add missing fields, remove old ones, rename others
remi-stripe Oct 1, 2018
406afde
Move all Entities tests to a sub-folder and add missing Dispute test.
remi-stripe Oct 1, 2018
b08f145
Split InvoiceLineItem in a separate resource InvoiceItem
remi-stripe Oct 2, 2018
ccce5b4
Automatically convert Unix timestamps to DateTimes
ob-stripe Oct 2, 2018
dc7e6c1
Add coverlet for code coverage
ob-stripe Oct 1, 2018
46f5648
Revamp interfaces on Stripe model classes
ob-stripe Oct 2, 2018
0f1ea0c
Interfaces for polymorphic API resources
ob-stripe Oct 4, 2018
f784298
Fix warning in .NET Framework specific code
ob-stripe Oct 5, 2018
5b160f9
Add some missing tests
ob-stripe Oct 5, 2018
b704df0
Use an interface for PaymentIntentSourceAction
ob-stripe Oct 9, 2018
cebff81
Use longs instead of ints
ob-stripe Oct 10, 2018
ba87552
Fix docs and move parameters to the shared struct as they work on both
remi-stripe Oct 15, 2018
7df6121
Usage record methods now take the subscription item id as a parameter
remi-stripe Oct 17, 2018
52c74f8
Rename SourceTokenOrExistingSourceId to SourceId
remi-stripe Oct 17, 2018
eb4b4e3
Add support for charge.expired
remi-stripe Oct 19, 2018
e9fd90d
Add a migration guide for v20.0
remi-stripe Oct 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Please only file issues here that you believe represent actual bugs or feature r

If you're having general trouble with your Stripe integration, please reach out to Stripe support using the form at https://support.stripe.com/ (preferred) or via email to support@stripe.com.

If you are reporting a bug, please include your OS version, .NET version and the version of the Stripe.net library you're using, as well as any other details that may be helpful in reproducing the problem.
If you are reporting a bug, please include your OS version, .NET version and the version of the Stripe.net library you're using, as well as any other details that may be helpful in reproducing the problem.
2 changes: 1 addition & 1 deletion .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
project.lock.json

.DS_Store
.idea/
.idea/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
15 changes: 11 additions & 4 deletions appveyor.yml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ version: 19.10.0.{build}
image: Visual Studio 2017

environment:
STRIPE_TEST_SK: sk_test_eBgAzVoEpJKfYjD9nf2YoyMM
COVERALLS_REPO_TOKEN:
secure: T0PmP8uyzCseacBCDRBlti2y9Tz5DL6fknea0MKWvbPYrzADmLY2/5kOTfYIsPUk
# If you bump this, don't forget to bump `MinimumMockVersion` in `BaseStripeTest.cs` as well.
STRIPE_MOCK_VERSION: 0.30.0
STRIPE_MOCK_VERSION: 0.33.0

deploy:
- provider: NuGet
Expand All @@ -27,6 +28,7 @@ install:
}
$app = Start-Process -FilePath "stripe-mock\stripe-mock.exe" -NoNewWindow -PassThru
Write-Host ("stripe-mock running, Id = $($app.Id)`n") -ForegroundColor Green
- dotnet tool install coveralls.net --version 1.0.0 --tool-path tools

before_build:
- ps: Write-Host $("`n HOST INFORMATION `n") -BackgroundColor DarkCyan
Expand All @@ -48,11 +50,16 @@ after_build:
- dotnet pack -c Release src\Stripe.net

test_script:
- ps: Write-Host $("`n RUNNING THE NEW XUNIT + STRIPE-MOCK TESTS `n") -BackgroundColor DarkCyan
- ps: Write-Host $("`n RUNNING TESTS `n") -BackgroundColor DarkCyan
- dotnet test src\StripeTests\StripeTests.csproj

after_test:
- ps: Write-Host $("`n RUNNING COVERAGE `n") -BackgroundColor DarkCyan
- dotnet test -c Debug -f netcoreapp2.1 src/StripeTests/StripeTests.csproj --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- .\tools\csmacnz.Coveralls --opencover -i src/StripeTests/coverage.opencover.xml --useRelativePaths

artifacts:
- path: '**\*.nupkg'
- path: 'src\Stripe.net\bin\Release\*.nupkg'

# these commands tell appveyor to open an RDP session for debugging
#init:
Expand Down
Empty file modified global.json
100755 → 100644
Empty file.
32 changes: 17 additions & 15 deletions readme.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Stripe.net [![Build status](https://ci.appveyor.com/api/projects/status/rg0pg5tlr1a6f8tf/branch/master?svg=true)](https://ci.appveyor.com/project/stripe/stripe-dotnet) [![NuGet](https://img.shields.io/nuget/v/stripe.net.svg)](https://www.nuget.org/packages/Stripe.net/)
# Stripe.net
[![Build status](https://ci.appveyor.com/api/projects/status/rg0pg5tlr1a6f8tf/branch/master?svg=true)](https://ci.appveyor.com/project/stripe/stripe-dotnet) [![NuGet](https://img.shields.io/nuget/v/stripe.net.svg)](https://www.nuget.org/packages/Stripe.net/)
[![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 library, supporting .NET Standard 1.2+, .NET Core 1.0+, and .NET Framework 4.5+

Expand Down Expand Up @@ -36,11 +38,11 @@ a) In your application initialization, set your API key (only once once during s
StripeConfiguration.SetApiKey("[your api key here]");
```

b) Pass the API key to [StripeRequestOptions](#requestoptions):
b) Pass the API key to [RequestOptions](#requestoptions):

```csharp
var planService = new StripePlanService();
planService.Get(*planId*, new StripeRequestOptions() { ApiKey = "[your api key here]" });
var planService = new PlanService();
planService.Get(*planId*, new RequestOptions() { ApiKey = "[your api key here]" });
```

You can obtain your secret API key from the [API Settings](https://dashboard.stripe.com/account/apikeys) in the Dashboard.
Expand All @@ -63,10 +65,10 @@ If you are using Xamarin/Mono, you may want to provide your own `HttpMessageHand

### Request Options

All of the service methods accept an optional `StripeRequestOptions` object. This is used if you need an [Idempotency Key](https://stripe.com/docs/api?lang=curl#idempotent_requests), if you are using [Stripe Connect](https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header), or if you want to pass the secret API key on each method.
All of the service methods accept an optional `RequestOptions` object. This is used if you need an [Idempotency Key](https://stripe.com/docs/api?lang=curl#idempotent_requests), if you are using [Stripe Connect](https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header), or if you want to pass the secret API key on each method.

```csharp
var requestOptions = new StripeRequestOptions();
var requestOptions = new RequestOptions();
requestOptions.ApiKey = "SECRET API KEY"; // (optional) set the api key on a per-request basis
requestOptions.IdempotencyKey = "SOME STRING"; // (optional) create an idempotent request
requestOptions.StripeConnectAccountId = "CONNECTED ACCOUNT ID"; // (optional) authenticate as a connected account
Expand All @@ -78,7 +80,7 @@ The [`StripeResponse`](./src/Stripe.net/Infrastructure/public/StripeResponse.cs)

**Example: Access the StripeResponse**
```csharp
var chargeService = new StripeChargeService();
var chargeService = new ChargeService();
StripeCharge charge = chargeService.Create(...);
StripeResponse response = charge.StripeResponse;
```
Expand Down Expand Up @@ -113,18 +115,18 @@ public class StripeResponse

### Date Filtering

Many of the `List()`-methods support parameters to filter by date. You can use the `StripeDateFilter` class to combine the filters to make more interesting and complex queries.
Many of the `List()`-methods support parameters to filter by date. You can use the `DateFilter` class to combine the filters to make more interesting and complex queries.

**Example: Interesting Queries with StripeDateFilter**
**Example: Interesting Queries with DateFilter**
```csharp
var chargeService = new StripeChargeService();
var chargeService = new ChargeService();

var chargesToday = chargeService.List(new StripeChargeListOptions {
Created = new StripeDateFilter { GreaterThanOrEqual = DateTime.UtcNow.Date }
var chargesToday = chargeService.List(new ChargeListOptions {
Created = new DateFilter { GreaterThanOrEqual = DateTime.UtcNow.Date }
});

var chargesYesterday = chargeService.List(new StripeChargeListOptions {
Created = new StripeDateFilter {
var chargesYesterday = chargeService.List(new ChargeListOptions {
Created = new DateFilter {
GreaterThanOrEqual = DateTime.Now.AddDays(-1).Date,
LessThan = DateTime.Now.Date
}
Expand All @@ -135,4 +137,4 @@ var chargesYesterday = chargeService.List(new StripeChargeListOptions {

We welcome contributions from anyone interested in Stripe or Stripe.net development. If you'd like to submit a pull request, it's best to start with an issue to describe what you'd like to build.

Once you've written your pull request, **please make sure you test your changes**.
Once you've written your pull request, **please make sure you test your changes**.
1 change: 0 additions & 1 deletion src/Stripe.net.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.4
Expand Down
8 changes: 8 additions & 0 deletions src/Stripe.net/Constants/AccountType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Stripe
{
public static class AccountType
{
public const string Custom = "custom";
public const string Standard = "standard";
}
}
4 changes: 2 additions & 2 deletions src/Stripe.net/Constants/BankAccountHolderType.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace Stripe
namespace Stripe
{
public static class BankAccountHolderType
{
public const string Individual = "individual";
public const string Company = "company";
}
}
}
Loading