Event.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * Events are our way of letting you know when something interesting happens in
  6. * your account. When an interesting event occurs, we create a new
  7. * <code>Event</code> object. For example, when a charge succeeds, we create a
  8. * <code>charge.succeeded</code> event; and when an invoice payment attempt fails,
  9. * we create an <code>invoice.payment_failed</code> event. Note that many API
  10. * requests may cause multiple events to be created. For example, if you create a
  11. * new subscription for a customer, you will receive both a
  12. * <code>customer.subscription.created</code> event and a
  13. * <code>charge.succeeded</code> event.
  14. *
  15. * Events occur when the state of another API resource changes. The state of that
  16. * resource at the time of the change is embedded in the event's data field. For
  17. * example, a <code>charge.succeeded</code> event will contain a charge, and an
  18. * <code>invoice.payment_failed</code> event will contain an invoice.
  19. *
  20. * As with other API resources, you can use endpoints to retrieve an <a
  21. * href="https://stripe.com/docs/api#retrieve_event">individual event</a> or a <a
  22. * href="https://stripe.com/docs/api#list_events">list of events</a> from the API.
  23. * We also have a separate <a
  24. * href="http://en.wikipedia.org/wiki/Webhook">webhooks</a> system for sending the
  25. * <code>Event</code> objects directly to an endpoint on your server. Webhooks are
  26. * managed in your <a href="https://dashboard.stripe.com/account/webhooks">account
  27. * settings</a>, and our <a href="https://stripe.com/docs/webhooks">Using
  28. * Webhooks</a> guide will help you get set up.
  29. *
  30. * When using <a href="https://stripe.com/docs/connect">Connect</a>, you can also
  31. * receive notifications of events that occur in connected accounts. For these
  32. * events, there will be an additional <code>account</code> attribute in the
  33. * received <code>Event</code> object.
  34. *
  35. * <strong>NOTE:</strong> Right now, access to events through the <a
  36. * href="https://stripe.com/docs/api#retrieve_event">Retrieve Event API</a> is
  37. * guaranteed only for 30 days.
  38. *
  39. * @property string $id Unique identifier for the object.
  40. * @property string $object String representing the object's type. Objects of the same type share the same value.
  41. * @property string $account The connected account that originated the event.
  42. * @property null|string $api_version The Stripe API version used to render <code>data</code>. <em>Note: This property is populated only for events on or after October 31, 2014</em>.
  43. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  44. * @property \Stripe\StripeObject $data
  45. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  46. * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified.
  47. * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event.
  48. * @property string $type Description of the event (e.g., <code>invoice.created</code> or <code>charge.refunded</code>).
  49. */
  50. class Event extends ApiResource
  51. {
  52. const OBJECT_NAME = 'event';
  53. use ApiOperations\All;
  54. use ApiOperations\Retrieve;
  55. /**
  56. * Possible string representations of event types.
  57. *
  58. * @see https://stripe.com/docs/api#event_types
  59. */
  60. const ACCOUNT_UPDATED = 'account.updated';
  61. const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized';
  62. const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized';
  63. const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created';
  64. const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted';
  65. const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated';
  66. const APPLICATION_FEE_CREATED = 'application_fee.created';
  67. const APPLICATION_FEE_REFUNDED = 'application_fee.refunded';
  68. const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated';
  69. const BALANCE_AVAILABLE = 'balance.available';
  70. const CAPABILITY_UPDATED = 'capability.updated';
  71. const CHARGE_CAPTURED = 'charge.captured';
  72. const CHARGE_EXPIRED = 'charge.expired';
  73. const CHARGE_FAILED = 'charge.failed';
  74. const CHARGE_PENDING = 'charge.pending';
  75. const CHARGE_REFUNDED = 'charge.refunded';
  76. const CHARGE_SUCCEEDED = 'charge.succeeded';
  77. const CHARGE_UPDATED = 'charge.updated';
  78. const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed';
  79. const CHARGE_DISPUTE_CREATED = 'charge.dispute.created';
  80. const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated';
  81. const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn';
  82. const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated';
  83. const CHARGE_REFUND_UPDATED = 'charge.refund.updated';
  84. const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed';
  85. const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded';
  86. const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed';
  87. const COUPON_CREATED = 'coupon.created';
  88. const COUPON_DELETED = 'coupon.deleted';
  89. const COUPON_UPDATED = 'coupon.updated';
  90. const CREDIT_NOTE_CREATED = 'credit_note.created';
  91. const CREDIT_NOTE_UPDATED = 'credit_note.updated';
  92. const CREDIT_NOTE_VOIDED = 'credit_note.voided';
  93. const CUSTOMER_CREATED = 'customer.created';
  94. const CUSTOMER_DELETED = 'customer.deleted';
  95. const CUSTOMER_UPDATED = 'customer.updated';
  96. const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created';
  97. const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted';
  98. const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated';
  99. const CUSTOMER_SOURCE_CREATED = 'customer.source.created';
  100. const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted';
  101. const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring';
  102. const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated';
  103. const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created';
  104. const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted';
  105. const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied';
  106. const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired';
  107. const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end';
  108. const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated';
  109. const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created';
  110. const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted';
  111. const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated';
  112. const FILE_CREATED = 'file.created';
  113. const INVOICE_CREATED = 'invoice.created';
  114. const INVOICE_DELETED = 'invoice.deleted';
  115. const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed';
  116. const INVOICE_FINALIZED = 'invoice.finalized';
  117. const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible';
  118. const INVOICE_PAID = 'invoice.paid';
  119. const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required';
  120. const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed';
  121. const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded';
  122. const INVOICE_SENT = 'invoice.sent';
  123. const INVOICE_UPCOMING = 'invoice.upcoming';
  124. const INVOICE_UPDATED = 'invoice.updated';
  125. const INVOICE_VOIDED = 'invoice.voided';
  126. const INVOICEITEM_CREATED = 'invoiceitem.created';
  127. const INVOICEITEM_DELETED = 'invoiceitem.deleted';
  128. const INVOICEITEM_UPDATED = 'invoiceitem.updated';
  129. const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created';
  130. const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created';
  131. const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request';
  132. const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated';
  133. const ISSUING_CARD_CREATED = 'issuing_card.created';
  134. const ISSUING_CARD_UPDATED = 'issuing_card.updated';
  135. const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created';
  136. const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated';
  137. const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed';
  138. const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created';
  139. const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated';
  140. const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted';
  141. const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated';
  142. const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created';
  143. const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated';
  144. const MANDATE_UPDATED = 'mandate.updated';
  145. const ORDER_CREATED = 'order.created';
  146. const ORDER_PAYMENT_FAILED = 'order.payment_failed';
  147. const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded';
  148. const ORDER_UPDATED = 'order.updated';
  149. const ORDER_RETURN_CREATED = 'order_return.created';
  150. const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated';
  151. const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled';
  152. const PAYMENT_INTENT_CREATED = 'payment_intent.created';
  153. const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed';
  154. const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing';
  155. const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action';
  156. const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded';
  157. const PAYMENT_METHOD_ATTACHED = 'payment_method.attached';
  158. const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated';
  159. const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated';
  160. const PAYMENT_METHOD_DETACHED = 'payment_method.detached';
  161. const PAYMENT_METHOD_UPDATED = 'payment_method.updated';
  162. const PAYOUT_CANCELED = 'payout.canceled';
  163. const PAYOUT_CREATED = 'payout.created';
  164. const PAYOUT_FAILED = 'payout.failed';
  165. const PAYOUT_PAID = 'payout.paid';
  166. const PAYOUT_UPDATED = 'payout.updated';
  167. const PERSON_CREATED = 'person.created';
  168. const PERSON_DELETED = 'person.deleted';
  169. const PERSON_UPDATED = 'person.updated';
  170. const PING = 'ping';
  171. const PLAN_CREATED = 'plan.created';
  172. const PLAN_DELETED = 'plan.deleted';
  173. const PLAN_UPDATED = 'plan.updated';
  174. const PRICE_CREATED = 'price.created';
  175. const PRICE_DELETED = 'price.deleted';
  176. const PRICE_UPDATED = 'price.updated';
  177. const PRODUCT_CREATED = 'product.created';
  178. const PRODUCT_DELETED = 'product.deleted';
  179. const PRODUCT_UPDATED = 'product.updated';
  180. const PROMOTION_CODE_CREATED = 'promotion_code.created';
  181. const PROMOTION_CODE_DELETED = 'promotion_code.deleted';
  182. const PROMOTION_CODE_UPDATED = 'promotion_code.updated';
  183. const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created';
  184. const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated';
  185. const RECIPIENT_CREATED = 'recipient.created';
  186. const RECIPIENT_DELETED = 'recipient.deleted';
  187. const RECIPIENT_UPDATED = 'recipient.updated';
  188. const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed';
  189. const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded';
  190. const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated';
  191. const REVIEW_CLOSED = 'review.closed';
  192. const REVIEW_OPENED = 'review.opened';
  193. const SETUP_INTENT_CANCELED = 'setup_intent.canceled';
  194. const SETUP_INTENT_CREATED = 'setup_intent.created';
  195. const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action';
  196. const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed';
  197. const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded';
  198. const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created';
  199. const SKU_CREATED = 'sku.created';
  200. const SKU_DELETED = 'sku.deleted';
  201. const SKU_UPDATED = 'sku.updated';
  202. const SOURCE_CANCELED = 'source.canceled';
  203. const SOURCE_CHARGEABLE = 'source.chargeable';
  204. const SOURCE_FAILED = 'source.failed';
  205. const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification';
  206. const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required';
  207. const SOURCE_TRANSACTION_CREATED = 'source.transaction.created';
  208. const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated';
  209. const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted';
  210. const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled';
  211. const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed';
  212. const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created';
  213. const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring';
  214. const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released';
  215. const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated';
  216. const TAX_RATE_CREATED = 'tax_rate.created';
  217. const TAX_RATE_UPDATED = 'tax_rate.updated';
  218. const TOPUP_CANCELED = 'topup.canceled';
  219. const TOPUP_CREATED = 'topup.created';
  220. const TOPUP_FAILED = 'topup.failed';
  221. const TOPUP_REVERSED = 'topup.reversed';
  222. const TOPUP_SUCCEEDED = 'topup.succeeded';
  223. const TRANSFER_CREATED = 'transfer.created';
  224. const TRANSFER_REVERSED = 'transfer.reversed';
  225. const TRANSFER_UPDATED = 'transfer.updated';
  226. }