justifi 0.8.3 → 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 +4 -4
- data/lib/justifi/business.rb +25 -0
- data/lib/justifi/justifi_error.rb +4 -3
- data/lib/justifi/justifi_response.rb +6 -0
- data/lib/justifi/version.rb +1 -1
- data/lib/justifi.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c5206b5561f5b1dd8fc5c72bdb7fb0f79c4adb1ab24a0676905a6a109a29d4
|
4
|
+
data.tar.gz: 674099ead3a32b10f4df89bab1e3a35086f2a62287976fd12ddacffca0e86149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43a04dacd70bd28b492d8e590046404b3f7bd830f689afd00775cc42fb02f5870a0e26350142f14bd517bad585e453cd59ba92e750827aa4f67ab0464da42c7
|
7
|
+
data.tar.gz: 9f79aa97900bd886ec668ce95192765791b8a330af4b683341cc68375c4d220afd1194b1a00926bb31aedb2781dcdcdf7ad884d174254a416fd02f19c0bc2d34
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Justifi
|
4
|
+
module Business
|
5
|
+
class << self
|
6
|
+
def create(params:, headers: {})
|
7
|
+
JustifiOperations.execute_post_request("/v1/entities/business", params, headers)
|
8
|
+
end
|
9
|
+
|
10
|
+
def list(params: {}, headers: {})
|
11
|
+
JustifiOperations.list("/v1/entities/business", params, headers)
|
12
|
+
end
|
13
|
+
|
14
|
+
def get(business_id:, headers: {})
|
15
|
+
JustifiOperations.execute_get_request("/v1/entities/business/#{business_id}",
|
16
|
+
{},
|
17
|
+
headers)
|
18
|
+
end
|
19
|
+
|
20
|
+
def update(business_id:, params:, headers: {})
|
21
|
+
JustifiOperations.execute_patch_request("/v1/entities/business/#{business_id}", params, headers)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -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
|
data/lib/justifi/version.rb
CHANGED
data/lib/justifi.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2025-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/justifi.rb
|
163
163
|
- lib/justifi/api_operations.rb
|
164
164
|
- lib/justifi/balance_transaction.rb
|
165
|
+
- lib/justifi/business.rb
|
165
166
|
- lib/justifi/checkout.rb
|
166
167
|
- lib/justifi/checkout_session.rb
|
167
168
|
- lib/justifi/configuration.rb
|
@@ -189,7 +190,7 @@ metadata:
|
|
189
190
|
source_code_uri: https://github.com/justifi-tech/justifi-ruby
|
190
191
|
github_repo: ssh://github.com/justifi-tech/justifi-ruby
|
191
192
|
changelog_uri: https://github.com/justifi-tech/justifi-ruby/changelog
|
192
|
-
post_install_message:
|
193
|
+
post_install_message:
|
193
194
|
rdoc_options: []
|
194
195
|
require_paths:
|
195
196
|
- lib
|
@@ -205,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
206
|
version: '0'
|
206
207
|
requirements: []
|
207
208
|
rubygems_version: 3.2.32
|
208
|
-
signing_key:
|
209
|
+
signing_key:
|
209
210
|
specification_version: 4
|
210
211
|
summary: JustiFi API wrapper gem
|
211
212
|
test_files: []
|