stripe 15.2.1 → 15.3.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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/API_VERSION +1 -0
  3. data/CHANGELOG.md +66 -39
  4. data/OPENAPI_VERSION +1 -1
  5. data/README.md +14 -50
  6. data/VERSION +1 -1
  7. data/lib/stripe/api_version.rb +2 -1
  8. data/lib/stripe/events/v2_core_event_destination_ping_event.rb +1 -1
  9. data/lib/stripe/resources/account.rb +89 -5
  10. data/lib/stripe/resources/account_session.rb +79 -79
  11. data/lib/stripe/resources/billing_portal/session.rb +2 -2
  12. data/lib/stripe/resources/charge.rb +28 -15
  13. data/lib/stripe/resources/checkout/session.rb +57 -7
  14. data/lib/stripe/resources/confirmation_token.rb +19 -11
  15. data/lib/stripe/resources/credit_note.rb +9 -9
  16. data/lib/stripe/resources/customer_session.rb +2 -2
  17. data/lib/stripe/resources/event.rb +1 -1
  18. data/lib/stripe/resources/identity/verification_session.rb +34 -0
  19. data/lib/stripe/resources/invoice.rb +29 -4
  20. data/lib/stripe/resources/invoice_item.rb +1 -4
  21. data/lib/stripe/resources/mandate.rb +3 -0
  22. data/lib/stripe/resources/payment_intent.rb +331 -12
  23. data/lib/stripe/resources/payment_method.rb +17 -9
  24. data/lib/stripe/resources/quote.rb +26 -3
  25. data/lib/stripe/resources/setup_attempt.rb +1 -1
  26. data/lib/stripe/resources/setup_intent.rb +285 -3
  27. data/lib/stripe/resources/subscription.rb +68 -6
  28. data/lib/stripe/resources/subscription_schedule.rb +22 -0
  29. data/lib/stripe/resources/tax/registration.rb +20 -0
  30. data/lib/stripe/resources/terminal/configuration.rb +1 -0
  31. data/lib/stripe/resources/terminal/reader.rb +152 -4
  32. data/lib/stripe/resources/token.rb +1 -1
  33. data/lib/stripe/resources/treasury/financial_account.rb +5 -1
  34. data/lib/stripe/services/account_service.rb +83 -5
  35. data/lib/stripe/services/account_session_service.rb +48 -48
  36. data/lib/stripe/services/billing_portal/session_service.rb +1 -1
  37. data/lib/stripe/services/checkout/session_service.rb +57 -7
  38. data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
  39. data/lib/stripe/services/credit_note_service.rb +6 -6
  40. data/lib/stripe/services/customer_session_service.rb +1 -1
  41. data/lib/stripe/services/identity/verification_session_service.rb +16 -0
  42. data/lib/stripe/services/invoice_service.rb +29 -4
  43. data/lib/stripe/services/payment_intent_service.rb +315 -9
  44. data/lib/stripe/services/payment_method_service.rb +5 -0
  45. data/lib/stripe/services/quote_service.rb +20 -3
  46. data/lib/stripe/services/setup_intent_service.rb +275 -2
  47. data/lib/stripe/services/subscription_schedule_service.rb +13 -0
  48. data/lib/stripe/services/subscription_service.rb +48 -4
  49. data/lib/stripe/services/tax/registration_service.rb +13 -0
  50. data/lib/stripe/services/terminal/reader_service.rb +90 -0
  51. data/lib/stripe/services/test_helpers/confirmation_token_service.rb +6 -1
  52. data/lib/stripe/services/token_service.rb +1 -1
  53. data/lib/stripe/services/treasury/financial_account_service.rb +5 -1
  54. data/lib/stripe/services/v2/billing_service.rb +2 -2
  55. data/lib/stripe/services/v2/core/event_destination_service.rb +16 -16
  56. data/lib/stripe/version.rb +1 -1
  57. data/rbi/stripe/resources/account.rbi +78 -9
  58. data/rbi/stripe/resources/account_session.rbi +79 -79
  59. data/rbi/stripe/resources/billing_portal/session.rbi +2 -2
  60. data/rbi/stripe/resources/charge.rbi +32 -15
  61. data/rbi/stripe/resources/checkout/session.rbi +65 -9
  62. data/rbi/stripe/resources/confirmation_token.rbi +23 -12
  63. data/rbi/stripe/resources/credit_note.rbi +9 -9
  64. data/rbi/stripe/resources/customer_session.rbi +2 -2
  65. data/rbi/stripe/resources/event.rbi +1 -1
  66. data/rbi/stripe/resources/identity/verification_session.rbi +39 -1
  67. data/rbi/stripe/resources/invoice.rbi +36 -6
  68. data/rbi/stripe/resources/invoice_item.rbi +1 -4
  69. data/rbi/stripe/resources/mandate.rbi +4 -0
  70. data/rbi/stripe/resources/payment_intent.rbi +361 -21
  71. data/rbi/stripe/resources/payment_method.rbi +19 -10
  72. data/rbi/stripe/resources/quote.rbi +22 -3
  73. data/rbi/stripe/resources/setup_attempt.rbi +1 -1
  74. data/rbi/stripe/resources/setup_intent.rbi +332 -9
  75. data/rbi/stripe/resources/subscription.rbi +60 -7
  76. data/rbi/stripe/resources/subscription_schedule.rbi +23 -1
  77. data/rbi/stripe/resources/tax/registration.rbi +20 -1
  78. data/rbi/stripe/resources/terminal/configuration.rbi +1 -0
  79. data/rbi/stripe/resources/terminal/location.rbi +2 -2
  80. data/rbi/stripe/resources/terminal/reader.rbi +151 -4
  81. data/rbi/stripe/resources/token.rbi +1 -1
  82. data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
  83. data/rbi/stripe/services/account_service.rbi +77 -9
  84. data/rbi/stripe/services/account_session_service.rbi +48 -48
  85. data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
  86. data/rbi/stripe/services/checkout/session_service.rbi +65 -9
  87. data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
  88. data/rbi/stripe/services/credit_note_service.rbi +6 -6
  89. data/rbi/stripe/services/customer_session_service.rbi +1 -1
  90. data/rbi/stripe/services/identity/verification_session_service.rbi +17 -1
  91. data/rbi/stripe/services/invoice_service.rbi +36 -6
  92. data/rbi/stripe/services/payment_intent_service.rbi +348 -18
  93. data/rbi/stripe/services/payment_method_service.rbi +6 -1
  94. data/rbi/stripe/services/quote_service.rbi +16 -3
  95. data/rbi/stripe/services/setup_intent_service.rbi +326 -8
  96. data/rbi/stripe/services/subscription_schedule_service.rbi +12 -1
  97. data/rbi/stripe/services/subscription_service.rbi +41 -5
  98. data/rbi/stripe/services/tax/registration_service.rbi +14 -1
  99. data/rbi/stripe/services/terminal/location_service.rbi +2 -2
  100. data/rbi/stripe/services/terminal/reader_service.rbi +85 -0
  101. data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +9 -2
  102. data/rbi/stripe/services/token_service.rbi +1 -1
  103. data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
  104. data/rbi/stripe/services/v2/billing_service.rbi +1 -1
  105. data/rbi/stripe/services/v2/core/event_destination_service.rbi +13 -13
  106. metadata +3 -2
@@ -217,6 +217,7 @@ module Stripe
217
217
  end
218
218
 
219
219
  class Cashapp < Stripe::RequestParams; end
220
+ class Crypto < Stripe::RequestParams; end
220
221
  class CustomerBalance < Stripe::RequestParams; end
221
222
 
222
223
  class Eps < Stripe::RequestParams
@@ -435,6 +436,8 @@ module Stripe
435
436
  attr_accessor :boleto
436
437
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
437
438
  attr_accessor :cashapp
439
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
440
+ attr_accessor :crypto
438
441
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
439
442
  attr_accessor :customer_balance
440
443
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -526,6 +529,7 @@ module Stripe
526
529
  blik: nil,
527
530
  boleto: nil,
528
531
  cashapp: nil,
532
+ crypto: nil,
529
533
  customer_balance: nil,
530
534
  eps: nil,
531
535
  fpx: nil,
@@ -579,6 +583,7 @@ module Stripe
579
583
  @blik = blik
580
584
  @boleto = boleto
581
585
  @cashapp = cashapp
586
+ @crypto = crypto
582
587
  @customer_balance = customer_balance
583
588
  @eps = eps
584
589
  @fpx = fpx
@@ -914,7 +919,7 @@ module Stripe
914
919
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
915
920
  # One of `month`.
916
921
  attr_accessor :interval
917
- # Type of installment plan, one of `fixed_count`.
922
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
918
923
  attr_accessor :type
919
924
 
920
925
  def initialize(count: nil, interval: nil, type: nil)
@@ -1192,6 +1197,23 @@ module Stripe
1192
1197
  end
1193
1198
  end
1194
1199
 
1200
+ class Crypto < Stripe::RequestParams
1201
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
1202
+ #
1203
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
1204
+ #
1205
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
1206
+ #
1207
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
1208
+ #
1209
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
1210
+ attr_accessor :setup_future_usage
1211
+
1212
+ def initialize(setup_future_usage: nil)
1213
+ @setup_future_usage = setup_future_usage
1214
+ end
1215
+ end
1216
+
1195
1217
  class CustomerBalance < Stripe::RequestParams
1196
1218
  class BankTransfer < Stripe::RequestParams
1197
1219
  class EuBankTransfer < Stripe::RequestParams
@@ -1349,12 +1371,78 @@ module Stripe
1349
1371
  end
1350
1372
 
1351
1373
  class Klarna < Stripe::RequestParams
1374
+ class OnDemand < Stripe::RequestParams
1375
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
1376
+ attr_accessor :average_amount
1377
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
1378
+ attr_accessor :maximum_amount
1379
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
1380
+ attr_accessor :minimum_amount
1381
+ # Interval at which the customer is making purchases
1382
+ attr_accessor :purchase_interval
1383
+ # The number of `purchase_interval` between charges
1384
+ attr_accessor :purchase_interval_count
1385
+
1386
+ def initialize(
1387
+ average_amount: nil,
1388
+ maximum_amount: nil,
1389
+ minimum_amount: nil,
1390
+ purchase_interval: nil,
1391
+ purchase_interval_count: nil
1392
+ )
1393
+ @average_amount = average_amount
1394
+ @maximum_amount = maximum_amount
1395
+ @minimum_amount = minimum_amount
1396
+ @purchase_interval = purchase_interval
1397
+ @purchase_interval_count = purchase_interval_count
1398
+ end
1399
+ end
1400
+
1401
+ class Subscription < Stripe::RequestParams
1402
+ class NextBilling < Stripe::RequestParams
1403
+ # The amount of the next charge for the subscription.
1404
+ attr_accessor :amount
1405
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
1406
+ attr_accessor :date
1407
+
1408
+ def initialize(amount: nil, date: nil)
1409
+ @amount = amount
1410
+ @date = date
1411
+ end
1412
+ end
1413
+ # Unit of time between subscription charges.
1414
+ attr_accessor :interval
1415
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
1416
+ attr_accessor :interval_count
1417
+ # Name for subscription.
1418
+ attr_accessor :name
1419
+ # Describes the upcoming charge for this subscription.
1420
+ attr_accessor :next_billing
1421
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
1422
+ attr_accessor :reference
1423
+
1424
+ def initialize(
1425
+ interval: nil,
1426
+ interval_count: nil,
1427
+ name: nil,
1428
+ next_billing: nil,
1429
+ reference: nil
1430
+ )
1431
+ @interval = interval
1432
+ @interval_count = interval_count
1433
+ @name = name
1434
+ @next_billing = next_billing
1435
+ @reference = reference
1436
+ end
1437
+ end
1352
1438
  # Controls when the funds are captured from the customer's account.
1353
1439
  #
1354
1440
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
1355
1441
  #
1356
1442
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
1357
1443
  attr_accessor :capture_method
1444
+ # On-demand details if setting up or charging an on-demand payment.
1445
+ attr_accessor :on_demand
1358
1446
  # Preferred language of the Klarna authorization page that the customer is redirected to
1359
1447
  attr_accessor :preferred_locale
1360
1448
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -1367,11 +1455,21 @@ module Stripe
1367
1455
  #
1368
1456
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
1369
1457
  attr_accessor :setup_future_usage
1458
+ # Subscription details if setting up or charging a subscription.
1459
+ attr_accessor :subscriptions
1370
1460
 
1371
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
1461
+ def initialize(
1462
+ capture_method: nil,
1463
+ on_demand: nil,
1464
+ preferred_locale: nil,
1465
+ setup_future_usage: nil,
1466
+ subscriptions: nil
1467
+ )
1372
1468
  @capture_method = capture_method
1469
+ @on_demand = on_demand
1373
1470
  @preferred_locale = preferred_locale
1374
1471
  @setup_future_usage = setup_future_usage
1472
+ @subscriptions = subscriptions
1375
1473
  end
1376
1474
  end
1377
1475
 
@@ -1980,6 +2078,8 @@ module Stripe
1980
2078
  attr_accessor :card_present
1981
2079
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
1982
2080
  attr_accessor :cashapp
2081
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
2082
+ attr_accessor :crypto
1983
2083
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
1984
2084
  attr_accessor :customer_balance
1985
2085
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -2065,6 +2165,7 @@ module Stripe
2065
2165
  card: nil,
2066
2166
  card_present: nil,
2067
2167
  cashapp: nil,
2168
+ crypto: nil,
2068
2169
  customer_balance: nil,
2069
2170
  eps: nil,
2070
2171
  fpx: nil,
@@ -2115,6 +2216,7 @@ module Stripe
2115
2216
  @card = card
2116
2217
  @card_present = card_present
2117
2218
  @cashapp = cashapp
2219
+ @crypto = crypto
2118
2220
  @customer_balance = customer_balance
2119
2221
  @eps = eps
2120
2222
  @fpx = fpx
@@ -2286,7 +2388,7 @@ module Stripe
2286
2388
  attr_accessor :payment_method_data
2287
2389
  # Payment method-specific configuration for this PaymentIntent.
2288
2390
  attr_accessor :payment_method_options
2289
- # The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).
2391
+ # The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
2290
2392
  attr_accessor :payment_method_types
2291
2393
  # Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
2292
2394
  attr_accessor :radar_options
@@ -2512,6 +2614,7 @@ module Stripe
2512
2614
  end
2513
2615
 
2514
2616
  class Cashapp < Stripe::RequestParams; end
2617
+ class Crypto < Stripe::RequestParams; end
2515
2618
  class CustomerBalance < Stripe::RequestParams; end
2516
2619
 
2517
2620
  class Eps < Stripe::RequestParams
@@ -2730,6 +2833,8 @@ module Stripe
2730
2833
  attr_accessor :boleto
2731
2834
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
2732
2835
  attr_accessor :cashapp
2836
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
2837
+ attr_accessor :crypto
2733
2838
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
2734
2839
  attr_accessor :customer_balance
2735
2840
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -2821,6 +2926,7 @@ module Stripe
2821
2926
  blik: nil,
2822
2927
  boleto: nil,
2823
2928
  cashapp: nil,
2929
+ crypto: nil,
2824
2930
  customer_balance: nil,
2825
2931
  eps: nil,
2826
2932
  fpx: nil,
@@ -2874,6 +2980,7 @@ module Stripe
2874
2980
  @blik = blik
2875
2981
  @boleto = boleto
2876
2982
  @cashapp = cashapp
2983
+ @crypto = crypto
2877
2984
  @customer_balance = customer_balance
2878
2985
  @eps = eps
2879
2986
  @fpx = fpx
@@ -3209,7 +3316,7 @@ module Stripe
3209
3316
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
3210
3317
  # One of `month`.
3211
3318
  attr_accessor :interval
3212
- # Type of installment plan, one of `fixed_count`.
3319
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
3213
3320
  attr_accessor :type
3214
3321
 
3215
3322
  def initialize(count: nil, interval: nil, type: nil)
@@ -3487,6 +3594,23 @@ module Stripe
3487
3594
  end
3488
3595
  end
3489
3596
 
3597
+ class Crypto < Stripe::RequestParams
3598
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
3599
+ #
3600
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
3601
+ #
3602
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
3603
+ #
3604
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
3605
+ #
3606
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3607
+ attr_accessor :setup_future_usage
3608
+
3609
+ def initialize(setup_future_usage: nil)
3610
+ @setup_future_usage = setup_future_usage
3611
+ end
3612
+ end
3613
+
3490
3614
  class CustomerBalance < Stripe::RequestParams
3491
3615
  class BankTransfer < Stripe::RequestParams
3492
3616
  class EuBankTransfer < Stripe::RequestParams
@@ -3644,12 +3768,78 @@ module Stripe
3644
3768
  end
3645
3769
 
3646
3770
  class Klarna < Stripe::RequestParams
3771
+ class OnDemand < Stripe::RequestParams
3772
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
3773
+ attr_accessor :average_amount
3774
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
3775
+ attr_accessor :maximum_amount
3776
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
3777
+ attr_accessor :minimum_amount
3778
+ # Interval at which the customer is making purchases
3779
+ attr_accessor :purchase_interval
3780
+ # The number of `purchase_interval` between charges
3781
+ attr_accessor :purchase_interval_count
3782
+
3783
+ def initialize(
3784
+ average_amount: nil,
3785
+ maximum_amount: nil,
3786
+ minimum_amount: nil,
3787
+ purchase_interval: nil,
3788
+ purchase_interval_count: nil
3789
+ )
3790
+ @average_amount = average_amount
3791
+ @maximum_amount = maximum_amount
3792
+ @minimum_amount = minimum_amount
3793
+ @purchase_interval = purchase_interval
3794
+ @purchase_interval_count = purchase_interval_count
3795
+ end
3796
+ end
3797
+
3798
+ class Subscription < Stripe::RequestParams
3799
+ class NextBilling < Stripe::RequestParams
3800
+ # The amount of the next charge for the subscription.
3801
+ attr_accessor :amount
3802
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
3803
+ attr_accessor :date
3804
+
3805
+ def initialize(amount: nil, date: nil)
3806
+ @amount = amount
3807
+ @date = date
3808
+ end
3809
+ end
3810
+ # Unit of time between subscription charges.
3811
+ attr_accessor :interval
3812
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
3813
+ attr_accessor :interval_count
3814
+ # Name for subscription.
3815
+ attr_accessor :name
3816
+ # Describes the upcoming charge for this subscription.
3817
+ attr_accessor :next_billing
3818
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
3819
+ attr_accessor :reference
3820
+
3821
+ def initialize(
3822
+ interval: nil,
3823
+ interval_count: nil,
3824
+ name: nil,
3825
+ next_billing: nil,
3826
+ reference: nil
3827
+ )
3828
+ @interval = interval
3829
+ @interval_count = interval_count
3830
+ @name = name
3831
+ @next_billing = next_billing
3832
+ @reference = reference
3833
+ end
3834
+ end
3647
3835
  # Controls when the funds are captured from the customer's account.
3648
3836
  #
3649
3837
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
3650
3838
  #
3651
3839
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
3652
3840
  attr_accessor :capture_method
3841
+ # On-demand details if setting up or charging an on-demand payment.
3842
+ attr_accessor :on_demand
3653
3843
  # Preferred language of the Klarna authorization page that the customer is redirected to
3654
3844
  attr_accessor :preferred_locale
3655
3845
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -3662,11 +3852,21 @@ module Stripe
3662
3852
  #
3663
3853
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
3664
3854
  attr_accessor :setup_future_usage
3855
+ # Subscription details if setting up or charging a subscription.
3856
+ attr_accessor :subscriptions
3665
3857
 
3666
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
3858
+ def initialize(
3859
+ capture_method: nil,
3860
+ on_demand: nil,
3861
+ preferred_locale: nil,
3862
+ setup_future_usage: nil,
3863
+ subscriptions: nil
3864
+ )
3667
3865
  @capture_method = capture_method
3866
+ @on_demand = on_demand
3668
3867
  @preferred_locale = preferred_locale
3669
3868
  @setup_future_usage = setup_future_usage
3869
+ @subscriptions = subscriptions
3670
3870
  end
3671
3871
  end
3672
3872
 
@@ -4275,6 +4475,8 @@ module Stripe
4275
4475
  attr_accessor :card_present
4276
4476
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
4277
4477
  attr_accessor :cashapp
4478
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
4479
+ attr_accessor :crypto
4278
4480
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
4279
4481
  attr_accessor :customer_balance
4280
4482
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -4360,6 +4562,7 @@ module Stripe
4360
4562
  card: nil,
4361
4563
  card_present: nil,
4362
4564
  cashapp: nil,
4565
+ crypto: nil,
4363
4566
  customer_balance: nil,
4364
4567
  eps: nil,
4365
4568
  fpx: nil,
@@ -4410,6 +4613,7 @@ module Stripe
4410
4613
  @card = card
4411
4614
  @card_present = card_present
4412
4615
  @cashapp = cashapp
4616
+ @crypto = crypto
4413
4617
  @customer_balance = customer_balance
4414
4618
  @eps = eps
4415
4619
  @fpx = fpx
@@ -4536,7 +4740,7 @@ module Stripe
4536
4740
  attr_accessor :payment_method_data
4537
4741
  # Payment-method-specific configuration for this PaymentIntent.
4538
4742
  attr_accessor :payment_method_options
4539
- # The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
4743
+ # The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
4540
4744
  attr_accessor :payment_method_types
4541
4745
  # Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).
4542
4746
  attr_accessor :receipt_email
@@ -4859,6 +5063,7 @@ module Stripe
4859
5063
  end
4860
5064
 
4861
5065
  class Cashapp < Stripe::RequestParams; end
5066
+ class Crypto < Stripe::RequestParams; end
4862
5067
  class CustomerBalance < Stripe::RequestParams; end
4863
5068
 
4864
5069
  class Eps < Stripe::RequestParams
@@ -5077,6 +5282,8 @@ module Stripe
5077
5282
  attr_accessor :boleto
5078
5283
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
5079
5284
  attr_accessor :cashapp
5285
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
5286
+ attr_accessor :crypto
5080
5287
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
5081
5288
  attr_accessor :customer_balance
5082
5289
  # If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.
@@ -5168,6 +5375,7 @@ module Stripe
5168
5375
  blik: nil,
5169
5376
  boleto: nil,
5170
5377
  cashapp: nil,
5378
+ crypto: nil,
5171
5379
  customer_balance: nil,
5172
5380
  eps: nil,
5173
5381
  fpx: nil,
@@ -5221,6 +5429,7 @@ module Stripe
5221
5429
  @blik = blik
5222
5430
  @boleto = boleto
5223
5431
  @cashapp = cashapp
5432
+ @crypto = crypto
5224
5433
  @customer_balance = customer_balance
5225
5434
  @eps = eps
5226
5435
  @fpx = fpx
@@ -5556,7 +5765,7 @@ module Stripe
5556
5765
  # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
5557
5766
  # One of `month`.
5558
5767
  attr_accessor :interval
5559
- # Type of installment plan, one of `fixed_count`.
5768
+ # Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`.
5560
5769
  attr_accessor :type
5561
5770
 
5562
5771
  def initialize(count: nil, interval: nil, type: nil)
@@ -5834,6 +6043,23 @@ module Stripe
5834
6043
  end
5835
6044
  end
5836
6045
 
6046
+ class Crypto < Stripe::RequestParams
6047
+ # Indicates that you intend to make future payments with this PaymentIntent's payment method.
6048
+ #
6049
+ # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes.
6050
+ #
6051
+ # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead.
6052
+ #
6053
+ # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication).
6054
+ #
6055
+ # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6056
+ attr_accessor :setup_future_usage
6057
+
6058
+ def initialize(setup_future_usage: nil)
6059
+ @setup_future_usage = setup_future_usage
6060
+ end
6061
+ end
6062
+
5837
6063
  class CustomerBalance < Stripe::RequestParams
5838
6064
  class BankTransfer < Stripe::RequestParams
5839
6065
  class EuBankTransfer < Stripe::RequestParams
@@ -5991,12 +6217,78 @@ module Stripe
5991
6217
  end
5992
6218
 
5993
6219
  class Klarna < Stripe::RequestParams
6220
+ class OnDemand < Stripe::RequestParams
6221
+ # Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc.
6222
+ attr_accessor :average_amount
6223
+ # The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
6224
+ attr_accessor :maximum_amount
6225
+ # The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc.
6226
+ attr_accessor :minimum_amount
6227
+ # Interval at which the customer is making purchases
6228
+ attr_accessor :purchase_interval
6229
+ # The number of `purchase_interval` between charges
6230
+ attr_accessor :purchase_interval_count
6231
+
6232
+ def initialize(
6233
+ average_amount: nil,
6234
+ maximum_amount: nil,
6235
+ minimum_amount: nil,
6236
+ purchase_interval: nil,
6237
+ purchase_interval_count: nil
6238
+ )
6239
+ @average_amount = average_amount
6240
+ @maximum_amount = maximum_amount
6241
+ @minimum_amount = minimum_amount
6242
+ @purchase_interval = purchase_interval
6243
+ @purchase_interval_count = purchase_interval_count
6244
+ end
6245
+ end
6246
+
6247
+ class Subscription < Stripe::RequestParams
6248
+ class NextBilling < Stripe::RequestParams
6249
+ # The amount of the next charge for the subscription.
6250
+ attr_accessor :amount
6251
+ # The date of the next charge for the subscription in YYYY-MM-DD format.
6252
+ attr_accessor :date
6253
+
6254
+ def initialize(amount: nil, date: nil)
6255
+ @amount = amount
6256
+ @date = date
6257
+ end
6258
+ end
6259
+ # Unit of time between subscription charges.
6260
+ attr_accessor :interval
6261
+ # The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months.
6262
+ attr_accessor :interval_count
6263
+ # Name for subscription.
6264
+ attr_accessor :name
6265
+ # Describes the upcoming charge for this subscription.
6266
+ attr_accessor :next_billing
6267
+ # A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges.
6268
+ attr_accessor :reference
6269
+
6270
+ def initialize(
6271
+ interval: nil,
6272
+ interval_count: nil,
6273
+ name: nil,
6274
+ next_billing: nil,
6275
+ reference: nil
6276
+ )
6277
+ @interval = interval
6278
+ @interval_count = interval_count
6279
+ @name = name
6280
+ @next_billing = next_billing
6281
+ @reference = reference
6282
+ end
6283
+ end
5994
6284
  # Controls when the funds are captured from the customer's account.
5995
6285
  #
5996
6286
  # If provided, this parameter overrides the behavior of the top-level [capture_method](/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type.
5997
6287
  #
5998
6288
  # If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type.
5999
6289
  attr_accessor :capture_method
6290
+ # On-demand details if setting up or charging an on-demand payment.
6291
+ attr_accessor :on_demand
6000
6292
  # Preferred language of the Klarna authorization page that the customer is redirected to
6001
6293
  attr_accessor :preferred_locale
6002
6294
  # Indicates that you intend to make future payments with this PaymentIntent's payment method.
@@ -6009,11 +6301,21 @@ module Stripe
6009
6301
  #
6010
6302
  # If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`.
6011
6303
  attr_accessor :setup_future_usage
6304
+ # Subscription details if setting up or charging a subscription.
6305
+ attr_accessor :subscriptions
6012
6306
 
6013
- def initialize(capture_method: nil, preferred_locale: nil, setup_future_usage: nil)
6307
+ def initialize(
6308
+ capture_method: nil,
6309
+ on_demand: nil,
6310
+ preferred_locale: nil,
6311
+ setup_future_usage: nil,
6312
+ subscriptions: nil
6313
+ )
6014
6314
  @capture_method = capture_method
6315
+ @on_demand = on_demand
6015
6316
  @preferred_locale = preferred_locale
6016
6317
  @setup_future_usage = setup_future_usage
6318
+ @subscriptions = subscriptions
6017
6319
  end
6018
6320
  end
6019
6321
 
@@ -6622,6 +6924,8 @@ module Stripe
6622
6924
  attr_accessor :card_present
6623
6925
  # If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options.
6624
6926
  attr_accessor :cashapp
6927
+ # If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options.
6928
+ attr_accessor :crypto
6625
6929
  # If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options.
6626
6930
  attr_accessor :customer_balance
6627
6931
  # If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options.
@@ -6707,6 +7011,7 @@ module Stripe
6707
7011
  card: nil,
6708
7012
  card_present: nil,
6709
7013
  cashapp: nil,
7014
+ crypto: nil,
6710
7015
  customer_balance: nil,
6711
7016
  eps: nil,
6712
7017
  fpx: nil,
@@ -6757,6 +7062,7 @@ module Stripe
6757
7062
  @card = card
6758
7063
  @card_present = card_present
6759
7064
  @cashapp = cashapp
7065
+ @crypto = crypto
6760
7066
  @customer_balance = customer_balance
6761
7067
  @eps = eps
6762
7068
  @fpx = fpx
@@ -6878,7 +7184,7 @@ module Stripe
6878
7184
  attr_accessor :payment_method_data
6879
7185
  # Payment method-specific configuration for this PaymentIntent.
6880
7186
  attr_accessor :payment_method_options
6881
- # The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).
7187
+ # The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
6882
7188
  attr_accessor :payment_method_types
6883
7189
  # Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session).
6884
7190
  attr_accessor :radar_options
@@ -185,6 +185,7 @@ module Stripe
185
185
  end
186
186
 
187
187
  class Cashapp < Stripe::RequestParams; end
188
+ class Crypto < Stripe::RequestParams; end
188
189
  class CustomerBalance < Stripe::RequestParams; end
189
190
 
190
191
  class Eps < Stripe::RequestParams
@@ -405,6 +406,8 @@ module Stripe
405
406
  attr_accessor :card
406
407
  # If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method.
407
408
  attr_accessor :cashapp
409
+ # If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method.
410
+ attr_accessor :crypto
408
411
  # The `Customer` to whom the original PaymentMethod is attached.
409
412
  attr_accessor :customer
410
413
  # If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
@@ -503,6 +506,7 @@ module Stripe
503
506
  boleto: nil,
504
507
  card: nil,
505
508
  cashapp: nil,
509
+ crypto: nil,
506
510
  customer: nil,
507
511
  customer_balance: nil,
508
512
  eps: nil,
@@ -560,6 +564,7 @@ module Stripe
560
564
  @boleto = boleto
561
565
  @card = card
562
566
  @cashapp = cashapp
567
+ @crypto = crypto
563
568
  @customer = customer
564
569
  @customer_balance = customer_balance
565
570
  @eps = eps
@@ -198,16 +198,33 @@ module Stripe
198
198
  end
199
199
 
200
200
  class SubscriptionData < Stripe::RequestParams
201
+ class BillingMode < Stripe::RequestParams
202
+ # Attribute for param field type
203
+ attr_accessor :type
204
+
205
+ def initialize(type: nil)
206
+ @type = type
207
+ end
208
+ end
209
+ # Controls how prorations and invoices for subscriptions are calculated and orchestrated.
210
+ attr_accessor :billing_mode
201
211
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
202
212
  attr_accessor :description
203
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
213
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
204
214
  attr_accessor :effective_date
205
215
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
206
216
  attr_accessor :metadata
207
217
  # Integer representing the number of trial period days before the customer is charged for the first time.
208
218
  attr_accessor :trial_period_days
209
219
 
210
- def initialize(description: nil, effective_date: nil, metadata: nil, trial_period_days: nil)
220
+ def initialize(
221
+ billing_mode: nil,
222
+ description: nil,
223
+ effective_date: nil,
224
+ metadata: nil,
225
+ trial_period_days: nil
226
+ )
227
+ @billing_mode = billing_mode
211
228
  @description = description
212
229
  @effective_date = effective_date
213
230
  @metadata = metadata
@@ -476,7 +493,7 @@ module Stripe
476
493
  class SubscriptionData < Stripe::RequestParams
477
494
  # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs.
478
495
  attr_accessor :description
479
- # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted.
496
+ # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted.
480
497
  attr_accessor :effective_date
481
498
  # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values.
482
499
  attr_accessor :metadata