Skip to content

Commit 3e2e1b9

Browse files
authored
Merge pull request #968 from stripe/remi/codegen-277f09c
Add support for `payment_intent_data[transfer_data][amount]` on Checkout `Session`
2 parents 71bc735 + 0527966 commit 3e2e1b9

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

src/main/java/com/stripe/param/PaymentIntentConfirmParams.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ public class PaymentIntentConfirmParams extends ApiRequestParams {
1515
/**
1616
* Set to {@code true} to fail the payment attempt if the PaymentIntent transitions into {@code
1717
* requires_action}. This parameter is intended for simpler integrations that do not handle
18-
* customer actions.
18+
* customer actions, like <a
19+
* href="https://stripe.com/docs/payments/save-card-without-authentication">saving cards without
20+
* authentication</a>.
1921
*/
2022
@SerializedName("error_on_requires_action")
2123
Boolean errorOnRequiresAction;
@@ -232,7 +234,9 @@ public PaymentIntentConfirmParams build() {
232234
/**
233235
* Set to {@code true} to fail the payment attempt if the PaymentIntent transitions into {@code
234236
* requires_action}. This parameter is intended for simpler integrations that do not handle
235-
* customer actions.
237+
* customer actions, like <a
238+
* href="https://stripe.com/docs/payments/save-card-without-authentication">saving cards without
239+
* authentication</a>.
236240
*/
237241
public Builder setErrorOnRequiresAction(Boolean errorOnRequiresAction) {
238242
this.errorOnRequiresAction = errorOnRequiresAction;

src/main/java/com/stripe/param/PaymentIntentCreateParams.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ public class PaymentIntentCreateParams extends ApiRequestParams {
7373
/**
7474
* Set to {@code true} to fail the payment attempt if the PaymentIntent transitions into {@code
7575
* requires_action}. This parameter is intended for simpler integrations that do not handle
76-
* customer actions. This can only be set when {@code confirm=true} is supplied.
76+
* customer actions, like <a
77+
* href="https://stripe.com/docs/payments/save-card-without-authentication">saving cards without
78+
* authentication</a>. This parameter can only be used with <a
79+
* href="https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm">{@code
80+
* confirm=true}</a>.
7781
*/
7882
@SerializedName("error_on_requires_action")
7983
Boolean errorOnRequiresAction;
@@ -514,7 +518,11 @@ public Builder setDescription(String description) {
514518
/**
515519
* Set to {@code true} to fail the payment attempt if the PaymentIntent transitions into {@code
516520
* requires_action}. This parameter is intended for simpler integrations that do not handle
517-
* customer actions. This can only be set when {@code confirm=true} is supplied.
521+
* customer actions, like <a
522+
* href="https://stripe.com/docs/payments/save-card-without-authentication">saving cards without
523+
* authentication</a>. This parameter can only be used with <a
524+
* href="https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm">{@code
525+
* confirm=true}</a>.
518526
*/
519527
public Builder setErrorOnRequiresAction(Boolean errorOnRequiresAction) {
520528
this.errorOnRequiresAction = errorOnRequiresAction;

src/main/java/com/stripe/param/checkout/SessionCreateParams.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ public Builder setState(String state) {
12851285

12861286
@Getter
12871287
public static class TransferData {
1288+
/** The amount that will be transferred automatically when a charge succeeds. */
1289+
@SerializedName("amount")
1290+
Long amount;
1291+
12881292
/**
12891293
* If specified, successful charges will be attributed to the destination account for tax
12901294
* reporting, and the funds from charges will be transferred to the destination account. The
@@ -1303,7 +1307,8 @@ public static class TransferData {
13031307
@SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
13041308
Map<String, Object> extraParams;
13051309

1306-
private TransferData(String destination, Map<String, Object> extraParams) {
1310+
private TransferData(Long amount, String destination, Map<String, Object> extraParams) {
1311+
this.amount = amount;
13071312
this.destination = destination;
13081313
this.extraParams = extraParams;
13091314
}
@@ -1313,13 +1318,21 @@ public static Builder builder() {
13131318
}
13141319

13151320
public static class Builder {
1321+
private Long amount;
1322+
13161323
private String destination;
13171324

13181325
private Map<String, Object> extraParams;
13191326

13201327
/** Finalize and obtain parameter instance from this builder. */
13211328
public TransferData build() {
1322-
return new TransferData(this.destination, this.extraParams);
1329+
return new TransferData(this.amount, this.destination, this.extraParams);
1330+
}
1331+
1332+
/** The amount that will be transferred automatically when a charge succeeds. */
1333+
public Builder setAmount(Long amount) {
1334+
this.amount = amount;
1335+
return this;
13231336
}
13241337

13251338
/**

0 commit comments

Comments
 (0)