Class: PayjpMock::Response::Resource::Customer

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

Constant Summary collapse

PREFIX =
'cus'.freeze
OBJECT =
'customer'.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



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/payjp_mock/response/resource/customer.rb', line 6

def default_attributes
  id = generate_resource_id(PREFIX)

  {
    cards:         PayjpMock::Response::List.new("/customers/#{id}/cards").to_h,
    created:       Time.now.to_i,
    default_card:  nil,
    description:   'test',
    email:         nil,
    id:            id,
    livemode:      false,
    metadata:      nil,
    object:        OBJECT,
    subscriptions: PayjpMock::Response::List.new("/customers/#{id}/subscriptions").to_h
  }
end

#override(attributes) ⇒ Object



23
24
# File 'lib/payjp_mock/response/resource/customer.rb', line 23

def override(attributes)
end