stripe 20.1.0.pre.alpha.2 → 20.1.0.pre.alpha.4

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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stripe/api_requestor.rb +35 -4
  3. data/lib/stripe/api_version.rb +1 -1
  4. data/lib/stripe/errors.rb +6 -0
  5. data/lib/stripe/event_types.rb +4 -4
  6. data/lib/stripe/events/{v2_payments_off_session_payment_requires_capture_event.rb → v2_signals_account_signal_customer_risk_ready_event.rb} +7 -7
  7. data/lib/stripe/object_types.rb +3 -0
  8. data/lib/stripe/params/account_create_params.rb +12 -12
  9. data/lib/stripe/params/account_update_params.rb +9 -9
  10. data/lib/stripe/params/checkout/session_create_params.rb +449 -4
  11. data/lib/stripe/params/checkout/session_update_params.rb +1 -1
  12. data/lib/stripe/params/confirmation_token_create_params.rb +22 -0
  13. data/lib/stripe/params/invoice_create_preview_params.rb +2 -2
  14. data/lib/stripe/params/issuing/authorization_capture_params.rb +24 -44
  15. data/lib/stripe/params/issuing/authorization_create_params.rb +8 -0
  16. data/lib/stripe/params/issuing/transaction_create_force_capture_params.rb +24 -44
  17. data/lib/stripe/params/issuing/transaction_create_unlinked_refund_params.rb +0 -43
  18. data/lib/stripe/params/payment_intent_confirm_params.rb +100 -0
  19. data/lib/stripe/params/payment_intent_create_params.rb +100 -0
  20. data/lib/stripe/params/payment_intent_update_params.rb +100 -0
  21. data/lib/stripe/params/payment_method_create_params.rb +22 -0
  22. data/lib/stripe/params/risk/form_retrieve_params.rb +15 -0
  23. data/lib/stripe/params/risk/form_update_params.rb +190 -0
  24. data/lib/stripe/params/setup_intent_confirm_params.rb +22 -0
  25. data/lib/stripe/params/setup_intent_create_params.rb +22 -0
  26. data/lib/stripe/params/setup_intent_update_params.rb +22 -0
  27. data/lib/stripe/params/subscription_schedule_update_params.rb +1 -1
  28. data/lib/stripe/params/subscription_update_params.rb +1 -1
  29. data/lib/stripe/params/test_helpers/confirmation_token_create_params.rb +22 -0
  30. data/lib/stripe/params/test_helpers/issuing/authorization_capture_params.rb +24 -44
  31. data/lib/stripe/params/test_helpers/issuing/authorization_create_params.rb +8 -0
  32. data/lib/stripe/params/test_helpers/issuing/transaction_create_force_capture_params.rb +24 -44
  33. data/lib/stripe/params/test_helpers/issuing/transaction_create_unlinked_refund_params.rb +0 -43
  34. data/lib/stripe/params/v2/core/account_create_params.rb +288 -1
  35. data/lib/stripe/params/v2/core/account_evaluation_create_params.rb +4 -1
  36. data/lib/stripe/params/v2/core/account_list_params.rb +3 -1
  37. data/lib/stripe/params/v2/core/account_update_params.rb +288 -1
  38. data/lib/stripe/params/v2/data/operation_search_params.rb +27 -0
  39. data/lib/stripe/params/v2/payments/off_session_payment_create_params.rb +0 -13
  40. data/lib/stripe/params/v2/signals/account_activity_create_params.rb +70 -2
  41. data/lib/stripe/params/v2/signals/account_evaluation_create_params.rb +72 -3
  42. data/lib/stripe/params.rb +9 -8
  43. data/lib/stripe/resources/account.rb +6 -6
  44. data/lib/stripe/resources/account_session.rb +56 -2
  45. data/lib/stripe/resources/balance.rb +83 -0
  46. data/lib/stripe/resources/billing/alert_notification.rb +1 -0
  47. data/lib/stripe/resources/billing_portal/configuration.rb +46 -0
  48. data/lib/stripe/resources/card.rb +3 -1
  49. data/lib/stripe/resources/charge.rb +52 -0
  50. data/lib/stripe/resources/checkout/session.rb +428 -5
  51. data/lib/stripe/resources/confirmation_token.rb +52 -0
  52. data/lib/stripe/resources/customer.rb +2 -2
  53. data/lib/stripe/resources/dispute.rb +1 -1
  54. data/lib/stripe/resources/financial_connections/account.rb +1 -1
  55. data/lib/stripe/resources/identity/verification_report.rb +35 -20
  56. data/lib/stripe/resources/invoice.rb +1 -1
  57. data/lib/stripe/resources/invoice_item.rb +1 -1
  58. data/lib/stripe/resources/issuing/authorization.rb +20 -0
  59. data/lib/stripe/resources/order.rb +1 -1
  60. data/lib/stripe/resources/payment_attempt_record.rb +52 -0
  61. data/lib/stripe/resources/payment_intent.rb +72 -0
  62. data/lib/stripe/resources/payment_link.rb +24 -1
  63. data/lib/stripe/resources/payment_method.rb +52 -0
  64. data/lib/stripe/resources/payment_record.rb +52 -0
  65. data/lib/stripe/resources/quote_preview_invoice.rb +3 -33
  66. data/lib/stripe/resources/quote_preview_subscription_schedule.rb +3 -0
  67. data/lib/stripe/resources/radar/payment_evaluation.rb +1 -1
  68. data/lib/stripe/resources/refund.rb +14 -0
  69. data/lib/stripe/resources/risk/form.rb +276 -0
  70. data/lib/stripe/resources/shared_payment/granted_token.rb +3 -3
  71. data/lib/stripe/resources/source.rb +1 -3
  72. data/lib/stripe/resources/source_mandate_notification.rb +1 -3
  73. data/lib/stripe/resources/subscription.rb +2 -2
  74. data/lib/stripe/resources/tax/calculation.rb +1 -1
  75. data/lib/stripe/resources/tax/registration.rb +64 -0
  76. data/lib/stripe/resources/tax/transaction.rb +1 -1
  77. data/lib/stripe/resources/token.rb +2 -0
  78. data/lib/stripe/resources/treasury/credit_reversal.rb +2 -0
  79. data/lib/stripe/resources/treasury/debit_reversal.rb +2 -0
  80. data/lib/stripe/resources/treasury/financial_account.rb +2 -0
  81. data/lib/stripe/resources/treasury/inbound_transfer.rb +2 -0
  82. data/lib/stripe/resources/treasury/outbound_payment.rb +2 -0
  83. data/lib/stripe/resources/treasury/outbound_transfer.rb +2 -0
  84. data/lib/stripe/resources/treasury/received_credit.rb +8 -0
  85. data/lib/stripe/resources/treasury/received_debit.rb +2 -0
  86. data/lib/stripe/resources/treasury/transaction.rb +16 -0
  87. data/lib/stripe/resources/treasury/transaction_entry.rb +16 -0
  88. data/lib/stripe/resources/v2/core/account.rb +1866 -185
  89. data/lib/stripe/resources/v2/core/account_evaluation.rb +2 -0
  90. data/lib/stripe/resources/v2/data/search_result_list.rb +382 -0
  91. data/lib/stripe/resources/v2/money_management/financial_address.rb +65 -1
  92. data/lib/stripe/resources/v2/money_management/received_credit.rb +66 -0
  93. data/lib/stripe/resources/v2/money_management/received_debit.rb +1 -1
  94. data/lib/stripe/resources/v2/payments/off_session_payment.rb +0 -20
  95. data/lib/stripe/resources/v2/signals/account_activity.rb +83 -1
  96. data/lib/stripe/resources/v2/signals/account_evaluation.rb +51 -1
  97. data/lib/stripe/resources/v2/signals/account_signal.rb +55 -0
  98. data/lib/stripe/resources.rb +12 -5
  99. data/lib/stripe/services/risk/form_service.rb +47 -0
  100. data/lib/stripe/services/risk_service.rb +13 -0
  101. data/lib/stripe/services/subscription_service.rb +1 -1
  102. data/lib/stripe/services/test_helpers/customer_service.rb +1 -1
  103. data/lib/stripe/services/test_helpers/shared_payment/granted_token_service.rb +2 -2
  104. data/lib/stripe/services/v1_services.rb +2 -1
  105. data/lib/stripe/services/v2/core/vault/gb_bank_account_service.rb +0 -28
  106. data/lib/stripe/services/v2/data/operation_service.rb +22 -0
  107. data/lib/stripe/services/v2/data_service.rb +2 -1
  108. data/lib/stripe/services/v2/money_management/financial_account_service.rb +1 -1
  109. data/lib/stripe/services/v2/payments/off_session_payment_service.rb +0 -11
  110. data/lib/stripe/services.rb +9 -0
  111. data/lib/stripe/stripe_client.rb +29 -4
  112. data/lib/stripe/stripe_event_notification_handler.rb +5 -5
  113. data/lib/stripe/stripe_service.rb +10 -0
  114. data/lib/stripe/util.rb +9 -2
  115. data/lib/stripe/v2_search_result_object.rb +62 -0
  116. data/lib/stripe/version.rb +1 -1
  117. data/lib/stripe/webhook.rb +1 -1
  118. data/lib/stripe/workload_identity_exchange.rb +242 -0
  119. data/lib/stripe.rb +2 -0
  120. data/rbi/stripe/stripe_client.rbi +13 -0
  121. data/rbi/stripe/workload_identity_exchange.rbi +21 -0
  122. data/rbi/stripe.rbi +7087 -1296
  123. metadata +14 -6
  124. data/lib/stripe/params/v2/core/vault/gb_bank_account_acknowledge_confirmation_of_payee_params.rb +0 -12
  125. data/lib/stripe/params/v2/core/vault/gb_bank_account_initiate_confirmation_of_payee_params.rb +0 -22
  126. data/lib/stripe/params/v2/payments/off_session_payment_capture_params.rb +0 -178
@@ -549,6 +549,270 @@ module Stripe
549
549
  end
550
550
 
551
551
  class Item < ::Stripe::RequestParams
552
+ class MetronomeCommit < ::Stripe::RequestParams
553
+ class Commit < ::Stripe::RequestParams
554
+ class AccessSchedule < ::Stripe::RequestParams
555
+ class ScheduleItem < ::Stripe::RequestParams
556
+ # The access amount in credit_type_id units.
557
+ attr_accessor :amount
558
+ # Hour-aligned RFC 3339 timestamp in UTC at which access to the balance amount ends (exclusive).
559
+ attr_accessor :ending_before
560
+ # Hour-aligned RFC 3339 timestamp in UTC at which access to the balance amount starts (inclusive).
561
+ attr_accessor :starting_at
562
+
563
+ def initialize(amount: nil, ending_before: nil, starting_at: nil)
564
+ @amount = amount
565
+ @ending_before = ending_before
566
+ @starting_at = starting_at
567
+ end
568
+
569
+ def self.field_encodings
570
+ @field_encodings = { amount: :decimal_string }
571
+ end
572
+ end
573
+ # The fixed price the buyer pays, in minor currency units.
574
+ attr_accessor :price_amount
575
+ # When and how many credits become available.
576
+ attr_accessor :schedule_items
577
+
578
+ def initialize(price_amount: nil, schedule_items: nil)
579
+ @price_amount = price_amount
580
+ @schedule_items = schedule_items
581
+ end
582
+
583
+ def self.field_encodings
584
+ @field_encodings = {
585
+ schedule_items: {
586
+ kind: :array,
587
+ element: { kind: :object, fields: { amount: :decimal_string } },
588
+ },
589
+ }
590
+ end
591
+ end
592
+
593
+ class CommitOptions < ::Stripe::RequestParams
594
+ class CustomAmount < ::Stripe::RequestParams
595
+ # Must be `true` when `custom_amount` is present. Omit `custom_amount` to disable custom amounts.
596
+ attr_accessor :enabled
597
+ # Maximum `access_amount` the customer can enter. Defaults to `999999999999999` when omitted.
598
+ attr_accessor :maximum
599
+ # Minimum `access_amount` the customer can enter. Defaults to `1` when omitted.
600
+ attr_accessor :minimum
601
+
602
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
603
+ @enabled = enabled
604
+ @maximum = maximum
605
+ @minimum = minimum
606
+ end
607
+ end
608
+
609
+ class DiscountTier < ::Stripe::RequestParams
610
+ # Percentage discount applied to the full access_amount when it falls in this tier.
611
+ attr_accessor :discount_percentage
612
+ # Upper bound (inclusive) in credit_type_id units. Use `inf` to define an unbounded tier.
613
+ attr_accessor :up_to
614
+
615
+ def initialize(discount_percentage: nil, up_to: nil)
616
+ @discount_percentage = discount_percentage
617
+ @up_to = up_to
618
+ end
619
+ end
620
+
621
+ class Option < ::Stripe::RequestParams
622
+ # The access amount for this option, in credit_type_id units.
623
+ attr_accessor :access_amount
624
+ # Whether this option is pre-selected in the Checkout UI. At most one option may be marked true.
625
+ attr_accessor :default_option
626
+
627
+ def initialize(access_amount: nil, default_option: nil)
628
+ @access_amount = access_amount
629
+ @default_option = default_option
630
+ end
631
+ end
632
+ # Optionally let the buyer enter a custom access amount.
633
+ attr_accessor :custom_amount
634
+ # Volume-based discount tiers.
635
+ attr_accessor :discount_tiers
636
+ # When access for the purchased credits ends. Hour-aligned UTC timestamp.
637
+ attr_accessor :ending_before
638
+ # Access-amount presets for the buyer to choose from.
639
+ attr_accessor :options
640
+ # When access for the purchased credits starts. Hour-aligned UTC timestamp.
641
+ attr_accessor :starting_at
642
+
643
+ def initialize(
644
+ custom_amount: nil,
645
+ discount_tiers: nil,
646
+ ending_before: nil,
647
+ options: nil,
648
+ starting_at: nil
649
+ )
650
+ @custom_amount = custom_amount
651
+ @discount_tiers = discount_tiers
652
+ @ending_before = ending_before
653
+ @options = options
654
+ @starting_at = starting_at
655
+ end
656
+ end
657
+
658
+ class Specifier < ::Stripe::RequestParams
659
+ # Key-value pairs for presentation group filters.
660
+ attr_accessor :presentation_group_values
661
+ # Key-value pairs for pricing group filters.
662
+ attr_accessor :pricing_group_values
663
+ # Metronome product ID to scope this specifier to.
664
+ attr_accessor :product_id
665
+ # Metronome product tags to scope this specifier to. A product matches this filter only if it has all specified tags.
666
+ attr_accessor :product_tags
667
+
668
+ def initialize(
669
+ presentation_group_values: nil,
670
+ pricing_group_values: nil,
671
+ product_id: nil,
672
+ product_tags: nil
673
+ )
674
+ @presentation_group_values = presentation_group_values
675
+ @pricing_group_values = pricing_group_values
676
+ @product_id = product_id
677
+ @product_tags = product_tags
678
+ end
679
+ end
680
+
681
+ class TaxDetails < ::Stripe::RequestParams
682
+ # Stripe [tax code](https://docs.stripe.com/tax/tax-codes) for this commit (for example, `txcd_10103000`). If the linked Stripe Product has a tax code, this value must match it.
683
+ attr_accessor :tax_code
684
+
685
+ def initialize(tax_code: nil)
686
+ @tax_code = tax_code
687
+ end
688
+ end
689
+ # Sets the balance amount and release schedule. Mutually exclusive with `commit_options`.
690
+ attr_accessor :access_schedule
691
+ # Metronome product tags this commit can be drawn down against. A product matches if it has at least one of the specified tags. Mutually exclusive with `specifiers`. If `applicable_metronome_products`, `applicable_metronome_product_tags`, and `specifiers` are all omitted, the commit applies to all products. See Metronome's [applicable_product_tags](https://docs.metronome.com/api-reference/contracts/edit-a-contract#body-add-commits-items-applicable-product-tags).
692
+ attr_accessor :applicable_metronome_product_tags
693
+ # Metronome product IDs this commit can be drawn down against. Mutually exclusive with `specifiers`. If `applicable_metronome_products`, `applicable_metronome_product_tags`, and `specifiers` are all omitted, the commit applies to all products. See Metronome's [applicable_product_ids](https://docs.metronome.com/api-reference/contracts/edit-a-contract#body-add-commits-items-applicable-product-ids).
694
+ attr_accessor :applicable_metronome_products
695
+ # Customer selects the balance amount to purchase. Mutually exclusive with `access_schedule`.
696
+ attr_accessor :commit_options
697
+ # The Metronome Custom Pricing Unit credit type ID for this commit, whose access amounts are credit counts. Omit it to price in fiat, where access amounts are in the smallest unit of `price_configuration[currency]`. Fiat credit type IDs are not accepted.
698
+ attr_accessor :credit_type_id
699
+ # Key-value pairs forwarded to the Metronome commit's [custom_fields](https://docs.metronome.com/api-reference/contracts/edit-a-contract#body-add-commits-items-custom-fields).
700
+ attr_accessor :custom_fields
701
+ # Free-form description. Forwarded to the Metronome commit's description.
702
+ attr_accessor :description
703
+ # The Metronome product ID for this commit.
704
+ attr_accessor :metronome_product
705
+ # Display name for the commit. Surfaced on the Metronome commit's name.
706
+ attr_accessor :name
707
+ # Priority for applying the commit. Lower priority values apply first. Forwarded to Metronome as-is.
708
+ attr_accessor :priority
709
+ # Specifies which rates are used to draw down the commit. Accepts `commit_rate`, `list_rate`, `COMMIT_RATE`, or `LIST_RATE`.
710
+ attr_accessor :rate_type
711
+ # Fraction of unused balance that rolls over on a Metronome contract transition. Must be between `0` and `1`. Forwarded to Metronome as-is.
712
+ attr_accessor :rollover_fraction
713
+ # Usage filters that determine what draws down the commit. If multiple specifiers are provided, a product only needs to match one. Mutually exclusive with `applicable_metronome_products` and `applicable_metronome_product_tags`. If `applicable_metronome_products`, `applicable_metronome_product_tags`, and `specifiers` are all omitted, the commit applies to all products. See Metronome's [specifiers](https://docs.metronome.com/api-reference/contracts/edit-a-contract#body-add-commits-items-specifiers).
714
+ attr_accessor :specifiers
715
+ # Tax details for this commit. If omitted, Stripe uses the tax code from the Stripe product linked to the Metronome commit product. If there is no linked Stripe product or the Stripe product has no tax code configured, the [preset tax rate on your account](https://docs.stripe.com/api/tax/settings/object#tax_settings_object-defaults-tax_code) will be used. If provided, `tax_code` is required.
716
+ attr_accessor :tax_details
717
+
718
+ def initialize(
719
+ access_schedule: nil,
720
+ applicable_metronome_product_tags: nil,
721
+ applicable_metronome_products: nil,
722
+ commit_options: nil,
723
+ credit_type_id: nil,
724
+ custom_fields: nil,
725
+ description: nil,
726
+ metronome_product: nil,
727
+ name: nil,
728
+ priority: nil,
729
+ rate_type: nil,
730
+ rollover_fraction: nil,
731
+ specifiers: nil,
732
+ tax_details: nil
733
+ )
734
+ @access_schedule = access_schedule
735
+ @applicable_metronome_product_tags = applicable_metronome_product_tags
736
+ @applicable_metronome_products = applicable_metronome_products
737
+ @commit_options = commit_options
738
+ @credit_type_id = credit_type_id
739
+ @custom_fields = custom_fields
740
+ @description = description
741
+ @metronome_product = metronome_product
742
+ @name = name
743
+ @priority = priority
744
+ @rate_type = rate_type
745
+ @rollover_fraction = rollover_fraction
746
+ @specifiers = specifiers
747
+ @tax_details = tax_details
748
+ end
749
+
750
+ def self.field_encodings
751
+ @field_encodings = {
752
+ access_schedule: {
753
+ kind: :object,
754
+ fields: {
755
+ schedule_items: {
756
+ kind: :array,
757
+ element: { kind: :object, fields: { amount: :decimal_string } },
758
+ },
759
+ },
760
+ },
761
+ priority: :decimal_string,
762
+ rollover_fraction: :decimal_string,
763
+ }
764
+ end
765
+ end
766
+
767
+ class PriceConfiguration < ::Stripe::RequestParams
768
+ # The currency for this commit purchase, as an ISO 4217 lowercase string (for example, `usd`).
769
+ attr_accessor :currency
770
+ # Specifies whether the price is considered inclusive or exclusive of taxes. When omitted and automatic tax is enabled, uses `tax_settings.defaults.tax_behavior`. If no default is set, the request returns an error.
771
+ attr_accessor :tax_behavior
772
+
773
+ def initialize(currency: nil, tax_behavior: nil)
774
+ @currency = currency
775
+ @tax_behavior = tax_behavior
776
+ end
777
+ end
778
+ # The list of commits to create for this Metronome contract.
779
+ attr_accessor :commits
780
+ # The Metronome contract ID to associate with this checkout item.
781
+ attr_accessor :metronome_contract
782
+ # The currency and tax behavior configuration for this commit purchase.
783
+ attr_accessor :price_configuration
784
+
785
+ def initialize(commits: nil, metronome_contract: nil, price_configuration: nil)
786
+ @commits = commits
787
+ @metronome_contract = metronome_contract
788
+ @price_configuration = price_configuration
789
+ end
790
+
791
+ def self.field_encodings
792
+ @field_encodings = {
793
+ commits: {
794
+ kind: :array,
795
+ element: {
796
+ kind: :object,
797
+ fields: {
798
+ access_schedule: {
799
+ kind: :object,
800
+ fields: {
801
+ schedule_items: {
802
+ kind: :array,
803
+ element: { kind: :object, fields: { amount: :decimal_string } },
804
+ },
805
+ },
806
+ },
807
+ priority: :decimal_string,
808
+ rollover_fraction: :decimal_string,
809
+ },
810
+ },
811
+ },
812
+ }
813
+ end
814
+ end
815
+
552
816
  class Subscription < ::Stripe::RequestParams
553
817
  class BillingCycleAnchorConfig < ::Stripe::RequestParams
554
818
  # The day of the month the anchor should be. Ranges from 1 to 31.
@@ -592,6 +856,21 @@ module Stripe
592
856
  end
593
857
 
594
858
  class Item < ::Stripe::RequestParams
859
+ class AdjustableQuantity < ::Stripe::RequestParams
860
+ # Set to true if the quantity can be adjusted to any non-negative integer.
861
+ attr_accessor :enabled
862
+ # The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.
863
+ attr_accessor :maximum
864
+ # The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.
865
+ attr_accessor :minimum
866
+
867
+ def initialize(enabled: nil, maximum: nil, minimum: nil)
868
+ @enabled = enabled
869
+ @maximum = maximum
870
+ @minimum = minimum
871
+ end
872
+ end
873
+
595
874
  class CurrentTrial < ::Stripe::RequestParams
596
875
  # The ID of the trial offer to apply to the subscription item.
597
876
  attr_accessor :trial_offer
@@ -696,6 +975,8 @@ module Stripe
696
975
  @field_encodings = { unit_amount_decimal: :decimal_string }
697
976
  end
698
977
  end
978
+ # When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.
979
+ attr_accessor :adjustable_quantity
699
980
  # The trial offer to apply to this subscription item.
700
981
  attr_accessor :current_trial
701
982
  # The ID of the [Price](https://docs.stripe.com/api/prices). One of `price` or `price_data` is required.
@@ -705,7 +986,14 @@ module Stripe
705
986
  # Quantity for this item.
706
987
  attr_accessor :quantity
707
988
 
708
- def initialize(current_trial: nil, price: nil, price_data: nil, quantity: nil)
989
+ def initialize(
990
+ adjustable_quantity: nil,
991
+ current_trial: nil,
992
+ price: nil,
993
+ price_data: nil,
994
+ quantity: nil
995
+ )
996
+ @adjustable_quantity = adjustable_quantity
709
997
  @current_trial = current_trial
710
998
  @price = price
711
999
  @price_data = price_data
@@ -813,18 +1101,45 @@ module Stripe
813
1101
  }
814
1102
  end
815
1103
  end
1104
+ # Configuration for the Metronome commit item.
1105
+ attr_accessor :metronome_commit
816
1106
  # Configuration for the subscription item.
817
1107
  attr_accessor :subscription
818
1108
  # The type of item.
819
1109
  attr_accessor :type
820
1110
 
821
- def initialize(subscription: nil, type: nil)
1111
+ def initialize(metronome_commit: nil, subscription: nil, type: nil)
1112
+ @metronome_commit = metronome_commit
822
1113
  @subscription = subscription
823
1114
  @type = type
824
1115
  end
825
1116
 
826
1117
  def self.field_encodings
827
1118
  @field_encodings = {
1119
+ metronome_commit: {
1120
+ kind: :object,
1121
+ fields: {
1122
+ commits: {
1123
+ kind: :array,
1124
+ element: {
1125
+ kind: :object,
1126
+ fields: {
1127
+ access_schedule: {
1128
+ kind: :object,
1129
+ fields: {
1130
+ schedule_items: {
1131
+ kind: :array,
1132
+ element: { kind: :object, fields: { amount: :decimal_string } },
1133
+ },
1134
+ },
1135
+ },
1136
+ priority: :decimal_string,
1137
+ rollover_fraction: :decimal_string,
1138
+ },
1139
+ },
1140
+ },
1141
+ },
1142
+ },
828
1143
  subscription: {
829
1144
  kind: :object,
830
1145
  fields: {
@@ -960,7 +1275,7 @@ module Stripe
960
1275
  attr_accessor :metadata
961
1276
  # The ID of the [Price](https://docs.stripe.com/api/prices) or [Plan](https://docs.stripe.com/api/plans) object. One of `price` or `price_data` is required.
962
1277
  attr_accessor :price
963
- # Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required.
1278
+ # Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline, for [dynamic pricing](https://docs.stripe.com/products-prices/how-products-and-prices-work#inline-pricing) when the amount isn't known ahead of time. One of `price` or `price_data` is required when creating a new line item.
964
1279
  attr_accessor :price_data
965
1280
  # The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.
966
1281
  attr_accessor :quantity
@@ -999,6 +1314,57 @@ module Stripe
999
1314
  end
1000
1315
  end
1001
1316
 
1317
+ class MarketingAttribution < ::Stripe::RequestParams
1318
+ class AdConversion < ::Stripe::RequestParams
1319
+ # Whether the customer consented to sending conversion data to an advertising platform.
1320
+ attr_accessor :consent_collected
1321
+
1322
+ def initialize(consent_collected: nil)
1323
+ @consent_collected = consent_collected
1324
+ end
1325
+ end
1326
+ # Information used when sending conversions to an advertising platform.
1327
+ attr_accessor :ad_conversion
1328
+ # The advertising platform's click identifier.
1329
+ attr_accessor :click_id
1330
+ # The Unix timestamp when the advertising interaction occurred.
1331
+ attr_accessor :occurred_at
1332
+ # The advertising group ID from the `utm_adgroup` parameter.
1333
+ attr_accessor :utm_adgroup
1334
+ # The advertising content identifier from the `utm_content` parameter.
1335
+ attr_accessor :utm_content
1336
+ # The advertising campaign ID from the `utm_id` parameter.
1337
+ attr_accessor :utm_id
1338
+ # The marketing medium from the `utm_medium` parameter.
1339
+ attr_accessor :utm_medium
1340
+ # The referral source from the `utm_source` parameter.
1341
+ attr_accessor :utm_source
1342
+ # The paid search term from the `utm_term` parameter.
1343
+ attr_accessor :utm_term
1344
+
1345
+ def initialize(
1346
+ ad_conversion: nil,
1347
+ click_id: nil,
1348
+ occurred_at: nil,
1349
+ utm_adgroup: nil,
1350
+ utm_content: nil,
1351
+ utm_id: nil,
1352
+ utm_medium: nil,
1353
+ utm_source: nil,
1354
+ utm_term: nil
1355
+ )
1356
+ @ad_conversion = ad_conversion
1357
+ @click_id = click_id
1358
+ @occurred_at = occurred_at
1359
+ @utm_adgroup = utm_adgroup
1360
+ @utm_content = utm_content
1361
+ @utm_id = utm_id
1362
+ @utm_medium = utm_medium
1363
+ @utm_source = utm_source
1364
+ @utm_term = utm_term
1365
+ end
1366
+ end
1367
+
1002
1368
  class NameCollection < ::Stripe::RequestParams
1003
1369
  class Business < ::Stripe::RequestParams
1004
1370
  # Enable business name collection on the Checkout Session. Defaults to `false`.
@@ -1485,6 +1851,53 @@ module Stripe
1485
1851
  end
1486
1852
  end
1487
1853
 
1854
+ class MandateOptions < ::Stripe::RequestParams
1855
+ # Maximum or fixed amount for future payments, specified in the Checkout Session's integration currency.
1856
+ attr_accessor :amount
1857
+ # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.
1858
+ attr_accessor :amount_type
1859
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
1860
+ attr_accessor :currency
1861
+ # A description of the mandate or subscription that is meant to be displayed to the customer.
1862
+ attr_accessor :description
1863
+ # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.
1864
+ attr_accessor :end_date
1865
+ # Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.
1866
+ attr_accessor :interval
1867
+ # The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.
1868
+ attr_accessor :interval_count
1869
+ # Unique identifier for the mandate or subscription.
1870
+ attr_accessor :reference
1871
+ # Start date of the mandate or subscription. Start date should not be lesser than yesterday.
1872
+ attr_accessor :start_date
1873
+ # Specifies the type of mandates supported. Possible values are `india`.
1874
+ attr_accessor :supported_types
1875
+
1876
+ def initialize(
1877
+ amount: nil,
1878
+ amount_type: nil,
1879
+ currency: nil,
1880
+ description: nil,
1881
+ end_date: nil,
1882
+ interval: nil,
1883
+ interval_count: nil,
1884
+ reference: nil,
1885
+ start_date: nil,
1886
+ supported_types: nil
1887
+ )
1888
+ @amount = amount
1889
+ @amount_type = amount_type
1890
+ @currency = currency
1891
+ @description = description
1892
+ @end_date = end_date
1893
+ @interval = interval
1894
+ @interval_count = interval_count
1895
+ @reference = reference
1896
+ @start_date = start_date
1897
+ @supported_types = supported_types
1898
+ end
1899
+ end
1900
+
1488
1901
  class Restrictions < ::Stripe::RequestParams
1489
1902
  # The card brands to block. If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment.
1490
1903
  attr_accessor :brands_blocked
@@ -1500,6 +1913,8 @@ module Stripe
1500
1913
  attr_accessor :capture_method
1501
1914
  # Installment options for card payments
1502
1915
  attr_accessor :installments
1916
+ # Configuration options for setting up an eMandate for cards issued in India.
1917
+ attr_accessor :mandate_options
1503
1918
  # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession.
1504
1919
  attr_accessor :request_decremental_authorization
1505
1920
  # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession.
@@ -1530,6 +1945,7 @@ module Stripe
1530
1945
  def initialize(
1531
1946
  capture_method: nil,
1532
1947
  installments: nil,
1948
+ mandate_options: nil,
1533
1949
  request_decremental_authorization: nil,
1534
1950
  request_extended_authorization: nil,
1535
1951
  request_incremental_authorization: nil,
@@ -1543,6 +1959,7 @@ module Stripe
1543
1959
  )
1544
1960
  @capture_method = capture_method
1545
1961
  @installments = installments
1962
+ @mandate_options = mandate_options
1546
1963
  @request_decremental_authorization = request_decremental_authorization
1547
1964
  @request_extended_authorization = request_extended_authorization
1548
1965
  @request_incremental_authorization = request_incremental_authorization
@@ -3170,7 +3587,7 @@ module Stripe
3170
3587
  attr_accessor :client_reference_id
3171
3588
  # Configure fields for the Checkout Session to gather active consent from customers.
3172
3589
  attr_accessor :consent_collection
3173
- # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Required in `setup` mode when `payment_method_types` is not set.
3590
+ # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Required in `setup` mode when `allowed_payment_method_types` is not set.
3174
3591
  attr_accessor :currency
3175
3592
  # Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `elements`.
3176
3593
  attr_accessor :custom_fields
@@ -3238,6 +3655,8 @@ module Stripe
3238
3655
  attr_accessor :locale
3239
3656
  # Settings for Managed Payments for this Checkout Session and resulting [PaymentIntents](/api/payment_intents/object), [Invoices](/api/invoices/object), and [Subscriptions](/api/subscriptions/object).
3240
3657
  attr_accessor :managed_payments
3658
+ # Advertising attribution information for this Checkout Session. Only one attribution is supported.
3659
+ attr_accessor :marketing_attributions
3241
3660
  # 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
3242
3661
  attr_accessor :metadata
3243
3662
  # The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item.
@@ -3357,6 +3776,7 @@ module Stripe
3357
3776
  line_items: nil,
3358
3777
  locale: nil,
3359
3778
  managed_payments: nil,
3779
+ marketing_attributions: nil,
3360
3780
  metadata: nil,
3361
3781
  mode: nil,
3362
3782
  name_collection: nil,
@@ -3416,6 +3836,7 @@ module Stripe
3416
3836
  @line_items = line_items
3417
3837
  @locale = locale
3418
3838
  @managed_payments = managed_payments
3839
+ @marketing_attributions = marketing_attributions
3419
3840
  @metadata = metadata
3420
3841
  @mode = mode
3421
3842
  @name_collection = name_collection
@@ -3452,6 +3873,30 @@ module Stripe
3452
3873
  element: {
3453
3874
  kind: :object,
3454
3875
  fields: {
3876
+ metronome_commit: {
3877
+ kind: :object,
3878
+ fields: {
3879
+ commits: {
3880
+ kind: :array,
3881
+ element: {
3882
+ kind: :object,
3883
+ fields: {
3884
+ access_schedule: {
3885
+ kind: :object,
3886
+ fields: {
3887
+ schedule_items: {
3888
+ kind: :array,
3889
+ element: { kind: :object, fields: { amount: :decimal_string } },
3890
+ },
3891
+ },
3892
+ },
3893
+ priority: :decimal_string,
3894
+ rollover_fraction: :decimal_string,
3895
+ },
3896
+ },
3897
+ },
3898
+ },
3899
+ },
3455
3900
  subscription: {
3456
3901
  kind: :object,
3457
3902
  fields: {
@@ -263,7 +263,7 @@ module Stripe
263
263
  attr_accessor :metadata
264
264
  # The ID of the [Price](https://docs.stripe.com/api/prices). One of `price` or `price_data` is required when creating a new line item.
265
265
  attr_accessor :price
266
- # Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required when creating a new line item.
266
+ # Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline, for [dynamic pricing](https://docs.stripe.com/products-prices/how-products-and-prices-work#inline-pricing) when the amount isn't known ahead of time. One of `price` or `price_data` is required when creating a new line item.
267
267
  attr_accessor :price_data
268
268
  # The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.
269
269
  attr_accessor :quantity