Skip to content

Commit

Permalink
Revert "STPAddress <-> STPPaymentMethod (#1278)"
Browse files Browse the repository at this point in the history
This reverts commit ee3cc60.
  • Loading branch information
davidme-stripe committed Aug 13, 2019
1 parent c43fc34 commit 925bc6e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 53 deletions.
5 changes: 0 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
## ??
* Add STPAddress initializer that takes STPPaymentMethodBillingDetails. [#1278](https://github.com/stripe/stripe-ios/pull/1278)
* Add convenience method to populate STPUserInformation with STPPaymentMethodBillingDetails. [#1278](https://github.com/stripe/stripe-ios/pull/1278)
* STPShippingAddressViewController prefills billing address for PaymentMethods too now, not just Card. [#1278](https://github.com/stripe/stripe-ios/pull/1278)

## 16.0.5 2019-08-09
* Fixed an compatibility issue when building with certain Cocoapods configurations. [#1288](https://github.com/stripe/stripe-ios/issues/1288)

Expand Down
9 changes: 0 additions & 9 deletions Stripe/PublicHeaders/STPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#import "STPFormEncodable.h"

@class CNContact;
@class STPPaymentMethodBillingDetails;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -133,14 +132,6 @@ extern STPContactField const STPContactFieldName;
+ (nullable NSDictionary *)shippingInfoForChargeWithAddress:(nullable STPAddress *)address
shippingMethod:(nullable PKShippingMethod *)method;

/**
Initializes a new STPAddress with data from STPPaymentMethodBillingDetails.
@param billingDetails The STPPaymentMethodBillingDetails instance you want to populate the STPAddress from.
@return A new STPAddress instance with data copied from the passed in billing details.
*/
- (instancetype)initWithPaymentMethodBillingDetails:(STPPaymentMethodBillingDetails *)billingDetails;

/**
Initializes a new STPAddress with data from an PassKit contact.
Expand Down
13 changes: 0 additions & 13 deletions Stripe/PublicHeaders/STPUserInformation.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#import <Foundation/Foundation.h>
#import "STPAddress.h"

@class STPPaymentMethodBillingDetails;

NS_ASSUME_NONNULL_BEGIN

/**
Expand All @@ -25,9 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
The user's billing address. When set, the add card form will be filled with
this address. The user will also have the option to fill their shipping address
using this address.
@note Set this using `setBillingAddressWithBillingDetails:` to use the billing
details from an `STPPaymentMethod` or `STPPaymentMethodParams` instance.
*/
@property (nonatomic, strong, nullable) STPAddress *billingAddress;

Expand All @@ -38,14 +33,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, strong, nullable) STPAddress *shippingAddress;

/**
A convenience method to populate `billingAddress` with a PaymentMethod's billing details.
@note Calling this overwrites the value of `billingAddress`.
*/
- (void)setBillingAddressWithBillingDetails:(STPPaymentMethodBillingDetails *)billingDetails
NS_SWIFT_NAME(setBillingAddress(with:));

@end

NS_ASSUME_NONNULL_END
19 changes: 0 additions & 19 deletions Stripe/STPAddress.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#import "STPCardValidator.h"
#import "STPEmailAddressValidator.h"
#import "STPFormEncoder.h"
#import "STPPaymentMethodAddress.h"
#import "STPPaymentMethodBillingDetails.h"
#import "STPPhoneNumberValidator.h"
#import "STPPostalCodeValidator.h"

Expand Down Expand Up @@ -60,23 +58,6 @@ - (NSString *)sanitizedPhoneStringFromCNPhoneNumber:(CNPhoneNumber *)phoneNumber
return stringIfHasContentsElseNil(phone);
}

- (instancetype)initWithPaymentMethodBillingDetails:(STPPaymentMethodBillingDetails *)billingDetails {
self = [super init];
if (self) {
_name = [billingDetails.name copy];
_phone = [billingDetails.phone copy];
_email = [billingDetails.email copy];
STPPaymentMethodAddress *pmAddress = billingDetails.address;
_line1 = [pmAddress.line1 copy];
_line2 = [pmAddress.line2 copy];
_city = [pmAddress.city copy];
_state = [pmAddress.state copy];
_postalCode = [pmAddress.postalCode copy];
_country = [pmAddress.country copy];
}
return self;
}

- (instancetype)initWithCNContact:(CNContact *)contact {
self = [super init];
if (self) {
Expand Down
3 changes: 0 additions & 3 deletions Stripe/STPShippingAddressViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ - (instancetype)initWithPaymentContext:(STPPaymentContext *)paymentContext {
if ([paymentOption isKindOfClass:[STPCard class]]) {
STPCard *card = (STPCard *)paymentOption;
billingAddress = [card address];
} else if ([paymentOption isKindOfClass:[STPPaymentMethod class]]) {
STPPaymentMethod *paymentMethod = (STPPaymentMethod *)paymentOption;
billingAddress = [[STPAddress alloc] initWithPaymentMethodBillingDetails:paymentMethod.billingDetails];
}
STPUserInformation *prefilledInformation;
if (paymentContext.prefilledInformation != nil) {
Expand Down
4 changes: 0 additions & 4 deletions Stripe/STPUserInformation.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ - (id)copyWithZone:(__unused NSZone *)zone {
return copy;
}

- (void)setBillingAddressWithBillingDetails:(STPPaymentMethodBillingDetails *)billingDetails {
self.billingAddress = [[STPAddress alloc] initWithPaymentMethodBillingDetails:billingDetails];
}

@end

0 comments on commit 925bc6e

Please sign in to comment.