Skip to content

Commit 7ac4afb

Browse files
authored
Merge pull request #2 from chris-omni/master
Update to latest upstream, adding JSON tags
2 parents c4e8c3b + c37892c commit 7ac4afb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3779
-966
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
.env
23
*.test
34
*.coverprofile

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ cache:
3333
env:
3434
global:
3535
# If changing this number, please also change it in `testing/testing.go`.
36-
- STRIPE_MOCK_VERSION=0.54.0
36+
- STRIPE_MOCK_VERSION=0.67.0
3737

3838
go:
3939
- "1.9.x"
4040
- "1.10.x"
4141
- "1.11.x"
42+
- "1.12.x"
4243
- tip
4344

4445
language: go

CHANGELOG.md

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,216 @@
11
# Changelog
22

3+
## 63.2.1 - 2019-09-25
4+
* [#961](https://github.com/stripe/stripe-go/pull/961) Properly tag `Customer` as deprecated in `PaymentMethodDetachParams`
5+
6+
## 63.2.0 - 2019-09-25
7+
* [#959](https://github.com/stripe/stripe-go/pull/959) Mark `Customer` on `PaymentMethodDetachParams` as deprecated
8+
* [#957](https://github.com/stripe/stripe-go/pull/957) Add missing error code
9+
10+
## 63.1.1 - 2019-09-23
11+
* [#954](https://github.com/stripe/stripe-go/pull/954) Add support for `Stripe-Should-Retry` header
12+
13+
## 63.1.0 - 2019-09-13
14+
* [#949](https://github.com/stripe/stripe-go/pull/949) Add support for `DeclineCode` on `Error` top-level
15+
16+
## 63.0.0 - 2019-09-10
17+
* [#947](https://github.com/stripe/stripe-go/pull/947) Bump API version to [`2019-09-09`](https://stripe.com/docs/upgrades#2019-09-09)
18+
19+
## 62.10.0 - 2019-09-09
20+
* [#945](https://github.com/stripe/stripe-go/pull/945) Changes to `Account` and `Person` to represent identity verification state
21+
22+
## 62.9.0 - 2019-09-04
23+
* [#943](https://github.com/stripe/stripe-go/pull/943) Add support for `Authentication` and `URL` on Issuing `Authorization`
24+
25+
## 62.8.2 - 2019-08-29
26+
* [#939](https://github.com/stripe/stripe-go/pull/939) Also log error in case of non-`stripe.Error`
27+
28+
## 62.8.1 - 2019-08-29
29+
* [#938](https://github.com/stripe/stripe-go/pull/938) Rearrange error logging so that 402 doesn't log an error
30+
31+
## 62.8.0 - 2019-08-29
32+
* [#937](https://github.com/stripe/stripe-go/pull/937) Add support for `EndBehavior` on `SubscriptionSchedule`
33+
34+
## 62.7.0 - 2019-08-27
35+
* [#935](https://github.com/stripe/stripe-go/pull/935) Retry requests on a 429 that's a lock timeout
36+
37+
## 62.6.0 - 2019-08-26
38+
* [#934](https://github.com/stripe/stripe-go/pull/934) Add support for `SubscriptionBillingCycleAnchorNow` and `SubscriptionBillingCycleAnchorUnchanged` on `Invoice`
39+
* [#933](https://github.com/stripe/stripe-go/pull/933) Add `PendingVerification` on `Account`, `Person` and `Capability`
40+
41+
## 62.5.0 - 2019-08-23
42+
* [#930](https://github.com/stripe/stripe-go/pull/930) Add `FailureReason` to `Refund`
43+
44+
## 62.4.0 - 2019-08-22
45+
* [#926](https://github.com/stripe/stripe-go/pull/926) Add support for decimal amounts on Billing resources
46+
47+
## 62.3.0 - 2019-08-22
48+
* [#928](https://github.com/stripe/stripe-go/pull/928) Bring retry code in-line with current best practices
49+
50+
## 62.2.0 - 2019-08-21
51+
* [#922](https://github.com/stripe/stripe-go/pull/922) A few Billing changes
52+
* Add `Schedule` to `Subscription`
53+
* Add missing parameters for the Upcoming Invoice API: `Schedule`, `SubscriptionCancelAt`, `SubscriptionCancelNow`
54+
* Add missing properties and parameters for a `SubscriptionSchedule` phase: `BillingThresholds`, `CollectionMethod`, `DefaultPaymentMethod`, `InvoiceSettings`
55+
* [#923](https://github.com/stripe/stripe-go/pull/923) Add support for `Mode` on Checkout `Session`
56+
57+
## 62.1.2 - 2019-08-19
58+
* [#921](https://github.com/stripe/stripe-go/pull/921) Mark `Customer` as an invalid parameter on PaymentMethod creation
59+
60+
## 62.1.1 - 2019-08-15
61+
* [#918](https://github.com/stripe/stripe-go/pull/918) Fix `RadarEarlyFraudWarnings` to use the proper API endpoint
62+
63+
## 62.1.0 - 2019-08-15
64+
* [#916](https://github.com/stripe/stripe-go/pull/916)
65+
* Add support for `PIN` on Issuing `Card` to reflect the status of a card's PIN
66+
* Add support for `Executive` on Person create, update and list
67+
68+
## 62.0.0 - 2019-08-14
69+
* [#915](https://github.com/stripe/stripe-go/pull/915) Move to API version [`2019-08-14`](https://stripe.com/docs/upgrades#2019-08-14) and other changes
70+
* Pin to API version `2019-08-14`
71+
* Rename `AccountCapabilityPlatformPayments` to `AccountCapabilityTransfers`
72+
* Add `Executive` in `PersonRelationship`
73+
* Remove `PayentMethodOptions` as there was a typo which was fixed
74+
* Make `OffSession` only support booleans on `PaymentIntent`
75+
* Remove `PaymentIntentLastPaymentError` and use `Error` instead
76+
* Move `DeclineCode` on `Error` to the `DeclineCode` type instead of `string`
77+
* [#914](https://github.com/stripe/stripe-go/pull/914) Update webhook handler example to use `http.MaxBytesReader`
78+
79+
## 61.27.0 - 2019-08-09
80+
* [#913](https://github.com/stripe/stripe-go/pull/913) Remove `SubscriptionScheduleRevision`
81+
* Note that this is technically a breaking change, however we've chosen to release it as a minor version in light of the fact that this resource and its API methods were virtually unused.
82+
83+
## 61.26.0 - 2019-08-08
84+
* [#911](https://github.com/stripe/stripe-go/pull/911)
85+
* Add support for `PaymentMethodDetails.Card.Moto` on `Charge`
86+
* Add support `StatementDescriptorSuffix` on `Charge` and `PaymentIntent`
87+
* Add support `SubscriptionData.ApplicationFeePercent` on Checkout `Session`
88+
89+
## 61.25.0 - 2019-07-30
90+
* [#910](https://github.com/stripe/stripe-go/pull/910) Add `balancetransaction` package with a `Get` and `List` methods
91+
92+
## 61.24.0 - 2019-07-30
93+
* [#906](https://github.com/stripe/stripe-go/pull/906) Add decline code type and constants (for use with card errors)
94+
95+
## 61.23.0 - 2019-07-29
96+
* [#879](https://github.com/stripe/stripe-go/pull/879) Add support for OAuth API endpoints
97+
98+
## 61.22.0 - 2019-07-29
99+
* [#909](https://github.com/stripe/stripe-go/pull/909) Rename `PayentMethodOptions` to `PaymentMethodOptions` on `PaymentIntent` and `SetupIntent`. Keep the old name until the next major version for backwards-compatibility
100+
101+
## 61.21.0 - 2019-07-26
102+
* [#904](https://github.com/stripe/stripe-go/pull/904) Add support for Klarna and source orders
103+
104+
## 61.20.0 - 2019-07-25
105+
* [#897](https://github.com/stripe/stripe-go/pull/897) Add all missing error codes
106+
* [#903](https://github.com/stripe/stripe-go/pull/903) Disable HTTP/2 by default (until underlying bug in Go's implementation is fixed)
107+
* [#905](https://github.com/stripe/stripe-go/pull/905) Add missing `Authenticated` field for 3DS charges
108+
109+
## 61.19.0 - 2019-07-22
110+
* [#902](https://github.com/stripe/stripe-go/pull/902) Add support for `StatementDescriptor` when capturing a `PaymentIntent`
111+
112+
## 61.18.0 - 2019-07-19
113+
* [#898](https://github.com/stripe/stripe-go/pull/898) Add `Customer` filter when listing `CreditNote`
114+
* [#899](https://github.com/stripe/stripe-go/pull/899) Add `OffSession` parameter when updating `SubscriptionItem`
115+
116+
## 61.17.0 - 2019-07-17
117+
* [#895](https://github.com/stripe/stripe-go/pull/895) Add `VoidedAt` on `CreditNote`
118+
119+
## 61.16.0 - 2019-07-16
120+
* [#894](https://github.com/stripe/stripe-go/pull/894) Introduce encoding for high precision decimal fields
121+
122+
## 61.15.0 - 2019-07-15
123+
* [#893](https://github.com/stripe/stripe-go/pull/893)
124+
* Add support for `PaymentMethodOptions` on `PaymentIntent` and `SetupIntent`
125+
* Add missing parameters to `PaymentIntentConfirmParams`
126+
127+
## 61.14.0 - 2019-07-15
128+
* [#891](https://github.com/stripe/stripe-go/pull/891) Various changes relaed to SCA for Billing
129+
* Add support for `PendingSetupIntent` on `Subscription`
130+
* Add support for `PaymentBehavior` on `Subscription` creation and update
131+
* Add support for `PaymentBehavior` on `SubscriptionItem` update
132+
* Add support for `OffSession` when paying an `Invoice`
133+
* Add support for `OffSession` on `Subscription` creation and update
134+
135+
## 61.13.0 - 2019-07-05
136+
* [#888](https://github.com/stripe/stripe-go/pull/888) Add support for `SetupFutureUsage` on `PaymentIntent` update and confirm
137+
* [#890](https://github.com/stripe/stripe-go/pull/890) Add support for `SetupFutureUsage` on Checkout `Session`
138+
139+
## 61.12.0 - 2019-07-01
140+
* [#887](https://github.com/stripe/stripe-go/pull/887) Allow `OffSession` to be a bool on `PaymentIntent` creation and confirmation
141+
142+
## 61.11.0 - 2019-07-01
143+
* [#886](https://github.com/stripe/stripe-go/pull/886) Add `CardVerificationUnavailable` constant value
144+
145+
## 61.10.0 - 2019-07-01
146+
* [#884](https://github.com/stripe/stripe-go/pull/884) Add support for the `SetupIntent` resource and APIs
147+
* [#885](https://github.com/stripe/stripe-go/pull/885) Quick fix to the `NextAction` property on `SetupIntent`
148+
149+
## 61.9.0 - 2019-06-27
150+
* [#882](https://github.com/stripe/stripe-go/pull/882) Add `DefaultPaymentMethod` and `DefaultSource` to `SubscriptionSchedule`
151+
152+
## 61.8.0 - 2019-06-27
153+
* **Note:** This release was deleted after we merged some bad code. Please use 61.9.0 instead.
154+
155+
## 61.7.1 - 2019-06-25
156+
* [#881](https://github.com/stripe/stripe-go/pull/881) Documentation fixes
157+
158+
## 61.7.0 - 2019-06-25
159+
* [#880](https://github.com/stripe/stripe-go/pull/880)
160+
* Add support for `CollectionMethod` on `Invoice`, `Subscription` and `SubscriptionSchedule`
161+
* Add support for `UnifiedProration` on `InvoiceLine`
162+
163+
## 61.6.0 - 2019-06-24
164+
* [#878](https://github.com/stripe/stripe-go/pull/878) Enable request latency telemetry by default
165+
166+
## 61.5.0 - 2019-06-20
167+
* [#877](https://github.com/stripe/stripe-go/pull/877) Add `CancellationReason` to `PaymentIntent`
168+
169+
## 61.4.0 - 2019-06-18
170+
* [#845](https://github.com/stripe/stripe-go/pull/845) Add support for `CustomerBalanceTransaction` resource and APIs
171+
* [#875](https://github.com/stripe/stripe-go/pull/875) Add missing `Account` settings
172+
173+
## 61.3.0 - 2019-06-18
174+
* [#874](https://github.com/stripe/stripe-go/pull/874) Log only to info on 402 errors from Stripe
175+
176+
## 61.2.0 - 2019-06-14
177+
* [#870](https://github.com/stripe/stripe-go/pull/870) Add support for `MerchantAmount` `MerchantCurrency` to Issuing `Transaction`
178+
* [#871](https://github.com/stripe/stripe-go/pull/871) Add support for `SubmitType` to Checkout `Session`
179+
180+
## 61.1.0 - 2019-06-06
181+
* [#867](https://github.com/stripe/stripe-go/pull/867) Add support for `Location` on Terminal `ConnectionToken`
182+
* [#868](https://github.com/stripe/stripe-go/pull/868) Add support for `Balance` and deprecate `AccountBalance` on Customer
183+
184+
## 61.0.1 - 2019-05-24
185+
* [#865](https://github.com/stripe/stripe-go/pull/865) Fix `earlyfraudwarning` client
186+
187+
## 61.0.0 - 2019-05-24
188+
* [#864](https://github.com/stripe/stripe-go/pull/864) Pin library to API version `2019-05-16`
189+
190+
## 60.19.0 - 2019-05-24
191+
* [#862](https://github.com/stripe/stripe-go/pull/862) Add support for `radar.early_fraud_warning` resource
192+
193+
## 60.18.0 - 2019-05-22
194+
* [#861](https://github.com/stripe/stripe-go/pull/861) Add new tax ID types: `TaxIDTypeINGST` and `TaxIDTypeNOVAT`
195+
196+
## 60.17.0 - 2019-05-16
197+
* [#860](https://github.com/stripe/stripe-go/pull/860) Add `OffSession` parameter to payment intents
198+
199+
## 60.16.0 - 2019-05-14
200+
* [#859](https://github.com/stripe/stripe-go/pull/859) Add missing `InvoiceSettings` to `Customer`
201+
202+
## 60.15.0 - 2019-05-14
203+
* [#855](https://github.com/stripe/stripe-go/pull/855) Add support for the capability resource and APIs
204+
205+
## 60.14.0 - 2019-05-10
206+
* [#858](https://github.com/stripe/stripe-go/pull/858) Add `StartDate` to `Subscription`
207+
208+
## 60.13.2 - 2019-05-10
209+
* [#857](https://github.com/stripe/stripe-go/pull/857) Fix invoice's `PaymentIntent` so its JSON tag uses API snakecase
210+
211+
## 60.13.1 - 2019-05-08
212+
* [#853](https://github.com/stripe/stripe-go/pull/853) Add paymentmethod package to the clients list
213+
3214
## 60.13.0 - 2019-05-07
4215
* [#850](https://github.com/stripe/stripe-go/pull/850) `OperatorAccount` is now deprecated across all Terminal endpoints
5216
* [#851](https://github.com/stripe/stripe-go/pull/851) Add `Customer` on the `Source` object

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
all: test bench vet lint check-gofmt
1+
all: test bench vet lint check-api-clients check-gofmt
22

33
bench:
44
go test -race -bench . -run "Benchmark" ./form
55

66
build:
77
go build ./...
88

9+
check-api-clients:
10+
go run scripts/check_api_clients/main.go
11+
912
check-gofmt:
1013
scripts/check_gofmt.sh
1114

1215
lint:
1316
golint -set_exit_status ./...
1417

1518
test:
16-
go run scripts/test_with_stripe_mock.go -race ./...
19+
go run scripts/test_with_stripe_mock/main.go -race ./...
1720

1821
vet:
1922
go vet ./...
2023

2124
coverage:
2225
# go currently cannot create coverage profiles when testing multiple packages, so we test each package
2326
# independently. This issue should be fixed in Go 1.10 (https://github.com/golang/go/issues/6909).
24-
go list ./... | xargs -n1 -I {} -P 4 go run scripts/test_with_stripe_mock.go -covermode=count -coverprofile=../../../{}/profile.coverprofile {}
27+
go list ./... | xargs -n1 -I {} -P 4 go run scripts/test_with_stripe_mock/main.go -covermode=count -coverprofile=../../../{}/profile.coverprofile {}
2528

2629
clean:
2730
find . -name \*.coverprofile -delete

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
### Go Module Support
2727

28-
The library currently *does not* ship with first-class support for Stripe
28+
The library currently *does not* ship with first-class support for Go
2929
modules. We put in support for it before, but ran into compatibility problems
3030
for existing installations using Dep (see discussion in [closer to the bottom
3131
of this thread][gomodvsdep], and [reverted support][gomodrevert]. Our current
@@ -40,7 +40,7 @@ suffix* in the path like so:
4040
module github.com/my/package
4141

4242
require (
43-
github.com/stripe/stripe-go v60.13.0
43+
github.com/stripe/stripe-go v63.2.1
4444
)
4545
```
4646

@@ -68,8 +68,8 @@ Below are a few simple examples:
6868
```go
6969
params := &stripe.CustomerParams{
7070
AccountBalance: stripe.Int64(-123),
71-
Description: stripe.String("Stripe Developer"),
72-
Email: stripe.String("gostripe@stripe.com"),
71+
Description: stripe.String("Stripe Developer"),
72+
Email: stripe.String("gostripe@stripe.com"),
7373
}
7474
params.SetSource("tok_1234")
7575

@@ -272,8 +272,8 @@ if err := i.Err(); err != nil {
272272

273273
### Configuring Automatic Retries
274274

275-
The library can be configured to automatically retry requests that fail due to
276-
an intermittent network problem or other knowingly non-deterministic errors:
275+
You can enable automatic retries on requests that fail due to a transient
276+
problem by configuring the maximum number of retries:
277277

278278
```go
279279
import (
@@ -294,6 +294,9 @@ sc.Init("sk_key", &stripe.Backends{
294294
coupon, err := sc.Coupons.New(...)
295295
```
296296

297+
Various errors can trigger a retry, like a connection error or a timeout, and
298+
also certain API responses like HTTP status `409 Conflict`.
299+
297300
[Idempotency keys][idempotency-keys] are added to requests to guarantee that
298301
retries are safe.
299302

@@ -329,10 +332,10 @@ type LeveledLoggerInterface interface {
329332
}
330333
```
331334

332-
Some loggers like [Logrus][logrus] support this interface out-of-the-box so
333-
it's possible to set `DefaultLeveledLogger` to a `*logrus.Logger` directly. For
334-
others (Zap for example) it'll be necessary to write a thin shim layer to
335-
support them.
335+
Some loggers like [Logrus][logrus] and Zap's [SugaredLogger][sugaredlogger]
336+
support this interface out-of-the-box so it's possible to set
337+
`DefaultLeveledLogger` to a `*logrus.Logger` or `*zap.SugaredLogger` directly.
338+
For others it may be necessary to write a thin shim layer to support them.
336339

337340
### Writing a Plugin
338341

@@ -351,6 +354,19 @@ This information is passed along when the library makes calls to the Stripe
351354
API. Note that while `Name` is always required, `URL` and `Version` are
352355
optional.
353356

357+
### Request latency telemetry
358+
359+
By default, the library sends request latency telemetry to Stripe. These
360+
numbers help Stripe improve the overall latency of its API for all users.
361+
362+
You can disable this behavior if you prefer:
363+
364+
```go
365+
config := &stripe.BackendConfig{
366+
EnableTelemetry: false,
367+
}
368+
```
369+
354370
## Development
355371

356372
Pull requests from the community are welcome. If you submit one, please keep

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
60.13.0-omni.1
1+
63.2.1-omni.1

0 commit comments

Comments
 (0)