class Iyzipay::Model::V2::Plan

Constants

RESOURCE

Public Instance Methods

create(request, options) click to toggle source
# File lib/iyzipay/model/v2/plan.rb, line 7
def create(request, options)
  path = path_for_action('products', request[:productReferenceCode], 'pricing-plans')
  data = request.to_json
  header = get_http_header(options, path, data)
  HttpClient.post_even_on_error(base_url(options, path), header, data)
end
update(request, options) click to toggle source
# File lib/iyzipay/model/v2/plan.rb, line 14
def update(request, options)
  path = path_for_action('pricing-plans', request[:pricingPlanReferenceCode])
  data = request.to_json
  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) click to toggle source
# File lib/iyzipay/model/v2/plan.rb, line 23
def base_url(options, path)
  "#{options.base_url}#{path}"
end
path_for_action(*args) click to toggle source
# File lib/iyzipay/model/v2/plan.rb, line 27
def path_for_action(*args)
  "#{RESOURCE}#{'/' + args.join('/')}"
end