solidgate-ruby-sdk 0.1.10 → 0.1.12
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 +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +11 -5
- data/lib/solidgate/client.rb +33 -0
- data/lib/solidgate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4128217c38f32fdd711b9730aee7aabb85e43f24634bac4b8233ff4f1dfd900f
|
|
4
|
+
data.tar.gz: 6d3917d1111b2043f1c9aa008364c2d4c09d75123ca59bbed6fb959c28add824
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 900f118702889d575cb369cac9f57ed75ea43c21ef4706971d1588354d62e24014170768cb124550a9ab633d5e67c5d5bc9c0101ad40c9e67bab78e8d4d2b58f
|
|
7
|
+
data.tar.gz: b696bb31ff5eb9676dd97a00c289d8fef9d6ae0ac4def587b8fbbbe33e635e454b34b03149fd755d1c3b6b475057ab3c16fa31dc06f99c1989fcf6a6738db7a4
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.10] - 2026-02-03
|
|
11
|
+
- Added refund method example to README
|
|
12
|
+
|
|
10
13
|
## [0.1.9] - 2026-02-03
|
|
11
14
|
- Added documentation for restore_subscription method
|
|
12
15
|
- Added restore_subscription to README.md usage examples
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -103,11 +103,8 @@ client.capture_payment('payment_id_123', amount: 500)
|
|
|
103
103
|
# Void an authorized payment (before settlement)
|
|
104
104
|
client.void_payment('payment_id_123')
|
|
105
105
|
|
|
106
|
-
# Refund
|
|
107
|
-
client.
|
|
108
|
-
|
|
109
|
-
# Partial refund
|
|
110
|
-
client.refund_payment('payment_id_123', amount: 500, reason: 'Customer request')
|
|
106
|
+
# Refund by order ID (pay.solidgate.com)
|
|
107
|
+
client.refund(order_id: 'order_123', amount: 1000)
|
|
111
108
|
```
|
|
112
109
|
|
|
113
110
|
### Subscription Management
|
|
@@ -142,6 +139,15 @@ client.cancel_subscription(
|
|
|
142
139
|
client.restore_subscription(
|
|
143
140
|
subscription_id: 'sub_123'
|
|
144
141
|
)
|
|
142
|
+
|
|
143
|
+
### Update subscription payment method
|
|
144
|
+
|
|
145
|
+
# Update the payment token associated with an existing subscription
|
|
146
|
+
client.update_subscription_payment_method(
|
|
147
|
+
subscription_id: 'sub_123',
|
|
148
|
+
token: 'tok_abc123'
|
|
149
|
+
)
|
|
150
|
+
|
|
145
151
|
```
|
|
146
152
|
|
|
147
153
|
### Subscription Pause Scheduling
|
data/lib/solidgate/client.rb
CHANGED
|
@@ -289,6 +289,22 @@ module Solidgate
|
|
|
289
289
|
encrypt_payload(params)
|
|
290
290
|
end
|
|
291
291
|
|
|
292
|
+
# Updates an existing price for a product.
|
|
293
|
+
# Use this to modify the amount, currency, or billing interval of a price.
|
|
294
|
+
#
|
|
295
|
+
# @param product_id [String] the product identifier that owns the price
|
|
296
|
+
# @param price_id [String] the price identifier to update
|
|
297
|
+
# @param params [Hash] price update parameters:
|
|
298
|
+
# @return [Hash] updated price details including price_id
|
|
299
|
+
# @raise [InvalidRequestError] if product_id, price_id, or params are invalid
|
|
300
|
+
#
|
|
301
|
+
# @example Update a price amount
|
|
302
|
+
# client.update_product_price('prod_123', 'price_456', amount: 2000)
|
|
303
|
+
#
|
|
304
|
+
def update_product_price(product_id, price_id, params)
|
|
305
|
+
patch("/api/v1/products/#{product_id}/prices/#{price_id}", body: params)
|
|
306
|
+
end
|
|
307
|
+
|
|
292
308
|
# Generates an HMAC-SHA512 signature for API request authentication.
|
|
293
309
|
# The signature is required for all API requests and webhook validation.
|
|
294
310
|
#
|
|
@@ -340,6 +356,23 @@ module Solidgate
|
|
|
340
356
|
post("/api/v1/refund", body: params, base_url: "https://pay.solidgate.com")
|
|
341
357
|
end
|
|
342
358
|
|
|
359
|
+
# Updates the payment method (token) associated with an existing subscription.
|
|
360
|
+
#
|
|
361
|
+
# @param params [Hash] update parameters including:
|
|
362
|
+
# - :subscription_id [String] the subscription to update
|
|
363
|
+
# - :token [String] new payment token / payment method identifier
|
|
364
|
+
# @return [Hash] response from the API with updated subscription/payment method details
|
|
365
|
+
# @raise [InvalidRequestError] if params are invalid
|
|
366
|
+
#
|
|
367
|
+
# @example Update a subscription's payment method
|
|
368
|
+
# client.update_subscription_payment_method(
|
|
369
|
+
# subscription_id: 'sub_123',
|
|
370
|
+
# token: 'tok_abc123'
|
|
371
|
+
# )
|
|
372
|
+
def update_subscription_payment_method(params)
|
|
373
|
+
post("/api/v1/subscription/update-token", body: params)
|
|
374
|
+
end
|
|
375
|
+
|
|
343
376
|
private
|
|
344
377
|
|
|
345
378
|
# Builds a Configuration object from the provided options.
|
data/lib/solidgate/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidgate-ruby-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hector Carrillo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|