-
Notifications
You must be signed in to change notification settings - Fork 460
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
Renaming all properties, structs and methods to match the API naming #459
Conversation
14eb36f
to
264b7ec
Compare
Protip: you can add https://github.com/stripe/stripe-go/pull/459/files?w=1 |
1dc074e
to
eeaaa19
Compare
13f9942
to
ca7110b
Compare
Just to double-check: this one is all set for review right Remi? |
@brandur-stripe Not quite yet. You wanted to fix the |
6d9985b
to
88a3345
Compare
@brandur-stripe I think this is ready to review. I will update the description to list all changes that we had in that library. As discussed internally, I will separately open a PR that lets us move all bool in params structs to pointers. |
88a3345
to
5328d5d
Compare
Okay rebased on the latest master as a few things had changed. |
dispute.go
Outdated
URL string `json:"url"` | ||
Created int64 `json:"created"` | ||
ID string `json:"id"` | ||
MimeType string `json:"mime_type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do MIMEType
? (Multipurpose Internet Mail Extensions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
invoiceitem.go
Outdated
Period *Period `json:"period"` | ||
Plan *Plan `json:"plan"` | ||
Proration bool `json:"proration"` | ||
Quantity int64 `json:"quantity"` | ||
Sub string `json:"subscription"` | ||
Subscription string `json:"subscription"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're about to break it anyway, should we make Subscription
expandable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
Paid int64 `json:"paid"` | ||
Returned int64 `json:"returned"` | ||
Canceled int64 `json:"canceled"` | ||
Fulfiled int64 `json:"fulfiled"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave this as Fulfilled
and fix it server side at some point instead.
No point in cargo culting too hard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I have seen confusion in other libraries such as stripe/stripe-dotnet#1085 so I think it's worth matching the API instead of trying to write words differently in code than we do in the API. wdyt?
payout.go
Outdated
Amount int64 `json:"amount"` | ||
ArrivalDate int64 `json:"arrival_date"` | ||
BalanceTransaction *BalanceTransaction `json:"balance_transaction"` | ||
BankAccoun *BankAccount `json:"bank_account"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here. Missing a "t" on the end.
subscription.go
Outdated
@@ -0,0 +1,133 @@ | |||
package stripe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the rational here, but I wonder if we should leave this as sub.go
so that you can always match the name of a Go file with the name of the corresponding package? (sub/
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I just renamed those back.
Great work Remi. Can't wait for this to come in! This is definitely going to be a little painful, but even so, probably time to rip the bandaid off. I left a few comments above, but otherwise LGTM. |
5328d5d
to
7955210
Compare
7955210
to
d788299
Compare
@brandur-stripe Okay, I addressed all remaining comments I think. Can you let me know if you have any other feedback? This one will have to be merged after we merge #507 into it but I think we can get this done this week! |
payout.go
Outdated
ArrivalDate int64 `json:"arrival_date"` | ||
Automatic bool `json:"automatic"` | ||
BalanceTransaction *BalanceTransaction `json:"balance_transaction"` | ||
BankAccoun *BankAccount `json:"bank_account"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelling: BankAccount
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, nice catch, fixed.
recipienttransfer.go
Outdated
Recipient *Recipient `json:"recipient"` | ||
Reversals *ReversalList `json:"reversals"` | ||
Reversed bool `json:"reversed"` | ||
SourceTransation *BalanceTransactionSource `json:"source_transaction"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelling: SourceTransaction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, nice catch, fixed.
@remi-stripe Nice! I took one more pass; I can't guarantee I got everything, but only found some minor stuff. Otherwise, this LGTM. |
e6af552
to
b16e137
Compare
Rebased on the latest master. I had to squash all commits into one readable long one because there were too many merge conflicts on small ones and it was easy to miss something and introduce a regression |
Nice Remi! What do you say that we try to do the work to get this merged ASAP early next week ... before you get too tired to continue this project ;) I'm not sure if you had a particular timeline in mind, but it seems like we're going to have to pull the trigger on this at some point. We're also sitting at v29.* right now, and v30.* would be a nice round number of a big breaking change like this one :) |
@brandur-stripe I'd love to do that. This can't be merged as is, there's the other PR waiting where I'm blocked for now though. It's unlikely to be cleaned up by early next week though and then I'm OOO for a bit. |
Ah k :/ Well in that case let's just try to get it on the board as soon as we can. |
I've had my eyes on version 30.0.0 for a while though so I'll try to get this done! |
b16e137
to
324b82c
Compare
Hello. Any updates on this PR? Is there any approximate date when it will be merged? |
@kerak19 Sorry about the delayed response here. We're not exactly sure when this will come in, but Remi and I are meeting a little later today, and I'm hopeful that we can get this in within the next couple weeks. |
Moved to #544 as the bigger PR |
* Slight custom field description improvement * Wording and organization improvement on sync preferences page
This PR ensures that all properties in the library matches the official API. Names are not shortened anymore making it easier to associated a given parameter to its API counterpart.
We can't list all the changes one by one as those are extensive but here are the ones likely to impact most integrations:
BusinessURL
.DynamicLast4
orSSNLast4
.Account
onBankAccount
becomingAccountNumber
to avoid confusing with its Connect counterpart which is now namedAccount
instead ofAccountID
.MonthAnchor
or constants such asMonth
are now renamed to match the corresponding parameter/value in the APIMonthlyAnchor
andMonthly
.Meta
andLive
have been renamed toMetadata
andLivemode
on all classesValues
on List objects has been renamed toData
Owner
is nowAdditionalOwner
,Transaction
is nowBalanceTransaction
with all constants and corresponding classes renamed to match thisTx
were also replaced byBalanceTransaction
in classes, properties and constantsFee
andFeeRefund
have been renamed toApplicationFee
andApplicationFeeRefund
along with all related classes, properties and constants.Sub
has been renamed toSubscription
along with all related classes, properties and constants.City
becomingAddressCity
andMonth
becoming `ExpMonth.ErrorCode
such asErrorCodeCardDeclined
orErrorCodeIncorrectZip
.Object
andPreviousAttributes
and methodsGetObjectValue()
andGetPreviousValue()
.StartingAfter
,EndingBefore
andHasMore
.AddMeta()
has been renamed toAddMetadata()
,Expand()
toAddExpand()