paymos 1.5.1 → 1.6.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: '085824f8d197938805072bbe261b174157877f18edaff7602221a68ad1bbca52'
4
- data.tar.gz: 60d04d4f82f6baee7aa3b23953eb603213304f5022a87ab5a5ad8d04b5d507c4
3
+ metadata.gz: 5e0c80046042c2f9d6412a4634125c0a4394e9aab174d20d6b6a26fe60517e76
4
+ data.tar.gz: 52280f1bd972bf101b857e697addf3d1c115c09e87ae2287fdfc506c83606e09
5
5
  SHA512:
6
- metadata.gz: 0f05fdb1aed2a83d2f9fdbac11ecd905eb8e013d3a2d84ffbfad02bff215412528fa8c2a3cd197492d6443d46e25b7d4389b362a3b6f00bfb504daf4a011d3de
7
- data.tar.gz: e7147f721cbb9d0c7230d9bdcb785e809d67d497a6da3d663e67e81b9325d6d7abd6b6ecc71046379f6e2a0fa0fb1df2840db9249dcd700e5a15f3185bddc247
6
+ metadata.gz: 2a205a28f143426bbbedcafe4240751448d4161d60d7f30650570567a4e5eebf7232a4c0e313ad88853bcaa7e49a4170ddfafe3f0f4ad7e41d6946882e052531
7
+ data.tar.gz: ce658911f58df1d6b5f30bdb4f9c4c5894118019e57604b94d29ea759f3b9e2e568ddf0265b818eb33c91e1da05d0cd848fca5afe1e545c27ce3172767c3271d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.6.0] - 2026-11-03
6
+
7
+ - fix(sdk): resolve preflight lint and conformance vector count for autorelease
8
+ - feat(refunds): finalize clean merchant refunds spec, SDKs, CMS plugins, and targeted test scripts
9
+
10
+ - **403 is no longer reported as an authentication failure.** `Paymos::PermissionError` (subclasses `Paymos::AuthenticationError`, so existing `rescue` blocks keep working) now carries every 403.
11
+ - **Base URL must use HTTPS.** Plain HTTP is accepted only against a loopback host, which is what a local integration test points at. The API secret signs every request, so a plaintext base URL put that credential on the wire.
12
+
13
+ ## [1.5.2] - 2026-11-02
14
+
15
+ - wip: snapshot shared working tree before merging main
16
+ - fix(merge): keep both sides for 126 conflicting files (union / semantic JSON merge); Balance.razor keeps ClickToCopy ID column
17
+ - wip(refunds): merchant refund plugin work (CMS adapters, PHP SDK, tests) - unverified WIP snapshot
18
+
19
+ - **403 is no longer reported as an authentication failure.** `Paymos::PermissionError` (subclasses `Paymos::AuthenticationError`, so existing `rescue` blocks keep working) now carries every 403.
20
+ - **Base URL must use HTTPS.** Plain HTTP is accepted only against a loopback host, which is what a local integration test points at. The API secret signs every request, so a plaintext base URL put that credential on the wire.
21
+
5
22
  ## [1.5.1] - 2026-11-01
6
23
 
7
24
  - refactor(invoices): remove the multiple-payment toggle
data/README.md CHANGED
@@ -67,6 +67,7 @@ outcome. Creation returns 201 and an identical replay returns 200; both yield a
67
67
  `Paymos::NotFoundError` (404). List periods use RFC 3339 timestamps, and
68
68
  `paymos.refunds.each` provides the same bounded cursor iteration as invoices.
69
69
  In sandbox, use `paymos.withdrawals.simulate_completion(refund.withdrawal_id)`,
70
+ In sandbox, use `paymos.refunds.simulate(refund.withdrawal_id, status: 'completed')`,
70
71
  then read the refund again. Refunds have their own list and do not appear in the
71
72
  ordinary withdrawals list.
72
73
 
data/lib/paymos/client.rb CHANGED
@@ -298,6 +298,22 @@ module Paymos
298
298
  end
299
299
 
300
300
  class Refunds < Resource
301
+ UNSPECIFIED_STATUS = Object.new.freeze
302
+ private_constant :UNSPECIFIED_STATUS
303
+
304
+ def simulate(refund_id, positional_status = UNSPECIFIED_STATUS, status: UNSPECIFIED_STATUS)
305
+ if positional_status.equal?(UNSPECIFIED_STATUS) == status.equal?(UNSPECIFIED_STATUS)
306
+ raise ArgumentError, 'Provide exactly one refund simulation status'
307
+ end
308
+
309
+ status = positional_status unless positional_status.equal?(UNSPECIFIED_STATUS)
310
+ unless %w[completed failed cancelled].include?(status)
311
+ raise ArgumentError, 'A terminal refund simulation status is required'
312
+ end
313
+
314
+ Refund.from(@client.request('POST', "/v1/sandbox/refunds/#{segment(refund_id)}/simulate", payload: { status: }))
315
+ end
316
+
301
317
  def create(invoice_id:, mode:, external_order_id:)
302
318
  values = { invoice_id:, mode:, external_order_id: }
303
319
  missing = values.select { |_name, value| !value.is_a?(String) || value.strip.empty? }.keys
@@ -307,11 +323,6 @@ module Paymos
307
323
  Refund.from(@client.request('POST', '/v1/refunds', payload: values))
308
324
  end
309
325
 
310
- def simulate(refund_id, status)
311
- Refund.from(@client.request('POST', "/v1/sandbox/refunds/#{segment(refund_id)}/simulate",
312
- payload: { status: }))
313
- end
314
-
315
326
  def get(refund_id) = Refund.from(@client.request('GET', "/v1/refunds/#{segment(refund_id)}"))
316
327
 
317
328
  def list(limit: nil, cursor: nil, invoice_id: nil, status: nil, created_from: nil, created_to: nil)
data/lib/paymos/models.rb CHANGED
@@ -133,9 +133,9 @@ module Paymos
133
133
  end
134
134
 
135
135
  class Refund < Model
136
- fields :withdrawal_id, :invoice_id, :mode, :external_order_id, :status, :is_final, :is_test,
136
+ fields :type, :project_id, :withdrawal_id, :invoice_id, :mode, :external_order_id, :status, :is_final, :is_test,
137
137
  :amount, :fee, :currency, :network, :destination_address, :first_sender, :tx_hash,
138
- :explorer_url, :created_at, :completed_at, :failed_at, :cancelled_at, :type, :project_id,
138
+ :explorer_url, :created_at, :completed_at, :failed_at, :cancelled_at,
139
139
  required: %i[withdrawal_id invoice_id mode external_order_id status is_final is_test amount
140
140
  currency network destination_address first_sender created_at]
141
141
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paymos
4
- VERSION = '1.5.1'
4
+ VERSION = '1.6.0'
5
5
  end
data/sig/paymos.rbs CHANGED
@@ -276,6 +276,7 @@ module Paymos
276
276
 
277
277
  class Refunds
278
278
  def simulate: (String refund_id, String status) -> Refund
279
+ | (String refund_id, status: String) -> Refund
279
280
  def create: (invoice_id: String, mode: "full" | "overpayment", external_order_id: String) -> Refund
280
281
  def get: (String refund_id) -> Refund
281
282
  def list: (?limit: Integer?, ?cursor: String?, ?invoice_id: String?, ?status: String | Array[String]?, ?created_from: String?, ?created_to: String?) -> Page[Refund]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paymos
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paymos Labs