beyond_api 0.8.0.pre → 0.11.1.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 687b39004d4ab172f3a2433b310fd09b95d3aa241be7e5f782941ae0edbeb491
4
- data.tar.gz: 0524b2418f1185ae9902054381fc17ecd5e97fba16b9b2af5df80fd7bca47f65
3
+ metadata.gz: 3e68b42556a0a1c1038d1c234fba9910fc847c0250ed3c2426091996ffe5c703
4
+ data.tar.gz: d2507537ae0cfee8e216322dc5a74d66f73b31c7a4279f4b043e8f67ff43e04e
5
5
  SHA512:
6
- metadata.gz: 93a00f049eb3570f335a5ea6ad1eefc323ed1ea96b9e642dafa3277ad5854ccc6edc16d5b7aae156cd46cf7311809cdad4b4eb241d2935e24895e1bd581857ce
7
- data.tar.gz: 85c9dfe12bbeb3dd6592a6371be3611f85b009a6eb050cf12bba2cf5a9f93025809a44f46364ec5e9c7c474f542108e8a0112ff16beac30e410f8d85bbe0b7a7
6
+ metadata.gz: bebea8aaf4fb068465618d308c0fb7439272853f49b6e964acc8e5c685057541a182d13619da7f431c1fbc9a3aac5f5310ff0f279633ea51cbd07df80dc2aebf
7
+ data.tar.gz: 5a237fd7ffdde5902f8a198dd80f60a3e668ca80440d5929981ecd7f2154ca397cd11f3017e6572d56ef65394157e6df591bfc9794ba311376455c37e1af780c
@@ -1,3 +1,41 @@
1
+ ### v0.11.1.pre
2
+
3
+ * bug-fixes
4
+ * Use `BeyondApi::Error` for authentication errors
5
+
6
+ ### v0.11.0.pre
7
+
8
+ * enhancements
9
+ * Improve error handling class
10
+ * Improve `BeyondApi::Error` class
11
+
12
+ ### v0.10.0.pre
13
+
14
+ * features
15
+ * Add optional `paginated: false` parameter to `session.categories_view.all(paginated: false)`
16
+ * Add optional `paginated: false` parameter to `session.categories.all(paginated: false)`
17
+ * Add optional `paginated: false` parameter to `session.customers.all(paginated: false)`
18
+ * Add optional `paginated: false` parameter to `session.orders.all(paginated: false)`
19
+ * Add optional `paginated: false` parameter to `session.payment_methods.all(paginated: false)`
20
+ * Add optional `paginated: false` parameter to `session.products_view.all(paginated: false)`
21
+ * Add optional `paginated: false` parameter to `session.script_tags.all(paginated: false)`
22
+ * Add optional `paginated: false` parameter to `session.shipping_zones.all(paginated: false)`
23
+ * Add optional `paginated: false` parameter to `session.users.all(paginated: false)`
24
+ * Add optional `paginated: false` parameter to `session.webhook_subscriptions.all(paginated: false)`
25
+
26
+ ### v0.9.0.pre
27
+
28
+ * bug-fixes
29
+ * Fix typo
30
+
31
+ * features
32
+ * Add optional `paginated: false` parameter to `session.products.all(paginated: false)`
33
+
34
+ ### v0.8.1.pre
35
+
36
+ * bug-fixes
37
+ * Fix exception handling
38
+
1
39
  ### v0.8.0.pre
2
40
 
3
41
  * deprecations
@@ -1,20 +1,5 @@
1
1
  # Getting started
2
2
 
3
- ## Get your credentials
4
-
5
- ### Sign up for a developer test shop
6
-
7
- First you will need to sign up for a Beyond test shop.
8
- Visit [our sign up form](https://signup.beyondshop.cloud), fill out the form with your data, and click the **Sign up** button.
9
-
10
- ### Create a custom app
11
-
12
- Log in to the cockpit of your test shop, navigate to **Apps > Custom apps** and click **Add custom app**.
13
- Fill out the form with the **App name**, **Application Callback URL** and **App scopes**.
14
- Save your app.
15
-
16
- You will then receive your `client_id` and `client_secret`.
17
-
18
3
  ## Authenticating a shop (the session object)
19
4
 
20
5
  ### Obtaining a token from an authentication code
@@ -42,192 +27,194 @@ Check the [_rubydoc_ documentation](https://rubydoc.info/github/ePages-de/beyond
42
27
  Here you can find a list with all available methods:
43
28
 
44
29
  * Carts
45
- * `session.carts.add_line_item(cart_id, body)`
46
- * `session.carts.create(body)`
47
- * `session.carts.create_order(cart_id, body)`
48
- * `session.carts.create_payment(cart_id, body)`
49
- * `session.carts.create_payment_and_order(cart_id, body)`
50
- * `session.carts.delete(cart_id)`
51
- * `session.carts.delete_line_item(cart_id, line_item_id)`
52
- * `session.carts.delete_shipping_address(cart_id)`
53
- * `session.carts.find(cart_id)`
54
- * `session.carts.payment_method(cart_id)`
55
- * `session.carts.payment_methods(cart_id)`
56
- * `session.carts.replace_line_item(cart_id, line_item_id, body)`
57
- * `session.carts.replace_line_items(cart_id, body)`
58
- * `session.carts.set_billing_address(cart_id, body)`
59
- * `session.carts.set_payment_method(cart_id, payment_method_id)`
60
- * `session.carts.set_payment_method_to_default(cart_id)`
61
- * `session.carts.set_shipping_address(cart_id, body)`
62
- * `session.carts.set_shipping_method(cart_id, shipping_zone_id, shipping_method_id)`
63
- * `session.carts.set_shipping_method_to_default(cart_id)`
64
- * `session.carts.shipping_method(cart_id)`
65
- * `session.carts.shipping_methods(cart_id)`
66
- * Categories View
67
- * `session.categories_view.all(params = {})`
68
- * `session.categories_view.find(category_id)`
69
- * `session.categories_view.products(category_id, params = {})`
70
- * `session.categories_view.search_by_label(label)`
71
- * `session.categories_view.search_by_product(body, params = {})`
72
- * `session.categories_view.search_by_product_id(product_id, params = {})`
30
+ * [`session.carts.add_line_item(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#add_line_item-instance_method)
31
+ * [`session.carts.create`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create-instance_method)
32
+ * [`session.carts.create_order(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create_order-instance_method)
33
+ * [`session.carts.create_payment(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create_payment-instance_method)
34
+ * [`session.carts.create_payment_and_order(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create_payment_and_order-instance_method)
35
+ * [`session.carts.delete(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#delete-instance_method)
36
+ * [`session.carts.delete_line_item(cart_id, line_item_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#delete_line_item-instance_method)
37
+ * [`session.carts.delete_shipping_address(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#delete_shipping_address-instance_method)
38
+ * [`session.carts.find(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#find-instance_method)
39
+ * [`session.carts.payment_method(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#payment_method-instance_method)
40
+ * [`session.carts.payment_methods(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#payment_methods-instance_method)
41
+ * [`session.carts.replace_line_item(cart_id, line_item_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#replace_line_item-instance_method)
42
+ * [`session.carts.replace_line_items(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#replace_line_items-instance_method)
43
+ * [`session.carts.set_billing_address(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_billing_address-instance_method)
44
+ * [`session.carts.set_payment_method(cart_id, payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_payment_method-instance_method)
45
+ * [`session.carts.set_payment_method_to_default(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_payment_method_to_default-instance_method)
46
+ * [`session.carts.set_shipping_address(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_shipping_address-instance_method)
47
+ * [`session.carts.set_shipping_method(cart_id, shipping_zone_id, shipping_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_shipping_method-instance_method)
48
+ * [`session.carts.set_shipping_method_to_default(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#set_shipping_method_to_default-instance_method)
49
+ * [`session.carts.shipping_method(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#shipping_method-instance_method)
50
+ * [`session.carts.shipping_methods(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#shipping_methods-instance_method)
51
+ * Categories view
52
+ * [`session.categories_view.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#all-instance_method)
53
+ * [`session.categories_view.find(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#find-instance_method)
54
+ * [`session.categories_view.products(category_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#products-instance_method)
55
+ * [`session.categories_view.search_by_label(label)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#search_by_label-instance_method)
56
+ * [`session.categories_view.search_by_product(body, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#search_by_product-instance_method)
57
+ * [`session.categories_view.search_by_product_id(product_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#search_by_product_id-instance_method)
73
58
  * Categories
74
- * `session.categories.all(params = {})`
75
- * `session.categories.create(body)`
76
- * `session.categories.delete(category_id)`
77
- * `session.categories.find(category_id)`
78
- * `session.categories.patch(category_id, body)`
79
- * `session.categories.update(category_id, body)`
80
- * Checkout Settings
81
- * `session.checkout_settings.all`
82
- * `session.checkout_settings.update(body)`
83
- * Newsletter Target
84
- * `session.newsletter_target.create(submit_url)`
85
- * `session.newsletter_target.delete`
86
- * `session.newsletter_target.find`
87
- * `session.newsletter_target.update(submit_url)`
88
- * Order Settings
89
- * `session.order_settings.all(params = {})`
90
- * `session.order_settings.update(order_settings, body)`
59
+ * [`session.categories.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#all-instance_method)
60
+ * [`session.categories.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#create-instance_method)
61
+ * [`session.categories.delete(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#delete-instance_method)
62
+ * [`session.categories.find(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#find-instance_method)
63
+ * [`session.categories.patch(category_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#patch-instance_method)
64
+ * [`session.categories.update(category_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#update-instance_method)
65
+ * Checkout settings
66
+ * [`session.checkout_settings.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CheckoutSettings#all-instance_method)
67
+ * [`session.checkout_settings.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CheckoutSettings#update-instance_method)
68
+ * Token
69
+ * [`session.token.client_credentials`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#client_credentials-instance_method)
70
+ * [`session.token.create(code)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#create-instance_method)
71
+ * [`session.token.refresh`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#refresh-instance_method)
72
+ * [`session.token.session`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#session-instance_method)
73
+ * Customers
74
+ * [`session.customers.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#all-instance_method)
75
+ * [`session.customers.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#create-instance_method)
76
+ * [`session.customers.delete(customer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#delete-instance_method)
77
+ * [`session.customers.find(customer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#find-instance_method)
78
+ * [`session.customers.update(customer_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#update-instance_method)
79
+ * Newsletter target
80
+ * [`session.newsletter_target.create(submit_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#create-instance_method)
81
+ * [`session.newsletter_target.delete`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#delete-instance_method)
82
+ * [`session.newsletter_target.find`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#find-instance_method)
83
+ * [`session.newsletter_target.update(submit_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#update-instance_method)
84
+ * Order settings
85
+ * [`session.order_settings.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/OrderSettings#all-instance_method)
86
+ * [`session.order_settings.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/OrderSettings#update-instance_method)
91
87
  * Orders
92
- * `session.orders.active_payment_process(order_id)`
93
- * `session.orders.active_refund_process(order_id)`
94
- * `session.orders.all(params = {})`
95
- * `session.orders.cancel(order_id, body)`
96
- * `session.orders.cancelation_process(order_id, cancelation_id)`
97
- * `session.orders.cancelation_processes(order_id, params = {})`
98
- * `session.orders.capture_payment_process(order_id, payment_id)`
99
- * `session.orders.create_cancelation_process(order_id, body)`
100
- * `session.orders.create_invoice(order_id, body)`
101
- * `session.orders.create_return_process(order_id, body)`
102
- * `session.orders.create_shipping_process(order_id, body)`
103
- * `session.orders.events(order_id, params = {})`
104
- * `session.orders.find(order_id)`
105
- * `session.orders.mark_payment_process_as_paid(order_id, payment_id, body)`
106
- * `session.orders.mark_payment_process_as_voided(order_id, payment_id, body)`
107
- * `session.orders.mark_refund_process_as_paid(order_id)`
108
- * `session.orders.mark_shipping_process_as_delivered(order_id, shipping_process_id, body)`
109
- * `session.orders.mark_shipping_process_as_shipped(order_id, shipping_id, body)`
110
- * `session.orders.payment_process(order_id, payment_id)`
111
- * `session.orders.payment_processes(order_id, params = {})`
112
- * `session.orders.processes(order_id)`
113
- * `session.orders.refund_process(order_id, refund_id)`
114
- * `session.orders.refund_processes(order_id, params = {})`
115
- * `session.orders.return_process(order_id, return_process_id)`
116
- * `session.orders.return_processes(order_id, params = {})`
117
- * `session.orders.search_by_cart_id(cart_id)`
118
- * `session.orders.search_order_number_by_cart_id(cart_id)`
119
- * `session.orders.send_invoice(order_id)`
120
- * `session.orders.shipping_process(order_id, shipping_process_id)`
121
- * `session.orders.shipping_processes(order_id, params = {})`
122
- * `session.orders.update_billing_address(order_id, body)`
123
- * `session.orders.update_order_note(order_id, body)`
124
- * `session.orders.update_shipping_address(order_id, body)`
125
- * Payment Methods
126
- * `session.payment_methods.activate(payment_method_id)`
127
- * `session.payment_methods.all(params = {})`
128
- * `session.payment_methods.deactivate(payment_method_id)`
129
- * `session.payment_methods.find(payment_method_id)`
130
- * `session.payment_methods.sort(payment_method_ids)`
131
- * `session.payment_methods.update(payment_method_id, body)`
132
- * Product Attribute Definitions
133
- * `session.product_attribute_definitions.all(params = {})`
134
- * `session.product_attribute_definitions.create(product_attribute_name)`
135
- * `session.product_attribute_definitions.delete(product_attribute_name)`
136
- * `session.product_attribute_definitions.find(product_attribute_name)`
137
- * Product Settings
138
- * `session.product_settings.all`
139
- * Products View
140
- * `session.products_view.all(params = {})`
141
- * `session.products_view.available_tags`
142
- * `session.products_view.find(product_id)`
143
- * `session.products_view.search_by_query(query)`
144
- * `session.products_view.search_by_tag(tag, params = {})`
145
- * `session.products_view.search_by_term(term, params = {})`
88
+ * [`session.orders.active_payment_process(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#active_payment_process-instance_method)
89
+ * [`session.orders.active_refund_process(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#active_refund_process-instance_method)
90
+ * [`session.orders.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#all-instance_method)
91
+ * [`session.orders.cancel(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancel-instance_method)
92
+ * [`session.orders.cancelation_process(order_id, cancelation_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancelation_process-instance_method)
93
+ * [`session.orders.cancelation_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancelation_processes-instance_method)
94
+ * [`session.orders.capture_payment_process(order_id, payment_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#capture_payment_process-instance_method)
95
+ * [`session.orders.create_cancelation_process(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#create_cancelation_process-instance_method)
96
+ * [`session.orders.create_invoice(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#create_invoice-instance_method)
97
+ * [`session.orders.create_return_process(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#create_return_process-instance_method)
98
+ * [`session.orders.create_shipping_process(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#create_shipping_process-instance_method)
99
+ * [`session.orders.events(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#events-instance_method)
100
+ * [`session.orders.find(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#find-instance_method)
101
+ * [`session.orders.mark_payment_process_as_paid(order_id, payment_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#mark_payment_process_as_paid-instance_method)
102
+ * [`session.orders.mark_payment_process_as_voided(order_id, payment_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#mark_payment_process_as_voided-instance_method)
103
+ * [`session.orders.mark_refund_process_as_paid(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#mark_refund_process_as_paid-instance_method)
104
+ * [`session.orders.mark_shipping_process_as_delivered(order_id, shipping_process_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#mark_shipping_process_as_delivered-instance_method)
105
+ * [`session.orders.mark_shipping_process_as_shipped(order_id, shipping_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#mark_shipping_process_as_shipped-instance_method)
106
+ * [`session.orders.payment_process(order_id, payment_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#payment_process-instance_method)
107
+ * [`session.orders.payment_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#payment_processes-instance_method)
108
+ * [`session.orders.processes(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#processes-instance_method)
109
+ * [`session.orders.refund_process(order_id, refund_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#refund_process-instance_method)
110
+ * [`session.orders.refund_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#refund_processes-instance_method)
111
+ * [`session.orders.return_process(order_id, return_process_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#return_process-instance_method)
112
+ * [`session.orders.return_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#return_processes-instance_method)
113
+ * [`session.orders.search_by_cart_id(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#search_by_cart_id-instance_method)
114
+ * [`session.orders.search_order_number_by_cart_id(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#search_order_number_by_cart_id-instance_method)
115
+ * [`session.orders.send_order_document(order_id, order_document_uri)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#send_order_document-instance_method)
116
+ * [`session.orders.shipping_process(order_id, shipping_process_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#shipping_process-instance_method)
117
+ * [`session.orders.shipping_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#shipping_processes-instance_method)
118
+ * [`session.orders.update_billing_address(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#update_billing_address-instance_method)
119
+ * [`session.orders.update_order_note(order_id, order_note)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#update_order_note-instance_method)
120
+ * [`session.orders.update_shipping_address(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#update_shipping_address-instance_method)
121
+ * Payment methods
122
+ * [`session.payment_methods.activate(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#activate-instance_method)
123
+ * [`session.payment_methods.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#all-instance_method)
124
+ * [`session.payment_methods.deactivate(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#deactivate-instance_method)
125
+ * [`session.payment_methods.find(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#find-instance_method)
126
+ * [`session.payment_methods.sort(payment_method_ids)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#sort-instance_method)
127
+ * [`session.payment_methods.update(payment_method_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#update-instance_method)
128
+ * Product attribute definitions
129
+ * [`session.product_attribute_definitions.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#all-instance_method)
130
+ * [`session.product_attribute_definitions.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#create-instance_method)
131
+ * [`session.product_attribute_definitions.delete(product_attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#delete-instance_method)
132
+ * [`session.product_attribute_definitions.find(product_attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#find-instance_method)
133
+ * Products view
134
+ * [`session.products_view.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#all-instance_method)
135
+ * [`session.products_view.available_tags`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#available_tags-instance_method)
136
+ * [`session.products_view.find(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#find-instance_method)
137
+ * [`session.products_view.search_by_tag(tag, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#search_by_tag-instance_method)
138
+ * [`session.products_view.search_by_term(term, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#search_by_term-instance_method)
146
139
  * Products
147
- * `session.products.all(params = {})`
148
- * `session.products.create(body)`
149
- * `session.products.create_variation(body)`
150
- * `session.products.delete(product_id)`
151
- * `session.products.find(product_id)`
152
- * `session.products.find_variation(product_id)`
153
- * `session.products.update(product_id, body)`
154
- * `session.products.update_variation(product_id, body)`
155
- * Scopes
156
- * `session.scopes.all(params = {})`
157
- * Script Tags
158
- * `session.script_tags.all(params = {})`
159
- * `session.script_tags.create(script_tag_url)`
160
- * `session.script_tags.delete(script_tag_id)`
161
- * `session.script_tags.find(script_tag_id)`
162
- * `session.script_tags.update(script_tag_id, script_tag_url)`
163
- * Shipping Zones
164
- * `session.shipping_zones.all(params = {})`
165
- * `session.shipping_zones.create(body)`
166
- * `session.shipping_zones.create_shipping_method(shipping_zone_id, body)`
167
- * `session.shipping_zones.delete(shipping_zone_id)`
168
- * `session.shipping_zones.delete_shipping_method(shipping_zone_id, shipping_method_id)`
169
- * `session.shipping_zones.find(shipping_zone_id)`
170
- * `session.shipping_zones.find_serviceable_countries`
171
- * `session.shipping_zones.shipping_method(shipping_zone_id, shipping_method_id)`
172
- * `session.shipping_zones.shipping_methods(shipping_zone_id, params = {})`
173
- * `session.shipping_zones.sort(shipping_zone_ids)`
174
- * `session.shipping_zones.sort_shipping_methods(shipping_zone_id)`
175
- * `session.shipping_zones.update(shipping_zone_id, body)`
140
+ * [`session.products.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#all-instance_method)
141
+ * [`session.products.assign_variation_images_differentiator(product_id, differentiator)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#assign_variation_images_differentiator-instance_method)
142
+ * [`session.products.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#create-instance_method)
143
+ * [`session.products.create_variation(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#create_variation-instance_method)
144
+ * [`session.products.delete(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#delete-instance_method)
145
+ * [`session.products.find(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#find-instance_method)
146
+ * [`session.products.find_variation(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#find_variation-instance_method)
147
+ * [`session.products.update(product_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#update-instance_method)
148
+ * [`session.products.update_variation(product_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#update_variation-instance_method)
149
+ * Script tags
150
+ * [`session.script_tags.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#all-instance_method)
151
+ * [`session.script_tags.create(script_tag_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#create-instance_method)
152
+ * [`session.script_tags.delete(script_tag_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#delete-instance_method)
153
+ * [`session.script_tags.find(script_tag_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#find-instance_method)
154
+ * [`session.script_tags.update(script_tag_id, script_tag_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#update-instance_method)
155
+ * Shipping zones
156
+ * [`session.shipping_zones.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#all-instance_method)
157
+ * [`session.shipping_zones.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#create-instance_method)
158
+ * [`session.shipping_zones.create_shipping_method(shipping_zone_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#create_shipping_method-instance_method)
159
+ * [`session.shipping_zones.delete(shipping_zone_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#delete-instance_method)
160
+ * [`session.shipping_zones.delete_shipping_method(shipping_zone_id, shipping_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#delete_shipping_method-instance_method)
161
+ * [`session.shipping_zones.find(shipping_zone_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#find-instance_method)
162
+ * [`session.shipping_zones.find_serviceable_countries`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#find_serviceable_countries-instance_method)
163
+ * [`session.shipping_zones.shipping_method(shipping_zone_id, shipping_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#shipping_method-instance_method)
164
+ * [`session.shipping_zones.shipping_methods(shipping_zone_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#shipping_methods-instance_method)
165
+ * [`session.shipping_zones.sort(shipping_zone_ids)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#sort-instance_method)
166
+ * [`session.shipping_zones.sort_shipping_methods(shipping_zone_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#sort_shipping_methods-instance_method)
167
+ * [`session.shipping_zones.update(shipping_zone_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#update-instance_method)
176
168
  * Shop
177
- * `session.shop.address`
178
- * `session.shop.attribute(attribute_name)`
179
- * `session.shop.attributes(params = {})`
180
- * `session.shop.close`
181
- * `session.shop.create_attribute(body)`
182
- * `session.shop.create_image(body)`
183
- * `session.shop.current`
184
- * `session.shop.delete_attribute(attribute_name)`
185
- * `session.shop.delete_image(image_id)`
186
- * `session.shop.image(image_id)`
187
- * `session.shop.images(params = {})`
188
- * `session.shop.legal_content(legal_content_type)`
189
- * `session.shop.legal_contents(params = {})`
190
- * `session.shop.legal_details`
191
- * `session.shop.open`
192
- * `session.shop.search_images_by_label(label)`
193
- * `session.shop.update(body)`
194
- * `session.shop.update_address(body)`
195
- * `session.shop.update_attribute(attribute_name, body)`
196
- * `session.shop.update_legal_content(body)`
197
- * `session.shop.update_legal_details(body)`
198
- * `session.shop.upload_image(image_path, image_name, label)`
169
+ * [`session.shop.address`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#address-instance_method)
170
+ * [`session.shop.attribute(attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#attribute-instance_method)
171
+ * [`session.shop.attributes(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#attributes-instance_method)
172
+ * [`session.shop.create_attribute(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#create_attribute-instance_method)
173
+ * [`session.shop.create_image(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#create_image-instance_method)
174
+ * [`session.shop.current`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#current-instance_method)
175
+ * [`session.shop.delete_attribute(attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#delete_attribute-instance_method)
176
+ * [`session.shop.delete_image(image_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#delete_image-instance_method)
177
+ * [`session.shop.image(image_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#image-instance_method)
178
+ * [`session.shop.images(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#images-instance_method)
179
+ * [`session.shop.legal_content(legal_content_type)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_content-instance_method)
180
+ * [`session.shop.legal_contents(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_contents-instance_method)
181
+ * [`session.shop.legal_details`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_details-instance_method)
182
+ * [`session.shop.search_images_by_label(label)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#search_images_by_label-instance_method)
183
+ * [`session.shop.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update-instance_method)
184
+ * [`session.shop.update_address(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_address-instance_method)
185
+ * [`session.shop.update_attribute(attribute_name, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_attribute-instance_method)
186
+ * [`session.shop.update_legal_content(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_legal_content-instance_method)
187
+ * [`session.shop.update_legal_details(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_legal_details-instance_method)
188
+ * [`session.shop.upload_image(image_path, image_name, label)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#upload_image-instance_method)
199
189
  * Signers
200
- * `session.signers.all`
201
- * `session.signers.create`
202
- * `session.signers.delete(signer_id)`
203
- * Token
204
- * `session.token.create(code)`
205
- * `session.token.refresh`
190
+ * [`session.signers.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#all-instance_method)
191
+ * [`session.signers.create`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#create-instance_method)
192
+ * [`session.signers.delete(signer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#delete-instance_method)
206
193
  * Users
207
- * `session.users.add_roles(user_id, body)`
208
- * `session.users.all(params = {})`
209
- * `session.users.change_password(user_id, current_password, new_password)`
210
- * `session.users.change_username(user_id, new_username, current_password)`
211
- * `session.users.create(body)`
212
- * `session.users.disable_support_access`
213
- * `session.users.enable_support_access`
214
- * `session.users.find(user_id)`
215
- * `session.users.roles(user_id)`
216
- * `session.users.search_by_username(username)`
217
- * `session.users.send_email_address_change(user_id, new_email, current_password, locale)`
218
- * `session.users.send_reset_password_email(email, locale)`
219
- * `session.users.set_roles(user_id, body)`
220
- * `session.users.support_access`
221
- * `session.users.verify_password(password)`
194
+ * [`session.users.add_roles(user_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#add_roles-instance_method)
195
+ * [`session.users.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#all-instance_method)
196
+ * [`session.users.change_password(user_id, current_password, new_password)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#change_password-instance_method)
197
+ * [`session.users.change_username(user_id, new_username, current_password)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#change_username-instance_method)
198
+ * [`session.users.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#create-instance_method)
199
+ * [`session.users.disable_support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#disable_support_access-instance_method)
200
+ * [`session.users.enable_support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#enable_support_access-instance_method)
201
+ * [`session.users.find(user_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#find-instance_method)
202
+ * [`session.users.roles(user_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#roles-instance_method)
203
+ * [`session.users.search_by_username(username)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#search_by_username-instance_method)
204
+ * [`session.users.send_email_address_change(user_id, new_email, current_password, locale)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#send_email_address_change-instance_method)
205
+ * [`session.users.send_reset_password_email(email, locale)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#send_reset_password_email-instance_method)
206
+ * [`session.users.set_roles(user_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#set_roles-instance_method)
207
+ * [`session.users.support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#support_access-instance_method)
208
+ * [`session.users.verify_password(password, user_role)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#verify_password-instance_method)
222
209
  * Variations
223
- * `session.variations.all(product_id, params = {})`
224
- * `session.variations.find(product_id, variation_id)`
225
- * `session.variations.update(product_id, variation_id, body)`
226
- * Webhook Subscriptions
227
- * `session.webhook_subscriptions.activate(webhook_subscription_id)`
228
- * `session.webhook_subscriptions.all(params = {})`
229
- * `session.webhook_subscriptions.create(body)`
230
- * `session.webhook_subscriptions.deactivate(webhook_subscription_id)`
231
- * `session.webhook_subscriptions.delete(webhook_subscription_id)`
232
- * `session.webhook_subscriptions.find(webhook_subscription_id)`
233
- * `session.webhook_subscriptions.update(webhook_subscription_id, body)`
210
+ * [`session.variations.all(product_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#all-instance_method)
211
+ * [`session.variations.find(product_id, variation_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#find-instance_method)
212
+ * [`session.variations.update(product_id, variation_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#update-instance_method)
213
+ * Webhook subscriptions
214
+ * [`session.webhook_subscriptions.activate(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#activate-instance_method)
215
+ * [`session.webhook_subscriptions.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#all-instance_method)
216
+ * [`session.webhook_subscriptions.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#create-instance_method)
217
+ * [`session.webhook_subscriptions.deactivate(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#deactivate-instance_method)
218
+ * [`session.webhook_subscriptions.delete(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#delete-instance_method)
219
+ * [`session.webhook_subscriptions.find(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#find-instance_method)
220
+ * [`session.webhook_subscriptions.update(webhook_subscription_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#update-instance_method)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.8.0.pre)
4
+ beyond_api (0.11.1.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -5,6 +5,21 @@
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/1d173fa0b393e8eaf2a2/maintainability)](https://codeclimate.com/github/ePages-de/beyond_api-ruby_client/maintainability)
6
6
  ![License](https://img.shields.io/github/license/ePages-de/beyond_api-ruby_client)
7
7
 
8
+ ## Get your credentials
9
+
10
+ ### Sign up for a developer test shop
11
+
12
+ First you will need to sign up for a Beyond test shop.
13
+ Visit [our sign up form](https://signup.beyondshop.cloud), fill out the form with your data, and click the **Sign up** button.
14
+
15
+ ### Create a custom app
16
+
17
+ Log in to the cockpit of your test shop, navigate to **Apps > Custom apps** and click **Add custom app**.
18
+ Fill out the form with the **App name**, **Application Callback URL** and **App scopes**.
19
+ Save your app.
20
+
21
+ You will then receive your `client_id` and `client_secret`.
22
+
8
23
  ## Installation
9
24
 
10
25
  Add this line to your application's Gemfile:
@@ -1,14 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BeyondApi
4
- class Error
5
- attr_reader :error_id, :details, :message, :trace_id
4
+ class Error < StandardError
5
+ attr_reader :error_id, :details, :trace_id, :full_message, :status_code, :error, :error_description
6
6
 
7
- def initialize(data)
8
- @error_id = data['errorId']
9
- @details = data['details']
10
- @message = data['message']
11
- @trace_id = data['traceId']
7
+ def initialize(data, status_code = nil)
8
+ @error_id = data['errorId']
9
+ @details = data['details']
10
+ @trace_id = data['traceId']
11
+ @error = data['error']
12
+ @error_description = data['error_description']
13
+ @full_message = data
14
+ @status_code = status_code
15
+
16
+ super(data['message'] || data['error_description'])
12
17
  end
13
18
  end
14
19
  end
@@ -16,6 +16,7 @@ module BeyondApi
16
16
  #
17
17
  # @beyond_api.scopes +catg:r+
18
18
  #
19
+ # @option params [Boolean] :paginated
19
20
  # @option params [Integer] :size the page size
20
21
  # @option params [Integer] :page the page number
21
22
  #
@@ -25,9 +26,7 @@ module BeyondApi
25
26
  # @categories = session.categories.all(size: 100, page: 0)
26
27
  #
27
28
  def all(params = {})
28
- response, status = BeyondApi::Request.get(@session, "/categories", params)
29
-
30
- handle_response(response, status)
29
+ handle_all_request("/categories", :categories, params)
31
30
  end
32
31
 
33
32
  #
@@ -14,6 +14,7 @@ module BeyondApi
14
14
  # -H 'Accept: application/hal+json'
15
15
  #
16
16
  #
17
+ # @option params [Boolean] :paginated
17
18
  # @option params [Integer] :size the page size
18
19
  # @option params [Integer] :page the page number
19
20
  #
@@ -23,9 +24,7 @@ module BeyondApi
23
24
  # @categories = session.categories_view.all(size: 100, page: 0)
24
25
  #
25
26
  def all(params = {})
26
- response, status = BeyondApi::Request.get(@session, "/product-view/categories", params)
27
-
28
- handle_response(response, status)
27
+ handle_all_request("/product-view/categories", :categories, params)
29
28
  end
30
29
 
31
30
  #
@@ -14,6 +14,7 @@ module BeyondApi
14
14
  #
15
15
  # @beyond_api.scopes +cust:r+
16
16
  #
17
+ # @option params [Boolean] :paginated
17
18
  # @option params [Integer] :size the page size
18
19
  # @option params [Integer] :page the page number
19
20
  #
@@ -23,9 +24,7 @@ module BeyondApi
23
24
  # @customers = session.customers.all(size: 20, page: 0)
24
25
  #
25
26
  def all(params = {})
26
- response, status = BeyondApi::Request.get(@session, "/customers", params)
27
-
28
- handle_response(response, status)
27
+ handle_all_request("/customers", :customers, params)
29
28
  end
30
29
 
31
30
  #
@@ -57,6 +57,7 @@ module BeyondApi
57
57
  #
58
58
  # @beyond_api.scopes +ordr:r+
59
59
  #
60
+ # @option params [Boolean] :paginated
60
61
  # @option params [Integer] :size the page size
61
62
  # @option params [Integer] :page the page number
62
63
  #
@@ -66,9 +67,7 @@ module BeyondApi
66
67
  # @orders = session.orders.all(size: 100, page: 0)
67
68
  #
68
69
  def all(params = {})
69
- response, status = BeyondApi::Request.get(@session, "/orders", params)
70
-
71
- handle_response(response, status)
70
+ handle_all_request("/orders", :orders, params)
72
71
  end
73
72
 
74
73
  #
@@ -38,6 +38,7 @@ module BeyondApi
38
38
  #
39
39
  # @beyond_api.scopes +pymt:r+
40
40
  #
41
+ # @option params [Boolean] :paginated
41
42
  # @option params [Integer] :size the page size
42
43
  # @option params [Integer] :page the page number
43
44
  #
@@ -47,9 +48,7 @@ module BeyondApi
47
48
  # @payment_methods = session.payment_methods.all(size: 100, page: 0)
48
49
  #
49
50
  def all(params = {})
50
- response, status = BeyondApi::Request.get(@session, "/payment-methods", params)
51
-
52
- handle_response(response, status)
51
+ handle_all_request("/payment-methods", :payment_methods, params)
53
52
  end
54
53
 
55
54
  #
@@ -14,9 +14,9 @@ module BeyondApi
14
14
  #
15
15
  # @beyond_api.scopes +prad:r+
16
16
  #
17
- # @option param [Boolean] :paginated
18
- # @option param [Integer] :size the page size
19
- # @option param [Integer] :page the page number
17
+ # @option params [Boolean] :paginated
18
+ # @option params [Integer] :size the page size
19
+ # @option params [Integer] :page the page number
20
20
  #
21
21
  # @return [OpenStruct]
22
22
  #
@@ -24,18 +24,7 @@ module BeyondApi
24
24
  # @product_attribute_definitions = session.product_attribute_definitions.all(size: 100, page: 0)
25
25
  #
26
26
  def all(params = {})
27
- if params[:paginated] == false
28
- result = all_paginated(page: 0, size: 1000)
29
-
30
- (1..result[:page][:total_pages] - 1).each do |page|
31
- result[:embedded][:product_attribute_definition].concat(all_paginated(page: page, size: 1000)[:embedded][:product_attribute_definitions])
32
- end
33
-
34
- result.is_a?(Hash) ? result.delete(:page) : result.delete_field(:page)
35
- result
36
- else
37
- all_paginated(params)
38
- end
27
+ handle_all_request("/product-attribute-definitions", :product_attribute_definitions, params)
39
28
  end
40
29
 
41
30
  #
@@ -113,12 +102,5 @@ module BeyondApi
113
102
 
114
103
  handle_response(response, status)
115
104
  end
116
-
117
- private
118
-
119
- def all_paginated(params = {})
120
- response, status = BeyondApi::Request.get(@session, "/product-attribute-definitions", params)
121
- handle_response(response, status)
122
- end
123
105
  end
124
106
  end
@@ -32,6 +32,7 @@ module BeyondApi
32
32
  #
33
33
  # @beyond_api.scopes +prod:r+
34
34
  #
35
+ # @option params [Boolean] :paginated
35
36
  # @option params [Integer] :size the page size
36
37
  # @option params [Integer] :page the page number
37
38
  #
@@ -41,9 +42,7 @@ module BeyondApi
41
42
  # @products = session.products.all(size: 100, page: 0)
42
43
  #
43
44
  def all(params = {})
44
- response, status = BeyondApi::Request.get(@session, "/products", params)
45
-
46
- handle_response(response, status)
45
+ handle_all_request("/products", :products, params)
47
46
  end
48
47
 
49
48
  #
@@ -13,6 +13,7 @@ module BeyondApi
13
13
  # -H 'Content-Type: application/json' \
14
14
  # -H 'Accept: application/hal+json'
15
15
  #
16
+ # @option params [Boolean] :paginated
16
17
  # @option params [Integer] :size the page size
17
18
  # @option params [Integer] :page the page number
18
19
  #
@@ -22,9 +23,7 @@ module BeyondApi
22
23
  # @products = session.products_view.all(page: 0, size: 100)
23
24
  #
24
25
  def all(params = {})
25
- response, status = BeyondApi::Request.get(@session, "/product-view/products", params)
26
-
27
- handle_response(response, status)
26
+ handle_all_request("/product-view/products", :products, params)
28
27
  end
29
28
 
30
29
  #
@@ -12,6 +12,7 @@ module BeyondApi
12
12
  # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags' -i -X GET \
13
13
  # -H 'Authorization: Bearer <Access token>'
14
14
  #
15
+ # @option params [Boolean] :paginated
15
16
  # @option params [Integer] :size the page size
16
17
  # @option params [Integer] :page the page number
17
18
  #
@@ -21,9 +22,7 @@ module BeyondApi
21
22
  # @script_tags = session.script_tags.all(size: 20, page: 0)
22
23
  #
23
24
  def all(params = {})
24
- response, status = BeyondApi::Request.get(@session, "/script-tags", params)
25
-
26
- handle_response(response, status)
25
+ handle_all_request("/script-tags", :script_tags, params)
27
26
  end
28
27
 
29
28
  #
@@ -14,6 +14,7 @@ module BeyondApi
14
14
  # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones' -i -X GET \
15
15
  # -H 'Authorization: Bearer <Access token>'
16
16
  #
17
+ # @option params [Boolean] :paginated
17
18
  # @option params [Integer] :size the page size
18
19
  # @option params [Integer] :page the page number
19
20
  #
@@ -23,9 +24,7 @@ module BeyondApi
23
24
  # @shipping_zones = session.shipping_zones.all(size: 20, page: 0)
24
25
  #
25
26
  def all(params = {})
26
- response, status = BeyondApi::Request.get(@session, "/shipping-zones", params)
27
-
28
- handle_response(response, status)
27
+ handle_all_request("/shipping-zones", :shipping_zones, params)
29
28
  end
30
29
 
31
30
  #
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "beyond_api/utils"
4
+
3
5
  module BeyondApi
4
6
  class Token
5
7
  class InvalidSessionError < StandardError; end
6
8
 
9
+ include BeyondApi::Utils
10
+
7
11
  attr_reader :session
8
12
 
9
13
  def initialize(session)
@@ -44,7 +48,7 @@ module BeyondApi
44
48
  @session.refresh_token = response["refresh_token"]
45
49
  @session
46
50
  else
47
- BeyondApi::Error.new(response)
51
+ handle_error(response, status)
48
52
  end
49
53
  end
50
54
  end
@@ -40,6 +40,7 @@ module BeyondApi
40
40
  #
41
41
  # @beyond_api.scopes +user:r+
42
42
  #
43
+ # @option params [Boolean] :paginated
43
44
  # @option params [Integer] :size the page size
44
45
  # @option params [Integer] :page the page number
45
46
  #
@@ -49,9 +50,7 @@ module BeyondApi
49
50
  # @users = session.users.all(size: 100, page: 0)
50
51
  #
51
52
  def all(params = {})
52
- response, status = BeyondApi::Request.get(@session, "/users")
53
-
54
- handle_response(response, status)
53
+ handle_all_request("/users", :users, params)
55
54
  end
56
55
 
57
56
  #
@@ -34,6 +34,7 @@ module BeyondApi
34
34
  # -H 'Accept: application/hal+json' \
35
35
  # -H 'Authorization: Bearer <Access token>'
36
36
  #
37
+ # @option params [Boolean] :paginated
37
38
  # @option params [Integer] :size the page size
38
39
  # @option params [Integer] :page the page number
39
40
  #
@@ -43,9 +44,7 @@ module BeyondApi
43
44
  # @webhook_subscriptions = session.webhook_subscriptions.all(size: 100, page: 0)
44
45
  #
45
46
  def all(params = {})
46
- response, status = BeyondApi::Request.get(@session, "/webhook-subscriptions", params)
47
-
48
- handle_response(response, status)
47
+ handle_all_request("/webhook-subscriptions", :webhook_subscriptions, params)
49
48
  end
50
49
 
51
50
  #
@@ -10,12 +10,16 @@ module BeyondApi
10
10
  response = sanitize_response(response)
11
11
  BeyondApi.configuration.object_struct_responses ? to_object_struct(response) : response
12
12
  else
13
- error = BeyondApi::Error.new(response)
14
- BeyondApi.logger.error "[Beyond API] #{response}"
15
- BeyondApi.configuration.raise_error_requests ? raise(error) : error
13
+ handle_error(response, status)
16
14
  end
17
15
  end
18
16
 
17
+ def handle_error(response, status)
18
+ BeyondApi.logger.error "[Beyond API] #{status}: #{response}"
19
+ error = BeyondApi::Error.new(response, status)
20
+ BeyondApi.configuration.raise_error_requests ? raise(error) : error
21
+ end
22
+
19
23
  def to_object_struct(data)
20
24
  if data.is_a? Hash
21
25
  return OpenStruct.new(data.map { |key, val| [key, to_object_struct(val)] }.to_h)
@@ -40,6 +44,22 @@ module BeyondApi
40
44
  key.chars.first == "_" ? key[1..-1] : key
41
45
  end
42
46
 
47
+ def handle_all_request(url, resource, params = {})
48
+ if params[:paginated] == false
49
+ result = all_paginated(url, { page: 0, size: 1000 })
50
+
51
+ (1..result[:page][:total_pages] - 1).each do |page|
52
+ result[:embedded][resource].concat(all_paginated(url, { page: page, size: 1000 })[:embedded][resource])
53
+ end
54
+
55
+ result.is_a?(Hash) ? result.delete(:page) : result.delete_field(:page)
56
+
57
+ result
58
+ else
59
+ all_paginated(url, params)
60
+ end
61
+ end
62
+
43
63
  private
44
64
 
45
65
  def transform(thing)
@@ -49,5 +69,11 @@ module BeyondApi
49
69
  else; thing
50
70
  end
51
71
  end
72
+
73
+ def all_paginated(url, params = {})
74
+ response, status = BeyondApi::Request.get(@session, url, params)
75
+
76
+ handle_response(response, status)
77
+ end
52
78
  end
53
79
  end
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.8.0.pre".freeze
2
+ VERSION = "0.11.1.pre".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre
4
+ version: 0.11.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-02-21 00:00:00.000000000 Z
13
+ date: 2020-06-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: 1.3.1
192
192
  requirements: []
193
- rubygems_version: 3.0.3
193
+ rubygems_version: 3.0.1
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Ruby client to access the Beyond API