Class: Stripe::PaymentLocation

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Delete, APIOperations::Save
Defined in:
lib/stripe/resources/payment_location.rb

Overview

A Payment Location represents a physical location where payments take place.

Defined Under Namespace

Classes: Address, BusinessRegistration, CapabilitySettings

Constant Summary collapse

OBJECT_NAME =
"payment_location"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods included from APIOperations::Delete

included

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#addressObject (readonly)

Attribute for field address



92
93
94
# File 'lib/stripe/resources/payment_location.rb', line 92

def address
  @address
end

#business_registrationObject (readonly)

Identification numbers associated with the location.



94
95
96
# File 'lib/stripe/resources/payment_location.rb', line 94

def business_registration
  @business_registration
end

#capability_settingsObject (readonly)

The capability settings for the location. Only applicable for locations with requested payment location capabilities.



96
97
98
# File 'lib/stripe/resources/payment_location.rb', line 96

def capability_settings
  @capability_settings
end

#deletedObject (readonly)

Always true for a deleted object



98
99
100
# File 'lib/stripe/resources/payment_location.rb', line 98

def deleted
  @deleted
end

#display_nameObject (readonly)

The display name of the location.



100
101
102
# File 'lib/stripe/resources/payment_location.rb', line 100

def display_name
  @display_name
end

#idObject (readonly)

Unique identifier for the object.



102
103
104
# File 'lib/stripe/resources/payment_location.rb', line 102

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.



104
105
106
# File 'lib/stripe/resources/payment_location.rb', line 104

def livemode
  @livemode
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



106
107
108
# File 'lib/stripe/resources/payment_location.rb', line 106

def object
  @object
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Create a Payment Location.



109
110
111
112
113
114
115
116
# File 'lib/stripe/resources/payment_location.rb', line 109

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/payment_locations",
    params: params,
    opts: opts
  )
end

.delete(id, params = {}, opts = {}) ⇒ Object

Delete a Payment Location.



119
120
121
122
123
124
125
126
# File 'lib/stripe/resources/payment_location.rb', line 119

def self.delete(id, params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/payment_locations/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

.field_remappingsObject



161
162
163
# File 'lib/stripe/resources/payment_location.rb', line 161

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



153
154
155
156
157
158
159
# File 'lib/stripe/resources/payment_location.rb', line 153

def self.inner_class_types
  @inner_class_types = {
    address: Address,
    business_registration: BusinessRegistration,
    capability_settings: CapabilitySettings,
  }
end

.list(params = {}, opts = {}) ⇒ Object

List all Payment Locations.



139
140
141
# File 'lib/stripe/resources/payment_location.rb', line 139

def self.list(params = {}, opts = {})
  request_stripe_object(method: :get, path: "/v1/payment_locations", params: params, opts: opts)
end

.object_nameObject



13
14
15
# File 'lib/stripe/resources/payment_location.rb', line 13

def self.object_name
  "payment_location"
end

.update(id, params = {}, opts = {}) ⇒ Object

Update a Payment Location.



144
145
146
147
148
149
150
151
# File 'lib/stripe/resources/payment_location.rb', line 144

def self.update(id, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/payment_locations/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#delete(params = {}, opts = {}) ⇒ Object

Delete a Payment Location.



129
130
131
132
133
134
135
136
# File 'lib/stripe/resources/payment_location.rb', line 129

def delete(params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/payment_locations/%<id>s", { id: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end