verifiabl-issuer 0.5.0 → 1.0.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/CHANGELOG.md +37 -0
- data/README.md +21 -20
- data/lib/verifiabl/issuer/generated/non-pii-v2-fields.json +6 -10
- data/lib/verifiabl/issuer/generated/v2_codes.rb +8 -0
- data/lib/verifiabl/issuer/non_pii_v2.rb +14 -1
- data/lib/verifiabl/issuer/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 619853ce9733f541d03c4f5267ff59da66383941256b56970953bfec703f6600
|
|
4
|
+
data.tar.gz: 2c3b3bb84032287482bbde88fca5e85c947b6f557da73e165f4c5a593e629d44
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a987cf173047507e67e5e693bcba5b59cbc914818261dddc1edfbeecf3cc5609a70f3db96e5da7b3a8e05f4aaf09ce6aab7acb22efe3665b622f1ab2a2a95f9f
|
|
7
|
+
data.tar.gz: 25180a6200be501ef89c6a647c0975018c14e7b34084c58ed8430e679a86f0fac38752f8c3591df56b8bda16a2084cf545f469f1ddb80eddcc23b76718dd4d36
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,43 @@ All notable changes to the Verifiabl Ruby SDK will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## [1.0.0] - 2026-10-19
|
|
8
|
+
|
|
9
|
+
First stable release. The public API now follows Semantic Versioning.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Breaking:** an AU2 `lump_sum` earnings line without a `lump_sum_type` now
|
|
14
|
+
raises `ArgumentError` before sending. The API still accepts the line from
|
|
15
|
+
older SDK versions. To migrate, send a `lump_sum_type` from
|
|
16
|
+
`PayslipCodes::Australian::LUMP_SUM_TYPES` on each lump sum.
|
|
17
|
+
|
|
18
|
+
- `PayslipCodes::Australian::BASE_RATE_PERIODS` and
|
|
19
|
+
`PayslipCodes::NewZealand::BASE_RATE_PERIODS` both list every period a
|
|
20
|
+
payslip prints a rate in: `hour`, `day`, `week`, `fortnight`, `month` and
|
|
21
|
+
`year`.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- AU2 `superannuation` lines accept `contribution_type: "other"`, for an
|
|
26
|
+
employer contribution that is not SG, RESC or salary sacrifice, such as an
|
|
27
|
+
award or agreement rate above SG. `resc` excludes salary sacrifice, which has
|
|
28
|
+
its own `salary_sacrifice` line.
|
|
29
|
+
|
|
30
|
+
## [0.6.0] - 2026-10-13
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- **Breaking:** AU2 and NZ2 payloads replace `hourly` and `annual_rate` with
|
|
35
|
+
`base_rate`, the base rate the payslip prints apart from the earnings lines:
|
|
36
|
+
`{amount: "450.00", per: "day"}`. `per` is one of
|
|
37
|
+
`PayslipCodes::Australian::BASE_RATE_PERIODS` or
|
|
38
|
+
`PayslipCodes::NewZealand::BASE_RATE_PERIODS`. AU takes `hour`, `day` or
|
|
39
|
+
`year`; NZ also takes `week`. To migrate, send the printed annual rate as
|
|
40
|
+
`base_rate` with `per: "year"`, and a printed hourly rate as `base_rate`
|
|
41
|
+
with `per: "hour"`. Send hours and amounts only on `ordinary` earnings
|
|
42
|
+
lines. The API still accepts the old fields from earlier SDK versions.
|
|
43
|
+
|
|
7
44
|
## [0.5.0] - 2026-10-09
|
|
8
45
|
|
|
9
46
|
### Added
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ client, RBS signatures, and packed-gem consumer qualification.
|
|
|
9
9
|
Add the stable release to your bundle:
|
|
10
10
|
|
|
11
11
|
```ruby
|
|
12
|
-
gem "verifiabl-issuer", "0.
|
|
12
|
+
gem "verifiabl-issuer", "1.0.0"
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Then run `bundle install`.
|
|
@@ -151,14 +151,14 @@ provider_encryption_key = Base64.strict_decode64(
|
|
|
151
151
|
)
|
|
152
152
|
prepared = Verifiabl::Issuer.prepare_australian_v2_payslip(
|
|
153
153
|
pii: {
|
|
154
|
-
employee_name: "
|
|
155
|
-
employer_name: "Example
|
|
154
|
+
employee_name: "Ana Leota",
|
|
155
|
+
employer_name: "Example Software Pty Ltd",
|
|
156
156
|
employer_abn: "12 345 678 901",
|
|
157
|
-
address: {lines: ["
|
|
157
|
+
address: {lines: ["12 Example St"], suburb: "Sydney", state_or_territory: "NSW", postcode: "2000"}
|
|
158
158
|
},
|
|
159
159
|
payslip_non_pii: {
|
|
160
160
|
period_end: "2026-05-31", payment_date: "2026-06-04", currency: "AUD",
|
|
161
|
-
gross: "
|
|
161
|
+
gross: "9000.00", paygw: "2250.00", net: "6750.00"
|
|
162
162
|
},
|
|
163
163
|
issued_at: Time.now.utc,
|
|
164
164
|
key: provider_encryption_key
|
|
@@ -223,8 +223,9 @@ nz::LEAVE_BALANCE_UNITS # => ["hours", "days", "weeks"]
|
|
|
223
223
|
both jurisdictions. An AU2 `lump_sum` line takes a `lump_sum_type` from
|
|
224
224
|
`LUMP_SUM_TYPES`, and an `etp` line takes an `etp_type` from `ETP_TYPES` and
|
|
225
225
|
an `etp_component` from `ETP_COMPONENTS`. Use their strings in your normal
|
|
226
|
-
payslip hash; the lists do not restrict input or add local enum
|
|
227
|
-
|
|
226
|
+
payslip hash; the lists do not restrict input or add local enum validation,
|
|
227
|
+
and the API may accept a new code before this gem is updated. The gem raises
|
|
228
|
+
before sending an AU2 `lump_sum` line without a `lump_sum_type`.
|
|
228
229
|
Printed-text fields such as `tax_code` and `pay_cycle` are not code sets.
|
|
229
230
|
|
|
230
231
|
### Self-managed barcode flow
|
|
@@ -244,14 +245,14 @@ require "verifiabl/issuer"
|
|
|
244
245
|
PAYSLIP = {
|
|
245
246
|
external_id: "PAY-1001",
|
|
246
247
|
pii: {
|
|
247
|
-
employee_name: "
|
|
248
|
+
employee_name: "Ana Leota",
|
|
248
249
|
position: "Senior Developer",
|
|
249
250
|
department: "Engineering",
|
|
250
|
-
employer_name: "Example
|
|
251
|
+
employer_name: "Example Software Pty Ltd",
|
|
251
252
|
employer_abn: "12 345 678 901",
|
|
252
253
|
bsb: "062-000",
|
|
253
254
|
account_number: "****5678",
|
|
254
|
-
account_name: "
|
|
255
|
+
account_name: "A Leota",
|
|
255
256
|
address: {lines: ["12 Example St"], suburb: "Sydney", state_or_territory: "NSW", postcode: "2000"}
|
|
256
257
|
},
|
|
257
258
|
non_pii: {
|
|
@@ -320,22 +321,22 @@ require "verifiabl/issuer"
|
|
|
320
321
|
PAYSLIP = {
|
|
321
322
|
external_id: "PAY-1002",
|
|
322
323
|
pii: {
|
|
323
|
-
employee_name: "
|
|
324
|
+
employee_name: "Ana Leota",
|
|
324
325
|
ird_number: "***-***-***",
|
|
325
|
-
position: "
|
|
326
|
-
department: "
|
|
327
|
-
employer_name: "Example
|
|
326
|
+
position: "Senior Developer",
|
|
327
|
+
department: "Engineering",
|
|
328
|
+
employer_name: "Example Software Limited",
|
|
328
329
|
account_number: "**-****-*******-**",
|
|
329
|
-
account_name: "
|
|
330
|
-
address: {lines: ["
|
|
330
|
+
account_name: "A Leota",
|
|
331
|
+
address: {lines: ["12 Example Street"], suburb: "Te Aro", city: "Wellington", postcode: "6011"}
|
|
331
332
|
},
|
|
332
333
|
non_pii: {
|
|
333
334
|
period_end: "2026-08-31",
|
|
334
335
|
payment_date: "2026-09-04",
|
|
335
336
|
currency: "NZD",
|
|
336
|
-
gross: "
|
|
337
|
-
paye: "
|
|
338
|
-
net: "
|
|
337
|
+
gross: "9000.00",
|
|
338
|
+
paye: "2283.96",
|
|
339
|
+
net: "6716.04"
|
|
339
340
|
}
|
|
340
341
|
}.freeze
|
|
341
342
|
|
|
@@ -434,7 +435,7 @@ Verifiabl:
|
|
|
434
435
|
|
|
435
436
|
```ruby
|
|
436
437
|
plaintext = Verifiabl::Issuer.format_australian_pii(
|
|
437
|
-
employee_name: "
|
|
438
|
+
employee_name: "Ana Leota",
|
|
438
439
|
employer_abn: "53004085616",
|
|
439
440
|
address: {lines: ["12 Example St"], suburb: "Sydney", state_or_territory: "NSW", postcode: "2000"}
|
|
440
441
|
)
|
|
@@ -13,12 +13,10 @@
|
|
|
13
13
|
"employment_basis": null,
|
|
14
14
|
"engagement_type": null,
|
|
15
15
|
"award": null,
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"amount": "decimal"
|
|
16
|
+
"base_rate": {
|
|
17
|
+
"amount": "decimal",
|
|
18
|
+
"per": null
|
|
20
19
|
},
|
|
21
|
-
"annual_rate": "decimal",
|
|
22
20
|
"taxable_gross": "decimal",
|
|
23
21
|
"stsl_withholding": "decimal",
|
|
24
22
|
"earnings": [
|
|
@@ -82,12 +80,10 @@
|
|
|
82
80
|
"tax_code": null,
|
|
83
81
|
"employment_type": null,
|
|
84
82
|
"hours_paid": "decimal",
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"amount": "decimal"
|
|
83
|
+
"base_rate": {
|
|
84
|
+
"amount": "decimal",
|
|
85
|
+
"per": null
|
|
89
86
|
},
|
|
90
|
-
"annual_rate": "decimal",
|
|
91
87
|
"earnings_not_liable_for_acc": "decimal",
|
|
92
88
|
"earnings": [
|
|
93
89
|
{
|
|
@@ -40,6 +40,10 @@ module Verifiabl
|
|
|
40
40
|
PAY_FREQUENCIES = %w[
|
|
41
41
|
weekly fortnightly monthly quarterly four_weekly semi_monthly
|
|
42
42
|
].map!(&:freeze).freeze
|
|
43
|
+
|
|
44
|
+
BASE_RATE_PERIODS = %w[
|
|
45
|
+
hour day week fortnight month year
|
|
46
|
+
].map!(&:freeze).freeze
|
|
43
47
|
end
|
|
44
48
|
|
|
45
49
|
module NewZealand
|
|
@@ -62,6 +66,10 @@ module Verifiabl
|
|
|
62
66
|
LEAVE_BALANCE_UNITS = %w[
|
|
63
67
|
hours days weeks
|
|
64
68
|
].map!(&:freeze).freeze
|
|
69
|
+
|
|
70
|
+
BASE_RATE_PERIODS = %w[
|
|
71
|
+
hour day week fortnight month year
|
|
72
|
+
].map!(&:freeze).freeze
|
|
65
73
|
end
|
|
66
74
|
end
|
|
67
75
|
end
|
|
@@ -4,7 +4,8 @@ require "json"
|
|
|
4
4
|
|
|
5
5
|
module Verifiabl
|
|
6
6
|
module Issuer
|
|
7
|
-
# A pre-transport guard for unknown fields
|
|
7
|
+
# A pre-transport guard for unknown fields, the decimal grammar and AU2 lump sum codes, not a second
|
|
8
|
+
# implementation of the API contract.
|
|
8
9
|
module NonPiiV2
|
|
9
10
|
FIELDS = JSON.parse(File.read(File.join(__dir__, "generated/non-pii-v2-fields.json"))).freeze
|
|
10
11
|
DECIMAL_PATTERN = /\A-?[0-9]+(?:\.[0-9]+)?\z/
|
|
@@ -13,8 +14,20 @@ module Verifiabl
|
|
|
13
14
|
|
|
14
15
|
def validate!(schema, payload)
|
|
15
16
|
check!(FIELDS.fetch(schema), payload, "payslip_non_pii")
|
|
17
|
+
check_lump_sum_types!(payload) if schema == AUSTRALIAN_PAYSLIP_V2_SCHEMA
|
|
16
18
|
end
|
|
17
19
|
|
|
20
|
+
# The API still accepts a bare lump sum from older SDKs, but a lump sum without its STP2 code
|
|
21
|
+
# cannot be categorised, so this SDK requires the code before sending.
|
|
22
|
+
def check_lump_sum_types!(payload)
|
|
23
|
+
Array(payload["earnings"]).each_with_index do |line, index|
|
|
24
|
+
next unless line["type"] == "lump_sum" && line["lump_sum_type"].nil?
|
|
25
|
+
|
|
26
|
+
raise ArgumentError, "payslip_non_pii.earnings[#{index}].lump_sum_type is required on a lump_sum line"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
private_class_method :check_lump_sum_types!
|
|
30
|
+
|
|
18
31
|
def check!(allowed, value, path)
|
|
19
32
|
case allowed
|
|
20
33
|
when Hash then check_object!(allowed, value, path)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: verifiabl-issuer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Verifiabl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -206,7 +206,7 @@ licenses:
|
|
|
206
206
|
metadata:
|
|
207
207
|
bug_tracker_uri: https://github.com/Verifiabl/verifiabl-ruby/issues
|
|
208
208
|
changelog_uri: https://github.com/Verifiabl/verifiabl-ruby/blob/main/gems/verifiabl-issuer/CHANGELOG.md
|
|
209
|
-
documentation_uri: https://docs.verifiabl.io/
|
|
209
|
+
documentation_uri: https://docs.verifiabl.io/issuers
|
|
210
210
|
homepage_uri: https://verifiabl.io
|
|
211
211
|
source_code_uri: https://github.com/Verifiabl/verifiabl-ruby
|
|
212
212
|
post_install_message:
|