-
Notifications
You must be signed in to change notification settings - Fork 368
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
Add support for the payment_intent resource #543
Conversation
3b7df4b
to
b345fe2
Compare
@@ -0,0 +1,4 @@ | |||
package com.stripe.model; | |||
|
|||
public class PaymentIntentCollection extends StripeCollection<Payout> { |
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.
I'm unfamiliar with our client libs / java in general, but is Payout
a typo?
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.
yes it's just a WIP branch to start discussion on naming
af7bb00
to
a91df5d
Compare
PaymentIntentSourceAction nextSourceAction; | ||
@Getter(AccessLevel.NONE) @Setter(AccessLevel.NONE) ExpandableField<Account> onBehalfOf; | ||
String receiptEmail; | ||
String returnUrl; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
String type = jsonObject.get("type").getAsString(); | ||
sourceAction.setType(type); | ||
Class<? extends PaymentIntentSourceActionValue> cl = objectMap.get(type); | ||
if (cl != null) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
protected String name; | ||
protected String phone; | ||
protected String trackingNumber; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
a91df5d
to
fc22242
Compare
r? @ob-stripe |
@Getter | ||
@Setter | ||
@EqualsAndHashCode(callSuper = false) | ||
public class PaymentIntentSourceActionValue extends StripeObject { |
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.
This class does not have any attributes, so you can remove all the Lombok annotations. You should also declare the class as abstract
as it is an abstract superclass that should not be used directly.
protected String name; | ||
protected String phone; | ||
protected String trackingNumber; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
PaymentIntentSourceAction nextSourceAction; | ||
@Getter(AccessLevel.NONE) @Setter(AccessLevel.NONE) ExpandableField<Account> onBehalfOf; | ||
String receiptEmail; | ||
String returnUrl; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
return (this.application != null) ? this.application.getId() : null; | ||
} | ||
|
||
public void setApplication(String applicationID) { |
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.
Could you replace all fooID
with fooId
? This will make it easier to rebase the v6 branch.
} | ||
|
||
public void setSourceObject(Account c) { | ||
this.onBehalfOf = new ExpandableField<Account>(c.getId(), c); |
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.
Copy/paste error here, Account
should be ExternalAccount
.
|
||
// <editor-fold desc="capture"> | ||
/** | ||
* capture a payment intent. |
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.
Nit, but can you check that all Javadoc comments start with a capital letter?
return request(RequestMethod.POST, instanceURL(PaymentIntent.class, this.id) + "/confirm", null, | ||
PaymentIntent.class, options); | ||
} | ||
// </editor-fold> |
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.
Can you confirm that none of the cancel
, confirm
and create
requests accept any parameters server-side (and that there are no plans to add parameters)? If not, we should add signatures that accept params.
String type = jsonObject.get("type").getAsString(); | ||
sourceAction.setType(type); | ||
Class<? extends PaymentIntentSourceActionValue> cl = objectMap.get(type); | ||
if (cl != null) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
assertNotNull(actionValue); | ||
assertEquals("https://stripe.com", actionValue.getUrl()); | ||
} | ||
} |
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.
Hate to be a bother, but do you mind adding a second test (and fixture) for the expandable attributes?
@ob-stripe Thank you for the careful review! Damn I missed a few things! Can you have a look? |
This resource is gated so for now tests will be stubbed Fix linting errors
ea0d9e7
to
cc5748f
Compare
Released in 5.46.0. |
This resource is gated so for now tests will be stubbed.
cc @michelle-stripe @jenan-stripe @stripe/api-libraries