multicard 0.1.0 → 0.2.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: 4deef0f73a9d0f65799ff892e950f24b744a350cadd90b2956fc5dd4c91f6f2f
4
- data.tar.gz: 1471a57173d4a1b868867350f9de3e9e72513f6fe873bba4fa10767f79044eba
3
+ metadata.gz: 41b2116da3fd9724e750a8ace1d5803a09a14bf8eb11a58d323a4bc1235321cc
4
+ data.tar.gz: ced60479704e63bcfe013cef263bc9286368dc119da3448b373d97de53b14a74
5
5
  SHA512:
6
- metadata.gz: 9ba05346db8cf1fe2b16577f06423fe19b24652c4cb5210124ef313c94355c4645008be1d57157095c33acce7f4b2197f159905fde1188977bc1cc0c2ae44aa4
7
- data.tar.gz: e9e987599830d737e9f878bd46938df9308607bc79a5cf3314bf6b4df4f7076ec81a4389deba588ace709ed517b111844da9c1ebe8ec22661e56cf9df6148802
6
+ metadata.gz: c1a4f60027a4d7af9d865d434abb4853112051873f7cb86a6d34873b49c0f4dd32def71b7ba59db0f1a45941164536660c34f72f85935354746bca666cb3bf01
7
+ data.tar.gz: d29d537327f473bcdf8931c83a416ca7a4849607011f4e37b8d6a1c2afcd59772515bdac8dc69107f771ca5c1e611e9b98064159431b06682e5ee70abc5e5bd9
data/CHANGELOG.md CHANGED
@@ -5,7 +5,33 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.1.0] - 2026-02-16
8
+ ## [0.2.0] - 2026-06-22
9
+
10
+ ### Fixed
11
+
12
+ - `Payments#partial_refund` now uses the correct Multicard endpoint
13
+ `DELETE /payment/{uuid}/partial` with body `{ refund_amount, ofd, card_pan? }`.
14
+ Previously it issued `POST /payment/{uuid}/refund/partial { amount }` (wrong
15
+ verb, path, and missing the mandatory `ofd` fiscal array).
16
+
17
+ ### Changed
18
+
19
+ - **Breaking:** `Payments#partial_refund` signature is now
20
+ `partial_refund(payment_id, refund_amount:, ofd:, card_pan: nil)`
21
+ (was `partial_refund(payment_id, amount:)`). `ofd` is required (the original
22
+ receipt is cancelled and a new one issued for the remaining items); `card_pan`
23
+ is optional and only used for wallet apps (Payme/Click).
24
+ - `HttpClient#delete` and `Resources::Base#delete` now accept an optional JSON
25
+ `body:`, enabling DELETE-with-body requests.
26
+
27
+ ## [0.1.1] - 2026-02-21
28
+
29
+ ### Changed
30
+
31
+ - Updated gem author metadata
32
+ - Replaced HTTP.rb with Net::HTTP (zero runtime dependencies)
33
+
34
+ ## [0.1.0] - 2026-02-21
9
35
 
10
36
  ### Added
11
37
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Honey Murena
3
+ Copyright (c) 2026 Pavel Skripin
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Multicard Ruby SDK
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/multicard.svg)](https://badge.fury.io/rb/multicard)
4
- [![CI](https://github.com/pashgo/multicard-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/pashgo/multicard-ruby/actions/workflows/ci.yml)
5
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
5
 
7
6
  Ruby client for the [Multicard](https://multicard.uz) payment gateway (Uzbekistan).
@@ -211,8 +210,16 @@ client.payments.confirm('payment-uuid', otp_code: '123456')
211
210
  # Full refund
212
211
  client.payments.refund('payment-uuid')
213
212
 
214
- # Partial refund
215
- client.payments.partial_refund('payment-uuid', amount: 100_000)
213
+ # Partial refund — cancels the original fiscal receipt and issues a new one
214
+ # for the remaining items, so the `ofd` array is mandatory.
215
+ client.payments.partial_refund(
216
+ 'payment-uuid',
217
+ refund_amount: 100_000,
218
+ ofd: [{ vat_percent: 12, price: 100_000, amount: 1, package_code: '1234567', mxik: '08110' }]
219
+ )
220
+
221
+ # Wallet refunds (Payme/Click) additionally require the masked PAN:
222
+ client.payments.partial_refund('payment-uuid', refund_amount: 100_000, ofd: [...], card_pan: '8600****1234')
216
223
  ```
217
224
 
218
225
  ### Fiscal Receipt
@@ -51,7 +51,7 @@ module Multicard
51
51
  # The 401 retry in authenticated_request is still applied (token refresh).
52
52
  @http_client.post(path, body: body || {}, headers: headers)
53
53
  when :delete
54
- @http_client.delete(path, params: params || {}, headers: headers)
54
+ @http_client.delete(path, body: body, params: params || {}, headers: headers)
55
55
  else
56
56
  raise ArgumentError, "Unsupported HTTP method: #{method}"
57
57
  end
@@ -11,7 +11,7 @@ module Multicard
11
11
  def initialize(**options)
12
12
  @application_id = options[:application_id]
13
13
  @secret = options[:secret]
14
- @base_url = options[:base_url] || DEFAULT_BASE_URL
14
+ @base_url = (options[:base_url] || DEFAULT_BASE_URL).chomp('/')
15
15
  @timeout = options[:timeout] || DEFAULT_TIMEOUT
16
16
  @open_timeout = options[:open_timeout] || DEFAULT_OPEN_TIMEOUT
17
17
  @logger = options[:logger]
@@ -18,8 +18,8 @@ module Multicard
18
18
  request(:post, path, body: body, headers: headers)
19
19
  end
20
20
 
21
- def delete(path, params: {}, headers: {})
22
- request(:delete, path, params: params, headers: headers)
21
+ def delete(path, body: nil, params: {}, headers: {})
22
+ request(:delete, path, body: body, params: params, headers: headers)
23
23
  end
24
24
 
25
25
  def get_with_retry(path, params: {}, headers: {}, retries: 2)
@@ -19,8 +19,8 @@ module Multicard
19
19
  @client.authenticated_request(:post, path, body: body)
20
20
  end
21
21
 
22
- def delete(path, params = {})
23
- @client.authenticated_request(:delete, path, params: params)
22
+ def delete(path, body: nil, params: {})
23
+ @client.authenticated_request(:delete, path, body: body, params: params)
24
24
  end
25
25
 
26
26
  def default_store_id
@@ -113,11 +113,20 @@ module Multicard
113
113
 
114
114
  # Partial refund.
115
115
  #
116
+ # Cancels the original fiscal receipt and issues a new one for the
117
+ # remaining items (the +ofd+ array is mandatory for partial refunds).
118
+ #
116
119
  # @param payment_id [String] payment ID (UUID)
117
- # @param amount [Integer] refund amount in tiyin
120
+ # @param refund_amount [Integer] refund amount in tiyin
121
+ # @param ofd [Array<Hash>] fiscal receipt items for the remaining goods
122
+ # @param card_pan [String, nil] masked PAN — required only for wallet apps (Payme/Click)
118
123
  # @return [Response]
119
- def partial_refund(payment_id, amount:)
120
- post("/payment/#{encode_path(payment_id)}/refund/partial", { amount: amount })
124
+ def partial_refund(payment_id, refund_amount:, ofd:, card_pan: nil)
125
+ delete("/payment/#{encode_path(payment_id)}/partial", body: {
126
+ refund_amount: refund_amount,
127
+ ofd: ofd,
128
+ card_pan: card_pan
129
+ }.compact)
121
130
  end
122
131
 
123
132
  # Submit a fiscal receipt link.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Multicard
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multicard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Honey Murena
7
+ - Pavel Skripin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-21 00:00:00.000000000 Z
11
+ date: 2026-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -70,7 +70,7 @@ description: Ruby SDK for Multicard.uz — payment gateway supporting Uzcard, Hu
70
70
  and 9 wallet apps (Payme, Click, Uzum, etc.). Invoices, card payments, splits, holds,
71
71
  payouts, card binding, and webhook verification.
72
72
  email:
73
- - dev@honeymurena.com
73
+ - skripin.pavel@gmail.com
74
74
  executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []