stripe 19.1.0 → 19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +3 -0
  3. data/lib/stripe/api_version.rb +1 -1
  4. data/lib/stripe/event_types.rb +16 -0
  5. data/lib/stripe/events/v2_commerce_product_catalog_imports_failed_event.rb +44 -0
  6. data/lib/stripe/events/v2_commerce_product_catalog_imports_processing_event.rb +44 -0
  7. data/lib/stripe/events/v2_commerce_product_catalog_imports_succeeded_event.rb +44 -0
  8. data/lib/stripe/events/v2_commerce_product_catalog_imports_succeeded_with_errors_event.rb +44 -0
  9. data/lib/stripe/object_types.rb +1 -0
  10. data/lib/stripe/params/account_create_params.rb +26 -0
  11. data/lib/stripe/params/account_update_params.rb +26 -0
  12. data/lib/stripe/params/balance_settings_update_params.rb +42 -2
  13. data/lib/stripe/params/charge_create_params.rb +4 -1
  14. data/lib/stripe/params/checkout/session_create_params.rb +28 -15
  15. data/lib/stripe/params/confirmation_token_create_params.rb +11 -1
  16. data/lib/stripe/params/invoice_create_preview_params.rb +60 -0
  17. data/lib/stripe/params/payment_intent_capture_params.rb +2 -2
  18. data/lib/stripe/params/payment_intent_confirm_params.rb +38 -5
  19. data/lib/stripe/params/payment_intent_create_params.rb +65 -6
  20. data/lib/stripe/params/payment_intent_increment_authorization_params.rb +2 -2
  21. data/lib/stripe/params/payment_intent_update_params.rb +58 -5
  22. data/lib/stripe/params/payment_link_create_params.rb +30 -1
  23. data/lib/stripe/params/payment_link_update_params.rb +29 -0
  24. data/lib/stripe/params/payment_method_configuration_create_params.rb +43 -1
  25. data/lib/stripe/params/payment_method_configuration_list_params.rb +4 -0
  26. data/lib/stripe/params/payment_method_configuration_update_params.rb +43 -1
  27. data/lib/stripe/params/payment_method_create_params.rb +11 -1
  28. data/lib/stripe/params/payout_create_params.rb +1 -1
  29. data/lib/stripe/params/setup_intent_confirm_params.rb +18 -2
  30. data/lib/stripe/params/setup_intent_create_params.rb +18 -2
  31. data/lib/stripe/params/setup_intent_update_params.rb +18 -2
  32. data/lib/stripe/params/subscription_create_params.rb +61 -11
  33. data/lib/stripe/params/subscription_item_create_params.rb +1 -7
  34. data/lib/stripe/params/subscription_item_delete_params.rb +1 -7
  35. data/lib/stripe/params/subscription_item_update_params.rb +1 -7
  36. data/lib/stripe/params/subscription_schedule_create_params.rb +4 -0
  37. data/lib/stripe/params/subscription_schedule_update_params.rb +4 -0
  38. data/lib/stripe/params/subscription_update_params.rb +62 -8
  39. data/lib/stripe/params/terminal/configuration_create_params.rb +52 -0
  40. data/lib/stripe/params/terminal/configuration_update_params.rb +52 -0
  41. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +11 -1
  42. data/lib/stripe/params/test_helpers/test_clock_create_params.rb +4 -1
  43. data/lib/stripe/params/v2/billing/meter_event_adjustment_create_params.rb +2 -2
  44. data/lib/stripe/params/v2/commerce/product_catalog/import_create_params.rb +25 -0
  45. data/lib/stripe/params/v2/commerce/product_catalog/import_list_params.rb +54 -0
  46. data/lib/stripe/params/v2/commerce/product_catalog/import_retrieve_params.rb +12 -0
  47. data/lib/stripe/params/v2/core/account_create_params.rb +28 -6
  48. data/lib/stripe/params/v2/core/account_token_create_params.rb +27 -5
  49. data/lib/stripe/params/v2/core/account_update_params.rb +29 -7
  50. data/lib/stripe/params/v2/core/event_destination_create_params.rb +23 -0
  51. data/lib/stripe/params.rb +1342 -614
  52. data/lib/stripe/railtie.rb +8 -0
  53. data/lib/stripe/resources/account.rb +4 -0
  54. data/lib/stripe/resources/balance_settings.rb +42 -2
  55. data/lib/stripe/resources/charge.rb +35 -0
  56. data/lib/stripe/resources/checkout/session.rb +23 -7
  57. data/lib/stripe/resources/confirmation_token.rb +26 -0
  58. data/lib/stripe/resources/discount.rb +2 -2
  59. data/lib/stripe/resources/invoice.rb +2 -0
  60. data/lib/stripe/resources/invoice_item.rb +34 -1
  61. data/lib/stripe/resources/issuing/dispute.rb +1 -1
  62. data/lib/stripe/resources/issuing/personalization_design.rb +1 -1
  63. data/lib/stripe/resources/mandate.rb +13 -0
  64. data/lib/stripe/resources/payment_attempt_record.rb +40 -10
  65. data/lib/stripe/resources/payment_intent.rb +71 -5
  66. data/lib/stripe/resources/payment_link.rb +40 -0
  67. data/lib/stripe/resources/payment_method.rb +26 -0
  68. data/lib/stripe/resources/payment_method_configuration.rb +68 -0
  69. data/lib/stripe/resources/payment_record.rb +40 -10
  70. data/lib/stripe/resources/radar/payment_evaluation.rb +1 -1
  71. data/lib/stripe/resources/refund.rb +13 -0
  72. data/lib/stripe/resources/setup_attempt.rb +13 -0
  73. data/lib/stripe/resources/setup_intent.rb +26 -0
  74. data/lib/stripe/resources/subscription.rb +77 -4
  75. data/lib/stripe/resources/subscription_item.rb +2 -0
  76. data/lib/stripe/resources/subscription_schedule.rb +2 -0
  77. data/lib/stripe/resources/terminal/configuration.rb +64 -0
  78. data/lib/stripe/resources/terminal/reader.rb +116 -0
  79. data/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +3 -3
  80. data/lib/stripe/resources/v2/billing/meter_event_session.rb +3 -3
  81. data/lib/stripe/resources/v2/commerce/product_catalog_import.rb +274 -0
  82. data/lib/stripe/resources/v2/core/account.rb +37 -10
  83. data/lib/stripe/resources/v2/core/account_token.rb +1 -1
  84. data/lib/stripe/resources/v2/core/event.rb +1 -0
  85. data/lib/stripe/resources/v2/core/event_destination.rb +24 -0
  86. data/lib/stripe/resources.rb +500 -178
  87. data/lib/stripe/services/payment_intent_service.rb +3 -1
  88. data/lib/stripe/services/subscription_service.rb +2 -2
  89. data/lib/stripe/services/v2/billing/meter_event_session_service.rb +1 -1
  90. data/lib/stripe/services/v2/commerce/product_catalog/import_service.rb +45 -0
  91. data/lib/stripe/services/v2/commerce/product_catalog_service.rb +17 -0
  92. data/lib/stripe/services/v2/commerce_service.rb +15 -0
  93. data/lib/stripe/services/v2/core/account_service.rb +1 -1
  94. data/lib/stripe/services/v2/core/account_token_service.rb +5 -1
  95. data/lib/stripe/services/v2/core/accounts/person_token_service.rb +2 -1
  96. data/lib/stripe/services/v2/core/event_service.rb +2 -1
  97. data/lib/stripe/services/v2_services.rb +2 -1
  98. data/lib/stripe/services.rb +469 -189
  99. data/lib/stripe/version.rb +1 -1
  100. data/lib/stripe.rb +25 -4
  101. data/rbi/stripe.rbi +2785 -253
  102. metadata +14 -2
@@ -97,6 +97,70 @@ module Stripe
97
97
  end
98
98
  end
99
99
 
100
+ class BillingSchedule < ::Stripe::StripeObject
101
+ class AppliesTo < ::Stripe::StripeObject
102
+ # The billing schedule will apply to the subscription item with the given price ID.
103
+ attr_reader :price
104
+ # Controls which subscription items the billing schedule applies to.
105
+ attr_reader :type
106
+
107
+ def self.inner_class_types
108
+ @inner_class_types = {}
109
+ end
110
+
111
+ def self.field_remappings
112
+ @field_remappings = {}
113
+ end
114
+ end
115
+
116
+ class BillUntil < ::Stripe::StripeObject
117
+ class Duration < ::Stripe::StripeObject
118
+ # Specifies billing duration. Either `day`, `week`, `month` or `year`.
119
+ attr_reader :interval
120
+ # The multiplier applied to the interval.
121
+ attr_reader :interval_count
122
+
123
+ def self.inner_class_types
124
+ @inner_class_types = {}
125
+ end
126
+
127
+ def self.field_remappings
128
+ @field_remappings = {}
129
+ end
130
+ end
131
+ # The timestamp the billing schedule will apply until.
132
+ attr_reader :computed_timestamp
133
+ # Specifies the billing period.
134
+ attr_reader :duration
135
+ # If specified, the billing schedule will apply until the specified timestamp.
136
+ attr_reader :timestamp
137
+ # Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`.
138
+ attr_reader :type
139
+
140
+ def self.inner_class_types
141
+ @inner_class_types = { duration: Duration }
142
+ end
143
+
144
+ def self.field_remappings
145
+ @field_remappings = {}
146
+ end
147
+ end
148
+ # Specifies which subscription items the billing schedule applies to.
149
+ attr_reader :applies_to
150
+ # Specifies the end of billing period.
151
+ attr_reader :bill_until
152
+ # Unique identifier for the billing schedule.
153
+ attr_reader :key
154
+
155
+ def self.inner_class_types
156
+ @inner_class_types = { applies_to: AppliesTo, bill_until: BillUntil }
157
+ end
158
+
159
+ def self.field_remappings
160
+ @field_remappings = {}
161
+ end
162
+ end
163
+
100
164
  class BillingThresholds < ::Stripe::StripeObject
101
165
  # Monetary threshold that triggers the subscription to create an invoice
102
166
  attr_reader :amount_gte
@@ -531,8 +595,14 @@ module Stripe
531
595
  class PendingUpdate < ::Stripe::StripeObject
532
596
  # If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format.
533
597
  attr_reader :billing_cycle_anchor
598
+ # The pending subscription-level discount that will be applied when the pending update is applied.
599
+ attr_reader :discount
600
+ # The discounts that will be applied to the subscription when the pending update is applied. Use `expand[]=discounts` to expand each discount.
601
+ attr_reader :discounts
534
602
  # The point after which the changes reflected by this update will be discarded and no longer applied.
535
603
  attr_reader :expires_at
604
+ # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
605
+ attr_reader :metadata
536
606
  # List of subscription items, each with an attached plan, that will be set if the update is applied.
537
607
  attr_reader :subscription_items
538
608
  # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied.
@@ -613,6 +683,8 @@ module Stripe
613
683
  attr_reader :billing_cycle_anchor_config
614
684
  # The billing mode of the subscription.
615
685
  attr_reader :billing_mode
686
+ # Billing schedules for this subscription.
687
+ attr_reader :billing_schedules
616
688
  # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
617
689
  attr_reader :billing_thresholds
618
690
  # A date in the future at which the subscription will automatically get canceled
@@ -706,7 +778,7 @@ module Stripe
706
778
  # If the subscription has a trial, the beginning of that trial.
707
779
  attr_reader :trial_start
708
780
 
709
- # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).
781
+ # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details.
710
782
  #
711
783
  # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
712
784
  #
@@ -720,7 +792,7 @@ module Stripe
720
792
  )
721
793
  end
722
794
 
723
- # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).
795
+ # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details.
724
796
  #
725
797
  # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.
726
798
  #
@@ -790,7 +862,7 @@ module Stripe
790
862
  )
791
863
  end
792
864
 
793
- # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If no resumption invoice is generated, the subscription becomes active immediately. If a resumption invoice is generated, the subscription remains paused until the invoice is paid or marked uncollectible. If the invoice isn't paid by the expiration date, it is voided and the subscription remains paused. You can only resume subscriptions with collection_method set to charge_automatically. send_invoice subscriptions are not supported.
865
+ # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions).
794
866
  def resume(params = {}, opts = {})
795
867
  request_stripe_object(
796
868
  method: :post,
@@ -800,7 +872,7 @@ module Stripe
800
872
  )
801
873
  end
802
874
 
803
- # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If no resumption invoice is generated, the subscription becomes active immediately. If a resumption invoice is generated, the subscription remains paused until the invoice is paid or marked uncollectible. If the invoice isn't paid by the expiration date, it is voided and the subscription remains paused. You can only resume subscriptions with collection_method set to charge_automatically. send_invoice subscriptions are not supported.
875
+ # Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions).
804
876
  def self.resume(subscription, params = {}, opts = {})
805
877
  request_stripe_object(
806
878
  method: :post,
@@ -860,6 +932,7 @@ module Stripe
860
932
  automatic_tax: AutomaticTax,
861
933
  billing_cycle_anchor_config: BillingCycleAnchorConfig,
862
934
  billing_mode: BillingMode,
935
+ billing_schedules: BillingSchedule,
863
936
  billing_thresholds: BillingThresholds,
864
937
  cancellation_details: CancellationDetails,
865
938
  invoice_settings: InvoiceSettings,
@@ -27,6 +27,8 @@ module Stripe
27
27
  @field_remappings = {}
28
28
  end
29
29
  end
30
+ # The time period the subscription item has been billed for.
31
+ attr_reader :billed_until
30
32
  # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period
31
33
  attr_reader :billing_thresholds
32
34
  # Time at which the object was created. Measured in seconds since the Unix epoch.
@@ -248,6 +248,8 @@ module Stripe
248
248
  @field_remappings = {}
249
249
  end
250
250
  end
251
+ # Controls whether discounts apply to this invoice item. Defaults to true if no value is provided.
252
+ attr_reader :discountable
251
253
  # The stackable discounts that will be applied to the item.
252
254
  attr_reader :discounts
253
255
  # Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
@@ -540,6 +540,19 @@ module Stripe
540
540
  end
541
541
  end
542
542
 
543
+ class VerifoneM425 < ::Stripe::StripeObject
544
+ # A File ID representing an image to display on the reader
545
+ attr_reader :splashscreen
546
+
547
+ def self.inner_class_types
548
+ @inner_class_types = {}
549
+ end
550
+
551
+ def self.field_remappings
552
+ @field_remappings = {}
553
+ end
554
+ end
555
+
543
556
  class VerifoneP400 < ::Stripe::StripeObject
544
557
  # A File ID representing an image to display on the reader
545
558
  attr_reader :splashscreen
@@ -553,6 +566,45 @@ module Stripe
553
566
  end
554
567
  end
555
568
 
569
+ class VerifoneP630 < ::Stripe::StripeObject
570
+ # A File ID representing an image to display on the reader
571
+ attr_reader :splashscreen
572
+
573
+ def self.inner_class_types
574
+ @inner_class_types = {}
575
+ end
576
+
577
+ def self.field_remappings
578
+ @field_remappings = {}
579
+ end
580
+ end
581
+
582
+ class VerifoneUx700 < ::Stripe::StripeObject
583
+ # A File ID representing an image to display on the reader
584
+ attr_reader :splashscreen
585
+
586
+ def self.inner_class_types
587
+ @inner_class_types = {}
588
+ end
589
+
590
+ def self.field_remappings
591
+ @field_remappings = {}
592
+ end
593
+ end
594
+
595
+ class VerifoneV660p < ::Stripe::StripeObject
596
+ # A File ID representing an image to display on the reader
597
+ attr_reader :splashscreen
598
+
599
+ def self.inner_class_types
600
+ @inner_class_types = {}
601
+ end
602
+
603
+ def self.field_remappings
604
+ @field_remappings = {}
605
+ end
606
+ end
607
+
556
608
  class Wifi < ::Stripe::StripeObject
557
609
  class EnterpriseEapPeap < ::Stripe::StripeObject
558
610
  # A File ID representing a PEM file containing the server certificate
@@ -657,8 +709,16 @@ module Stripe
657
709
  attr_reader :stripe_s710
658
710
  # Attribute for field tipping
659
711
  attr_reader :tipping
712
+ # Attribute for field verifone_m425
713
+ attr_reader :verifone_m425
660
714
  # Attribute for field verifone_p400
661
715
  attr_reader :verifone_p400
716
+ # Attribute for field verifone_p630
717
+ attr_reader :verifone_p630
718
+ # Attribute for field verifone_ux700
719
+ attr_reader :verifone_ux700
720
+ # Attribute for field verifone_v660p
721
+ attr_reader :verifone_v660p
662
722
  # Attribute for field wifi
663
723
  attr_reader :wifi
664
724
 
@@ -722,7 +782,11 @@ module Stripe
722
782
  stripe_s700: StripeS700,
723
783
  stripe_s710: StripeS710,
724
784
  tipping: Tipping,
785
+ verifone_m425: VerifoneM425,
725
786
  verifone_p400: VerifoneP400,
787
+ verifone_p630: VerifoneP630,
788
+ verifone_ux700: VerifoneUx700,
789
+ verifone_v660p: VerifoneV660p,
726
790
  wifi: Wifi,
727
791
  }
728
792
  end
@@ -18,6 +18,83 @@ module Stripe
18
18
  end
19
19
 
20
20
  class Action < ::Stripe::StripeObject
21
+ class ApiError < ::Stripe::StripeObject
22
+ # For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one.
23
+ attr_reader :advice_code
24
+ # For card errors, the ID of the failed charge.
25
+ attr_reader :charge
26
+ # For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.
27
+ attr_reader :code
28
+ # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://docs.stripe.com/declines#issuer-declines) if they provide one.
29
+ attr_reader :decline_code
30
+ # A URL to more information about the [error code](https://docs.stripe.com/error-codes) reported.
31
+ attr_reader :doc_url
32
+ # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.
33
+ attr_reader :message
34
+ # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.
35
+ attr_reader :network_advice_code
36
+ # For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.
37
+ attr_reader :network_decline_code
38
+ # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.
39
+ attr_reader :param
40
+ # A PaymentIntent guides you through the process of collecting a payment from your customer.
41
+ # We recommend that you create exactly one PaymentIntent for each order or
42
+ # customer session in your system. You can reference the PaymentIntent later to
43
+ # see the history of payment attempts for a particular session.
44
+ #
45
+ # A PaymentIntent transitions through
46
+ # [multiple statuses](/payments/paymentintents/lifecycle)
47
+ # throughout its lifetime as it interfaces with Stripe.js to perform
48
+ # authentication flows and ultimately creates at most one successful charge.
49
+ #
50
+ # Related guide: [Payment Intents API](https://docs.stripe.com/payments/payment-intents)
51
+ attr_reader :payment_intent
52
+ # PaymentMethod objects represent your customer's payment instruments.
53
+ # You can use them with [PaymentIntents](https://docs.stripe.com/payments/payment-intents) to collect payments or save them to
54
+ # Customer objects to store instrument details for future payments.
55
+ #
56
+ # Related guides: [Payment Methods](https://docs.stripe.com/payments/payment-methods) and [More Payment Scenarios](https://docs.stripe.com/payments/more-payment-scenarios).
57
+ attr_reader :payment_method
58
+ # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.
59
+ attr_reader :payment_method_type
60
+ # A URL to the request log entry in your dashboard.
61
+ attr_reader :request_log_url
62
+ # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
63
+ # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
64
+ # Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow.
65
+ #
66
+ # Create a SetupIntent when you're ready to collect your customer's payment credentials.
67
+ # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
68
+ # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
69
+ # you through the setup process.
70
+ #
71
+ # Successful SetupIntents result in payment credentials that are optimized for future payments.
72
+ # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
73
+ # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
74
+ # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
75
+ # If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer),
76
+ # it automatically attaches the resulting payment method to that Customer after successful setup.
77
+ # We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on
78
+ # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.
79
+ #
80
+ # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.
81
+ #
82
+ # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)
83
+ attr_reader :setup_intent
84
+ # Attribute for field source
85
+ attr_reader :source
86
+ # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`
87
+ attr_reader :type
88
+
89
+ def self.inner_class_types
90
+ @inner_class_types = {}
91
+ end
92
+
93
+ def self.field_remappings
94
+ @field_remappings = {}
95
+ end
96
+ end
97
+
21
98
  class CollectInputs < ::Stripe::StripeObject
22
99
  class Input < ::Stripe::StripeObject
23
100
  class CustomText < ::Stripe::StripeObject
@@ -285,6 +362,39 @@ module Stripe
285
362
  end
286
363
  end
287
364
 
365
+ class PrintContent < ::Stripe::StripeObject
366
+ class Image < ::Stripe::StripeObject
367
+ # Creation time of the object (in seconds since the Unix epoch).
368
+ attr_reader :created_at
369
+ # The original name of the uploaded file (e.g. `receipt.png`).
370
+ attr_reader :filename
371
+ # The size (in bytes) of the uploaded file.
372
+ attr_reader :size
373
+ # The format of the uploaded file.
374
+ attr_reader :type
375
+
376
+ def self.inner_class_types
377
+ @inner_class_types = {}
378
+ end
379
+
380
+ def self.field_remappings
381
+ @field_remappings = {}
382
+ end
383
+ end
384
+ # Metadata of an uploaded file
385
+ attr_reader :image
386
+ # The type of content to print. Currently supports `image`.
387
+ attr_reader :type
388
+
389
+ def self.inner_class_types
390
+ @inner_class_types = { image: Image }
391
+ end
392
+
393
+ def self.field_remappings
394
+ @field_remappings = {}
395
+ end
396
+ end
397
+
288
398
  class ProcessPaymentIntent < ::Stripe::StripeObject
289
399
  class ProcessConfig < ::Stripe::StripeObject
290
400
  class Tipping < ::Stripe::StripeObject
@@ -448,6 +558,8 @@ module Stripe
448
558
  @field_remappings = {}
449
559
  end
450
560
  end
561
+ # The reader action failed due to an [API error](https://docs.stripe.com/api/errors). Only present when `status` is `failed` and the underlying failure was an API error. Avoid parsing the `message` field for programmatic logic; use `type` or `code` instead. The `message` field is for display to humans only and may be updated at anytime. Requires [reader version](https://docs.stripe.com/terminal/readers/stripe-reader-s700-s710#reader-software-version) 2.42 or later. Readers on older versions always return null.
562
+ attr_reader :api_error
451
563
  # Represents a reader action to collect customer inputs
452
564
  attr_reader :collect_inputs
453
565
  # Represents a reader action to collect a payment method
@@ -458,6 +570,8 @@ module Stripe
458
570
  attr_reader :failure_code
459
571
  # Detailed failure message, only set if status is `failed`.
460
572
  attr_reader :failure_message
573
+ # Represents a reader action to print content
574
+ attr_reader :print_content
461
575
  # Represents a reader action to process a payment intent
462
576
  attr_reader :process_payment_intent
463
577
  # Represents a reader action to process a setup intent
@@ -473,9 +587,11 @@ module Stripe
473
587
 
474
588
  def self.inner_class_types
475
589
  @inner_class_types = {
590
+ api_error: ApiError,
476
591
  collect_inputs: CollectInputs,
477
592
  collect_payment_method: CollectPaymentMethod,
478
593
  confirm_payment_intent: ConfirmPaymentIntent,
594
+ print_content: PrintContent,
479
595
  process_payment_intent: ProcessPaymentIntent,
480
596
  process_setup_intent: ProcessSetupIntent,
481
597
  refund_payment: RefundPayment,
@@ -12,7 +12,7 @@ module Stripe
12
12
  end
13
13
 
14
14
  class Cancel < ::Stripe::StripeObject
15
- # Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them.
15
+ # The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them.
16
16
  attr_reader :identifier
17
17
 
18
18
  def self.inner_class_types
@@ -29,7 +29,7 @@ module Stripe
29
29
  attr_reader :created
30
30
  # The name of the meter event. Corresponds with the `event_name` field on a meter.
31
31
  attr_reader :event_name
32
- # The unique id of this meter event adjustment.
32
+ # The unique ID of this meter event adjustment.
33
33
  attr_reader :id
34
34
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
35
35
  attr_reader :livemode
@@ -37,7 +37,7 @@ module Stripe
37
37
  attr_reader :object
38
38
  # Open Enum. The meter event adjustment’s status.
39
39
  attr_reader :status
40
- # Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet.
40
+ # Open Enum. Specifies the type of cancellation. Currently supports canceling a single event.
41
41
  attr_reader :type
42
42
 
43
43
  def self.inner_class_types
@@ -11,14 +11,14 @@ module Stripe
11
11
  "v2.billing.meter_event_session"
12
12
  end
13
13
 
14
- # The authentication token for this session. Use this token when calling the
14
+ # The authentication token for this session. Use this token when calling the
15
15
  # high-throughput meter event API.
16
16
  attr_reader :authentication_token
17
17
  # The creation time of this session.
18
18
  attr_reader :created
19
- # The time at which this session will expire.
19
+ # The time at which this session expires.
20
20
  attr_reader :expires_at
21
- # The unique id of this auth session.
21
+ # The unique ID of this auth session.
22
22
  attr_reader :id
23
23
  # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
24
24
  attr_reader :livemode