defra_ruby_mocks 5.1.1 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a54f9624d84a56d58fb86ff1a7556d5d7c88db8cd4c93106c260e1b14008c38
4
- data.tar.gz: 020561b363c345fa55dc26a27b9cc5bbe4306a5c5743ef824d095463b8e80e12
3
+ metadata.gz: aecd68d9ac0f7dd9256d9d8f39eb645d7fc32c45cf9bc8a6e76315029156d81e
4
+ data.tar.gz: 470e1e68a160dcc92895eccfc862ca7b302fb8a185505afe554d56798a7b7f7a
5
5
  SHA512:
6
- metadata.gz: 60761ea8c403d69d31ef96d890d37b90013b26e0dc0cd271ef7b5a3efb933225d3fb75178dc3aae3f8715088e1fe2e26344118668bed43cee9f44b901c0071e9
7
- data.tar.gz: d6c620d9805c12b864727a0f6d7b52356a18925858f8ef11c6e44889764f317d52379146c3fc25adede7e06c8c04e814fd8990b03d57816f4604bf70db7d9490
6
+ metadata.gz: f5fe8f9332df764a30bc808156ec2c61c31ab582bd0d8784bcef5da2a7cdbb7b16d14d9459bcd97b9918f9775803f60ecbbd487d46fd7bfd8c11b7a711f91e54
7
+ data.tar.gz: bce6423f17b916a7d7447faaee544f9786934e1425e16735b2de95742676cdccfad6746f75caae1c8241d9a1898a0c38e33fd1dd90daf68c7485b6ac3321aceb
@@ -6,9 +6,9 @@ class BaseSendWebhookJob < ApplicationJob
6
6
  Rails.logger.warn "[DefraRubyMocks] [BaseSendWebhookJob] sending #{webhook_type} webhook " \
7
7
  "for #{govpay_id}, status \"#{status}\" to #{callback_url}"
8
8
  RestClient::Request.execute(
9
- method: :get,
9
+ method: :post,
10
10
  url: callback_url,
11
- body: body,
11
+ payload: body.to_json,
12
12
  headers: { "Pay-Signature": webhook_signature(body, signing_secret) }
13
13
  )
14
14
  rescue StandardError => e
@@ -27,7 +27,8 @@ class BaseSendWebhookJob < ApplicationJob
27
27
  end
28
28
 
29
29
  def webhook_signature(webhook_body, signing_secret)
30
- OpenSSL::HMAC.hexdigest("sha256", signing_secret.encode("utf-8"), webhook_body.to_json.encode("utf-8"))
30
+ digest = OpenSSL::Digest.new("sha256")
31
+ OpenSSL::HMAC.hexdigest(digest, signing_secret, webhook_body.to_json)
31
32
  end
32
33
 
33
34
  end
@@ -11,7 +11,7 @@ class SendRefundWebhookJob < BaseSendWebhookJob
11
11
  def webhook_body(govpay_id:, status:)
12
12
  webhook_body ||= JSON.parse(File.read("lib/fixtures/files/govpay/webhook_refund_update_body.json"))
13
13
 
14
- webhook_body["payment_id"] = govpay_id
14
+ webhook_body["refund_id"] = govpay_id
15
15
  webhook_body["status"] = status
16
16
 
17
17
  webhook_body
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DefraRubyMocks
4
- VERSION = "5.1.1"
4
+ VERSION = "5.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defra_ruby_mocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.1
4
+ version: 5.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Defra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-08 00:00:00.000000000 Z
11
+ date: 2025-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails