Class: Perpetto::API
- Inherits:
-
Object
- Object
- Perpetto::API
- Defined in:
- lib/perpetto/api.rb
Instance Method Summary collapse
- #cart_paid(cart_id) ⇒ Object
- #delete_profile_data(email) ⇒ Object
- #delete_store_data ⇒ Object
- #get_campaigns ⇒ Object
- #get_containers ⇒ Object
- #get_shop_info ⇒ Object
-
#initialize(account_id, secret) ⇒ API
constructor
A new instance of API.
- #item_updated(item_id, item_hash) ⇒ Object
- #order_voided(cart_id) ⇒ Object
- #profile_info(email) ⇒ Object
Constructor Details
#initialize(account_id, secret) ⇒ API
Returns a new instance of API.
8 9 10 11 |
# File 'lib/perpetto/api.rb', line 8 def initialize(account_id, secret) @account_id = account_id @secret = secret end |
Instance Method Details
#cart_paid(cart_id) ⇒ Object
25 26 27 |
# File 'lib/perpetto/api.rb', line 25 def cart_paid(cart_id) post('backend_track/cart_paid', {cart_id: cart_id}) end |
#delete_profile_data(email) ⇒ Object
45 46 47 |
# File 'lib/perpetto/api.rb', line 45 def delete_profile_data(email) post('backend_action/delete_profile', {email: email}) end |
#delete_store_data ⇒ Object
41 42 43 |
# File 'lib/perpetto/api.rb', line 41 def delete_store_data post('backend_action/delete_domain') end |
#get_campaigns ⇒ Object
21 22 23 |
# File 'lib/perpetto/api.rb', line 21 def get_campaigns get('info/campaigns') end |
#get_containers ⇒ Object
17 18 19 |
# File 'lib/perpetto/api.rb', line 17 def get_containers get('info/containers') end |
#get_shop_info ⇒ Object
13 14 15 |
# File 'lib/perpetto/api.rb', line 13 def get_shop_info get('') end |
#item_updated(item_id, item_hash) ⇒ Object
33 34 35 |
# File 'lib/perpetto/api.rb', line 33 def item_updated(item_id, item_hash) post('backend_track/items_updated', {items: {item_id => item_hash}}) end |
#order_voided(cart_id) ⇒ Object
29 30 31 |
# File 'lib/perpetto/api.rb', line 29 def order_voided(cart_id) post('backend_track/order_voided', {cart_id: cart_id}) end |
#profile_info(email) ⇒ Object
37 38 39 |
# File 'lib/perpetto/api.rb', line 37 def profile_info(email) get("info/profile", {email: email}) end |