Class: Paystack::Resources::Storefront

Inherits:
BaseResource show all
Defined in:
lib/paystack/resources/storefront.rb

Instance Method Summary collapse

Methods inherited from BaseResource

new

Instance Method Details

#add_products(id, body = {}) ⇒ Object

Add Products to Storefront POST /storefront/id/product



10
11
12
# File 'lib/paystack/resources/storefront.rb', line 10

def add_products(id, body = {})
  @transport.post("/storefront/#{id}/product", body: body)
end

#create(body = {}) ⇒ Object

Create Storefront POST /storefront



17
18
19
# File 'lib/paystack/resources/storefront.rb', line 17

def create(body = {})
  @transport.post("/storefront", body: body)
end

#delete(id) ⇒ Object

Delete Storefront DELETE /storefront/id



24
25
26
# File 'lib/paystack/resources/storefront.rb', line 24

def delete(id)
  @transport.delete("/storefront/#{id}")
end

#duplicate(id) ⇒ Object

Duplicate Storefront POST /storefront/id/duplicate



31
32
33
# File 'lib/paystack/resources/storefront.rb', line 31

def duplicate(id)
  @transport.post("/storefront/#{id}/duplicate")
end

#fetch(id) ⇒ Object

Fetch Storefront GET /storefront/id



38
39
40
# File 'lib/paystack/resources/storefront.rb', line 38

def fetch(id)
  @transport.get("/storefront/#{id}")
end

#fetch_orders(id) ⇒ Object

Fetch Storefront Orders GET /storefront/id/order



45
46
47
# File 'lib/paystack/resources/storefront.rb', line 45

def fetch_orders(id)
  @transport.get("/storefront/#{id}/order")
end

#list(query = {}) ⇒ Object

List Storefronts GET /storefront



52
53
54
# File 'lib/paystack/resources/storefront.rb', line 52

def list(query = {})
  @transport.get("/storefront", query: query)
end

#list_products(id) ⇒ Object

List Storefront Products GET /storefront/id/product



59
60
61
# File 'lib/paystack/resources/storefront.rb', line 59

def list_products(id)
  @transport.get("/storefront/#{id}/product")
end

#publish(id) ⇒ Object

Publish Storefront POST /storefront/id/publish



66
67
68
# File 'lib/paystack/resources/storefront.rb', line 66

def publish(id)
  @transport.post("/storefront/#{id}/publish")
end

#update(id, body = {}) ⇒ Object

Update Storefront PUT /storefront/id



73
74
75
# File 'lib/paystack/resources/storefront.rb', line 73

def update(id, body = {})
  @transport.put("/storefront/#{id}", body: body)
end

#verify_slug(slug) ⇒ Object

Verify Storefront Slug GET /storefront/verify/slug



80
81
82
# File 'lib/paystack/resources/storefront.rb', line 80

def verify_slug(slug)
  @transport.get("/storefront/verify/#{slug}")
end