Class: PayjpMock::Response::Resource::Subscription

Inherits:
Base
  • Object
show all
Defined in:
lib/payjp_mock/response/resource/subscription.rb

Constant Summary collapse

PREFIX =
'sub'.freeze
OBJECT =
'subscription'.freeze

Instance Attribute Summary

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

#initialize, #status

Methods included from Util

#generate_fingerprint, #generate_resource_id

Methods inherited from Base

#body, #exception, #status, #to_h

Constructor Details

This class inherits a constructor from PayjpMock::Response::Resource::Base

Instance Method Details

#default_attributesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/payjp_mock/response/resource/subscription.rb', line 8

def default_attributes
  now = Time.now.to_i

  {
    canceled_at:          nil,
    created:              now,
    current_period_end:   now + 15.days,
    current_period_start: now - 15.days,
    customer:             generate_resource_id(Customer::PREFIX),
    id:                   generate_resource_id(PREFIX),
    livemode:             false,
    metadata:             nil,
    object:               OBJECT,
    paused_at:            nil,
    plan:                 Plan.new.to_h,
    resumed_at:           nil,
    start:                now - 15.days,
    status:               'active',
    trial_end:            nil,
    trial_start:          nil,
    prorate:              false
  }
end