Class: Stripe::PaymentLocation

Inherits:
APIResource show all
Extended by:
APIOperations::Create
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::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



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

def address
  @address
end

#business_registrationObject (readonly)

Identification numbers associated with the location.



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

def business_registration
  @business_registration
end

#capability_settingsObject (readonly)

The capability settings for the location. Only applicable for locations with requested Payment Location Capabilities.



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

def capability_settings
  @capability_settings
end

#deletedObject (readonly)

Always true for a deleted object



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

def deleted
  @deleted
end

#display_nameObject (readonly)

The display name of the location.



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

def display_name
  @display_name
end

#idObject (readonly)

Unique identifier for the object.



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

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`.



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

def livemode
  @livemode
end

#objectObject (readonly)

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



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

def object
  @object
end

Class Method Details

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

Create a Payment Location.



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

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.



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

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



155
156
157
# File 'lib/stripe/resources/payment_location.rb', line 155

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



147
148
149
150
151
152
153
# File 'lib/stripe/resources/payment_location.rb', line 147

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

.object_nameObject



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

def self.object_name
  "payment_location"
end

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

Update a Payment Location.



138
139
140
141
142
143
144
145
# File 'lib/stripe/resources/payment_location.rb', line 138

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.



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

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