Class: Form::V3
- Inherits:
-
Integration
- Object
- Integration
- Form::V3
- Defined in:
- app/models/pager_tree/integrations/form/v3.rb
Constant Summary collapse
- OPTIONS =
[ {key: :form_title, type: :string, default: ""}, {key: :form_header, type: :string, default: ""}, {key: :form_instructions, type: :string, default: ""}, {key: :form_footer_text, type: :string, default: ""}, {key: :form_footer_link, type: :string, default: ""}, {key: :form_email_required, type: :boolean, default: false}, {key: :form_phone_required, type: :boolean, default: false}, {key: :form_description_required, type: :boolean, default: false}, {key: :form_urgency_required, type: :boolean, default: false} ]
Instance Method Summary collapse
- #adapter_action ⇒ Object
- #adapter_incoming_can_defer? ⇒ Boolean
- #adapter_process_create ⇒ Object
- #adapter_response_inactive_subscription ⇒ Object
- #adapter_response_maintenance_mode ⇒ Object
- #adapter_response_upgrade ⇒ Object
- #adapter_supports_cnames? ⇒ Boolean
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_supports_outgoing? ⇒ Boolean
- #adapter_thirdparty_id ⇒ Object
Instance Method Details
#adapter_action ⇒ Object
68 69 70 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 68 def adapter_action :create end |
#adapter_incoming_can_defer? ⇒ Boolean
44 45 46 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 44 def adapter_incoming_can_defer? true end |
#adapter_process_create ⇒ Object
72 73 74 75 76 77 78 79 80 81 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 72 def adapter_process_create Alert.new( title: _title, description: _description, urgency: _urgency, thirdparty_id: adapter_thirdparty_id, dedup_keys: [], additional_data: _additional_datums ) end |
#adapter_response_inactive_subscription ⇒ Object
52 53 54 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 52 def adapter_response_inactive_subscription adapter_controller&.render(status: :payment_required, json: {code: Rack::Utils.status_code(:payment_required), errors: ["Customer must subscribe service plan to use this integration"]}) end |
#adapter_response_maintenance_mode ⇒ Object
60 61 62 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 60 def adapter_response_maintenance_mode adapter_controller&.render(status: :service_unavailable, json: {code: Rack::Utils.status_code(:service_unavailable), errors: ["Integration currently in maintenance mode"]}) end |
#adapter_response_upgrade ⇒ Object
56 57 58 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 56 def adapter_response_upgrade adapter_controller&.render(status: :payment_required, json: {code: Rack::Utils.status_code(:payment_required), errors: ["Customer must upgrade service plan to use this integration"]}) end |
#adapter_supports_cnames? ⇒ Boolean
48 49 50 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 48 def adapter_supports_cnames? true end |
#adapter_supports_incoming? ⇒ Boolean
36 37 38 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 36 def adapter_supports_incoming? true end |
#adapter_supports_outgoing? ⇒ Boolean
40 41 42 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 40 def adapter_supports_outgoing? false end |
#adapter_thirdparty_id ⇒ Object
64 65 66 |
# File 'app/models/pager_tree/integrations/form/v3.rb', line 64 def adapter_thirdparty_id @adapter_thirdparty_id ||= SecureRandom.uuid end |