Skip to content

Commit 0606db4

Browse files
committed
- Update fork to match latest version of Stripe
- Add json field tags for all files
1 parent 7ac4afb commit 0606db4

File tree

107 files changed

+2857
-1851
lines changed

Some content is hidden

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

107 files changed

+2857
-1851
lines changed

CHANGELOG.md

Lines changed: 190 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,191 @@
11
# Changelog
22

3+
## 68.18.0 - 2020-02-05
4+
* [#1026](https://github.com/stripe/stripe-go/pull/1026) Multiple changes on the `Balance` resource:
5+
* Add support for `ConnectReserved`
6+
* Add support for `SourceTypes` for a given type of balance.
7+
* Add support for FPX balance as a constant.
8+
9+
## 68.17.0 - 2020-02-03
10+
* [#1024](https://github.com/stripe/stripe-go/pull/1024) Add `FilePurposeAdditionalVerification` and `FilePurposeBusinessIcon` on `File`
11+
* [#1018](https://github.com/stripe/stripe-go/pull/1018) Add support for `ErrorOnRequiresAction` on `PaymentIntent`
12+
13+
## 68.16.0 - 2020-01-31
14+
* [#1023](https://github.com/stripe/stripe-go/pull/1023) Add support for `TaxIDTypeTHVAT` and `TaxIDTypeTWVAT` on `TaxId`
15+
16+
## 68.15.0 - 2020-01-30
17+
* [#1022](https://github.com/stripe/stripe-go/pull/1022) Add support for `Structure` on `Account`
18+
19+
## 68.14.0 - 2020-01-28
20+
* [#1021](https://github.com/stripe/stripe-go/pull/1021) Add support for `TaxIDTypeESCIF` on `TaxId`
21+
22+
## 68.13.0 - 2020-01-24
23+
* [#1019](https://github.com/stripe/stripe-go/pull/1019) Add support for `Shipping.Speed` and `Shipping.TrackingURL` on `IssuingCard`
24+
25+
## 68.12.0 - 2020-01-23
26+
* [#1017](https://github.com/stripe/stripe-go/pull/1017) Add new values for `TaxIDType` and fix `TaxIDTypeCHVAT`
27+
* [#1015](https://github.com/stripe/stripe-go/pull/1015) Replace duplicate code in GetBackend method
28+
29+
## 68.11.0 - 2020-01-17
30+
* [#1014](https://github.com/stripe/stripe-go/pull/1014) Add `Metadata` support on Checkout `Session`
31+
32+
## 68.10.0 - 2020-01-15
33+
* [#1012](https://github.com/stripe/stripe-go/pull/1012) Adds `PendingUpdate` to `Subscription`
34+
35+
## 68.9.0 - 2020-01-14
36+
* [#1013](https://github.com/stripe/stripe-go/pull/1013) Add support for `CreditNoteLineItem`
37+
38+
## 68.8.0 - 2020-01-08
39+
* [#1011](https://github.com/stripe/stripe-go/pull/1011) Add support for `InvoiceItem` and fix `Livemode` on `InvoiceLine`
40+
41+
## 68.7.0 - 2020-01-07
42+
* [#1008](https://github.com/stripe/stripe-go/pull/1008) Add `ReportingCategory` to `BalanceTransaction`
43+
44+
## 68.6.0 - 2020-01-06
45+
* [#1009](https://github.com/stripe/stripe-go/pull/1009) Add constant for `TaxIDTypeSGUEN` on `TaxId`
46+
47+
## 68.5.0 - 2020-01-03
48+
* [#1007](https://github.com/stripe/stripe-go/pull/1007) Add support for `SpendingLimitsCurrency` on Issuing `Card` and `Cardholder`
49+
50+
## 68.4.0 - 2019-12-20
51+
* [#1006](https://github.com/stripe/stripe-go/pull/1006) Adds `ExecutivesProvided` to `Account`
52+
53+
## 68.3.0 - 2019-12-19
54+
* [#1005](https://github.com/stripe/stripe-go/pull/1005) Add `Metadata` and `Livemode` to Terminal `Reader` and `Location'
55+
56+
## 68.2.0 - 2019-12-09
57+
* [#1002](https://github.com/stripe/stripe-go/pull/1002) Add support for AU BECS Debit on PaymentMethod
58+
59+
## 68.1.0 - 2019-12-04
60+
* [#1001](https://github.com/stripe/stripe-go/pull/1001) Add support for `Network` on `Charge`
61+
62+
## 68.0.0 - 2019-12-03
63+
* [#1000](https://github.com/stripe/stripe-go/pull/1000) Multiple breaking changes:
64+
* Pin to API version `2019-12-03`
65+
* Rename `InvoiceBillingStatus` to `InvoiceStatus` for consistency
66+
* Remove typo-ed field `OutOfBankdAmount` on `CreditNote`
67+
* Remove deprecated `PaymentIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly` and `SetupIntentPaymentMethodOptionsCardRequestThreeDSecureChallengeOnly` from `PaymentIntent` and `SetupIntent`.
68+
* Remove `OperatorAccount` on `TerminalLocationListParams`
69+
70+
## 67.10.0 - 2019-12-02
71+
* [#999](https://github.com/stripe/stripe-go/pull/999) Add support for `Status` filter when listing `Invoice`s.
72+
73+
## 67.9.0 - 2019-11-26
74+
* [#997](https://github.com/stripe/stripe-go/pull/997) Add new refund reason `RefundReasonExpiredUncapturedCharge`
75+
76+
## 67.8.0 - 2019-11-26
77+
* [#998](https://github.com/stripe/stripe-go/pull/998) Add support for `CreditNote` preview
78+
79+
## 67.7.0 - 2019-11-25
80+
* [#996](https://github.com/stripe/stripe-go/pull/996) Add support for `OutOfBandAmount` on `CreditNote` creation
81+
* [#995](https://github.com/stripe/stripe-go/pull/995) Fix comment typos
82+
83+
## 67.6.0 - 2019-11-22
84+
* [#994](https://github.com/stripe/stripe-go/pull/994) Support for the `now` on `StartDate` on Subscription Schedule creation
85+
86+
## 67.5.0 - 2019-11-21
87+
* [#993](https://github.com/stripe/stripe-go/pull/993) Add `PaymentIntent` filter when listing `Dispute`s
88+
89+
## 67.4.1 - 2019-11-19
90+
* [#991](https://github.com/stripe/stripe-go/pull/991) Add missing constant for PaymentMethod of type FPX
91+
92+
## 67.4.0 - 2019-11-18
93+
* [#989](https://github.com/stripe/stripe-go/pull/989) Add support for `ViolatedAuthorizationControls` on Issuing `Authorization`
94+
95+
## 67.3.0 - 2019-11-07
96+
* [#988](https://github.com/stripe/stripe-go/pull/988) Add `Company` and `Individual` to Issuing `Cardholder`
97+
98+
## 67.2.0 - 2019-11-06
99+
* [#985](https://github.com/stripe/stripe-go/pull/985) Multiple API changes
100+
* Add `Disputed` to `Charge`
101+
* Add `PaymentIntent` to `Refund` and `Dispute`
102+
* Add `Charge` to `DisputeListParams`
103+
* Add `PaymentIntent` to `RefundListParams` and `RefundParams`
104+
105+
## 67.1.0 - 2019-11-06
106+
* [#986](https://github.com/stripe/stripe-go/pull/986) Add support for iDEAL and SEPA debit on `PaymentMethod`
107+
108+
## 67.0.0 - 2019-11-05
109+
* [#987](https://github.com/stripe/stripe-go/pull/987) Move to the latest API version and add new changes
110+
* Move to API version `2019-11-05`
111+
* Add `DefaultSettings` on `SubscritionSchedule`
112+
* Remove `BillingThresholds`, `CollectionMethod`, `DefaultPaymentMethod` and `DefaultSource` and `invoice_settings` from `SubscriptionSchedule`
113+
* `OffSession` on `PaymentIntent` is now always a boolean
114+
115+
## 66.3.0 - 2019-11-04
116+
* [#984](https://github.com/stripe/stripe-go/pull/984) Add support for `UseStripeSDK` on `PaymentIntent` create and confirm
117+
118+
## 66.2.0 - 2019-11-04
119+
* [#983](https://github.com/stripe/stripe-go/pull/983) Add support for cloning saved PaymentMethods
120+
* [#980](https://github.com/stripe/stripe-go/pull/980) Improve docs for ephemeral keys
121+
122+
## 66.1.1 - 2019-10-24
123+
* [#978](https://github.com/stripe/stripe-go/pull/978) Properly pass `Type` in `PaymentIntentPaymentMethodOptionsCardInstallmentsPlanParams`
124+
* Note that this is technically a breaking change, however we've chosen to release it as a patch version as this shipped yesterday and is a new feature
125+
* [#977](https://github.com/stripe/stripe-go/pull/977) Contributor Convenant
126+
127+
## 66.1.0 - 2019-10-23
128+
* [#974](https://github.com/stripe/stripe-go/pull/974) Add support for installments on `PaymentIntent` and `Charge`
129+
* [#975](https://github.com/stripe/stripe-go/pull/975) Add support for `PendingInvoiceItemInterval` on `Subscription`
130+
* [#976](https://github.com/stripe/stripe-go/pull/976) Add `TaxIDTypeMXRFC` constant to `TaxIDType`
131+
132+
## 66.0.0 - 2019-10-18
133+
* [#973](https://github.com/stripe/stripe-go/pull/973) Multiple breaking changes
134+
* Pin to the latest API version `2019-10-17`
135+
* Remove `RenewalBehavior` on `SubscriptionSchedule`
136+
* Remove `RenewalBehavior` and `RenewalInterval` as parameters on `SubscriptionSchedule`
137+
138+
## 65.2.0 - 2019-10-17
139+
* [#972](https://github.com/stripe/stripe-go/pull/972) Various API changes
140+
* `Requirements` on Issuing `Cardholder`
141+
* `PaymentMethodDetails.AuBecsDebit.Mandate` on `Charge`
142+
* `PaymentBehavior` on `Subscription` creation can now take the value `pending_if_incomplete`
143+
* `PaymentBehavior` on `SubscriptionItem` creation is now supported
144+
* `SubscriptionData.TrialFromPlan` is now supported on Checkout `Session` creation
145+
* New values for `TaxIDType`
146+
147+
## 65.1.1 - 2019-10-11
148+
* [#970](https://github.com/stripe/stripe-go/pull/970) Properly deserialize `Fulfilled` on `StatusTransitions` in the `order` package
149+
150+
## 65.1.0 - 2019-10-09
151+
* [#969](https://github.com/stripe/stripe-go/pull/969) Add `DeviceType` filter when listing Terminal `Reader`s
152+
153+
## 65.0.0 - 2019-10-09
154+
* [#951](https://github.com/stripe/stripe-go/pull/951) Move to API version [`2019-10-08`](https://stripe.com/docs/upgrades#2019-10-08) and other changes
155+
* [#950](https://github.com/stripe/stripe-go/pull/950) Remove lossy "MarshalJSON" implementations
156+
* [#962](https://github.com/stripe/stripe-go/pull/962) Removed deprecated properties and most todos
157+
* Removed `GetBalanceTransaction` and `List` from the `balance` package. Prefer using `Get` and `List` in the `balancetransaction` package.
158+
* Removed `ApplicationFee` from the `charge` and `paymentintent` packages. Prefer using `ApplicationFeeAmount`.
159+
* Removed `TaxInfo` and related fields from the `customer` packager. Prefer using the `customertaxid` package.
160+
* Removed unsupported `Customer` parameter on `PaymentMethodParams` and `PaymentMethodDetachParams` in the `paymentmethod` package.
161+
* Removed `Billing` properties in the `invoice`, `sub` and `subschedule` packages. Prefer using `CollectionMethod`.
162+
* Removed the `InvoiceBilling` type from the `invoice` package. Prefer using `InvoiceCollectionMethod`.
163+
* Removed the `SubscriptionBilling` type from the `sub` package. Prefer using `SubscriptionCollectionMethod`.
164+
* Removed deprecated constants for `PaymentIntentConfirmationMethod` in `paymentintent` package.
165+
* Removed `OperatorAccount` from Terminal APIs.
166+
* [#960](https://github.com/stripe/stripe-go/pull/960) Remove `issuerfraudrecord` package. Prefer using `earlyfraudwarning`
167+
* [#968](https://github.com/stripe/stripe-go/pull/968) Rename `AccountOpener` to `Representative` and update to latest API version
168+
169+
## 64.1.0 - 2019-10-09
170+
* [#967](https://github.com/stripe/stripe-go/pull/967) Add `Get` method to `OrderReturn`
171+
172+
## 64.0.0 - 2019-10-08
173+
* ~[#968](https://github.com/stripe/stripe-go/pull/968) Update to latest API version [`2019-10-08`](https://stripe.com/docs/upgrades#2019-10-08)~
174+
* **Note:** This release is actually a no-op as we failed to merge the changes. Please use 65.0.0 instead.
175+
176+
## 63.5.0 - 2019-10-03
177+
* [#955](https://github.com/stripe/stripe-go/pull/955) Add FPX `PaymentMethod` Support
178+
* [#966](https://github.com/stripe/stripe-go/pull/966) Add the `Account` field to `BankAccount`
179+
180+
## 63.4.0 - 2019-09-30
181+
* [#952](https://github.com/stripe/stripe-go/pull/952) Add AU BECS Debit Support
182+
183+
## 63.3.0 - 2019-09-30
184+
* [#964](https://github.com/stripe/stripe-go/pull/964) Add support for `Status` and `Location` filters when listing `Reader`s
185+
186+
## 63.2.2 - 2019-09-26
187+
* [#963](https://github.com/stripe/stripe-go/pull/963) Update `SourceSourceOrder` `Items` field to fix unmarshalling errors
188+
3189
## 63.2.1 - 2019-09-25
4190
* [#961](https://github.com/stripe/stripe-go/pull/961) Properly tag `Customer` as deprecated in `PaymentMethodDetachParams`
5191

@@ -179,7 +365,7 @@
179365

180366
## 61.1.0 - 2019-06-06
181367
* [#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
368+
* [#868](https://github.com/stripe/stripe-go/pull/868) Add support for `Balance` and deprecate `AccountBalance` on Customer
183369

184370
## 61.0.1 - 2019-05-24
185371
* [#865](https://github.com/stripe/stripe-go/pull/865) Fix `earlyfraudwarning` client
@@ -246,7 +432,7 @@
246432
* [#837](https://github.com/stripe/stripe-go/pull/837) Add helpers to go from `[]T` to `[]*T` for `string`, `int64`, `float64`, `bool`
247433

248434
## 60.5.1 - 2019-04-16
249-
* [#836](https://github.com/stripe/stripe-go/pull/836) Fix `SpendingLimits` on `AuthorizationControlsParams` and `AuthorizationControls` to be a slice on Issuing `Card` and `Cardholder`
435+
* [#836](https://github.com/stripe/stripe-go/pull/836) Fix `SpendingLimits` on `AuthorizationControlsParams` and `AuthorizationControls` to be a slice on Issuing `Card` and `Cardholder`
250436

251437
## 60.5.0 - 2019-04-16
252438
* [#740](https://github.com/stripe/stripe-go/pull/740) Add support for the Checkout `Session` resource and APIs
@@ -442,7 +628,7 @@
442628
* [#711](https://github.com/stripe/stripe-go/pull/711) Drop support for Go 1.7 (hasn't been supported by Go core since the release of Go 1.9 in August 2017)
443629

444630
## 51.4.0 - 2018-10-19
445-
* [#708](https://github.com/stripe/stripe-go/pull/708) Add Stripe Terminal endpoints to master to `client.API`
631+
* [#708](https://github.com/stripe/stripe-go/pull/708) Add Stripe Terminal endpoints to master to `client.API`
446632

447633
## 51.3.0 - 2018-10-09
448634
* [#704](https://github.com/stripe/stripe-go/pull/704) Add support for `subscription_cancel_at_period_end` on the Upcoming Invoice API.
@@ -924,7 +1110,7 @@
9241110
* Rules under charge outcomes are now expandable and collapsed by default
9251111

9261112
## 19.17.0 - 2017-04-06
927-
* Please see 20.0.0 (bad release)
1113+
* Please see 20.0.0 (bad release)
9281114

9291115
## 19.16.0 - 2017-03-23
9301116
* Allow the ID of an identity document to be passed into an account owner update

CODE_OF_CONDUCT.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq
77+

README.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
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
31-
of this thread][gomodvsdep], and [reverted support][gomodrevert]. Our current
31+
of this thread][gomodvsdep]), and [reverted support][gomodrevert]. Our current
3232
plan is to wait for better module compatibility in Dep (see a [preliminary
3333
patch here][depgomodsupport]), give the release a little grace time to become
3434
more widely distributed, then bring support back.
@@ -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 v63.2.1
43+
github.com/stripe/stripe-go v68.18.0
4444
)
4545
```
4646

@@ -67,27 +67,26 @@ Below are a few simple examples:
6767

6868
```go
6969
params := &stripe.CustomerParams{
70-
AccountBalance: stripe.Int64(-123),
71-
Description: stripe.String("Stripe Developer"),
72-
Email: stripe.String("[email protected]"),
70+
Description: stripe.String("Stripe Developer"),
71+
Email: stripe.String("[email protected]"),
7372
}
74-
params.SetSource("tok_1234")
7573

7674
customer, err := customer.New(params)
7775
```
7876

79-
### Charges
77+
### PaymentIntents
8078

8179
```go
82-
params := &stripe.ChargeListParams{Customer: stripe.String(customer.ID)}
83-
params.Filters.AddFilter("include[]", "", "total_count")
80+
params := &stripe.PaymentIntentListParams{
81+
Customer: stripe.String(customer.ID),
82+
}
8483

8584
// set this so you can easily retry your request in case of a timeout
8685
params.Params.IdempotencyKey = stripe.NewIdempotencyKey()
8786

88-
i := charge.List(params)
87+
i := paymentintent.List(params)
8988
for i.Next() {
90-
charge := i.Charge()
89+
pi := i.PaymentIntent()
9190
}
9291

9392
if err := i.Err(); err != nil {
@@ -125,7 +124,7 @@ or `Params` class. For example:
125124

126125
```go
127126
// For a list request
128-
listParams := &stripe.ChargeListParams{}
127+
listParams := &stripe.CustomerListParams{}
129128
listParams.SetStripeAccount("acct_123")
130129
```
131130

@@ -170,19 +169,17 @@ func handler(w http.ResponseWriter, r *http.Request) {
170169
c := appengine.NewContext(r)
171170
httpClient := urlfetch.Client(c)
172171

173-
sc := stripeClient.New("sk_live_key", stripe.NewBackends(httpClient))
172+
sc := stripeClient.New("sk_test_123", stripe.NewBackends(httpClient))
174173

175-
chargeParams := &stripe.ChargeParams{
176-
Amount: stripe.Int64(2000),
177-
Currency: stripe.String(string(stripe.CurrencyUSD)),
178-
Description: stripe.String("Charge from Google App Engine"),
174+
params := &stripe.CustomerParams{
175+
Description: stripe.String("Stripe Developer"),
176+
Email: stripe.String("[email protected]"),
179177
}
180-
chargeParams.SetSource("tok_amex") // obtained with Stripe.js
181-
charge, err := sc.Charges.New(chargeParams)
178+
customer, err := sc.Customers.New(params)
182179
if err != nil {
183-
fmt.Fprintf(w, "Could not process payment: %v", err)
180+
fmt.Fprintf(w, "Could not create customer: %v", err)
184181
}
185-
fmt.Fprintf(w, "Completed payment: %v", charge.ID)
182+
fmt.Fprintf(w, "Customer created: %v", customer.ID)
186183
}
187184
```
188185

VERSION

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

0 commit comments

Comments
 (0)