don't update customer.email with shipping

This commit is contained in:
Ben Guo 2017-06-27 16:57:07 -04:00
parent a17ea5abbe
commit 78a8497bb4
3 changed files with 4 additions and 5 deletions

View File

@ -153,7 +153,10 @@ NS_ASSUME_NONNULL_BEGIN
* When your user enters a new shipping address, PaymentContext will save it to
* the current customer object. When PaymentContext loads, if you haven't
* manually set a prefilled value, any shipping information saved on the customer
* will be used to prefill the shipping address form.
* will be used to prefill the shipping address form. Note that because your
* customer's email may not be the same as the email provided with their shipping
* info, PaymentContext will not prefill the shipping form's email using your
* customer's email.
*
* You should not rely on the shipping information stored on the Stripe customer
* for order fulfillment, as your user may change this information if they make

View File

@ -83,9 +83,6 @@
shipping.state = shippingDict[@"address"][@"state"];
shipping.postalCode = shippingDict[@"address"][@"postal_code"];
shipping.country = shippingDict[@"address"][@"country"];
// Note: email is currently one level above in the customer API,
// but the SDK stores it in customer.shippingAddress
shipping.email = dict[@"email"];
customer.shippingAddress = shipping;
}
NSMutableArray *sources = [NSMutableArray array];

View File

@ -149,7 +149,6 @@ static NSTimeInterval const DefaultCachedCustomerMaxAge = 60;
NSMutableDictionary *params = [NSMutableDictionary new];
params[@"shipping"] = [STPAddress shippingInfoForChargeWithAddress:shipping
shippingMethod:nil];
params[@"email"] = shipping.email;
[STPAPIClient updateCustomerWithParameters:[params copy]
usingKey:ephemeralKey
completion:^(STPCustomer *customer, NSError *error) {