paymos 1.7.0 → 1.7.1

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: 57b262c38d6cb857ca0d294ce81d4597f1bfbfa0424c547d1503d67c679f19e7
4
+ data.tar.gz: 78d77c7ea30e6bfa9a364b69518bd5ce815d4b4346c914adfef1ac684fcc063d
5
5
  SHA512:
6
- metadata.gz: a5400d64070f388f4aa881655cc0e3bd7bec28873e74e9464071415e4303a9363853f9462c14772b547f6467a34add12cda5858c963018998cd81161c1948459
7
- data.tar.gz: '0364786fcc8214ae4d109feab9f8d9b363efff7810cbfa2514f1b07b707865ded95e6971b043eeb2be33c99255a562010b0969a4b360b5f1368fbe632a771051'
6
+ metadata.gz: 1b7d6b4c2eb4e485f491498b66b15ea078c9ae1b5cfae766f0307a3a565b26ee5f08456f7a3a5c72e8a2b4314a7e5d33167f5a015478791dab5bc554b9de33c3
7
+ data.tar.gz: 8f10f5358a1b2a8d1e0946b1b4bab01064d05ca78ad1edeae824420dad5af26cd6f9beea2b3eefbf3b5cf63ad6751c24eeebfe7c3cc4badcd6b451b24a75a5f8
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.7.1] - 2026-11-17
6
+
7
+ - refactor(checkout): remove product images from invoice products
8
+
5
9
  ## [1.7.0] - 2026-11-16
6
10
 
7
11
  - docs(sdk,drupal): document invoice products[] and update OpenAPI snapshot
data/README.md CHANGED
@@ -31,14 +31,13 @@ balances = paymos.balances.get
31
31
 
32
32
  ### Product line items (`products[]`)
33
33
 
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`.
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) is an optional keyword and is omitted on the wire when `nil`.
35
35
 
36
36
  ```ruby
37
- # 1-item invoice with optional description and image_url
37
+ # 1-item invoice with optional description
38
38
  studio_pro = Paymos::InvoiceProduct.new(
39
39
  title: "Studio Pro",
40
40
  description: "One-month access",
41
- image_url: "https://shop.example/images/studio-pro.webp",
42
41
  quantity: 2,
43
42
  unit_amount: "24.50"
44
43
  )
@@ -50,7 +49,7 @@ single_invoice = paymos.invoices.create(
50
49
  products: [studio_pro]
51
50
  )
52
51
 
53
- # Multi-item cart including a minimal 3-field item (no description / image_url)
52
+ # Multi-item cart including a minimal 3-field item (no description)
54
53
  cart_invoice = paymos.invoices.create(
55
54
  project_id: "prj_...",
56
55
  amount: "59.00",
@@ -69,7 +68,7 @@ end
69
68
 
70
69
  - **Authoritative `amount`:** `amount` is the exact order total and is never recomputed from `sum(quantity * unit_amount)`.
71
70
  - **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`.
71
+ - **Webhooks:** signed invoice webhooks omit `products`.
73
72
 
74
73
  Responses are immutable Ruby objects with documented RBS signatures (`sig/paymos.rbs`); request
75
74
  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?
274
274
  end
275
275
  end
276
276
  end
data/lib/paymos/models.rb CHANGED
@@ -80,11 +80,11 @@ 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
86
  def to_h
87
- super.reject { |key, value| %i[description image_url].include?(key) && value.nil? }
87
+ super.reject { |key, value| key == :description && value.nil? }
88
88
  end
89
89
  end
90
90
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paymos
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.1'
5
5
  end
data/sig/paymos.rbs CHANGED
@@ -76,11 +76,10 @@ module Paymos
76
76
  class InvoiceProduct < Model
77
77
  attr_reader title: String
78
78
  attr_reader description: String?
79
- attr_reader image_url: String?
80
79
  attr_reader quantity: Integer
81
80
  attr_reader unit_amount: String
82
81
 
83
- def initialize: (title: String, quantity: Integer, unit_amount: String, ?description: String?, ?image_url: String?) -> void
82
+ def initialize: (title: String, quantity: Integer, unit_amount: String, ?description: String?) -> void
84
83
  end
85
84
 
86
85
  class Order < Model
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.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paymos Labs