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

[17.0.0, breaking] Update API version from 2015-10-12 to 2019-05-16 #1254

Merged
merged 18 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 17.0.0 ??
* Updates API version from 2015-10-12 to 2019-05-16
* Adds `STPSourceRedirectStatusNotRequired` to `STPSourceRedirectStatus`. Previously, optional redirects were marked as `STPSourceRedirectStatusSucceeded`.
* Adds `STPSourceCard3DSecureStatusRecommended` to `STPSourceCard3DSecureStatus`.
* Removes `STPLegalEntityParams`. Initialize an `STPConnectAccountParams` with an `individual` or `company` dictionary instead. See https://stripe.com/docs/api/tokens/create_account#create_account_token-account
* Changes the `STPPaymentContextDelegate paymentContext:didCreatePaymentResult:completion:` completion block type to `STPPaymentStatusBlock`, to let you inform the context that the user canceled.

## 16.0.7 2019-08-23
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "AliSoftware/OHHTTPStubs" "8.0.0"
github "capitalone/SWHttpTrafficRecorder" "1.0.2"
github "erikdoe/ocmock" "v3.4.3"
github "uber/ios-snapshot-test-case" "6.0.3"
github "uber/ios-snapshot-test-case" "6.1.0"
1 change: 1 addition & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Migration Guides

### Migrating from versions < 17.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm kind of inclined not to have another major version bump so soon...Maybe 16.1.0? This should only be a breaking change for Connect users right? Thoughts @yuki-stripe @davidme-stripe

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with how versioning has worked here in the past, but moving from the 2015 API sounds like an appropriate reason to increment the major version number.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Definitely wary of fatiguing our users...there are the (minor) enum changes that Source users should update with, too. Outside of that, it should be unnoticed.

Either way, I'd like to ship this only after some confidence that 16.* won't have more bugfixes.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Let's hold this patch until 16.0.* has settled and then go from there

* The API version has been updated from 2015-10-12 to 2019-05-16. CHANGELOG.md has details on the changes made, which includes breaking changes for `STPConnectAccountParams` users. Your backend Stripe API version should be sufficiently decoupled from the SDK's so that keeping their versions in sync is not required, and no further action is required to migrate to this version of the SDK.
* For STPPaymentContext users: the completion block type in `paymentContext:didCreatePaymentResult:completion:` has changed to `STPPaymentStatusBlock`, to let you inform the context that the user has cancelled.

### Migrating from versions < 16.0.0
Expand Down
56 changes: 40 additions & 16 deletions Stripe.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions Stripe/PublicHeaders/STPConnectAccountAddress.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// STPConnectAccountAddress.h
// Stripe
//
// Created by Yuki Tokuhiro on 8/2/19.
// Copyright © 2019 Stripe, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "STPFormEncodable.h"

NS_ASSUME_NONNULL_BEGIN

/**
An address to use with `STPConnectAccountParams`.
*/
@interface STPConnectAccountAddress : NSObject <STPFormEncodable>
yuki-stripe marked this conversation as resolved.
Show resolved Hide resolved

/**
City, district, suburb, town, or village.

For addresses in Japan: City or ward.
*/
@property (nonatomic, copy, nullable) NSString *city;

/**
Two-letter country code (ISO 3166-1 alpha-2).

@see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
*/
@property (nonatomic, copy, nullable) NSString *country;

/**
Address line 1 (e.g., street, PO Box, or company name).

For addresses in Japan: Block or building number.
*/
@property (nonatomic, copy, nullable) NSString *line1;

/**
Address line 2 (e.g., apartment, suite, unit, or building).

For addresses in Japan: Building details.
*/
@property (nonatomic, copy, nullable) NSString *line2;

/**
ZIP or postal code.
*/
@property (nonatomic, copy, nullable) NSString *postalCode;

/**
State, county, province, or region.

For addresses in Japan: Prefecture.
*/
@property (nonatomic, copy, nullable) NSString *state;

/**
Town or cho-me.

This property only applies to Japanese addresses.
*/
@property (nonatomic, copy, nullable) NSString *town;

@end

NS_ASSUME_NONNULL_END
92 changes: 92 additions & 0 deletions Stripe/PublicHeaders/STPConnectAccountCompanyParams.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// STPConnectAccountCompanyParams.h
// StripeiOS
//
// Created by Yuki Tokuhiro on 8/2/19.
// Copyright © 2019 Stripe, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "STPConnectAccountAddress.h"
#import "STPFormEncodable.h"

NS_ASSUME_NONNULL_BEGIN

/**
Information about the company or business to use with `STPConnectAccountParams`.

@see https://stripe.com/docs/api/tokens/create_account#create_account_token-account-company
*/
@interface STPConnectAccountCompanyParams : NSObject <STPFormEncodable>

/**
The company’s primary address.
*/
@property (nonatomic, strong) STPConnectAccountAddress *address;

/**
The Kana variation of the company’s primary address (Japan only).
*/
@property (nonatomic, nullable) STPConnectAccountAddress *kanaAddress;

/**
The Kanji variation of the company’s primary address (Japan only).
*/
@property (nonatomic, nullable) STPConnectAccountAddress *kanjiAddress;

/**
Whether the company’s directors have been provided.

Set this Boolean to true after creating all the company’s directors with the Persons API (https://stripe.com/docs/api/persons) for accounts with a relationship.director requirement.
This value is not automatically set to true after creating directors, so it needs to be updated to indicate all directors have been provided.
*/
@property (nonatomic, nullable) NSNumber *directorsProvided;

/**
The company’s legal name.
*/
@property (nonatomic, copy, nullable) NSString *name;

/**
The Kana variation of the company’s legal name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanaName;

/**
The Kanji variation of the company’s legal name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanjiName;

/**
Whether the company’s owners have been provided.

Set this Boolean to true after creating all the company’s owners with the Persons API (https://stripe.com/docs/api/persons) for accounts with a relationship.owner requirement.
*/
@property (nonatomic, nullable) NSNumber *ownersProvided;

/**
The company’s phone number (used for verification).
*/
@property (nonatomic, copy, nullable) NSString *phone;

/**
The business ID number of the company, as appropriate for the company’s country.

(Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)
*/
@property (nonatomic, copy, nullable) NSString *taxID;

/**
The jurisdiction in which the taxID is registered (Germany-based companies only).
*/
@property (nonatomic, copy, nullable) NSString *taxIDRegistrar;

/**
The VAT number of the company.
*/
@property (nonatomic, copy, nullable) NSString *vatID;

@end

NS_ASSUME_NONNULL_END
163 changes: 163 additions & 0 deletions Stripe/PublicHeaders/STPConnectAccountIndividualParams.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
//
// STPConnectAccountIndividualParams.h
// Stripe
//
// Created by Yuki Tokuhiro on 8/2/19.
// Copyright © 2019 Stripe, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "STPConnectAccountAddress.h"
#import "STPFormEncodable.h"

NS_ASSUME_NONNULL_BEGIN

@class STPConnectAccountIndividualVerification, STPConnectAccountVerificationDocument;

/**
Information about the person represented by the account for use with `STPConnectAccountParams`.

@see https://stripe.com/docs/api/tokens/create_account#create_account_token-account-individual
*/
@interface STPConnectAccountIndividualParams : NSObject <STPFormEncodable>

/**
The individual’s primary address.
*/
@property (nonatomic, nullable) STPConnectAccountAddress *address;

/**
The Kana variation of the the individual’s primary address (Japan only).
*/
@property (nonatomic, nullable) STPConnectAccountAddress *kanaAddress;

/**
The Kanji variation of the the individual’s primary address (Japan only).
*/
@property (nonatomic, nullable) STPConnectAccountAddress *kanjiAddress;

/**
The individual’s date of birth.

Must include `day`, `month`, and `year`, and only those fields are used.
*/
@property (nonatomic, copy, nullable) NSDateComponents *dateOfBirth;

/**
The individual's email address.
*/
@property (nonatomic, copy, nullable) NSString *email;

/**
The individual’s first name.
*/
@property (nonatomic, copy, nullable) NSString *firstName;

/**
The Kana variation of the the individual’s first name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanaFirstName;

/**
The Kanji variation of the individual’s first name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanjiFirstName;

/**
The individual’s gender

International regulations require either “male” or “female”.
*/
@property (nonatomic, copy, nullable) NSString *gender;

/**
The government-issued ID number of the individual, as appropriate for the representative’s country.
Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada.

Instead of the number itself, you can also provide a PII token created with Stripe.js (see https://stripe.com/docs/stripe-js/reference#collecting-pii-data).
*/
@property (nonatomic, copy, nullable) NSString *idNumber;

/**
The individual’s last name.
*/
@property (nonatomic, copy, nullable) NSString *lastName;

/**
The Kana varation of the individual’s last name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanaLastName;

/**
The Kanji varation of the individual’s last name (Japan only).
*/
@property (nonatomic, copy, nullable) NSString *kanjiLastName;

/**
The individual’s maiden name.
*/
@property (nonatomic, copy, nullable) NSString *maidenName;

/**
Set of key-value pairs that you can attach to an object.

This can be useful for storing additional information about the object in a structured format.
*/
@property (nonatomic, copy, nullable) NSDictionary *metadata;

/**
The individual’s phone number.
*/
@property (nonatomic, copy, nullable) NSString *phone;

/**
The last four digits of the individual’s Social Security Number (U.S. only).
*/
@property (nonatomic, copy, nullable) NSString *ssnLast4;

/**
The individual’s verification document information.
*/
@property (nonatomic, strong, nullable) STPConnectAccountIndividualVerification *verification;

@end

#pragma mark -

/**
The individual’s verification document information for use with `STPConnectAccountIndividualParams`.
*/
@interface STPConnectAccountIndividualVerification: NSObject <STPFormEncodable>

/**
An identifying document, either a passport or local ID card.
*/
@property (nonatomic, strong, nullable) STPConnectAccountVerificationDocument *document;

@end

#pragma mark -

/**
An identifying document, either a passport or local ID card for use with `STPConnectAccountIndividualVerification`.
*/
@interface STPConnectAccountVerificationDocument: NSObject<STPFormEncodable>

/**
The back of an ID returned by a file upload with a `purpose` value of `identity_document`.

@see https://stripe.com/docs/api/files/create for file uploads
*/
@property (nonatomic, copy, nullable) NSString *back;

/**
The front of an ID returned by a file upload with a `purpose` value of `identity_document`.

@see https://stripe.com/docs/api/files/create for file uploads
*/
@property (nonatomic, copy, nullable) NSString *front;

@end

NS_ASSUME_NONNULL_END
Loading