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

API Updates #1444

Merged
merged 1 commit into from Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v190
v192
12 changes: 12 additions & 0 deletions src/main/java/com/stripe/model/Charge.java
Expand Up @@ -1168,6 +1168,9 @@ public static class PaymentMethodDetails extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("pix")
Pix pix;

@SerializedName("promptpay")
Promptpay promptpay;

Expand Down Expand Up @@ -2435,6 +2438,15 @@ public static class Paynow extends StripeObject {
String reference;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {
/** Unique transaction id generated by BCB. */
@SerializedName("bank_transaction_id")
String bankTransactionId;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
65 changes: 65 additions & 0 deletions src/main/java/com/stripe/model/Invoice.java
Expand Up @@ -316,6 +316,14 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("footer")
String footer;

/**
* Details of the invoice that was cloned. See the <a
* href="https://stripe.com/docs/invoicing/invoice-revisions">revision documentation</a> for more
* details.
*/
@SerializedName("from_invoice")
FromInvoice fromInvoice;

/**
* The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the
* invoice has not been finalized yet, this will be null.
Expand All @@ -342,6 +350,12 @@ public class Invoice extends ApiResource implements HasId, MetadataStore<Invoice
@SerializedName("last_finalization_error")
StripeError lastFinalizationError;

/** The ID of the most recent non-draft revision of this invoice. */
@SerializedName("latest_revision")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Invoice> latestRevision;

/**
* The individual line items that make up the invoice. {@code lines} is sorted as follows: invoice
* items in reverse chronological order, followed by the subscription, if any.
Expand Down Expand Up @@ -644,6 +658,24 @@ public void setDefaultSourceObject(PaymentSource expandableObject) {
new ExpandableField<PaymentSource>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code latestRevision} object. */
public String getLatestRevision() {
return (this.latestRevision != null) ? this.latestRevision.getId() : null;
}

public void setLatestRevision(String id) {
this.latestRevision = ApiResource.setExpandableFieldId(id, this.latestRevision);
}

/** Get expanded {@code latestRevision}. */
public Invoice getLatestRevisionObject() {
return (this.latestRevision != null) ? this.latestRevision.getExpanded() : null;
}

public void setLatestRevisionObject(Invoice expandableObject) {
this.latestRevision = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}

/** Get ID of expandable {@code onBehalfOf} object. */
public String getOnBehalfOf() {
return (this.onBehalfOf != null) ? this.onBehalfOf.getId() : null;
Expand Down Expand Up @@ -1674,6 +1706,39 @@ public void setDiscountObject(Discount expandableObject) {
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class FromInvoice extends StripeObject {
/** The relation between this invoice and the cloned invoice. */
@SerializedName("action")
String action;

/** The invoice that was cloned. */
@SerializedName("invoice")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Invoice> invoice;

/** Get ID of expandable {@code invoice} object. */
public String getInvoice() {
return (this.invoice != null) ? this.invoice.getId() : null;
}

public void setInvoice(String id) {
this.invoice = ApiResource.setExpandableFieldId(id, this.invoice);
}

/** Get expanded {@code invoice}. */
public Invoice getInvoiceObject() {
return (this.invoice != null) ? this.invoice.getExpanded() : null;
}

public void setInvoiceObject(Invoice expandableObject) {
this.invoice = new ExpandableField<Invoice>(expandableObject.getId(), expandableObject);
}
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
50 changes: 50 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Expand Up @@ -1455,6 +1455,9 @@ public static class NextAction extends StripeObject {
@SerializedName("paynow_display_qr_code")
PaynowDisplayQrCode paynowDisplayQrCode;

@SerializedName("pix_display_qr_code")
PixDisplayQrCode pixDisplayQrCode;

@SerializedName("promptpay_display_qr_code")
PromptpayDisplayQrCode promptpayDisplayQrCode;

Expand Down Expand Up @@ -1509,6 +1512,37 @@ public static class PaynowDisplayQrCode extends StripeObject {
String imageUrlSvg;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class PixDisplayQrCode extends StripeObject {
/**
* The raw data string used to generate QR code, it should be used together with QR code
* library.
*/
@SerializedName("data")
String data;

/** The date (unix timestamp) when the PIX expires. */
@SerializedName("expires_at")
Long expiresAt;

/**
* The URL to the hosted pix instructions page, which allows customers to view the pix QR
* code.
*/
@SerializedName("hosted_instructions_url")
String hostedInstructionsUrl;

/** ​​The image_url_png string used to render png QR code. */
@SerializedName("image_url_png")
String imageUrlPng;

/** ​​The image_url_svg string used to render svg QR code. */
@SerializedName("image_url_svg")
String imageUrlSvg;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -2088,6 +2122,9 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("pix")
Pix pix;

@SerializedName("promptpay")
Promptpay promptpay;

Expand Down Expand Up @@ -3054,6 +3091,19 @@ public static class Paynow extends StripeObject {
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {
/** The number of seconds (between 10 and 1209600) after which Pix payment will expire. */
@SerializedName("expires_after_seconds")
Long expiresAfterSeconds;

/** The timestamp at which the Pix expires. */
@SerializedName("expires_at")
Long expiresAt;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/com/stripe/model/PaymentMethod.java
Expand Up @@ -147,6 +147,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
@SerializedName("paynow")
Paynow paynow;

@SerializedName("pix")
Pix pix;

@SerializedName("promptpay")
Promptpay promptpay;

Expand All @@ -171,8 +174,8 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore<P
* au_becs_debit}, {@code bacs_debit}, {@code bancontact}, {@code blik}, {@code boleto}, {@code
* card}, {@code card_present}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code
* giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code klarna}, {@code
* konbini}, {@code link}, {@code oxxo}, {@code p24}, {@code paynow}, {@code promptpay}, {@code
* sepa_debit}, {@code sofort}, {@code us_bank_account}, or {@code wechat_pay}.
* konbini}, {@code link}, {@code oxxo}, {@code p24}, {@code paynow}, {@code pix}, {@code
* promptpay}, {@code sepa_debit}, {@code sofort}, {@code us_bank_account}, or {@code wechat_pay}.
*/
@SerializedName("type")
String type;
Expand Down Expand Up @@ -1112,6 +1115,11 @@ public static class P24 extends StripeObject {
@EqualsAndHashCode(callSuper = false)
public static class Paynow extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/stripe/model/checkout/Session.java
Expand Up @@ -313,6 +313,7 @@ public class Session extends ApiResource implements HasId {
* The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If
* you’re using <a href="https://stripe.com/docs/payments/checkout/custom-domains">Custom
* Domains</a>, the URL will use your subdomain. Otherwise, it’ll use {@code checkout.stripe.com.}
* This value is only present when the session is active.
*/
@SerializedName("url")
String url;
Expand Down Expand Up @@ -840,6 +841,9 @@ public static class PaymentMethodOptions extends StripeObject {
@SerializedName("paynow")
Paynow paynow;

@SerializedName("pix")
Pix pix;

@SerializedName("sepa_debit")
SepaDebit sepaDebit;

Expand Down Expand Up @@ -1519,6 +1523,15 @@ public static class Paynow extends StripeObject {
String setupFutureUsage;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Pix extends StripeObject {
/** The number of seconds after which Pix payment will expire. */
@SerializedName("expires_after_seconds")
Long expiresAfterSeconds;
}

@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/treasury/CreditReversal.java
Expand Up @@ -30,6 +30,10 @@ public class CreditReversal extends ApiResource implements HasId {
@SerializedName("amount")
Long amount;

/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;

/**
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
* in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/stripe/model/treasury/DebitReversal.java
Expand Up @@ -30,6 +30,10 @@ public class DebitReversal extends ApiResource implements HasId {
@SerializedName("amount")
Long amount;

/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;

/**
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
* in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
Expand Down
Expand Up @@ -256,6 +256,9 @@ public enum Type implements ApiRequestParams.EnumParam {
@SerializedName("paynow")
PAYNOW("paynow"),

@SerializedName("pix")
PIX("pix"),

@SerializedName("promptpay")
PROMPTPAY("promptpay"),

Expand Down