mintsoft 0.1.7 → 0.1.8

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: e2a17bbdcac6407c2e35b8c88255eca2aa11c885925050fa52b5c77ee56cdf17
4
- data.tar.gz: b8bf5662fb94f4b854aca4790e0420fce462dd5915ef75f2ef6ecde8eb10ff7b
3
+ metadata.gz: f2794a34f86aaf4b8893894ad55ee7540b5d2aed7615696b3a4182d1dcdc46ab
4
+ data.tar.gz: 3ccf116643c9649630adf9d236b3d265c123688f89872f1454771e5d2189bc5e
5
5
  SHA512:
6
- metadata.gz: bb81292cb1375785a2f553848ca8312cf42e45d70c05b5bc2c79a8c63ad4c9e35145927decf712bef768392637baea29735d54aa98fad8e474bbfe4d7c897c9f
7
- data.tar.gz: 691e669052b7de1ab710aff5d03061ab5040b9871b3593978cfc5eda0f91aec766c7fc0e1e8aea7e4c8a0cb44aa346801f35c5b41a4145eb8b321c6aaa3f7864
6
+ metadata.gz: 00f11f1b2b9dcf445d06f8a5545b9fc2bde79abfdb3f228a14cea0362856d5079fd22ed8befc8af22480bf0c2da83d807a1d9f240d8121ed15eb8589c62b81cd
7
+ data.tar.gz: c588a47224828812dec6d1a7371d017159a401feaa31e04bd167160fa0939a583f786733954380f1010b38dbccc77c265fcb64d59068b20f6cd1f149be55b911
data/README.md CHANGED
@@ -5,7 +5,7 @@ A Ruby wrapper for the Mintsoft API that provides simple token-based authenticat
5
5
  ## Features
6
6
 
7
7
  - **Token-only authentication**: Manual token management for full control
8
- - **5 Essential API endpoints**: Authentication, Order Search, Return Reasons, Create Returns, Add Return Items
8
+ - **6 Essential API endpoints**: Authentication, Order Search, Return Reasons, Create Returns, Add Return Items, Retrieve Returns
9
9
  - **OpenStruct-based objects**: Flexible response handling with automatic attribute conversion
10
10
  - **Faraday HTTP client**: Robust HTTP handling with JSON support
11
11
  - **Comprehensive error handling**: Clear error messages for common scenarios
@@ -120,9 +120,16 @@ result = client.returns.add_item(return_obj.id, {
120
120
  notes: "Optional notes"
121
121
  })
122
122
 
123
+ # Retrieve a specific return by ID
124
+ return_obj = client.returns.retrieve(return_id)
125
+
123
126
  # Access return properties
124
127
  puts return_obj.id # Direct access to return ID
125
- # Note: Items data structure depends on API response format
128
+ puts return_obj.order_id # Direct access to order ID
129
+ puts return_obj.status # Direct access to return status
130
+ puts return_obj.customer_name # Direct access to customer name
131
+ puts return_obj.total_value # Direct access to total value
132
+ # Note: Available properties depend on API response structure
126
133
  ```
127
134
 
128
135
  ### Error Handling
@@ -31,6 +31,15 @@ module Mintsoft
31
31
  Objects::Return.new(response_data)
32
32
  end
33
33
 
34
+ def retrieve(return_id)
35
+ validate_return_id!(return_id)
36
+
37
+ response = get_request("/api/Return/#{return_id}")
38
+ response_data = handle_response(response)
39
+
40
+ Objects::Return.new(response_data)
41
+ end
42
+
34
43
  private
35
44
 
36
45
  def validate_order_id!(order_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mintsoft
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mintsoft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Chong