Class: WebPay::Shop

Inherits:
ApiResource show all
Defined in:
lib/webpay/shop.rb

Instance Method Summary collapse

Methods inherited from ApiResource

#initialize

Constructor Details

This class inherits a constructor from WebPay::ApiResource

Instance Method Details

#all(params = {}) ⇒ ShopResponseList

List shops filtered by params.

Parameters:

Returns:



46
47
48
49
50
# File 'lib/webpay/shop.rb', line 46

def all(params = {})
  req = WebPay::BasicListRequest.create(params)
  raw_response = @client._request(:get, 'shops', req)
  WebPay::ShopResponseList.new(raw_response)
end

#alter_status(params = {}) ⇒ ShopResponse

Alter the test shop’s status to the specified one.

Parameters:

Returns:



36
37
38
39
40
# File 'lib/webpay/shop.rb', line 36

def alter_status(params = {})
  req = WebPay::ShopRequestAlterStatus.create(params)
  raw_response = @client._request(:post, 'shops' + '/' + req.id.to_s + '/' + 'alter_status', req)
  WebPay::ShopResponse.new(raw_response)
end

#create(params = {}) ⇒ ShopResponse

Create a shop object with given parameters.

Parameters:

Returns:



6
7
8
9
10
# File 'lib/webpay/shop.rb', line 6

def create(params = {})
  req = WebPay::ShopRequestCreate.create(params)
  raw_response = @client._request(:post, 'shops', req)
  WebPay::ShopResponse.new(raw_response)
end

#retrieve(params = {}) ⇒ ShopResponse

Retrieve a shop object by shop id.

Parameters:

  • params (ShopIdRequest|Hash) (defaults to: {})

    Parameters to API call

Returns:



16
17
18
19
20
# File 'lib/webpay/shop.rb', line 16

def retrieve(params = {})
  req = WebPay::ShopIdRequest.create(params)
  raw_response = @client._request(:get, 'shops' + '/' + req.id.to_s, req)
  WebPay::ShopResponse.new(raw_response)
end

#update(params = {}) ⇒ ShopResponse

Update an existing shop with specified parameters.

Parameters:

Returns:



26
27
28
29
30
# File 'lib/webpay/shop.rb', line 26

def update(params = {})
  req = WebPay::ShopRequestUpdate.create(params)
  raw_response = @client._request(:post, 'shops' + '/' + req.id.to_s, req)
  WebPay::ShopResponse.new(raw_response)
end