-
Notifications
You must be signed in to change notification settings - Fork 996
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
Update PaymentIntents support #1038
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
12a23a0
Remove `PaymentIntent.returnUrl` property
danj-stripe 0e7501c
Add (empty) classes for next_source_action values
danj-stripe 98a68e7
Fill out implementation of STPPaymentIntentSourceActionAuthorizeWithURL
danj-stripe d8cfcab
Add enum for nextSourceAction.type
danj-stripe a842822
Fill out implementation of STPPaymentIntentSourceAction
danj-stripe 975f56f
Add STPPaymentIntentSourceAction to STPPaymentIntent
danj-stripe a211cd6
Update STPPaymentIntent tests, and JSON for fixture
danj-stripe 8f8de96
Adding test for new enum value from string
danj-stripe 40ac1f4
Add test for decoding `STPPaymentIntentSourceAction`
danj-stripe 52f6606
Convert enum value to a string, instead of using `type` from the server
danj-stripe 4adcc95
Update disabled functional test for confirming to make sure the retur…
danj-stripe b4ccf91
Use `STPPaymentIntentSourceActionAuthorizeWithURL.returnURL` in `STPR…
danj-stripe eba2751
Update MIGRATING for removal of `STPPaymentIntent.returnUrl`
danj-stripe 04d4d10
Use SDK's enum value instead of server's string constant in documenta…
danj-stripe 40e9acf
Use dict, not response, while decoding.
danj-stripe 09614b1
Fix copy/paste error in failing test
danj-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,44 @@ | ||
// | ||
// STPPaymentIntentSourceAction.h | ||
// Stripe | ||
// | ||
// Created by Daniel Jackson on 11/7/18. | ||
// Copyright © 2018 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPAPIResponseDecodable.h" | ||
#import "STPPaymentIntentEnums.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@class STPPaymentIntentSourceActionAuthorizeWithURL; | ||
|
||
/** | ||
Source Action details for an STPPaymentIntent. This is a container for | ||
the various types that are available. Check the `type` to see which one | ||
it is, and then use the related property for the details necessary to handle | ||
it. | ||
*/ | ||
@interface STPPaymentIntentSourceAction: NSObject<STPAPIResponseDecodable> | ||
|
||
/** | ||
You cannot directly instantiate an `STPPaymentIntentSourceAction`. | ||
*/ | ||
- (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPPaymentIntentSourceAction."))); | ||
|
||
/** | ||
The type of source action needed. The value of this field determines which | ||
property of this object contains further details about the action. | ||
*/ | ||
@property (nonatomic, readonly) STPPaymentIntentSourceActionType type; | ||
|
||
/** | ||
The details for authorizing via URL, when `type == STPPaymentIntentSourceActionTypeAuthorizeWithURL` | ||
*/ | ||
@property (nonatomic, nullable, readonly) STPPaymentIntentSourceActionAuthorizeWithURL* authorizeWithURL; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
40 changes: 40 additions & 0 deletions
40
Stripe/PublicHeaders/STPPaymentIntentSourceActionAuthorizeWithURL.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,40 @@ | ||
// | ||
// STPPaymentIntentSourceActionAuthorizeWithURL.h | ||
// Stripe | ||
// | ||
// Created by Daniel Jackson on 11/7/18. | ||
// Copyright © 2018 Stripe, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#import "STPAPIResponseDecodable.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
The `STPPaymentIntentSourceAction` details when type is `STPPaymentIntentSourceActionTypeAuthorizeWithURL`. | ||
|
||
These are created & owned by the containing `STPPaymentIntent`. | ||
*/ | ||
@interface STPPaymentIntentSourceActionAuthorizeWithURL: NSObject<STPAPIResponseDecodable> | ||
|
||
/** | ||
You cannot directly instantiate an `STPPaymentIntentSourceActionAuthorizeWithURL`. | ||
*/ | ||
- (instancetype)init __attribute__((unavailable("You cannot directly instantiate an STPPaymentIntentSourceActionAuthorizeWithURL."))); | ||
|
||
/** | ||
The URL where the user will authorize this charge. | ||
*/ | ||
@property (nonatomic, readonly) NSURL *url; | ||
|
||
/** | ||
The return URL that'll be redirected back to when the user is done | ||
authorizing the charge. | ||
*/ | ||
@property (nonatomic, nullable, readonly) NSURL *returnURL; | ||
|
||
@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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of renaming this something like
STPPaymentIntentSourceActionURLAuthorizationData
?AuthorizeWithURL
is a bit confusing to meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured consistency with the API (where this shows up as
authorize_with_url
, plus the other stripe SDKs (which use essentially the same thing), was a good reason to go with this monstrosity of a name. It's my hope that users of the library never actually really interact with this class - I suspect they'll just access it's fields through theSTPPaymentIntent
objectThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense