Skip to content
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 ACSS Debit #1195

Merged
merged 6 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
With client_metadata fixes
  • Loading branch information
richardm-stripe committed Apr 7, 2021
commit a98888dacab9415c963e278b0e41aa0fe0126c36
100 changes: 50 additions & 50 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,23 @@ public static class NextAction extends StripeObject {
Map<String, Object> useStripeSdk;

@SerializedName("verify_with_microdeposits")
NextActionVerifyWithMicrodeposits verifyWithMicrodeposits;
VerifyWithMicrodeposits verifyWithMicrodeposits;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class VerifyWithMicrodeposits extends StripeObject {
/** The timestamp when the microdeposits are expected to land. */
@SerializedName("arrival_date")
Long arrivalDate;

/**
* The URL for the hosted verification page, which allows customers to verify their bank
* account.
*/
@SerializedName("hosted_verification_url")
String hostedVerificationUrl;
}
}

@Getter
Expand Down Expand Up @@ -1151,22 +1167,6 @@ public static class NextActionRedirectToUrl extends StripeObject {
String url;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class NextActionVerifyWithMicrodeposits extends StripeObject {
/** The timestamp when the microdeposits are expected to land. */
@SerializedName("arrival_date")
Long arrivalDate;

/**
* The URL for the hosted verification page, which allows customers to verify their bank
* account.
*/
@SerializedName("hosted_verification_url")
String hostedVerificationUrl;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -1200,7 +1200,7 @@ public static class PaymentMethodOptions extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class AcssDebit extends StripeObject {
@SerializedName("mandate_options")
AcssDebitMandateOptions mandateOptions;
MandateOptions mandateOptions;

/**
* Bank account verification method.
Expand All @@ -1211,38 +1211,6 @@ public static class AcssDebit extends StripeObject {
String verificationMethod;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AcssDebitMandateOptions extends StripeObject {
/** A URL for custom mandate text. */
@SerializedName("custom_mandate_url")
String customMandateUrl;

/**
* Description of the interval. Only required if 'payment_schedule' parmeter is 'interval' or
* 'combined'.
*/
@SerializedName("interval_description")
String intervalDescription;

/**
* Payment schedule for the mandate.
*
* <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
*/
@SerializedName("payment_schedule")
String paymentSchedule;

/**
* Transaction type of the mandate.
*
* <p>One of {@code business}, or {@code personal}.
*/
@SerializedName("transaction_type")
String transactionType;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -1338,6 +1306,38 @@ public static class Plan extends StripeObject {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class MandateOptions extends StripeObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be inside AcssDebit

/** A URL for custom mandate text. */
@SerializedName("custom_mandate_url")
String customMandateUrl;

/**
* Description of the interval. Only required if 'payment_schedule' parmeter is 'interval' or
* 'combined'.
*/
@SerializedName("interval_description")
String intervalDescription;

/**
* Payment schedule for the mandate.
*
* <p>One of {@code combined}, {@code interval}, or {@code sporadic}.
*/
@SerializedName("payment_schedule")
String paymentSchedule;

/**
* Transaction type of the mandate.
*
* <p>One of {@code business}, or {@code personal}.
*/
@SerializedName("transaction_type")
String transactionType;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down

This file was deleted.

This file was deleted.

80 changes: 56 additions & 24 deletions src/main/java/com/stripe/model/SetupIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,23 @@ public static class NextAction extends StripeObject {
Map<String, Object> useStripeSdk;

@SerializedName("verify_with_microdeposits")
PaymentIntent.NextActionVerifyWithMicrodeposits verifyWithMicrodeposits;
VerifyWithMicrodeposits verifyWithMicrodeposits;

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class VerifyWithMicrodeposits extends StripeObject {
/** The timestamp when the microdeposits are expected to land. */
@SerializedName("arrival_date")
Long arrivalDate;

/**
* The URL for the hosted verification page, which allows customers to verify their bank
* account.
*/
@SerializedName("hosted_verification_url")
String hostedVerificationUrl;
}
}

@Getter
Expand Down Expand Up @@ -734,7 +750,7 @@ public static class AcssDebit extends StripeObject {
String currency;

@SerializedName("mandate_options")
AcssDebitMandateOptions mandateOptions;
MandateOptions mandateOptions;

/**
* Bank account verification method.
Expand All @@ -748,7 +764,28 @@ public static class AcssDebit extends StripeObject {
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class AcssDebitMandateOptions extends StripeObject {
public static class Card extends StripeObject {
/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your
* customers for authentication based on risk level and <a
* href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Permitted values include: {@code automatic} or {@code any}. If not
* provided, defaults to {@code automatic}. Read our guide on <a
* href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually requesting 3D
* Secure</a> for more information on how this configuration interacts with Radar and our SCA
* Engine.
*
* <p>One of {@code any}, {@code automatic}, or {@code challenge_only}.
*/
@SerializedName("request_three_d_secure")
String requestThreeDSecure;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class MandateOptions extends StripeObject {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, inside AcssDebit

/** A URL for custom mandate text. */
@SerializedName("custom_mandate_url")
String customMandateUrl;
Expand Down Expand Up @@ -777,27 +814,6 @@ public static class AcssDebitMandateOptions extends StripeObject {
String transactionType;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Card extends StripeObject {
/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your
* customers for authentication based on risk level and <a
* href="https://stripe.com/docs/strong-customer-authentication">other requirements</a>.
* However, if you wish to request 3D Secure based on logic from your own fraud engine,
* provide this option. Permitted values include: {@code automatic} or {@code any}. If not
* provided, defaults to {@code automatic}. Read our guide on <a
* href="https://stripe.com/docs/payments/3d-secure#manual-three-ds">manually requesting 3D
* Secure</a> for more information on how this configuration interacts with Radar and our SCA
* Engine.
*
* <p>One of {@code any}, {@code automatic}, or {@code challenge_only}.
*/
@SerializedName("request_three_d_secure")
String requestThreeDSecure;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand All @@ -811,4 +827,20 @@ public static class SepaDebit extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class SepaDebitMandateOptions extends StripeObject {}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class VerifyWithMicrodeposits extends StripeObject {
/** The timestamp when the microdeposits are expected to land. */
@SerializedName("arrival_date")
Long arrivalDate;

/**
* The URL for the hosted verification page, which allows customers to verify their bank
* account.
*/
@SerializedName("hosted_verification_url")
String hostedVerificationUrl;
}
}
12 changes: 2 additions & 10 deletions src/main/java/com/stripe/model/checkout/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.stripe.model.LineItem;
import com.stripe.model.LineItemCollection;
import com.stripe.model.PaymentIntent;
import com.stripe.model.PaymentPagesCheckoutSessionCheckoutSessionResourcePaymentMethodOptions;
import com.stripe.model.SetupIntent;
import com.stripe.model.ShippingDetails;
import com.stripe.model.StripeObject;
Expand Down Expand Up @@ -160,7 +159,7 @@ public class Session extends ApiResource implements HasId {
* CheckoutSession.
*/
@SerializedName("payment_method_options")
PaymentPagesCheckoutSessionCheckoutSessionResourcePaymentMethodOptions paymentMethodOptions;
PaymentMethodOptions paymentMethodOptions;

/**
* A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept.
Expand Down Expand Up @@ -455,14 +454,7 @@ public static class TaxID extends StripeObject {
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentMethodOptionsForPayment extends StripeObject
implements PaymentPagesCheckoutSessionCheckoutSessionResourcePaymentMethodOptions {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PaymentMethodOptionsForSetup extends StripeObject
implements PaymentPagesCheckoutSessionCheckoutSessionResourcePaymentMethodOptions {}
public static class PaymentMethodOptions extends StripeObject {}

@Getter
@Setter
Expand Down
Loading