Module: PaymentPlanExtension
- Included in:
- TessituraRest
- Defined in:
- lib/tessitura_rest/web/payment_plan_extension.rb
Instance Method Summary collapse
- #add_billing_payment_plan(session_key, billing_id, billing_type_id, name, number, month, year, start_date = nil, end_date = nil, options = {}) ⇒ Object
- #add_tms_billing_payment_plan(session_key, billing_id, billing_type_id, account_id, start_date = nil, end_date = nil, options = {}) ⇒ Object
- #preview_billing_payment_plan(session_key, billing_id, start_date = nil, end_date = nil, options = {}) ⇒ Object
- #remove_payment_plan(session_key, options = {}) ⇒ Object
- #update_payment_plan(session_key, account_id, billing_type_id, options = {}) ⇒ Object
- #validate_payment_plan(session_key, options = {}) ⇒ Object
Instance Method Details
#add_billing_payment_plan(session_key, billing_id, billing_type_id, name, number, month, year, start_date = nil, end_date = nil, options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 2 def add_billing_payment_plan(session_key, billing_id, billing_type_id, name, number, month, year, start_date = nil, end_date = nil, = {}) parameters = { 'BillingScheduleId': billing_id, 'BillingTypeId': billing_type_id, 'StartDate': start_date, 'EndDate': end_date, 'Card': { 'Name': name, 'Number': number, 'ExpiryMonth': month, 'ExpiryYear': year, }, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule"), ) JSON.parse(response.body) end |
#add_tms_billing_payment_plan(session_key, billing_id, billing_type_id, account_id, start_date = nil, end_date = nil, options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 22 def add_tms_billing_payment_plan(session_key, billing_id, billing_type_id, account_id, start_date = nil, end_date = nil, = {}) parameters = { 'BillingScheduleId': billing_id, 'BillingTypeId': billing_type_id, 'StartDate': start_date, 'EndDate': end_date, 'AccountId': account_id, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule"), ) JSON.parse(response.body) end |
#preview_billing_payment_plan(session_key, billing_id, start_date = nil, end_date = nil, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 37 def preview_billing_payment_plan(session_key, billing_id, start_date = nil, end_date = nil, = {}) parameters = { 'BillingScheduleId': billing_id, 'StartDate': start_date, 'EndDate': end_date, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan/Schedule/Preview"), ) JSON.parse(response.body) end |
#remove_payment_plan(session_key, options = {}) ⇒ Object
72 73 74 75 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 72 def remove_payment_plan(session_key, = {}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan"), ) end |
#update_payment_plan(session_key, account_id, billing_type_id, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 61 def update_payment_plan(session_key, account_id, billing_type_id, = {}) parameters = { 'AccountId': account_id, 'BillingTypeId': billing_type_id, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Payments/Plan"), ) end |
#validate_payment_plan(session_key, options = {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tessitura_rest/web/payment_plan_extension.rb', line 50 def validate_payment_plan(session_key, = {}) parameters = { 'ValidatePaymentPlan': true, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) response = self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Validate"), ) JSON.parse(response.body) end |