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

Split up cards and card params. #760

Merged
merged 4 commits into from
Aug 3, 2017
Merged

Conversation

bdorfman-stripe
Copy link
Contributor

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?

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.
Copy link
Contributor

@bg-stripe bg-stripe left a 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

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;
Copy link
Contributor

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?

Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor

@joeydong-stripe joeydong-stripe left a 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.
Copy link
Contributor

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..."

Copy link
Contributor

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

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;
Copy link
Contributor

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.

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.")));
Copy link
Contributor

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
@stripe-ci stripe-ci removed the approved label Aug 2, 2017
@bdorfman-stripe
Copy link
Contributor Author

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?

@joeydong-stripe
Copy link
Contributor

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.

Yeah I wanted to lean that way too. We can update the style guide to reflect that.

@bg-stripe
Copy link
Contributor

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.

+1

@@ -13,20 +13,23 @@
#import "STPImageLibrary+Private.h"
#import "STPImageLibrary.h"

NS_ASSUME_NONNULL_BEGIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Contributor

@bg-stripe bg-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@stripe-ci stripe-ci removed the approved label Aug 2, 2017
@bdorfman-stripe bdorfman-stripe merged commit 34a3c03 into master Aug 3, 2017
@bdorfman-stripe bdorfman-stripe deleted the bdorfman-split-cardparams branch August 3, 2017 18:22
davidme-stripe pushed a commit that referenced this pull request Feb 18, 2022
Add mime-types to gemfile for automated deploys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants