ultracart_api 4.1.3 → 4.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072052f4d9cffb084d1c14e700e1a912b9d07d0f5528d5bfb56afc397055cc34
|
4
|
+
data.tar.gz: 16dc833a02415b6218568966bf11c7ac3cc4c02cfb2d6f9f2954c30b2fb589c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26bfb1c9739bd9aaf0cd5dac305b5b2927fa09337b196a1796a7f2265512bc914ff083a02f0dc821e76fad615e024f8fb86be4490e316d1bf7769df75908348
|
7
|
+
data.tar.gz: 5f4957d6892dc48e4a214b90f9951fd3dad6c0ee782c567ae491aac5c5f5147c22638cb89836643cc4509da6e8a153a6e50192530c250ccf47e2fa297adc0d1d
|
data/README.md
CHANGED
@@ -1,89 +1,79 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
UltracartClient - the Ruby gem for the UltraCart Rest API V2
|
1
|
+
# UltraCart Ruby SDK
|
4
2
|
|
5
3
|
UltraCart REST API Version 2
|
6
4
|
|
5
|
+
Note: Every method has a sample for every language. See https://github.com/UltraCart/sdk_samples
|
6
|
+
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 4.1.
|
10
|
+
- Package version: 4.1.5
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
-
For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
|
12
|
+
- For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
To build the Ruby code into a gem:
|
16
|
+
gemfile:
|
19
17
|
|
20
18
|
```shell
|
21
|
-
gem
|
19
|
+
gem 'ultracart_api', '4.1.5'
|
22
20
|
```
|
23
21
|
|
24
|
-
|
22
|
+
install:
|
25
23
|
|
26
24
|
```shell
|
27
|
-
gem install
|
28
|
-
```
|
29
|
-
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.1.3.gem` to install the development dependencies)
|
31
|
-
|
32
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
-
|
34
|
-
Finally add this to the Gemfile:
|
35
|
-
|
36
|
-
gem 'ultracart_api', '~> 4.1.3'
|
37
|
-
|
38
|
-
### Install from Git
|
39
|
-
|
40
|
-
If the Ruby gem is hosted at a git repository: https://github.com/UltraCart/rest_api_v2_sdk_ruby, then add the following in the Gemfile:
|
41
|
-
|
42
|
-
gem 'ultracart_api', :git => 'https://github.com/UltraCart/rest_api_v2_sdk_ruby.git'
|
43
|
-
|
44
|
-
### Include the Ruby code directly
|
45
|
-
|
46
|
-
Include the Ruby code directly using `-I` as follows:
|
47
|
-
|
48
|
-
```shell
|
49
|
-
ruby -Ilib script.rb
|
25
|
+
gem install ultracart_api
|
50
26
|
```
|
51
27
|
|
52
28
|
## Getting Started
|
53
29
|
|
54
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
-
|
56
30
|
```ruby
|
57
|
-
# Load the gem
|
58
31
|
require 'ultracart_api'
|
32
|
+
require_relative '../constants'
|
59
33
|
|
60
|
-
#
|
61
|
-
UltracartClient.
|
62
|
-
# Configure OAuth2 access token for authorization: ultraCartOauth
|
63
|
-
config.access_token = 'YOUR ACCESS TOKEN'
|
34
|
+
# OrderApi.getOrder() retrieves a single order for a given order_id.
|
35
|
+
order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
64
36
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
37
|
+
# The expansion variable instructs UltraCart how much information to return. The order object is large and
|
38
|
+
# while it's easily manageable for a single order, when querying thousands of orders, is useful to reduce
|
39
|
+
# payload size.
|
40
|
+
# see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
|
41
|
+
=begin
|
42
|
+
Possible Order Expansions:
|
43
|
+
affiliate affiliate.ledger auto_order
|
44
|
+
billing channel_partner checkout
|
45
|
+
coupon customer_profile digital_order
|
46
|
+
edi fraud_score gift
|
47
|
+
gift_certificate internal item
|
48
|
+
linked_shipment marketing payment
|
49
|
+
payment.transaction quote salesforce
|
50
|
+
shipping shipping.tracking_number_details summary
|
51
|
+
taxes
|
52
|
+
=end
|
53
|
+
expansion = "item,summary,billing,shipping,shipping.tracking_number_details"
|
70
54
|
|
71
|
-
|
72
|
-
click_query = UltracartClient::AffiliateClickQuery.new # AffiliateClickQuery | Click query
|
55
|
+
order_id = 'DEMO-0009104390'
|
73
56
|
opts = {
|
74
|
-
|
75
|
-
_offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
|
76
|
-
_expand: '_expand_example' # String | The object expansion to perform on the result. Only option is link.
|
57
|
+
'_expand' => expansion
|
77
58
|
}
|
78
59
|
|
79
60
|
begin
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
61
|
+
api_response = order_api.get_order(order_id, opts)
|
62
|
+
|
63
|
+
# Check for errors
|
64
|
+
if api_response.error
|
65
|
+
puts "Developer Message: #{api_response.error.developer_message}"
|
66
|
+
puts "User Message: #{api_response.error.user_message}"
|
67
|
+
exit
|
68
|
+
end
|
86
69
|
|
70
|
+
order = api_response.order
|
71
|
+
|
72
|
+
# Using inspect instead of var_dump for Ruby-style object representation
|
73
|
+
puts order.inspect
|
74
|
+
rescue StandardError => e
|
75
|
+
puts "An error occurred: #{e.message}"
|
76
|
+
end
|
87
77
|
```
|
88
78
|
|
89
79
|
## Documentation for API Endpoints
|
@@ -1526,6 +1516,8 @@ Not every change is committed to every SDK.
|
|
1526
1516
|
|
1527
1517
|
| Version | Date | Comments |
|
1528
1518
|
| --: | :-: | --- |
|
1519
|
+
| 4.1.5 | 03/28/2025 | added paypal fastlane constants for payments |
|
1520
|
+
| 4.1.4 | 03/07/2025 | updated github readme.md |
|
1529
1521
|
| 4.1.3 | 03/07/2025 | updated github readme.md files |
|
1530
1522
|
| 4.1.2 | 03/05/2025 | added ChannelPartnerOrder.use_prior_payment_information_from_order_id |
|
1531
1523
|
| 4.1.1 | 02/28/2025 | auto order pause method |
|
@@ -1103,7 +1103,7 @@ module UltracartClient
|
|
1103
1103
|
return false if !@email.nil? && @email.to_s.length > 100
|
1104
1104
|
return false if !@gift_email.nil? && @gift_email.to_s.length > 100
|
1105
1105
|
return false if !@gift_message.nil? && @gift_message.to_s.length > 10000
|
1106
|
-
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"])
|
1106
|
+
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer", "PayPal Fastlane"])
|
1107
1107
|
return false unless payment_method_validator.valid?(@payment_method)
|
1108
1108
|
return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
|
1109
1109
|
return false if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50
|
@@ -1375,7 +1375,7 @@ module UltracartClient
|
|
1375
1375
|
# Custom attribute writer method checking allowed values (enum).
|
1376
1376
|
# @param [Object] payment_method Object to be assigned
|
1377
1377
|
def payment_method=(payment_method)
|
1378
|
-
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"])
|
1378
|
+
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer", "PayPal Fastlane"])
|
1379
1379
|
unless validator.valid?(payment_method)
|
1380
1380
|
fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
|
1381
1381
|
end
|
@@ -260,7 +260,7 @@ module UltracartClient
|
|
260
260
|
# Check to see if the all the properties in the model are valid
|
261
261
|
# @return true if the model is valid
|
262
262
|
def valid?
|
263
|
-
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card"])
|
263
|
+
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
|
264
264
|
return false unless payment_method_validator.valid?(@payment_method)
|
265
265
|
payment_status_validator = EnumAttributeValidator.new('String', ["Unprocessed", "Authorized", "Capture Failed", "Processed", "Declined", "Voided", "Refunded", "Skipped"])
|
266
266
|
return false unless payment_status_validator.valid?(@payment_status)
|
@@ -270,7 +270,7 @@ module UltracartClient
|
|
270
270
|
# Custom attribute writer method checking allowed values (enum).
|
271
271
|
# @param [Object] payment_method Object to be assigned
|
272
272
|
def payment_method=(payment_method)
|
273
|
-
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card"])
|
273
|
+
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
|
274
274
|
unless validator.valid?(payment_method)
|
275
275
|
fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
|
276
276
|
end
|
@@ -530,7 +530,7 @@ module UltracartClient
|
|
530
530
|
return false if !@email.nil? && @email.to_s.length > 100
|
531
531
|
return false if !@first_name.nil? && @first_name.to_s.length > 30
|
532
532
|
return false if !@last_name.nil? && @last_name.to_s.length > 30
|
533
|
-
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay"])
|
533
|
+
payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
|
534
534
|
return false unless payment_method_validator.valid?(@payment_method)
|
535
535
|
return false if !@phone.nil? && @phone.to_s.length > 25
|
536
536
|
return false if !@postal_code.nil? && @postal_code.to_s.length > 20
|
@@ -625,7 +625,7 @@ module UltracartClient
|
|
625
625
|
# Custom attribute writer method checking allowed values (enum).
|
626
626
|
# @param [Object] payment_method Object to be assigned
|
627
627
|
def payment_method=(payment_method)
|
628
|
-
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay"])
|
628
|
+
validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
|
629
629
|
unless validator.valid?(payment_method)
|
630
630
|
fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
|
631
631
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultracart_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|