-
Notifications
You must be signed in to change notification settings - Fork 982
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
Split up cards and card params. #760
Conversation
Make STPCard not subclass STPCardParams. Make many STPCard properties readonly. Deprecate some public methods that didn't actually need to be public. Deprecate broken out address methods in favor of STPAddress object. This brings STPCard and STPCardParams more line with the sources API.
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.
nice! +1 for deprecating these things rather than just removing them
Stripe/PublicHeaders/STPCard.h
Outdated
This parses a string representing a card's funding type into the appropriate `STPCardFundingType` enum value, i.e. `[STPCard fundingFromString:@"prepaid"] == STPCardFundingTypePrepaid`. | ||
The cardholder's address. | ||
*/ | ||
@property (nonatomic, nonnull, readonly) STPAddress *address; |
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.
nit: nonnull
is implied by NS_ASSUME
.
while we're at it, should we update these properties to match the style guide and be explicit about strong/copy/assign everywhere?
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.
+1. Also wrapping all header comments at the 80th column.
*/ | ||
@property (nonatomic, readonly) STPCardFundingType funding; | ||
- (instancetype)initWithID:(NSString *)cardID |
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.
👍 glad we're deprecating this
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.
👏
also, I guess this is a good case to try out using NS_ASSUME_NONNULL_BEGIN / NS_ASSUME_NONNULL_END
inside implementations
CHANGELOG
Outdated
@@ -1,4 +1,5 @@ | |||
== X.Y.Z 2017-XX-YY | |||
* Many methods on `STPCard` and `STPCardParams` have been deprecated or made readonly to bring card objects more in line with the rest of the API. See MIGRATING for further details. |
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.
Just starting a discussion, what do we think about starting all of our changelog lines with "Adds / Improves / Fixes"? In this case, I think it would be more like "Fixes many methods..."
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 changelog items should be declarative, like commit messages
Stripe/PublicHeaders/STPCard.h
Outdated
This parses a string representing a card's funding type into the appropriate `STPCardFundingType` enum value, i.e. `[STPCard fundingFromString:@"prepaid"] == STPCardFundingTypePrepaid`. | ||
The cardholder's address. | ||
*/ | ||
@property (nonatomic, nonnull, readonly) STPAddress *address; |
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.
+1. Also wrapping all header comments at the 80th column.
Stripe/PublicHeaders/STPCard.h
Outdated
expMonth:(NSUInteger)expMonth | ||
expYear:(NSUInteger)expYear | ||
funding:(STPCardFundingType)funding; | ||
- (nonnull instancetype) init __attribute__((unavailable("You cannot directly instantiate an STPCard. You should only use one that has been returned from an STPAPIClient callback."))); |
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.
nice guard!
Wrap all comments at 80 chars Assume nonnull in implementation Update property definitions to style guide
Updated a bunch of the property declarations. I went with leaving out the strong/copy/assign part from the readonly headers and just putting them in the readwrite versions in the implementation. Not sure if we have an opinion one way or another on that? |
Yeah I wanted to lean that way too. We can update the style guide to reflect that. |
+1 |
@@ -13,20 +13,23 @@ | |||
#import "STPImageLibrary+Private.h" | |||
#import "STPImageLibrary.h" | |||
|
|||
NS_ASSUME_NONNULL_BEGIN |
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.
🎉
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.
lgtm!
Add mime-types to gemfile for automated deploys
Make STPCard not subclass STPCardParams.
Make many STPCard properties readonly.
Deprecate some public methods that didn't actually need to be public.
Deprecate broken out address methods in favor of STPAddress object.
This brings STPCard and STPCardParams more line with the sources API.
Note: I did a bunch of deprecation marks, but we could discuss just deleting those methods instead?