Class: CurrentApiVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/stripe/current_api_version.rb

Class Method Summary collapse

Class Method Details

.after_switch_to_products_in_plans?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/stripe/current_api_version.rb', line 9

def self.after_switch_to_products_in_plans?
  Date.parse(call) >= Date.parse('2018-02-05')
end

.callObject



2
3
4
5
6
7
# File 'lib/stripe/current_api_version.rb', line 2

def self.call
  Stripe.api_version || begin
    resp, _ = Stripe::Plan.request(:get, Stripe::Plan.resource_url)
    resp.http_headers['stripe-version']
  end
end