Module: PaymentPlanExtension

Included in:
TessituraRest
Defined in:
lib/tessitura_rest/web/payment_plan_extension.rb

Instance Method Summary collapse

Instance Method Details

#add_tms_billing_payment_plan(session_key, billing_id, billing_type_id, account_id, start_date = nil, end_date = nil, options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 2

def add_tms_billing_payment_plan(session_key, billing_id, billing_type_id, , start_date = nil, end_date = nil, options = {})
  parameters =
    {
      'BillingScheduleId': billing_id,
      'BillingTypeId': billing_type_id,
      'StartDate': start_date,
      'EndDate': end_date,
      'AccountId': ,
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters.to_json)
  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 = {}) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 17

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.to_json)
  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 = {}) ⇒ Object



52
53
54
55
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 52

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

#update_payment_plan(session_key, account_id, billing_type_id, options = {}) ⇒ Object



41
42
43
44
45
46
47
48
49
50
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 41

def update_payment_plan(session_key, , billing_type_id, options = {})
  parameters =
    {
      'AccountId': ,
      'BillingTypeId': billing_type_id,
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters.to_json)
  self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan"), options)
end

#validate_payment_plan(session_key, options = {}) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 30

def validate_payment_plan(session_key, options = {})
  parameters =
    {
      'ValidatePaymentPlan': true,
    }
  options.merge!(basic_auth: @auth, headers: @headers)
  options.merge!(:body => parameters.to_json)
  response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Validate"), options)
  JSON.parse(response.body)
end