Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to read/write shipping to a PaymentIntent (#1558)
* Add PaymentIntent shipping details * Add shipping to STPPaymentIntent * Add shipping to STPPaymentIntent confirm * PR feedback * Undo NS_UNAVAILABLE new * Fix broken test b/c bad merge conflict
- Loading branch information
1 parent
9320104
commit a8fba70
Showing
18 changed files
with
665 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// STPPaymentIntentShippingDetails.h | ||
// Stripe | ||
// | ||
// Created by Yuki Tokuhiro on 4/27/20. | ||
// Copyright © 2020 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPAPIResponseDecodable.h" | ||
|
||
@class STPPaymentIntentShippingDetailsAddress; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
Shipping information for a PaymentIntent | ||
@see https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping | ||
*/ | ||
@interface STPPaymentIntentShippingDetails : NSObject <STPAPIResponseDecodable> | ||
|
||
/** | ||
Shipping address. | ||
*/ | ||
@property (nonatomic, nullable, readonly) STPPaymentIntentShippingDetailsAddress *address; | ||
|
||
/** | ||
Recipient name. | ||
*/ | ||
@property (nonatomic, nullable, copy, readonly) NSString *name; | ||
|
||
/** | ||
The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. | ||
*/ | ||
@property (nonatomic, nullable, copy, readonly) NSString *carrier; | ||
|
||
/** | ||
Recipient phone (including extension). | ||
*/ | ||
@property (nonatomic, nullable, copy, readonly) NSString *phone; | ||
|
||
/** | ||
The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. | ||
*/ | ||
@property (nonatomic, nullable, copy, readonly) NSString *trackingNumber; | ||
|
||
/** | ||
You cannot directly instantiate an `STPPaymentIntentShippingDetails`. | ||
You should only use one that is part of an existing `STPPaymentMethod` object. | ||
*/ | ||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
60 changes: 60 additions & 0 deletions
60
Stripe/PublicHeaders/STPPaymentIntentShippingDetailsAddress.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// STPPaymentIntentShippingDetailsAddress.h | ||
// Stripe | ||
// | ||
// Created by Yuki Tokuhiro on 4/27/20. | ||
// Copyright © 2020 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPAPIResponseDecodable.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
Shipping address for a PaymentIntent's shipping details. | ||
@see https://stripe.com/docs/api/payment_intents/object#payment_intent_object-shipping | ||
*/ | ||
@interface STPPaymentIntentShippingDetailsAddress : NSObject <STPAPIResponseDecodable> | ||
|
||
/** | ||
City/District/Suburb/Town/Village. | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *city; | ||
|
||
/** | ||
Two-letter country code (ISO 3166-1 alpha-2). | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *country; | ||
|
||
/** | ||
Address line 1 (Street address/PO Box/Company name). | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *line1; | ||
|
||
/** | ||
Address line 2 (Apartment/Suite/Unit/Building). | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *line2; | ||
|
||
/** | ||
ZIP or postal code. | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *postalCode; | ||
|
||
/** | ||
State/County/Province/Region. | ||
*/ | ||
@property (nonatomic, copy, nullable, readonly) NSString *state; | ||
|
||
/** | ||
You cannot directly instantiate an `STPPaymentIntentShippingDetailsAddress`. | ||
You should only use one that is part of an existing `STPPaymentMethod` object. | ||
*/ | ||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
64 changes: 64 additions & 0 deletions
64
Stripe/PublicHeaders/STPPaymentIntentShippingDetailsAddressParams.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// | ||
// STPPaymentIntentShippingDetailsAddressParams.h | ||
// Stripe | ||
// | ||
// Created by Yuki Tokuhiro on 4/27/20. | ||
// Copyright © 2020 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPFormEncodable.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
Shipping address for a PaymentIntent's shipping details. | ||
@see https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-shipping-address | ||
*/ | ||
@interface STPPaymentIntentShippingDetailsAddressParams : NSObject <NSCopying, STPFormEncodable> | ||
|
||
/** | ||
City/District/Suburb/Town/Village. | ||
*/ | ||
@property (nonatomic, copy, nullable) NSString *city; | ||
|
||
/** | ||
Two-letter country code (ISO 3166-1 alpha-2). | ||
*/ | ||
@property (nonatomic, copy, nullable) NSString *country; | ||
|
||
/** | ||
Address line 1 (Street address/PO Box/Company name). | ||
*/ | ||
@property (nonatomic, copy) NSString *line1; | ||
|
||
/** | ||
Address line 2 (Apartment/Suite/Unit/Building). | ||
*/ | ||
@property (nonatomic, copy, nullable) NSString *line2; | ||
|
||
/** | ||
ZIP or postal code. | ||
*/ | ||
@property (nonatomic, copy, nullable) NSString *postalCode; | ||
|
||
/** | ||
State/County/Province/Region. | ||
*/ | ||
@property (nonatomic, copy, nullable) NSString *state; | ||
|
||
/** | ||
Initialize an `STPPaymentIntentShippingDetailsAddressParams` instance with required properties. | ||
*/ | ||
- (instancetype)initWithLine1:(NSString *)line1; | ||
|
||
/** | ||
Use `initWithLine1:` instead. | ||
*/ | ||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
61 changes: 61 additions & 0 deletions
61
Stripe/PublicHeaders/STPPaymentIntentShippingDetailsParams.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// STPPaymentIntentShippingDetailsParams.h | ||
// Stripe | ||
// | ||
// Created by Yuki Tokuhiro on 4/27/20. | ||
// Copyright © 2020 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPFormEncodable.h" | ||
|
||
@class STPPaymentIntentShippingDetailsAddressParams; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
Shipping information for a PaymentIntent | ||
@see https://stripe.com/docs/api/payment_intents/confirm#confirm_payment_intent-shipping | ||
*/ | ||
@interface STPPaymentIntentShippingDetailsParams : NSObject <NSCopying, STPFormEncodable> | ||
|
||
/** | ||
Shipping address. | ||
*/ | ||
@property (nonatomic) STPPaymentIntentShippingDetailsAddressParams *address; | ||
|
||
/** | ||
Recipient name. | ||
*/ | ||
@property (nonatomic, copy) NSString *name; | ||
|
||
/** | ||
The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. | ||
*/ | ||
@property (nonatomic, nullable, copy) NSString *carrier; | ||
|
||
/** | ||
Recipient phone (including extension). | ||
*/ | ||
@property (nonatomic, nullable, copy) NSString *phone; | ||
|
||
/** | ||
The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. | ||
*/ | ||
@property (nonatomic, nullable, copy) NSString *trackingNumber; | ||
|
||
/** | ||
Initialize an `STPPaymentIntentShippingDetailsParams` with required properties. | ||
*/ | ||
- (instancetype)initWithAddress:(STPPaymentIntentShippingDetailsAddressParams *)address name:(NSString *)name; | ||
|
||
/** | ||
Use `initWithAddress:name:` instead. | ||
*/ | ||
- (instancetype)init NS_UNAVAILABLE; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.