justifi 0.9.0 → 0.10.0

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: 82a9df0515849f544d804cf04d4bb75168da326e5666e60942ec876bd0b77869
4
- data.tar.gz: c62ee0120e0414f4a482cd729a673e71fec47f388b55727c06a724afdf00f7d3
3
+ metadata.gz: b4c5206b5561f5b1dd8fc5c72bdb7fb0f79c4adb1ab24a0676905a6a109a29d4
4
+ data.tar.gz: 674099ead3a32b10f4df89bab1e3a35086f2a62287976fd12ddacffca0e86149
5
5
  SHA512:
6
- metadata.gz: 0add9d65d10543923d07c89f1f99d72cbd9ae9c11da9d2a6960edc13ad4a76e1d3a10740a59e4dd635a51464c4c87f1a0360a7aa764e06fc91858f0d7eb90dc0
7
- data.tar.gz: eceb3a2e2052ca4b689f85b38bfe884ff9a4bcc0f64c045f6b75788e7089aac4f3d14893a0ed8ff974c991de2db7abf2744f6d7fbe7598cb97fec729d75701e0
6
+ metadata.gz: c43a04dacd70bd28b492d8e590046404b3f7bd830f689afd00775cc42fb02f5870a0e26350142f14bd517bad585e453cd59ba92e750827aa4f67ab0464da42c7
7
+ data.tar.gz: 9f79aa97900bd886ec668ce95192765791b8a330af4b683341cc68375c4d220afd1194b1a00926bb31aedb2781dcdcdf7ad884d174254a416fd02f19c0bc2d34
@@ -2,17 +2,18 @@
2
2
 
3
3
  module Justifi
4
4
  class Error < StandardError
5
- attr_reader :response_code
5
+ attr_reader :response_code, :error_details
6
6
 
7
- def initialize(response_code, msg)
7
+ def initialize(response_code, msg, error_details: nil)
8
8
  super(msg)
9
9
  @response_code = response_code
10
+ @error_details = error_details
10
11
  end
11
12
  end
12
13
 
13
14
  class InvalidHttpResponseError < Error
14
15
  def initialize(response:)
15
- super(response.http_status, response.error_message)
16
+ super(response.http_status, response.error_message, error_details: response.error_details)
16
17
  end
17
18
  end
18
19
  end
@@ -58,6 +58,8 @@ module Justifi
58
58
  # the Justifi API.
59
59
  class JustifiResponse
60
60
  include JustifiResponseBase
61
+ extend Gem::Deprecate
62
+
61
63
  # The data contained by the HTTP body of the response deserialized from
62
64
  # JSON.
63
65
  attr_accessor :data
@@ -71,6 +73,9 @@ module Justifi
71
73
  # The boolean flag based on Net::HTTPSuccess
72
74
  attr_accessor :success
73
75
 
76
+ # The error hash from JustiFi API
77
+ attr_accessor :error_details
78
+
74
79
  # Initializes a JustifiResponse object from a Net::HTTP::HTTPResponse
75
80
  # object.
76
81
  def self.from_net_http(http_resp)
@@ -79,6 +84,7 @@ module Justifi
79
84
  resp.http_body = http_resp.body
80
85
  resp.success = http_resp.is_a? Net::HTTPSuccess
81
86
  resp.error_message = resp.data.dig(:error, :message)
87
+ resp.error_details = resp.data.dig(:error)
82
88
  JustifiResponseBase.populate_for_net_http(resp, http_resp)
83
89
  resp
84
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Justifi
4
- VERSION = "0.9.0"
4
+ VERSION = "0.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustiFi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
11
+ date: 2025-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -190,7 +190,7 @@ metadata:
190
190
  source_code_uri: https://github.com/justifi-tech/justifi-ruby
191
191
  github_repo: ssh://github.com/justifi-tech/justifi-ruby
192
192
  changelog_uri: https://github.com/justifi-tech/justifi-ruby/changelog
193
- post_install_message:
193
+ post_install_message:
194
194
  rdoc_options: []
195
195
  require_paths:
196
196
  - lib
@@ -205,8 +205,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  requirements: []
208
- rubygems_version: 3.0.3.1
209
- signing_key:
208
+ rubygems_version: 3.2.32
209
+ signing_key:
210
210
  specification_version: 4
211
211
  summary: JustiFi API wrapper gem
212
212
  test_files: []