Class: WebPay::Shop
- Inherits:
-
ApiResource
- Object
- ApiResource
- WebPay::Shop
- Defined in:
- lib/webpay/shop.rb
Instance Method Summary collapse
-
#all(params = {}) ⇒ ShopResponseList
List shops filtered by params.
-
#alter_status(params = {}) ⇒ ShopResponse
Alter the test shop’s status to the specified one.
-
#create(params = {}) ⇒ ShopResponse
Create a shop object with given parameters.
-
#retrieve(params = {}) ⇒ ShopResponse
Retrieve a shop object by shop id.
-
#update(params = {}) ⇒ ShopResponse
Update an existing shop with specified parameters.
Methods inherited from ApiResource
Constructor Details
This class inherits a constructor from WebPay::ApiResource
Instance Method Details
#all(params = {}) ⇒ ShopResponseList
List shops filtered by params.
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.
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.
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.
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.
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 |