Skip to content
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.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4776797593c966ebe1494340934edf45a6764bf2
1bc3aceb31e76e2eb165647acb28d8801c4b6911
11 changes: 6 additions & 5 deletions src/main/java/com/stripe/StripeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.stripe.exception.SignatureVerificationException;
import com.stripe.exception.StripeException;
import com.stripe.model.StripeObject;
import com.stripe.model.ThinEvent;
import com.stripe.model.v2.EventNotification;
import com.stripe.net.*;
import com.stripe.net.Webhook.Signature;
import java.net.PasswordAuthentication;
Expand Down Expand Up @@ -52,9 +52,9 @@ protected StripeResponseGetter getResponseGetter() {
* @return the StripeEvent instance
* @throws SignatureVerificationException if the verification fails.
*/
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret)
public EventNotification parseEventNotification(String payload, String sigHeader, String secret)
throws SignatureVerificationException {
return parseThinEvent(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
return parseEventNotification(payload, sigHeader, secret, Webhook.DEFAULT_TOLERANCE);
}

/**
Expand All @@ -70,11 +70,12 @@ public ThinEvent parseThinEvent(String payload, String sigHeader, String secret)
* @return the StripeEvent instance
* @throws SignatureVerificationException if the verification fails.
*/
public ThinEvent parseThinEvent(String payload, String sigHeader, String secret, long tolerance)
public EventNotification parseEventNotification(
String payload, String sigHeader, String secret, long tolerance)
throws SignatureVerificationException {
Signature.verifyHeader(payload, sigHeader, secret, tolerance);

return ApiResource.GSON.fromJson(payload, ThinEvent.class);
return EventNotification.fromJson(payload, this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.Account;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.Account;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1AccountUpdatedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Account fetchRelatedObject() throws StripeException {
return (Account) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1AccountUpdatedEvent fetchEvent() throws StripeException {
return (V1AccountUpdatedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.ApplicationFee;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.ApplicationFee;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1ApplicationFeeCreatedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public ApplicationFee fetchRelatedObject() throws StripeException {
return (ApplicationFee) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1ApplicationFeeCreatedEvent fetchEvent() throws StripeException {
return (V1ApplicationFeeCreatedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.ApplicationFee;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.ApplicationFee;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1ApplicationFeeRefundedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public ApplicationFee fetchRelatedObject() throws StripeException {
return (ApplicationFee) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1ApplicationFeeRefundedEvent fetchEvent() throws StripeException {
return (V1ApplicationFeeRefundedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.billing.Meter;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import java.time.Instant;
import java.util.List;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.billing.Meter;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1BillingMeterErrorReportTriggeredEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Meter fetchRelatedObject() throws StripeException {
return (Meter) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1BillingMeterErrorReportTriggeredEvent fetchEvent() throws StripeException {
return (V1BillingMeterErrorReportTriggeredEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.stripe.exception.StripeException;
import com.stripe.model.v2.EventNotification;

public final class V1BillingMeterNoMeterFoundEventNotification extends EventNotification {
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1BillingMeterNoMeterFoundEvent fetchEvent() throws StripeException {
return (V1BillingMeterNoMeterFoundEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.billingportal.Configuration;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.billingportal.Configuration;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1BillingPortalConfigurationCreatedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Configuration fetchRelatedObject() throws StripeException {
return (Configuration) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1BillingPortalConfigurationCreatedEvent fetchEvent() throws StripeException {
return (V1BillingPortalConfigurationCreatedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.billingportal.Configuration;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.billingportal.Configuration;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1BillingPortalConfigurationUpdatedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Configuration fetchRelatedObject() throws StripeException {
return (Configuration) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1BillingPortalConfigurationUpdatedEvent fetchEvent() throws StripeException {
return (V1BillingPortalConfigurationUpdatedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.Capability;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.Capability;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1CapabilityUpdatedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Capability fetchRelatedObject() throws StripeException {
return (Capability) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1CapabilityUpdatedEvent fetchEvent() throws StripeException {
return (V1CapabilityUpdatedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.Charge;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1ChargeCapturedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Charge fetchRelatedObject() throws StripeException {
return (Charge) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1ChargeCapturedEvent fetchEvent() throws StripeException {
return (V1ChargeCapturedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.Dispute;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec
package com.stripe.events;

import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.model.Dispute;
import com.stripe.model.v2.Event.RelatedObject;
import com.stripe.model.v2.EventNotification;
import lombok.Getter;

@Getter
public final class V1ChargeDisputeClosedEventNotification extends EventNotification {
@SerializedName("related_object")

/** Object containing the reference to API resource relevant to the event. */
RelatedObject relatedObject;

/** Retrieves the related object from the API. Make an API request on every call. */
public Dispute fetchRelatedObject() throws StripeException {
return (Dispute) super.fetchRelatedObject(this.relatedObject);
}
/** Retrieve the corresponding full event from the Stripe API. */
@Override
public V1ChargeDisputeClosedEvent fetchEvent() throws StripeException {
return (V1ChargeDisputeClosedEvent) super.fetchEvent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.stripe.exception.StripeException;
import com.stripe.model.Dispute;
import com.stripe.model.v2.Event;
import com.stripe.model.v2.Event.RelatedObject;
import lombok.Getter;

@Getter
Expand Down
Loading
Loading