class Iyzipay::Model::V2::Product
Constants
- RESOURCE
Public Instance Methods
create(request, options)
click to toggle source
# File lib/iyzipay/model/v2/product.rb, line 14 def create(request, options) data = request.to_json header = get_http_header(options, RESOURCE, data) HttpClient.post_even_on_error(base_url(options), header, data) end
list(options)
click to toggle source
# File lib/iyzipay/model/v2/product.rb, line 9 def list(options) header = get_http_header(options, RESOURCE) HttpClient.get_even_on_error(base_url(options), header) end
update(request, options)
click to toggle source
# File lib/iyzipay/model/v2/product.rb, line 20 def update(request, options) data = request.to_json path = path_for_action(request[:productReferenceCode]) header = get_http_header(options, path, data) HttpClient.post_even_on_error(base_url(options, path), header, data) end
Private Instance Methods
base_url(options, path = RESOURCE)
click to toggle source
# File lib/iyzipay/model/v2/product.rb, line 29 def base_url(options, path = RESOURCE) "#{options.base_url}#{path}" end
path_for_action(*path_args)
click to toggle source
# File lib/iyzipay/model/v2/product.rb, line 33 def path_for_action(*path_args) "#{RESOURCE}#{'/' + path_args.join('/')}" end