Class: BaseSendWebhookJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- BaseSendWebhookJob
- Defined in:
- app/jobs/base_send_webhook_job.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#callback_url ⇒ Object
Returns the value of attribute callback_url.
-
#govpay_payment_id ⇒ Object
Returns the value of attribute govpay_payment_id.
-
#signing_secret ⇒ Object
Returns the value of attribute signing_secret.
Instance Method Summary collapse
Instance Attribute Details
#callback_url ⇒ Object
Returns the value of attribute callback_url.
4 5 6 |
# File 'app/jobs/base_send_webhook_job.rb', line 4 def callback_url @callback_url end |
#govpay_payment_id ⇒ Object
Returns the value of attribute govpay_payment_id.
4 5 6 |
# File 'app/jobs/base_send_webhook_job.rb', line 4 def govpay_payment_id @govpay_payment_id end |
#signing_secret ⇒ Object
Returns the value of attribute signing_secret.
4 5 6 |
# File 'app/jobs/base_send_webhook_job.rb', line 4 def signing_secret @signing_secret end |
Instance Method Details
#post_callback ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/base_send_webhook_job.rb', line 6 def post_callback body = webhook_body RestClient::Request.execute( method: :post, url: callback_url, headers: { "Pay-Signature": webhook_signature(body, signing_secret) }, payload: body.to_json ) rescue StandardError => e Rails.logger.error "[DefraRubyMocks] [BaseSendWebhookJob] error sending " \ "#{webhook_type} webhook to #{callback_url}: #{e}" end |