Module: Vindi::Rest::Customer
- Included in:
- Vindi::Rest
- Defined in:
- lib/vindi/rest/customer.rb
Overview
Methods for the Customers API
Instance Method Summary collapse
-
#create_customer(options = {}) ⇒ Hash
Create a customer for a merchant vindi.
-
#customer(customer_id, options = {}) ⇒ Hash
Get a single customer from a merchant.
-
#delete_customer(customer_id, options = {}) ⇒ Object
Delete a customer from merchant vindi.
-
#list_customers(options = {}) ⇒ Array<Hash>
List customer for the authenticate user.
-
#unarchive_customer(customer_id, options = {}) ⇒ Object
Unarchive a customer from merchant vindi.
-
#update_customer(customer_id, options = {}) ⇒ Object
Edit a customer.
Instance Method Details
#create_customer(options = {}) ⇒ Hash
Create a customer for a merchant vindi
33 34 35 |
# File 'lib/vindi/rest/customer.rb', line 33 def create_customer( = {}) post('customers', )[:customer] end |
#customer(customer_id, options = {}) ⇒ Hash
Get a single customer from a merchant
22 23 24 |
# File 'lib/vindi/rest/customer.rb', line 22 def customer(customer_id, = {}) get("customers/#{customer_id}", )[:customer] end |
#delete_customer(customer_id, options = {}) ⇒ Object
Delete a customer from merchant vindi
56 57 58 |
# File 'lib/vindi/rest/customer.rb', line 56 def delete_customer(customer_id, = {}) delete("customers/#{customer_id}", )[:customer] end |
#list_customers(options = {}) ⇒ Array<Hash>
List customer for the authenticate user
11 12 13 |
# File 'lib/vindi/rest/customer.rb', line 11 def list_customers( = {}) get('customers', )[:customers] end |
#unarchive_customer(customer_id, options = {}) ⇒ Object
Unarchive a customer from merchant vindi
69 70 71 |
# File 'lib/vindi/rest/customer.rb', line 69 def unarchive_customer(customer_id, = {}) post("customers/#{customer_id}/unarchive", )[:customer] end |
#update_customer(customer_id, options = {}) ⇒ Object
Edit a customer
44 45 46 |
# File 'lib/vindi/rest/customer.rb', line 44 def update_customer(customer_id, = {}) put("customers/#{customer_id}", )[:customer] end |