module PaymentPlanExtension

Public Instance Methods

add_billing_payment_plan(session_key, billing_id, billing_type_id, name, number, month, year, start_date=nil, end_date=nil, options={}) click to toggle source
# File lib/tessitura_rest/web/payment_plan_extension.rb, line 3
def add_billing_payment_plan(session_key, billing_id, billing_type_id, name, number, month, year, start_date=nil, end_date=nil, options={})
  parameters =
    {
        'BillingScheduleId': billing_id,
        'BillingTypeId': billing_type_id,
        'StartDate': start_date,
        'EndDate': end_date,
        "Card": {
          "Name": name,
          "Number": number,
          "ExpiryMonth": month,
          "ExpiryYear": year
        }
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule"), options)
  JSON.parse(response.body)
end
preview_billing_payment_plan(session_key, billing_id, start_date=nil, end_date=nil, options={}) click to toggle source
# File lib/tessitura_rest/web/payment_plan_extension.rb, line 23
def preview_billing_payment_plan(session_key, billing_id, start_date=nil, end_date=nil, options={})
  parameters =
    {
        'BillingScheduleId': billing_id,
        'StartDate': start_date,
        'EndDate': end_date
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule/Preview"), options)
  JSON.parse(response.body)
end
remove_payment_plan(session_key, options={}) click to toggle source
# File lib/tessitura_rest/web/payment_plan_extension.rb, line 47
def remove_payment_plan(session_key, options={})
  options.merge!(basic_auth: @auth, headers: @headers)
  self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan"), options)
end
validate_payment_plan(session_key, options={}) click to toggle source
# File lib/tessitura_rest/web/payment_plan_extension.rb, line 36
def validate_payment_plan(session_key, options={})
  parameters =
    {
        'ValidatePaymentPlan': true
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters)
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Validate"), options)
  JSON.parse(response.body)
end