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.
- checksums.yaml +4 -4
- data/API_VERSION +1 -0
- data/CHANGELOG.md +66 -39
- data/OPENAPI_VERSION +1 -1
- data/README.md +14 -50
- data/VERSION +1 -1
- data/lib/stripe/api_version.rb +2 -1
- data/lib/stripe/events/v2_core_event_destination_ping_event.rb +1 -1
- data/lib/stripe/resources/account.rb +89 -5
- data/lib/stripe/resources/account_session.rb +79 -79
- data/lib/stripe/resources/billing_portal/session.rb +2 -2
- data/lib/stripe/resources/charge.rb +28 -15
- data/lib/stripe/resources/checkout/session.rb +57 -7
- data/lib/stripe/resources/confirmation_token.rb +19 -11
- data/lib/stripe/resources/credit_note.rb +9 -9
- data/lib/stripe/resources/customer_session.rb +2 -2
- data/lib/stripe/resources/event.rb +1 -1
- data/lib/stripe/resources/identity/verification_session.rb +34 -0
- data/lib/stripe/resources/invoice.rb +29 -4
- data/lib/stripe/resources/invoice_item.rb +1 -4
- data/lib/stripe/resources/mandate.rb +3 -0
- data/lib/stripe/resources/payment_intent.rb +331 -12
- data/lib/stripe/resources/payment_method.rb +17 -9
- data/lib/stripe/resources/quote.rb +26 -3
- data/lib/stripe/resources/setup_attempt.rb +1 -1
- data/lib/stripe/resources/setup_intent.rb +285 -3
- data/lib/stripe/resources/subscription.rb +68 -6
- data/lib/stripe/resources/subscription_schedule.rb +22 -0
- data/lib/stripe/resources/tax/registration.rb +20 -0
- data/lib/stripe/resources/terminal/configuration.rb +1 -0
- data/lib/stripe/resources/terminal/reader.rb +152 -4
- data/lib/stripe/resources/token.rb +1 -1
- data/lib/stripe/resources/treasury/financial_account.rb +5 -1
- data/lib/stripe/services/account_service.rb +83 -5
- data/lib/stripe/services/account_session_service.rb +48 -48
- data/lib/stripe/services/billing_portal/session_service.rb +1 -1
- data/lib/stripe/services/checkout/session_service.rb +57 -7
- data/lib/stripe/services/credit_note_preview_lines_service.rb +3 -3
- data/lib/stripe/services/credit_note_service.rb +6 -6
- data/lib/stripe/services/customer_session_service.rb +1 -1
- data/lib/stripe/services/identity/verification_session_service.rb +16 -0
- data/lib/stripe/services/invoice_service.rb +29 -4
- data/lib/stripe/services/payment_intent_service.rb +315 -9
- data/lib/stripe/services/payment_method_service.rb +5 -0
- data/lib/stripe/services/quote_service.rb +20 -3
- data/lib/stripe/services/setup_intent_service.rb +275 -2
- data/lib/stripe/services/subscription_schedule_service.rb +13 -0
- data/lib/stripe/services/subscription_service.rb +48 -4
- data/lib/stripe/services/tax/registration_service.rb +13 -0
- data/lib/stripe/services/terminal/reader_service.rb +90 -0
- data/lib/stripe/services/test_helpers/confirmation_token_service.rb +6 -1
- data/lib/stripe/services/token_service.rb +1 -1
- data/lib/stripe/services/treasury/financial_account_service.rb +5 -1
- data/lib/stripe/services/v2/billing_service.rb +2 -2
- data/lib/stripe/services/v2/core/event_destination_service.rb +16 -16
- data/lib/stripe/version.rb +1 -1
- data/rbi/stripe/resources/account.rbi +78 -9
- data/rbi/stripe/resources/account_session.rbi +79 -79
- data/rbi/stripe/resources/billing_portal/session.rbi +2 -2
- data/rbi/stripe/resources/charge.rbi +32 -15
- data/rbi/stripe/resources/checkout/session.rbi +65 -9
- data/rbi/stripe/resources/confirmation_token.rbi +23 -12
- data/rbi/stripe/resources/credit_note.rbi +9 -9
- data/rbi/stripe/resources/customer_session.rbi +2 -2
- data/rbi/stripe/resources/event.rbi +1 -1
- data/rbi/stripe/resources/identity/verification_session.rbi +39 -1
- data/rbi/stripe/resources/invoice.rbi +36 -6
- data/rbi/stripe/resources/invoice_item.rbi +1 -4
- data/rbi/stripe/resources/mandate.rbi +4 -0
- data/rbi/stripe/resources/payment_intent.rbi +361 -21
- data/rbi/stripe/resources/payment_method.rbi +19 -10
- data/rbi/stripe/resources/quote.rbi +22 -3
- data/rbi/stripe/resources/setup_attempt.rbi +1 -1
- data/rbi/stripe/resources/setup_intent.rbi +332 -9
- data/rbi/stripe/resources/subscription.rbi +60 -7
- data/rbi/stripe/resources/subscription_schedule.rbi +23 -1
- data/rbi/stripe/resources/tax/registration.rbi +20 -1
- data/rbi/stripe/resources/terminal/configuration.rbi +1 -0
- data/rbi/stripe/resources/terminal/location.rbi +2 -2
- data/rbi/stripe/resources/terminal/reader.rbi +151 -4
- data/rbi/stripe/resources/token.rbi +1 -1
- data/rbi/stripe/resources/treasury/financial_account.rbi +6 -2
- data/rbi/stripe/services/account_service.rbi +77 -9
- data/rbi/stripe/services/account_session_service.rbi +48 -48
- data/rbi/stripe/services/billing_portal/session_service.rbi +1 -1
- data/rbi/stripe/services/checkout/session_service.rbi +65 -9
- data/rbi/stripe/services/credit_note_preview_lines_service.rbi +3 -3
- data/rbi/stripe/services/credit_note_service.rbi +6 -6
- data/rbi/stripe/services/customer_session_service.rbi +1 -1
- data/rbi/stripe/services/identity/verification_session_service.rbi +17 -1
- data/rbi/stripe/services/invoice_service.rbi +36 -6
- data/rbi/stripe/services/payment_intent_service.rbi +348 -18
- data/rbi/stripe/services/payment_method_service.rbi +6 -1
- data/rbi/stripe/services/quote_service.rbi +16 -3
- data/rbi/stripe/services/setup_intent_service.rbi +326 -8
- data/rbi/stripe/services/subscription_schedule_service.rbi +12 -1
- data/rbi/stripe/services/subscription_service.rbi +41 -5
- data/rbi/stripe/services/tax/registration_service.rbi +14 -1
- data/rbi/stripe/services/terminal/location_service.rbi +2 -2
- data/rbi/stripe/services/terminal/reader_service.rbi +85 -0
- data/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +9 -2
- data/rbi/stripe/services/token_service.rbi +1 -1
- data/rbi/stripe/services/treasury/financial_account_service.rbi +6 -2
- data/rbi/stripe/services/v2/billing_service.rbi +1 -1
- data/rbi/stripe/services/v2/core/event_destination_service.rbi +13 -13
- metadata +3 -2
@@ -44,6 +44,13 @@ module Stripe
|
|
44
44
|
attr_reader :second
|
45
45
|
end
|
46
46
|
|
47
|
+
class BillingMode < Stripe::StripeObject
|
48
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
49
|
+
attr_reader :type
|
50
|
+
# Details on when the current billing_mode was adopted.
|
51
|
+
attr_reader :updated_at
|
52
|
+
end
|
53
|
+
|
47
54
|
class BillingThresholds < Stripe::StripeObject
|
48
55
|
# Monetary threshold that triggers the subscription to create an invoice
|
49
56
|
attr_reader :amount_gte
|
@@ -747,7 +754,7 @@ module Stripe
|
|
747
754
|
attr_accessor :billing_thresholds
|
748
755
|
# A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
|
749
756
|
attr_accessor :cancel_at
|
750
|
-
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
|
757
|
+
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
|
751
758
|
attr_accessor :cancel_at_period_end
|
752
759
|
# Details about why this subscription was cancelled
|
753
760
|
attr_accessor :cancellation_details
|
@@ -1105,6 +1112,15 @@ module Stripe
|
|
1105
1112
|
end
|
1106
1113
|
end
|
1107
1114
|
|
1115
|
+
class BillingMode < Stripe::RequestParams
|
1116
|
+
# Attribute for param field type
|
1117
|
+
attr_accessor :type
|
1118
|
+
|
1119
|
+
def initialize(type: nil)
|
1120
|
+
@type = type
|
1121
|
+
end
|
1122
|
+
end
|
1123
|
+
|
1108
1124
|
class BillingThresholds < Stripe::RequestParams
|
1109
1125
|
# Monetary threshold that triggers the subscription to advance to a new billing period
|
1110
1126
|
attr_accessor :amount_gte
|
@@ -1481,19 +1497,21 @@ module Stripe
|
|
1481
1497
|
attr_accessor :add_invoice_items
|
1482
1498
|
# A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).
|
1483
1499
|
attr_accessor :application_fee_percent
|
1484
|
-
# Automatic tax settings for this subscription.
|
1500
|
+
# Automatic tax settings for this subscription.
|
1485
1501
|
attr_accessor :automatic_tax
|
1486
|
-
#
|
1502
|
+
# A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.
|
1487
1503
|
attr_accessor :backdate_start_date
|
1488
1504
|
# A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals.
|
1489
1505
|
attr_accessor :billing_cycle_anchor
|
1490
1506
|
# Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC.
|
1491
1507
|
attr_accessor :billing_cycle_anchor_config
|
1508
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
1509
|
+
attr_accessor :billing_mode
|
1492
1510
|
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
|
1493
1511
|
attr_accessor :billing_thresholds
|
1494
1512
|
# A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
|
1495
1513
|
attr_accessor :cancel_at
|
1496
|
-
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
|
1514
|
+
# Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`.
|
1497
1515
|
attr_accessor :cancel_at_period_end
|
1498
1516
|
# Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.
|
1499
1517
|
attr_accessor :collection_method
|
@@ -1561,6 +1579,7 @@ module Stripe
|
|
1561
1579
|
backdate_start_date: nil,
|
1562
1580
|
billing_cycle_anchor: nil,
|
1563
1581
|
billing_cycle_anchor_config: nil,
|
1582
|
+
billing_mode: nil,
|
1564
1583
|
billing_thresholds: nil,
|
1565
1584
|
cancel_at: nil,
|
1566
1585
|
cancel_at_period_end: nil,
|
@@ -1595,6 +1614,7 @@ module Stripe
|
|
1595
1614
|
@backdate_start_date = backdate_start_date
|
1596
1615
|
@billing_cycle_anchor = billing_cycle_anchor
|
1597
1616
|
@billing_cycle_anchor_config = billing_cycle_anchor_config
|
1617
|
+
@billing_mode = billing_mode
|
1598
1618
|
@billing_thresholds = billing_thresholds
|
1599
1619
|
@cancel_at = cancel_at
|
1600
1620
|
@cancel_at_period_end = cancel_at_period_end
|
@@ -1643,6 +1663,26 @@ module Stripe
|
|
1643
1663
|
end
|
1644
1664
|
end
|
1645
1665
|
|
1666
|
+
class MigrateParams < Stripe::RequestParams
|
1667
|
+
class BillingMode < Stripe::RequestParams
|
1668
|
+
# Attribute for param field type
|
1669
|
+
attr_accessor :type
|
1670
|
+
|
1671
|
+
def initialize(type: nil)
|
1672
|
+
@type = type
|
1673
|
+
end
|
1674
|
+
end
|
1675
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
1676
|
+
attr_accessor :billing_mode
|
1677
|
+
# Specifies which fields in the response should be expanded.
|
1678
|
+
attr_accessor :expand
|
1679
|
+
|
1680
|
+
def initialize(billing_mode: nil, expand: nil)
|
1681
|
+
@billing_mode = billing_mode
|
1682
|
+
@expand = expand
|
1683
|
+
end
|
1684
|
+
end
|
1685
|
+
|
1646
1686
|
class ResumeParams < Stripe::RequestParams
|
1647
1687
|
# The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
|
1648
1688
|
attr_accessor :billing_cycle_anchor
|
@@ -1675,11 +1715,13 @@ module Stripe
|
|
1675
1715
|
attr_reader :billing_cycle_anchor
|
1676
1716
|
# The fixed values used to calculate the `billing_cycle_anchor`.
|
1677
1717
|
attr_reader :billing_cycle_anchor_config
|
1718
|
+
# The billing mode of the subscription.
|
1719
|
+
attr_reader :billing_mode
|
1678
1720
|
# Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period
|
1679
1721
|
attr_reader :billing_thresholds
|
1680
1722
|
# A date in the future at which the subscription will automatically get canceled
|
1681
1723
|
attr_reader :cancel_at
|
1682
|
-
# Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
|
1724
|
+
# Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period.
|
1683
1725
|
attr_reader :cancel_at_period_end
|
1684
1726
|
# If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
|
1685
1727
|
attr_reader :canceled_at
|
@@ -1759,7 +1801,7 @@ module Stripe
|
|
1759
1801
|
attr_reader :trial_end
|
1760
1802
|
# Settings related to subscription trials.
|
1761
1803
|
attr_reader :trial_settings
|
1762
|
-
# If the subscription has a trial, the beginning of that trial.
|
1804
|
+
# If the subscription has a trial, the beginning of that trial.
|
1763
1805
|
attr_reader :trial_start
|
1764
1806
|
|
1765
1807
|
# 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).
|
@@ -1826,6 +1868,26 @@ module Stripe
|
|
1826
1868
|
request_stripe_object(method: :get, path: "/v1/subscriptions", params: params, opts: opts)
|
1827
1869
|
end
|
1828
1870
|
|
1871
|
+
# Upgrade the billing_mode of an existing subscription.
|
1872
|
+
def migrate(params = {}, opts = {})
|
1873
|
+
request_stripe_object(
|
1874
|
+
method: :post,
|
1875
|
+
path: format("/v1/subscriptions/%<subscription>s/migrate", { subscription: CGI.escape(self["id"]) }),
|
1876
|
+
params: params,
|
1877
|
+
opts: opts
|
1878
|
+
)
|
1879
|
+
end
|
1880
|
+
|
1881
|
+
# Upgrade the billing_mode of an existing subscription.
|
1882
|
+
def self.migrate(subscription, params = {}, opts = {})
|
1883
|
+
request_stripe_object(
|
1884
|
+
method: :post,
|
1885
|
+
path: format("/v1/subscriptions/%<subscription>s/migrate", { subscription: CGI.escape(subscription) }),
|
1886
|
+
params: params,
|
1887
|
+
opts: opts
|
1888
|
+
)
|
1889
|
+
end
|
1890
|
+
|
1829
1891
|
# Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
|
1830
1892
|
def resume(params = {}, opts = {})
|
1831
1893
|
request_stripe_object(
|
@@ -15,6 +15,13 @@ module Stripe
|
|
15
15
|
"subscription_schedule"
|
16
16
|
end
|
17
17
|
|
18
|
+
class BillingMode < Stripe::StripeObject
|
19
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
20
|
+
attr_reader :type
|
21
|
+
# Details on when the current billing_mode was adopted.
|
22
|
+
attr_reader :updated_at
|
23
|
+
end
|
24
|
+
|
18
25
|
class CurrentPhase < Stripe::StripeObject
|
19
26
|
# The end of this phase of the subscription schedule.
|
20
27
|
attr_reader :end_date
|
@@ -351,6 +358,15 @@ module Stripe
|
|
351
358
|
end
|
352
359
|
|
353
360
|
class CreateParams < Stripe::RequestParams
|
361
|
+
class BillingMode < Stripe::RequestParams
|
362
|
+
# Attribute for param field type
|
363
|
+
attr_accessor :type
|
364
|
+
|
365
|
+
def initialize(type: nil)
|
366
|
+
@type = type
|
367
|
+
end
|
368
|
+
end
|
369
|
+
|
354
370
|
class DefaultSettings < Stripe::RequestParams
|
355
371
|
class AutomaticTax < Stripe::RequestParams
|
356
372
|
class Liability < Stripe::RequestParams
|
@@ -813,6 +829,8 @@ module Stripe
|
|
813
829
|
@trial_end = trial_end
|
814
830
|
end
|
815
831
|
end
|
832
|
+
# Controls how prorations and invoices for subscriptions are calculated and orchestrated.
|
833
|
+
attr_accessor :billing_mode
|
816
834
|
# The identifier of the customer to create the subscription schedule for.
|
817
835
|
attr_accessor :customer
|
818
836
|
# Object representing the subscription schedule's default settings.
|
@@ -831,6 +849,7 @@ module Stripe
|
|
831
849
|
attr_accessor :start_date
|
832
850
|
|
833
851
|
def initialize(
|
852
|
+
billing_mode: nil,
|
834
853
|
customer: nil,
|
835
854
|
default_settings: nil,
|
836
855
|
end_behavior: nil,
|
@@ -840,6 +859,7 @@ module Stripe
|
|
840
859
|
phases: nil,
|
841
860
|
start_date: nil
|
842
861
|
)
|
862
|
+
@billing_mode = billing_mode
|
843
863
|
@customer = customer
|
844
864
|
@default_settings = default_settings
|
845
865
|
@end_behavior = end_behavior
|
@@ -1376,6 +1396,8 @@ module Stripe
|
|
1376
1396
|
end
|
1377
1397
|
# ID of the Connect Application that created the schedule.
|
1378
1398
|
attr_reader :application
|
1399
|
+
# The billing mode of the subscription.
|
1400
|
+
attr_reader :billing_mode
|
1379
1401
|
# Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
|
1380
1402
|
attr_reader :canceled_at
|
1381
1403
|
# Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
|
@@ -637,6 +637,11 @@ module Stripe
|
|
637
637
|
attr_reader :type
|
638
638
|
end
|
639
639
|
|
640
|
+
class Ua < Stripe::StripeObject
|
641
|
+
# Type of registration in `country`.
|
642
|
+
attr_reader :type
|
643
|
+
end
|
644
|
+
|
640
645
|
class Ug < Stripe::StripeObject
|
641
646
|
# Type of registration in `country`.
|
642
647
|
attr_reader :type
|
@@ -884,6 +889,8 @@ module Stripe
|
|
884
889
|
attr_reader :tr
|
885
890
|
# Attribute for field tz
|
886
891
|
attr_reader :tz
|
892
|
+
# Attribute for field ua
|
893
|
+
attr_reader :ua
|
887
894
|
# Attribute for field ug
|
888
895
|
attr_reader :ug
|
889
896
|
# Attribute for field us
|
@@ -2049,6 +2056,15 @@ module Stripe
|
|
2049
2056
|
end
|
2050
2057
|
end
|
2051
2058
|
|
2059
|
+
class Ua < Stripe::RequestParams
|
2060
|
+
# Type of registration to be created in `country`.
|
2061
|
+
attr_accessor :type
|
2062
|
+
|
2063
|
+
def initialize(type: nil)
|
2064
|
+
@type = type
|
2065
|
+
end
|
2066
|
+
end
|
2067
|
+
|
2052
2068
|
class Ug < Stripe::RequestParams
|
2053
2069
|
# Type of registration to be created in `country`.
|
2054
2070
|
attr_accessor :type
|
@@ -2355,6 +2371,8 @@ module Stripe
|
|
2355
2371
|
attr_accessor :tr
|
2356
2372
|
# Options for the registration in TZ.
|
2357
2373
|
attr_accessor :tz
|
2374
|
+
# Options for the registration in UA.
|
2375
|
+
attr_accessor :ua
|
2358
2376
|
# Options for the registration in UG.
|
2359
2377
|
attr_accessor :ug
|
2360
2378
|
# Options for the registration in US.
|
@@ -2463,6 +2481,7 @@ module Stripe
|
|
2463
2481
|
tj: nil,
|
2464
2482
|
tr: nil,
|
2465
2483
|
tz: nil,
|
2484
|
+
ua: nil,
|
2466
2485
|
ug: nil,
|
2467
2486
|
us: nil,
|
2468
2487
|
uy: nil,
|
@@ -2562,6 +2581,7 @@ module Stripe
|
|
2562
2581
|
@tj = tj
|
2563
2582
|
@tr = tr
|
2564
2583
|
@tz = tz
|
2584
|
+
@ua = ua
|
2565
2585
|
@ug = ug
|
2566
2586
|
@us = us
|
2567
2587
|
@uy = uy
|
@@ -4,6 +4,7 @@
|
|
4
4
|
module Stripe
|
5
5
|
module Terminal
|
6
6
|
# A Configurations object represents how features should be configured for terminal readers.
|
7
|
+
# For information about how to use it, see the [Terminal configurations documentation](https://docs.stripe.com/terminal/fleet/configurations-overview).
|
7
8
|
class Configuration < APIResource
|
8
9
|
extend Stripe::APIOperations::Create
|
9
10
|
include Stripe::APIOperations::Delete
|
@@ -112,15 +112,51 @@ module Stripe
|
|
112
112
|
attr_reader :metadata
|
113
113
|
end
|
114
114
|
|
115
|
+
class CollectPaymentMethod < Stripe::StripeObject
|
116
|
+
class CollectConfig < Stripe::StripeObject
|
117
|
+
class Tipping < Stripe::StripeObject
|
118
|
+
# Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
|
119
|
+
attr_reader :amount_eligible
|
120
|
+
end
|
121
|
+
# Enable customer-initiated cancellation when processing this payment.
|
122
|
+
attr_reader :enable_customer_cancellation
|
123
|
+
# Override showing a tipping selection screen on this transaction.
|
124
|
+
attr_reader :skip_tipping
|
125
|
+
# Represents a per-transaction tipping configuration
|
126
|
+
attr_reader :tipping
|
127
|
+
end
|
128
|
+
# Represents a per-transaction override of a reader configuration
|
129
|
+
attr_reader :collect_config
|
130
|
+
# Most recent PaymentIntent processed by the reader.
|
131
|
+
attr_reader :payment_intent
|
132
|
+
# PaymentMethod objects represent your customer's payment instruments.
|
133
|
+
# You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
|
134
|
+
# Customer objects to store instrument details for future payments.
|
135
|
+
#
|
136
|
+
# Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
|
137
|
+
attr_reader :payment_method
|
138
|
+
end
|
139
|
+
|
140
|
+
class ConfirmPaymentIntent < Stripe::StripeObject
|
141
|
+
class ConfirmConfig < Stripe::StripeObject
|
142
|
+
# If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion.
|
143
|
+
attr_reader :return_url
|
144
|
+
end
|
145
|
+
# Represents a per-transaction override of a reader configuration
|
146
|
+
attr_reader :confirm_config
|
147
|
+
# Most recent PaymentIntent processed by the reader.
|
148
|
+
attr_reader :payment_intent
|
149
|
+
end
|
150
|
+
|
115
151
|
class ProcessPaymentIntent < Stripe::StripeObject
|
116
152
|
class ProcessConfig < Stripe::StripeObject
|
117
153
|
class Tipping < Stripe::StripeObject
|
118
154
|
# Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
|
119
155
|
attr_reader :amount_eligible
|
120
156
|
end
|
121
|
-
# Enable customer
|
157
|
+
# Enable customer-initiated cancellation when processing this payment.
|
122
158
|
attr_reader :enable_customer_cancellation
|
123
|
-
# If the customer
|
159
|
+
# If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion.
|
124
160
|
attr_reader :return_url
|
125
161
|
# Override showing a tipping selection screen on this transaction.
|
126
162
|
attr_reader :skip_tipping
|
@@ -135,7 +171,7 @@ module Stripe
|
|
135
171
|
|
136
172
|
class ProcessSetupIntent < Stripe::StripeObject
|
137
173
|
class ProcessConfig < Stripe::StripeObject
|
138
|
-
# Enable customer
|
174
|
+
# Enable customer-initiated cancellation when processing this SetupIntent.
|
139
175
|
attr_reader :enable_customer_cancellation
|
140
176
|
end
|
141
177
|
# ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.
|
@@ -148,7 +184,7 @@ module Stripe
|
|
148
184
|
|
149
185
|
class RefundPayment < Stripe::StripeObject
|
150
186
|
class RefundPaymentConfig < Stripe::StripeObject
|
151
|
-
# Enable customer
|
187
|
+
# Enable customer-initiated cancellation when refunding this payment.
|
152
188
|
attr_reader :enable_customer_cancellation
|
153
189
|
end
|
154
190
|
# The amount being refunded.
|
@@ -197,6 +233,10 @@ module Stripe
|
|
197
233
|
end
|
198
234
|
# Represents a reader action to collect customer inputs
|
199
235
|
attr_reader :collect_inputs
|
236
|
+
# Represents a reader action to collect a payment method
|
237
|
+
attr_reader :collect_payment_method
|
238
|
+
# Represents a reader action to confirm a payment
|
239
|
+
attr_reader :confirm_payment_intent
|
200
240
|
# Failure code, only set if status is `failed`.
|
201
241
|
attr_reader :failure_code
|
202
242
|
# Detailed failure message, only set if status is `failed`.
|
@@ -397,6 +437,74 @@ module Stripe
|
|
397
437
|
end
|
398
438
|
end
|
399
439
|
|
440
|
+
class CollectPaymentMethodParams < Stripe::RequestParams
|
441
|
+
class CollectConfig < Stripe::RequestParams
|
442
|
+
class Tipping < Stripe::RequestParams
|
443
|
+
# Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).
|
444
|
+
attr_accessor :amount_eligible
|
445
|
+
|
446
|
+
def initialize(amount_eligible: nil)
|
447
|
+
@amount_eligible = amount_eligible
|
448
|
+
end
|
449
|
+
end
|
450
|
+
# This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
|
451
|
+
attr_accessor :allow_redisplay
|
452
|
+
# Enables cancel button on transaction screens.
|
453
|
+
attr_accessor :enable_customer_cancellation
|
454
|
+
# Override showing a tipping selection screen on this transaction.
|
455
|
+
attr_accessor :skip_tipping
|
456
|
+
# Tipping configuration for this transaction.
|
457
|
+
attr_accessor :tipping
|
458
|
+
|
459
|
+
def initialize(
|
460
|
+
allow_redisplay: nil,
|
461
|
+
enable_customer_cancellation: nil,
|
462
|
+
skip_tipping: nil,
|
463
|
+
tipping: nil
|
464
|
+
)
|
465
|
+
@allow_redisplay = allow_redisplay
|
466
|
+
@enable_customer_cancellation = enable_customer_cancellation
|
467
|
+
@skip_tipping = skip_tipping
|
468
|
+
@tipping = tipping
|
469
|
+
end
|
470
|
+
end
|
471
|
+
# Configuration overrides.
|
472
|
+
attr_accessor :collect_config
|
473
|
+
# Specifies which fields in the response should be expanded.
|
474
|
+
attr_accessor :expand
|
475
|
+
# PaymentIntent ID.
|
476
|
+
attr_accessor :payment_intent
|
477
|
+
|
478
|
+
def initialize(collect_config: nil, expand: nil, payment_intent: nil)
|
479
|
+
@collect_config = collect_config
|
480
|
+
@expand = expand
|
481
|
+
@payment_intent = payment_intent
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
class ConfirmPaymentIntentParams < Stripe::RequestParams
|
486
|
+
class ConfirmConfig < Stripe::RequestParams
|
487
|
+
# The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme.
|
488
|
+
attr_accessor :return_url
|
489
|
+
|
490
|
+
def initialize(return_url: nil)
|
491
|
+
@return_url = return_url
|
492
|
+
end
|
493
|
+
end
|
494
|
+
# Configuration overrides.
|
495
|
+
attr_accessor :confirm_config
|
496
|
+
# Specifies which fields in the response should be expanded.
|
497
|
+
attr_accessor :expand
|
498
|
+
# PaymentIntent ID.
|
499
|
+
attr_accessor :payment_intent
|
500
|
+
|
501
|
+
def initialize(confirm_config: nil, expand: nil, payment_intent: nil)
|
502
|
+
@confirm_config = confirm_config
|
503
|
+
@expand = expand
|
504
|
+
@payment_intent = payment_intent
|
505
|
+
end
|
506
|
+
end
|
507
|
+
|
400
508
|
class ProcessPaymentIntentParams < Stripe::RequestParams
|
401
509
|
class ProcessConfig < Stripe::RequestParams
|
402
510
|
class Tipping < Stripe::RequestParams
|
@@ -696,6 +804,46 @@ module Stripe
|
|
696
804
|
)
|
697
805
|
end
|
698
806
|
|
807
|
+
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
|
808
|
+
def collect_payment_method(params = {}, opts = {})
|
809
|
+
request_stripe_object(
|
810
|
+
method: :post,
|
811
|
+
path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }),
|
812
|
+
params: params,
|
813
|
+
opts: opts
|
814
|
+
)
|
815
|
+
end
|
816
|
+
|
817
|
+
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
|
818
|
+
def self.collect_payment_method(reader, params = {}, opts = {})
|
819
|
+
request_stripe_object(
|
820
|
+
method: :post,
|
821
|
+
path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
|
822
|
+
params: params,
|
823
|
+
opts: opts
|
824
|
+
)
|
825
|
+
end
|
826
|
+
|
827
|
+
# Finalizes a payment on a Reader.
|
828
|
+
def confirm_payment_intent(params = {}, opts = {})
|
829
|
+
request_stripe_object(
|
830
|
+
method: :post,
|
831
|
+
path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }),
|
832
|
+
params: params,
|
833
|
+
opts: opts
|
834
|
+
)
|
835
|
+
end
|
836
|
+
|
837
|
+
# Finalizes a payment on a Reader.
|
838
|
+
def self.confirm_payment_intent(reader, params = {}, opts = {})
|
839
|
+
request_stripe_object(
|
840
|
+
method: :post,
|
841
|
+
path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
|
842
|
+
params: params,
|
843
|
+
opts: opts
|
844
|
+
)
|
845
|
+
end
|
846
|
+
|
699
847
|
# Creates a new Reader object.
|
700
848
|
def self.create(params = {}, opts = {})
|
701
849
|
request_stripe_object(
|
@@ -230,7 +230,7 @@ module Stripe
|
|
230
230
|
attr_accessor :ownership_exemption_reason
|
231
231
|
# The company's phone number (used for verification).
|
232
232
|
attr_accessor :phone
|
233
|
-
#
|
233
|
+
# When the business was incorporated or registered.
|
234
234
|
attr_accessor :registration_date
|
235
235
|
# The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).
|
236
236
|
attr_accessor :registration_number
|
@@ -89,19 +89,23 @@ module Stripe
|
|
89
89
|
attr_accessor :limit
|
90
90
|
# An object ID cursor for use in pagination.
|
91
91
|
attr_accessor :starting_after
|
92
|
+
# Only return FinancialAccounts that have the given status: `open` or `closed`
|
93
|
+
attr_accessor :status
|
92
94
|
|
93
95
|
def initialize(
|
94
96
|
created: nil,
|
95
97
|
ending_before: nil,
|
96
98
|
expand: nil,
|
97
99
|
limit: nil,
|
98
|
-
starting_after: nil
|
100
|
+
starting_after: nil,
|
101
|
+
status: nil
|
99
102
|
)
|
100
103
|
@created = created
|
101
104
|
@ending_before = ending_before
|
102
105
|
@expand = expand
|
103
106
|
@limit = limit
|
104
107
|
@starting_after = starting_after
|
108
|
+
@status = status
|
105
109
|
end
|
106
110
|
end
|
107
111
|
|