paymos 1.7.0 → 1.8.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: b4b2825ca7de83a212ccb05ee60ca1a00456d4e8db3a87517a3ec9f48601a578
4
- data.tar.gz: e997c75cd1c6f4ba28856d7d0028c233238f62dbc67d3fe1218cd7094ea9a764
3
+ metadata.gz: b2dbbdb711b584acd1a62489c4dede07a682d6844435ed1b8ecb928e93102ec3
4
+ data.tar.gz: 649dbcfedbb46bba61c715f08ce02e8f67988e8c9a02a1b5ef85063c52544acb
5
5
  SHA512:
6
- metadata.gz: a5400d64070f388f4aa881655cc0e3bd7bec28873e74e9464071415e4303a9363853f9462c14772b547f6467a34add12cda5858c963018998cd81161c1948459
7
- data.tar.gz: '0364786fcc8214ae4d109feab9f8d9b363efff7810cbfa2514f1b07b707865ded95e6971b043eeb2be33c99255a562010b0969a4b360b5f1368fbe632a771051'
6
+ metadata.gz: 26a39cb9fd8f85694c79cb438f0a7d795ce0322ac32811451d8a54110553108ebfc33365cf6ba24e10e2a05cd2bf9b40d67227bad64682fd4825c05930ec7c70
7
+ data.tar.gz: b6ebf36813ca48e6eee3989c22353c0f31d91055c871add47c41cd282532284d8ca7974b8c6db5d528526bff2d4fe0679213369eb08848dd13b479ce7520652c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.8.0] - 2026-11-28
6
+
7
+ - fix(ruby-sdk): make the conformance test pass rubocop
8
+ - docs(plugins): add 6-language READMEs (EN/zh-CN/ru/es/de/tr) and YouTube walkthrough previews across all 25 Paymos-labs repos
9
+ - fix: close bug batches 11-12 across SDKs, CMS plugins, workers, proxy, backup and admin
10
+
11
+ ## [1.7.1] - 2026-11-17
12
+
13
+ - refactor(checkout): remove product images from invoice products
14
+
5
15
  ## [1.7.0] - 2026-11-16
6
16
 
7
17
  - docs(sdk,drupal): document invoice products[] and update OpenAPI snapshot
data/README.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # Paymos Ruby SDK
2
2
 
3
+ **English** | [简体中文](README.zh-CN.md) | [Русский](README.ru.md) | [Español](README.es.md) | [Deutsch](README.de.md) | [Türkçe](README.tr.md)
4
+
3
5
  Official Ruby client for the Paymos Merchant API — invoices, withdrawals, refunds, balances,
4
6
  and static per-customer wallets with their confirmed-deposit feed. Its only runtime dependency is
5
7
  Ruby's official `base64` gem (required separately by modern Ruby versions).
6
8
 
9
+ [![Watch: Paymos API Quickstart in 10 Minutes — Sandbox to Signed Webhooks](https://i.ytimg.com/vi/aHQfHszuRBo/maxresdefault.jpg)](https://www.youtube.com/watch?v=aHQfHszuRBo)
10
+
11
+ > **Video walkthrough (1:22, subtitles in 6 languages):** [Watch on YouTube](https://www.youtube.com/watch?v=aHQfHszuRBo)
12
+
7
13
  ```bash
8
14
  gem install paymos
9
15
  ```
@@ -31,14 +37,13 @@ balances = paymos.balances.get
31
37
 
32
38
  ### Product line items (`products[]`)
33
39
 
34
- Pass optional `products:` (`1..50` `Paymos::InvoiceProduct` instances or Hashes) to display purchase context on hosted checkout, or omit `products:` / pass `products: nil` for a compatible `amount-only` invoice. Each `Paymos::InvoiceProduct` requires `title:` (<= 200 Unicode scalar values), positive integer `quantity:`, and decimal string `unit_amount:` (in the invoice currency); `description:` (plain text, <= 2000 scalars) and `image_url:` (HTTPS URL, <= 2048 scalars) are optional keywords and are omitted on the wire when `nil`.
40
+ Pass optional `products:` (`1..50` `Paymos::InvoiceProduct` instances or Hashes) to display purchase context on hosted checkout, or omit `products:` / pass `products: nil` for a compatible `amount-only` invoice. Each `Paymos::InvoiceProduct` requires `title:` (<= 200 Unicode scalar values), positive integer `quantity:`, and decimal string `unit_amount:` (in the invoice currency); `description:` (plain text, <= 2000 scalars) is an optional keyword and is omitted on the wire when `nil`.
35
41
 
36
42
  ```ruby
37
- # 1-item invoice with optional description and image_url
43
+ # 1-item invoice with optional description
38
44
  studio_pro = Paymos::InvoiceProduct.new(
39
45
  title: "Studio Pro",
40
46
  description: "One-month access",
41
- image_url: "https://shop.example/images/studio-pro.webp",
42
47
  quantity: 2,
43
48
  unit_amount: "24.50"
44
49
  )
@@ -50,7 +55,7 @@ single_invoice = paymos.invoices.create(
50
55
  products: [studio_pro]
51
56
  )
52
57
 
53
- # Multi-item cart including a minimal 3-field item (no description / image_url)
58
+ # Multi-item cart including a minimal 3-field item (no description)
54
59
  cart_invoice = paymos.invoices.create(
55
60
  project_id: "prj_...",
56
61
  amount: "59.00",
@@ -69,7 +74,7 @@ end
69
74
 
70
75
  - **Authoritative `amount`:** `amount` is the exact order total and is never recomputed from `sum(quantity * unit_amount)`.
71
76
  - **First-success replay:** the first successful create freezes `order.products` on the invoice. Replaying the same `external_order_id` with unchanged `(amount, currency, network)` returns HTTP 200 with the original `Paymos::Invoice` and `order.products`, even if `products` changed; changing `(amount, currency, network)` raises `Paymos::ConflictError` (`409 invoice_idempotency_conflict`). Legacy and `amount-only` invoices return `order.products == nil`.
72
- - **Image/product fallback & webhooks:** invoice creation stores `image_url` without fetching it server-side; if the buyer's browser fails to load an image or an item omits `description`/`image_url`, checkout hides only the missing media/description and keeps payment active. Signed invoice webhooks omit `products`.
77
+ - **Webhooks:** signed invoice webhooks omit `products`.
73
78
 
74
79
  Responses are immutable Ruby objects with documented RBS signatures (`sig/paymos.rbs`); request
75
80
  keywords remain idiomatic `snake_case` and are converted directly to the Paymos
@@ -1148,7 +1148,6 @@
1148
1148
  {
1149
1149
  "title": "Studio Pro",
1150
1150
  "description": "One-month access",
1151
- "image_url": "https://shop.example/images/studio-pro.webp",
1152
1151
  "quantity": 2,
1153
1152
  "unit_amount": "24.50"
1154
1153
  }
@@ -1169,7 +1168,6 @@
1169
1168
  {
1170
1169
  "title": "Studio Pro",
1171
1170
  "description": "One-month access",
1172
- "image_url": "https://shop.example/images/studio-pro.webp",
1173
1171
  "quantity": 2,
1174
1172
  "unit_amount": "24.50"
1175
1173
  }
@@ -1191,7 +1189,6 @@
1191
1189
  {
1192
1190
  "title": "Studio Pro",
1193
1191
  "description": "One-month access",
1194
- "image_url": "https://shop.example/images/studio-pro.webp",
1195
1192
  "quantity": 2,
1196
1193
  "unit_amount": "24.50"
1197
1194
  },
@@ -1217,7 +1214,6 @@
1217
1214
  {
1218
1215
  "title": "Studio Pro",
1219
1216
  "description": "One-month access",
1220
- "image_url": "https://shop.example/images/studio-pro.webp",
1221
1217
  "quantity": 2,
1222
1218
  "unit_amount": "24.50"
1223
1219
  },
@@ -1292,8 +1288,7 @@
1292
1288
  "unit_amount"
1293
1289
  ],
1294
1290
  "optional_item_fields": [
1295
- "description",
1296
- "image_url"
1291
+ "description"
1297
1292
  ],
1298
1293
  "omit_null_optional_item_fields": true,
1299
1294
  "quantity_type": "integer",
data/lib/paymos/client.rb CHANGED
@@ -270,7 +270,7 @@ module Paymos
270
270
  raise ArgumentError, 'products items must respond to to_h' unless item.respond_to?(:to_h)
271
271
 
272
272
  item.to_h.transform_keys(&:to_sym).reject do |key, value|
273
- %i[description image_url].include?(key) && value.nil?
273
+ (key == :description && value.nil?) || key == :image_url || key == :imageUrl
274
274
  end
275
275
  end
276
276
  end
data/lib/paymos/models.rb CHANGED
@@ -80,11 +80,31 @@ module Paymos
80
80
  end
81
81
 
82
82
  class InvoiceProduct < Model
83
- fields :title, :description, :image_url, :quantity, :unit_amount,
83
+ fields :title, :description, :quantity, :unit_amount,
84
84
  required: %i[title quantity unit_amount]
85
85
 
86
+ # Deprecated compatibility reader preserved from v1.7.0 so callers constructing
87
+ # InvoiceProduct with `image_url:` (including nil) or reading legacy responses
88
+ # continue to work; the value is never serialized onto outbound requests.
89
+ attr_reader :image_url
90
+
91
+ def self.from(value)
92
+ raise Error, 'Paymos API response must be a JSON object' unless value.is_a?(Hash)
93
+
94
+ attributes = field_names.to_h { |name| [name, value[name.to_s]] }
95
+ missing = required_names.select { |name| attributes[name].nil? }
96
+ raise Error, "Paymos API response is missing: #{missing.join(', ')}" unless missing.empty?
97
+
98
+ new(**attributes, image_url: value['image_url'])
99
+ end
100
+
101
+ def initialize(image_url: nil, **attributes)
102
+ @image_url = Model.deep_freeze(image_url)
103
+ super(**attributes)
104
+ end
105
+
86
106
  def to_h
87
- super.reject { |key, value| %i[description image_url].include?(key) && value.nil? }
107
+ super.reject { |key, value| key == :description && value.nil? }
88
108
  end
89
109
  end
90
110
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paymos
4
- VERSION = '1.7.0'
4
+ VERSION = '1.8.0'
5
5
  end
data/sig/paymos.rbs CHANGED
@@ -76,6 +76,7 @@ module Paymos
76
76
  class InvoiceProduct < Model
77
77
  attr_reader title: String
78
78
  attr_reader description: String?
79
+ # Deprecated compatibility accessor from v1.7.0; omitted from serialized request payloads.
79
80
  attr_reader image_url: String?
80
81
  attr_reader quantity: Integer
81
82
  attr_reader unit_amount: String
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.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paymos Labs