diff --git a/.env.template b/.env.development.template similarity index 71% rename from .env.template rename to .env.development.template index 99050d8..8ac203f 100644 --- a/.env.template +++ b/.env.development.template @@ -1,3 +1,2 @@ CLIENT_ID="" CLIENT_SECRET="" -SHOP_URL="" diff --git a/.env.test.template b/.env.test.template new file mode 100644 index 0000000..9cfd31b --- /dev/null +++ b/.env.test.template @@ -0,0 +1,10 @@ +API_URL="" + +CLIENT_ID="" +CLIENT_SECRET="" +REFRESH_TOKEN="" + +COCKPIT_USER_ID="" +COCKPIT_USER_NAME="" +COCKPIT_USER_EMAIL="" +COCKPIT_USER_PASSWORD="" diff --git a/.gitignore b/.gitignore index 9a8a687..f1cfd78 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,8 @@ .rspec_status # Environment variables -.env +.env* +!.env.*.template # Apple file system .DS_Store diff --git a/.rubocop.yml b/.rubocop.yml index f60d3dc..e35e523 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,35 +1,46 @@ require: - - rubocop-ordered_methods - - rubocop-rspec + - rubocop-rails + +# Enable all new cops by default AllCops: - Exclude: - - spec/**/*.rb NewCops: enable + Exclude: + - bin/* + - spec/dummy/bin/* + - spec/dummy/db/schema.rb -Style/StringLiterals: - EnforcedStyle: double_quotes +# Disable not wanted cops Metrics/AbcSize: Enabled: false Metrics/MethodLength: Enabled: false -Metrics/BlockLength: - Enabled: false Metrics/ClassLength: Enabled: false Style/Documentation: Enabled: false +Metrics/BlockLength: + Enabled: false Metrics/CyclomaticComplexity: Enabled: false Metrics/PerceivedComplexity: Enabled: false - -Layout/LineLength: - IgnoredPatterns: ['(\A|\s)#'] - -Style/AsciiComments: +Rails/ContentTag: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Naming/VariableNumber: + Enabled: false +Gemspec/DevelopmentDependencies: Enabled: false +# Prefer to use brackets on symbol arrays + Style/SymbolArray: EnforcedStyle: brackets + +# Prefer to use always lambda literals (->) + +Style/Lambda: + EnforcedStyle: literal diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..a0891f5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.3.4 diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 1d252a2..95a5c44 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -1,220 +1,54 @@ # Getting started -## Authenticating a shop (the session object) +This guide will help you quickly get started with the Beyond API Ruby Client by demonstrating how to obtain and use access tokens. -### Obtaining a token from an authentication code +### Obtaining an Authentication Token ```ruby -session = BeyondApi::Session.new(api_url: "https://your-shop-name.beyondshop.cloud/api") -session.token.create("your-auth-code") +require 'beyond_api' + +api_url = '/api' + +# Initialize the client for authentication +client = BeyondApi::Authentication::Token.new(api_url:) + +# Replace 'your-auth-code' with the actual code you obtained +token = client.get("your-auth-code") + +access_token = token[:access_token] +refresh_token = token[:refresh_token] ``` > You can get an authentication code by clicking the **Test authorization** button in your test shop's cockpit on your custom app's page. Clicking the button will redirect you to the **Application Callback URL** you have specified, attaching the code as a query parameter. -### Obtaining a token from a refresh token +### Refreshing an Access Token ```ruby -session = BeyondApi::Session.new(api_url: "https://your-shop-name.beyondshop.cloud/api", - refresh_token: "your-refresh-token") -session.token.refresh +# Initialize the client for authentication +client = BeyondApi::Authentication::Token.new(api_url: api_url) + +# Use the refresh token to get a new access token +new_token = client.refresh(refresh_token) + +new_access_token = new_token[:access_token] +new_refresh_token = new_token[:refresh_token] ``` ## Consuming the API Check the [_rubydoc_ documentation](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client) for more information on the Beyond API Ruby Client. -Here you can find a list with all available methods: - -* Carts - * [`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) - * [`session.carts.create`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create-instance_method) - * [`session.carts.create_order(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create_order-instance_method) - * [`session.carts.create_payment(cart_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#create_payment-instance_method) - * [`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) - * [`session.carts.delete(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#delete-instance_method) - * [`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) - * [`session.carts.delete_shipping_address(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#delete_shipping_address-instance_method) - * [`session.carts.find(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#find-instance_method) - * [`session.carts.payment_method(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#payment_method-instance_method) - * [`session.carts.payment_methods(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#payment_methods-instance_method) - * [`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) - * [`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) - * [`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) - * [`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) - * [`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) - * [`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) - * [`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) - * [`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) - * [`session.carts.shipping_method(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#shipping_method-instance_method) - * [`session.carts.shipping_methods(cart_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Carts#shipping_methods-instance_method) -* Categories view - * [`session.categories_view.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#all-instance_method) - * [`session.categories_view.find(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#find-instance_method) - * [`session.categories_view.products(category_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#products-instance_method) - * [`session.categories_view.search_by_label(label)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CategoriesView#search_by_label-instance_method) - * [`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) - * [`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) -* Categories - * [`session.categories.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#all-instance_method) - * [`session.categories.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#create-instance_method) - * [`session.categories.delete(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#delete-instance_method) - * [`session.categories.find(category_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#find-instance_method) - * [`session.categories.patch(category_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#patch-instance_method) - * [`session.categories.update(category_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Categories#update-instance_method) -* Checkout settings - * [`session.checkout_settings.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CheckoutSettings#all-instance_method) - * [`session.checkout_settings.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/CheckoutSettings#update-instance_method) -* Token - * [`session.token.client_credentials`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#client_credentials-instance_method) - * [`session.token.create(code)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#create-instance_method) - * [`session.token.refresh`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#refresh-instance_method) - * [`session.token.session`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Token#session-instance_method) -* Customers - * [`session.customers.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#all-instance_method) - * [`session.customers.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#create-instance_method) - * [`session.customers.delete(customer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#delete-instance_method) - * [`session.customers.find(customer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#find-instance_method) - * [`session.customers.update(customer_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Customers#update-instance_method) -* Newsletter target - * [`session.newsletter_target.create(submit_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#create-instance_method) - * [`session.newsletter_target.delete`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#delete-instance_method) - * [`session.newsletter_target.find`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#find-instance_method) - * [`session.newsletter_target.update(submit_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/NewsletterTarget#update-instance_method) -* Order settings - * [`session.order_settings.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/OrderSettings#all-instance_method) - * [`session.order_settings.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/OrderSettings#update-instance_method) -* Orders - * [`session.orders.active_payment_process(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#active_payment_process-instance_method) - * [`session.orders.active_refund_process(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#active_refund_process-instance_method) - * [`session.orders.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#all-instance_method) - * [`session.orders.cancel(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancel-instance_method) - * [`session.orders.cancelation_process(order_id, cancelation_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancelation_process-instance_method) - * [`session.orders.cancelation_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#cancelation_processes-instance_method) - * [`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) - * [`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) - * [`session.orders.create_invoice(order_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#create_invoice-instance_method) - * [`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) - * [`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) - * [`session.orders.events(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#events-instance_method) - * [`session.orders.find(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#find-instance_method) - * [`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) - * [`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) - * [`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) - * [`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) - * [`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) - * [`session.orders.payment_process(order_id, payment_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#payment_process-instance_method) - * [`session.orders.payment_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#payment_processes-instance_method) - * [`session.orders.processes(order_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#processes-instance_method) - * [`session.orders.refund_process(order_id, refund_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#refund_process-instance_method) - * [`session.orders.refund_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#refund_processes-instance_method) - * [`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) - * [`session.orders.return_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#return_processes-instance_method) - * [`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) - * [`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) - * [`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) - * [`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) - * [`session.orders.shipping_processes(order_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Orders#shipping_processes-instance_method) - * [`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) - * [`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) - * [`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) -* Payment methods - * [`session.payment_methods.activate(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#activate-instance_method) - * [`session.payment_methods.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#all-instance_method) - * [`session.payment_methods.deactivate(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#deactivate-instance_method) - * [`session.payment_methods.find(payment_method_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#find-instance_method) - * [`session.payment_methods.sort(payment_method_ids)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#sort-instance_method) - * [`session.payment_methods.update(payment_method_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/PaymentMethods#update-instance_method) -* Product attribute definitions - * [`session.product_attribute_definitions.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#all-instance_method) - * [`session.product_attribute_definitions.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#create-instance_method) - * [`session.product_attribute_definitions.delete(product_attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#delete-instance_method) - * [`session.product_attribute_definitions.find(product_attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductAttributeDefinitions#find-instance_method) -* Products view - * [`session.products_view.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#all-instance_method) - * [`session.products_view.available_tags`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#available_tags-instance_method) - * [`session.products_view.find(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ProductsView#find-instance_method) - * [`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) - * [`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) -* Products - * [`session.products.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#all-instance_method) - * [`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) - * [`session.products.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#create-instance_method) - * [`session.products.create_variation(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#create_variation-instance_method) - * [`session.products.delete(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#delete-instance_method) - * [`session.products.find(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#find-instance_method) - * [`session.products.find_variation(product_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#find_variation-instance_method) - * [`session.products.update(product_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#update-instance_method) - * [`session.products.update_variation(product_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Products#update_variation-instance_method) -* Script tags - * [`session.script_tags.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#all-instance_method) - * [`session.script_tags.create(script_tag_url)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#create-instance_method) - * [`session.script_tags.delete(script_tag_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#delete-instance_method) - * [`session.script_tags.find(script_tag_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ScriptTags#find-instance_method) - * [`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) -* Shipping zones - * [`session.shipping_zones.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#all-instance_method) - * [`session.shipping_zones.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#create-instance_method) - * [`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) - * [`session.shipping_zones.delete(shipping_zone_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#delete-instance_method) - * [`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) - * [`session.shipping_zones.find(shipping_zone_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#find-instance_method) - * [`session.shipping_zones.find_serviceable_countries`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#find_serviceable_countries-instance_method) - * [`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) - * [`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) - * [`session.shipping_zones.sort(shipping_zone_ids)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#sort-instance_method) - * [`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) - * [`session.shipping_zones.update(shipping_zone_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/ShippingZones#update-instance_method) -* Shop - * [`session.shop.address`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#address-instance_method) - * [`session.shop.attribute(attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#attribute-instance_method) - * [`session.shop.attributes(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#attributes-instance_method) - * [`session.shop.create_attribute(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#create_attribute-instance_method) - * [`session.shop.create_image(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#create_image-instance_method) - * [`session.shop.current`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#current-instance_method) - * [`session.shop.delete_attribute(attribute_name)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#delete_attribute-instance_method) - * [`session.shop.delete_image(image_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#delete_image-instance_method) - * [`session.shop.image(image_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#image-instance_method) - * [`session.shop.images(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#images-instance_method) - * [`session.shop.legal_content(legal_content_type)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_content-instance_method) - * [`session.shop.legal_contents(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_contents-instance_method) - * [`session.shop.legal_details`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#legal_details-instance_method) - * [`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) - * [`session.shop.update(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update-instance_method) - * [`session.shop.update_address(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_address-instance_method) - * [`session.shop.update_attribute(attribute_name, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_attribute-instance_method) - * [`session.shop.update_legal_content(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_legal_content-instance_method) - * [`session.shop.update_legal_details(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Shop#update_legal_details-instance_method) - * [`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) -* Signers - * [`session.signers.all`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#all-instance_method) - * [`session.signers.create`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#create-instance_method) - * [`session.signers.delete(signer_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Signers#delete-instance_method) -* Users - * [`session.users.add_roles(user_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#add_roles-instance_method) - * [`session.users.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#all-instance_method) - * [`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) - * [`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) - * [`session.users.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#create-instance_method) - * [`session.users.disable_support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#disable_support_access-instance_method) - * [`session.users.enable_support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#enable_support_access-instance_method) - * [`session.users.find(user_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#find-instance_method) - * [`session.users.roles(user_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#roles-instance_method) - * [`session.users.search_by_username(username)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#search_by_username-instance_method) - * [`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) - * [`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) - * [`session.users.set_roles(user_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#set_roles-instance_method) - * [`session.users.support_access`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#support_access-instance_method) - * [`session.users.verify_password(password, user_role)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Users#verify_password-instance_method) -* Variations - * [`session.variations.all(product_id, params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#all-instance_method) - * [`session.variations.find(product_id, variation_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#find-instance_method) - * [`session.variations.update(product_id, variation_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/Variations#update-instance_method) -* Webhook subscriptions - * [`session.webhook_subscriptions.activate(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#activate-instance_method) - * [`session.webhook_subscriptions.all(params = {})`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#all-instance_method) - * [`session.webhook_subscriptions.create(body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#create-instance_method) - * [`session.webhook_subscriptions.deactivate(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#deactivate-instance_method) - * [`session.webhook_subscriptions.delete(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#delete-instance_method) - * [`session.webhook_subscriptions.find(webhook_subscription_id)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#find-instance_method) - * [`session.webhook_subscriptions.update(webhook_subscription_id, body)`](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client/BeyondApi/WebhookSubscriptions#update-instance_method) +- BeyondApi::Authentication::Signer +- BeyondApi::Authentication::Token +- BeyondApi::Checkout::ShippingZone +- BeyondApi::ProductManagement::Category +- BeyondApi::ProductManagement::Image +- BeyondApi::ProductManagement::Product +- BeyondApi::ProductManagement::VariationImage +- BeyondApi::ProductManagement::Variation +- BeyondApi::ProductView::Category +- BeyondApi::Shop::Address +- BeyondApi::Shop::Shop +- BeyondApi::Storefront::ScriptTag +- BeyondApi::Webhook::Subscription diff --git a/Gemfile b/Gemfile index f1be1b3..cb3b7a1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,21 @@ # frozen_string_literal: true -source "https://rubygems.org" +source 'https://rubygems.org' # Specify your gem's dependencies in beyond_api.gemspec gemspec -gem "pry" +gem 'pry' + +group :development do + gem 'rubocop' +end group :test do - gem "factory_bot" + gem 'factory_bot' + gem 'jwt' + gem 'vcr' + gem 'webmock' end + +gem 'dotenv', groups: [:development, :test] diff --git a/Gemfile.lock b/Gemfile.lock index 2ddf4aa..6ec50e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,118 +2,158 @@ PATH remote: . specs: beyond_api (0.24.2.pre) - faraday (~> 1.9.0) + activesupport (~> 7.0) + faraday (~> 2.10.0) + faraday-multipart + faraday-retry + zeitwerk GEM remote: https://rubygems.org/ specs: - activesupport (6.1.4.1) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (7.2.0) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) coderay (1.1.3) - concurrent-ruby (1.1.9) - diff-lcs (1.4.4) - dotenv (2.7.6) - factory_bot (6.2.0) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + crack (1.0.0) + bigdecimal + rexml + diff-lcs (1.5.1) + dotenv (2.8.1) + drb (2.2.1) + factory_bot (6.4.6) activesupport (>= 5.0.0) - faker (2.19.0) - i18n (>= 1.6, < 2) - faraday (1.9.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) + faker (2.23.0) + i18n (>= 1.8.11, < 2) + faraday (2.10.1) + faraday-net_http (>= 2.0, < 3.2) + logger faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - i18n (1.8.11) + faraday-net_http (3.1.1) + net-http + faraday-retry (2.2.1) + faraday (~> 2.0) + hashdiff (1.1.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) - method_source (1.0.0) - minitest (5.14.4) - multipart-post (2.3.0) - parallel (1.21.0) - parser (3.0.3.1) + json (2.7.2) + jwt (2.8.2) + base64 + language_server-protocol (3.17.0.3) + logger (1.6.0) + method_source (1.1.0) + minitest (5.24.1) + multipart-post (2.4.1) + net-http (0.4.1) + uri + parallel (1.26.2) + parser (3.3.4.2) ast (~> 2.4.1) - pry (0.14.1) + racc + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - rainbow (3.0.0) + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.7) + rainbow (3.1.1) rake (10.5.0) - regexp_parser (2.1.1) - rexml (3.2.5) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + regexp_parser (2.9.2) + rexml (3.3.5) + strscan + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.3) - rubocop (1.23.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) + rubocop (1.65.1) + json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.12.0, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.13.0) - parser (>= 3.0.1.1) - rubocop-ordered_methods (0.9) - rubocop (>= 1.0) - rubocop-rspec (2.6.0) - rubocop (~> 1.19) - ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) - tzinfo (2.0.4) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.0) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-rails (2.25.1) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.31.0) + rubocop (~> 1.40) + rubocop-capybara (~> 2.17) + rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.29.1) + rubocop (~> 1.61) + ruby-progressbar (1.13.0) + securerandom (0.3.1) + strscan (3.1.0) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.1.0) - webrick (1.7.0) - yard (0.9.27) - webrick (~> 1.7.0) - zeitwerk (2.5.1) + unicode-display_width (2.5.0) + uri (0.13.0) + vcr (6.2.0) + webmock (3.23.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + yard (0.9.36) + zeitwerk (2.6.17) PLATFORMS ruby + x86_64-darwin-22 DEPENDENCIES beyond_api! bundler (~> 2.0) - dotenv (~> 2.7) + dotenv factory_bot faker (~> 2.2) + jwt pry rake (~> 10.0) rspec (~> 3.0) - rubocop (~> 1.20) - rubocop-ordered_methods (~> 0.9) + rubocop + rubocop-rails (~> 2.14) rubocop-rspec (~> 2.4) + vcr + webmock yard (~> 0.9) BUNDLED WITH - 2.4.8 + 2.5.17 diff --git a/README.md b/README.md index 130a2d3..a05ee0b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Beyond API Ruby Client +Ruby toolkit for the [ePages API](https://developer.epages.com/beyond-docs/#introduction) + ![Gem Version](https://img.shields.io/gem/v/beyond_api?label=gem%20version) [![Docs](https://img.shields.io/badge/docs-rubydoc-blue)](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client) [![Maintainability](https://api.codeclimate.com/v1/badges/1d173fa0b393e8eaf2a2/maintainability)](https://codeclimate.com/github/ePages-de/beyond_api-ruby_client/maintainability) @@ -18,7 +20,7 @@ Log in to the cockpit of your test shop, navigate to **Apps > Custom apps** and Fill out the form with the **App name**, **Application Callback URL** and **App scopes**. Save your app. -You will then receive your `client_id` and `client_secret`. +You will then receive your `client_id` and `client_secret` that you will use in the next step. ## Installation @@ -50,16 +52,92 @@ To install the gem manually from your shell, run: $ gem install beyond_api ``` +## Generating tokens + +API methods can be accessed through the client instance methods. This gem supports the various authentication methods supported by the ePages API. + +```ruby +# Client for authentication +api_url = '/api' +client = BeyondApi::Authentication::Token.new(api_url:) +``` +## Generate a token from [client credentials](https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_client_credentials) + +```ruby +client = client.client_credentials + +# => {:access_token=> "", :token_type=>"bearer", :expires_in=>3599, :scope=> "orde:r prat:dcur pypr:cur prod:urdc", :tenant_id=>1147, :iat=>1723477546, :jti=>"mqXCnX/q/vStoJO69q68x1gw61c="} +``` + +## Generate a token from [authorization code](https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_authorization_code) + +```ruby +client = client.get('') + +# => {:access_token=> "", :token_type=>"bearer", :refresh_token=> "", :expires_in=>3599, :scope=> "orde:r prat:dcur pypr:cur prod:urdc", :tenant_id=>1147, :iat=>1723453179, :jti=>"C0N0VYQUgzchp2GGo8WaINhpM8s="} +``` + +## Generate a token from [refresh token](https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_refresh_token) + +```ruby +# Client for authentication +api_url = '/api' +refresh_token = '' +client = BeyondApi::Authentication::Token.new(api_url:) + +client.refresh(refresh_token) + +# => {:access_token=> "", :token_type=>"bearer", :refresh_token=> "", :expires_in=>3599, :scope=> "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd", :tenant_id=>1147, :iat=>1723453179, :jti=>"C0N0VYQUgzchp2GGo8WaINhpM8s="} +``` + +## Making requests + +After generating your token following the instructions above, you can start using this gem to access various resources available, including categories, products, orders, webhooks, and more. + +```ruby +# Define the API URL and access token +api_url = '/api' +access_token = '' + +# Create a new client instance for category management +client = BeyondApi::ProductManagement::Category.new(api_url:, access_token:) + +# Find a specific category by its ID +client.find('category-id') + +# The response is a hash representing the category details: +# => { +# :id=>"8a4a8f6a-e3d9-4616-9e89-12c42c084534", +# :name=>"DO-NOT-DELETE Category", +# :type=>"SMART", +# :default_sort=>"HIGHEST_PRICE_FIRST", +# :filters=>[], +# :links=>{ +# :self=>{ +# :href=>"https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" +# }, +# :category=>{ +# :href=>"https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" +# } +# } +# } + +``` + ## Documentation See [GETTING_STARTED](https://github.com/ePages-de/beyond_api-ruby_client/blob/master/GETTING_STARTED.md) for information on consuming the Beyond API. ## Development -Check out the repo an run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. +Check out the repo an run `bin/setup` to install dependencies. Rename the file `.env.development.template` to `.env.development` and fill in the necessary information. Then, you can run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. +## Test + +Rename the file `.env.test.template` to `.env.test` and fill in the necessary information. Then, run `rspec` to run the tests. + ## Contributing Please see [CONTRIBUTING](https://github.com/ePages-de/beyond_api-ruby_client/blob/master/CONTRIBUTING.md). diff --git a/Rakefile b/Rakefile index 1f2d774..2e5f17c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,13 @@ # frozen_string_literal: true -require "bundler/gem_tasks" -require "rspec/core/rake_task" -require "yard" +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' +require 'yard' RSpec::Core::RakeTask.new(:spec) task default: :spec YARD::Rake::YardocTask.new do |t| - t.files = ["lib/**/*.rb"] + t.files = ['lib/**/*.rb'] end diff --git a/beyond_api.gemspec b/beyond_api.gemspec index 39f661f..2b8e4c0 100644 --- a/beyond_api.gemspec +++ b/beyond_api.gemspec @@ -1,35 +1,39 @@ # frozen_string_literal: true -lib = File.expand_path("lib", __dir__) +lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "beyond_api/version" +require 'beyond_api/version' Gem::Specification.new do |spec| - spec.name = "beyond_api" + spec.name = 'beyond_api' spec.version = BeyondApi::VERSION - spec.authors = ["Unai Abrisketa", "Kathia Salazar", "German San Emeterio", "Kenneth Gallego"] - - spec.summary = "Ruby client to access the Beyond API" - spec.homepage = "https://github.com/ePages-de/beyond_api-ruby_client" + spec.authors = ['Unai Abrisketa', 'Kathia Salazar', 'German San Emeterio', 'Kenneth Gallego', 'Andrés Bernardi'] + spec.summary = 'Ruby client to access the Beyond API' + spec.homepage = 'https://github.com/ePages-de/beyond_api-ruby_client' spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] + + spec.required_ruby_version = '>= 3.3' - spec.required_ruby_version = ">= 2.5.1" + spec.add_development_dependency 'bundler', '~> 2.0' + spec.add_development_dependency 'faker', '~> 2.2' + spec.add_development_dependency 'rake', '~> 10.0' + spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'rubocop', '~> 1.20' + spec.add_development_dependency 'rubocop-rails', '~> 2.14' + spec.add_development_dependency 'rubocop-rspec', '~> 2.4' + spec.add_development_dependency 'yard', '~> 0.9' - spec.add_development_dependency "bundler", "~> 2.0" - spec.add_development_dependency "dotenv", "~> 2.7" - spec.add_development_dependency "faker", "~> 2.2" - spec.add_development_dependency "rake", "~> 10.0" - spec.add_development_dependency "rspec", "~> 3.0" - spec.add_development_dependency "rubocop", "~> 1.20" - spec.add_development_dependency "rubocop-ordered_methods", "~> 0.9" - spec.add_development_dependency "rubocop-rspec", "~> 2.4" - spec.add_development_dependency "yard", "~> 0.9" + spec.add_dependency 'activesupport', '~> 7.0' + spec.add_dependency 'faraday', '~> 2.10.0' + spec.add_dependency 'faraday-multipart' + spec.add_dependency 'faraday-retry' + spec.add_dependency 'zeitwerk' - spec.add_dependency "faraday", "~> 1.9.0" + spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/bin/console b/bin/console index ce7d2fa..2489aea 100755 --- a/bin/console +++ b/bin/console @@ -4,16 +4,13 @@ require "bundler/setup" require "dotenv/load" require "beyond_api" +require "pry" + +Dotenv.load('.env.development') -unless ENV["CLIENT_ID"].nil? && ENV["CLIENT_SECRET"].nil? - BeyondApi.setup do |config| - config.client_id = ENV["CLIENT_ID"] - config.client_secret = ENV["CLIENT_SECRET"] - config.remove_response_links = true - config.remove_response_key_underscores = true - config.object_struct_responses = false - end +BeyondApi.setup do |config| + config.client_id = ENV.fetch("CLIENT_ID", nil) + config.client_secret = ENV.fetch("CLIENT_SECRET", nil) end -require "pry" Pry.start diff --git a/lib/beyond_api.rb b/lib/beyond_api.rb index c00e882..d2fd69a 100644 --- a/lib/beyond_api.rb +++ b/lib/beyond_api.rb @@ -1,60 +1,28 @@ # frozen_string_literal: true -require "beyond_api/version" - -require "logger" - -require "beyond_api/ext" -require "beyond_api/utils" +require 'active_support/all' +require 'faraday' +require 'faraday/retry' +require 'faraday/multipart' +require 'forwardable' +require 'json' +require 'zeitwerk' module BeyondApi - autoload :Connection, "beyond_api/connection" - autoload :Error, "beyond_api/error" - autoload :Logger, "beyond_api/logger" - autoload :Request, "beyond_api/request" - autoload :Session, "beyond_api/session" + loader = Zeitwerk::Loader.for_gem + loader.push_dir("#{__dir__}/beyond_api/services", namespace: BeyondApi) + loader.ignore("#{__dir__}/generators") + loader.setup - extend BeyondApi::Logger + extend Logger class << self attr_accessor :configuration - end - - def self.setup - self.configuration ||= Configuration.new - - yield configuration - end - - class Configuration - attr_accessor :client_id, :client_secret, :open_timeout, :timeout, :remove_response_links, - :remove_response_key_underscores, :object_struct_responses, :raise_error_requests, - :log_headers, :log_bodies, :log_level, :all_pagination_size, :retry_options - - def initialize - @client_id = nil - @client_secret = nil - @open_timeout = 2 - @timeout = 5 - @remove_response_links = false - @remove_response_key_underscores = false - @object_struct_responses = false - @raise_error_requests = false - - @log_level = :info - @log_headers = false - @log_bodies = false - @all_pagination_size = 200 + def setup + self.configuration ||= Configuration.new - @retry_options = { - max: 5, - interval: 0.05, - interval_randomness: 0.5, - backoff_factor: 2, - retry_statuses: [409], - exceptions: [Faraday::TimeoutError, Faraday::ConnectionFailed] - } + yield configuration end end end diff --git a/lib/beyond_api/all_pages_handler.rb b/lib/beyond_api/all_pages_handler.rb new file mode 100644 index 0000000..ebce66e --- /dev/null +++ b/lib/beyond_api/all_pages_handler.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module BeyondApi + class AllPagesHandler + include Concerns::Connection + + def initialize(session, url, params = {}) + @session = session + @url = url + @params = params + + first_page_data = fetch_page(0) + @response = first_page_data + @resource_key = first_page_data[:embedded].keys.first + @total_pages = first_page_data.dig(:page, :total_pages) + @total_elements = first_page_data.dig(:page, :total_elements) + end + + def call + (1..remaining_pages).each do |page| + process_page(page) + end + + update_response_page_info + + @response + end + + private + + def remaining_pages + @total_pages - 1 + end + + def fetch_page(page) + # Fixed page size + get(@url, @params.merge(page:, size: BeyondApi.configuration.all_pagination_size)) + end + + def process_page(page) + page_data = fetch_page(page) + + @response[:embedded][@resource_key].concat( + page_data[:embedded][@resource_key] + ) + end + + def update_response_page_info + @response[:page][:size] = @total_elements + @response[:page][:total_pages] = 1 + @response[:page][:number] = 0 + end + end +end diff --git a/lib/beyond_api/concerns/connection.rb b/lib/beyond_api/concerns/connection.rb new file mode 100644 index 0000000..7581096 --- /dev/null +++ b/lib/beyond_api/concerns/connection.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +module BeyondApi + module Concerns + module Connection + LOGGER = BeyondApi.logger + LOGGER.level = Kernel.const_get("::Logger::#{BeyondApi.configuration.log_level.to_s.upcase}") + + def get(path, params = {}) + handle_request { agent.get(path, parse_request(params)) } + end + + def put(path, body = {}, params = {}) + handle_request do + agent.put(path, body) do |request| + request.params = parse_request(params) + request.body = parse_request(body) + end + end + end + + def post(path, body = {}, params = {}) + handle_request do + agent.post(path, body) do |request| + request.params = parse_request(params) + request.body = parse_request(body) + end + end + end + + def delete(path, params = {}) + handle_request { agent.delete(path, parse_request(params)) } + end + + def upload_file(path, file_path, content_type, params = {}) + handle_request do + agent.post(path) do |request| + request.headers['Content-Type'] = content_type + request.params = parse_request(params) + request.body = File.binread(file_path) + end + end + end + + def upload_files(path, body, params = {}) + handle_request do + agent.post(path) do |request| + request.headers['Content-Type'] = 'multipart/form-data' + request.options[:params_encoder] = Faraday::FlatParamsEncoder + request.params = parse_request(params) + request.body = body + end + end + end + + private + + def parse_request(hash) + return hash unless @camelize_keys + + Utils.camelize_keys(hash) + end + + def handle_request + Response.new(yield).parse + rescue Faraday::TimeoutError, Faraday::ConnectionFailed => e + raise BeyondApi::FaradayError, e + end + + def agent + @agent ||= Faraday.new(url: @session.api_url, ssl: { verify: true }) do |faraday| + # Timeouts + faraday.options.timeout = BeyondApi.configuration.timeout.to_i + faraday.options.open_timeout = BeyondApi.configuration.open_timeout.to_i + # Authorization + faraday.request :authorization, *authorization_config + # Headers + faraday.headers['Accept'] = 'application/json' # Set default accept header + faraday.headers['Content-Type'] = 'application/json' # Set default content type + # Request options + faraday.request :json # Encode request bodies as JSON + faraday.request :retry, BeyondApi.configuration.retry_options + faraday.request :multipart, { flat_encode: true } + # Response options + faraday.response :json, content_type: 'application/json' + faraday.response :logger, *logger_config { |logger| apply_filters(logger) } + end + end + + def authorization_config + case @authorization + when :basic + [:basic, BeyondApi.configuration.client_id, BeyondApi.configuration.client_secret] + when :bearer + ['Bearer', @session.access_token] + end + end + + def logger_config + [LOGGER, { bodies: BeyondApi.configuration.log_bodies, headers: BeyondApi.configuration.log_headers }] + end + + def apply_filters(logger) + logger.filter(/(code=)([a-zA-Z0-9]+)/, '\1[FILTERED]') + logger.filter(/(refresh_token=)([a-zA-Z0-9.\-\_]+)/, '\1[FILTERED]') + end + end + end +end diff --git a/lib/beyond_api/concerns/pagination.rb b/lib/beyond_api/concerns/pagination.rb new file mode 100644 index 0000000..21403cd --- /dev/null +++ b/lib/beyond_api/concerns/pagination.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module BeyondApi + module Concerns + module Pagination + def fetch_all_pages(url, params = {}) + if params[:paginated] == false + AllPagesHandler.new(@session, url, params).call + else + get(url, params) + end + end + end + end +end diff --git a/lib/beyond_api/configuration.rb b/lib/beyond_api/configuration.rb new file mode 100644 index 0000000..87e3997 --- /dev/null +++ b/lib/beyond_api/configuration.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module BeyondApi + class Configuration + attr_accessor :client_id, :client_secret, + :open_timeout, :timeout, + :log_headers, :log_bodies, :log_level, + :all_pagination_size, :retry_options + + def initialize + @client_id = nil + @client_secret = nil + @open_timeout = 2 + @timeout = 5 + + @log_level = :info + @log_headers = false + @log_bodies = false + + @all_pagination_size = 200 + + @retry_options = { + max: 3, + interval: 0.05, + interval_randomness: 0.5, + backoff_factor: 2, + retry_statuses: [409], + exceptions: [Faraday::TimeoutError, Faraday::ConnectionFailed] + } + end + end +end diff --git a/lib/beyond_api/connection.rb b/lib/beyond_api/connection.rb deleted file mode 100644 index 511327b..0000000 --- a/lib/beyond_api/connection.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require "faraday" - -module BeyondApi - class Connection - LOGGER = ::BeyondApi.logger - LOGGER.level = Kernel.const_get("::Logger::#{BeyondApi.configuration.log_level.to_s.upcase}") - - def self.default - Faraday.new(ssl: { verify: true }) do |faraday| - faraday.adapter(:net_http) - faraday.options[:open_timeout] = BeyondApi.configuration.open_timeout.to_i - faraday.options[:timeout] = BeyondApi.configuration.timeout.to_i - faraday.headers["Accept"] = "application/json" - faraday.headers["Content-Type"] = "application/json" - faraday.request(:multipart) - faraday.request(:url_encoded) - faraday.request(:retry, BeyondApi.configuration.retry_options) - faraday.response :logger, LOGGER, { headers: BeyondApi.configuration.log_headers, - bodies: BeyondApi.configuration.log_bodies } - end - end - - def self.token - Faraday.new(ssl: { verify: true }) do |faraday| - faraday.options[:open_timeout] = BeyondApi.configuration.open_timeout.to_i - faraday.options[:timeout] = BeyondApi.configuration.timeout.to_i - faraday.response :logger, LOGGER, { headers: BeyondApi.configuration.log_headers, - bodies: BeyondApi.configuration.log_bodies } do |logger| - logger.filter(/(code=)([a-zA-Z0-9]+)/, '\1[FILTERED]') - logger.filter(/(refresh_token=)([a-zA-Z0-9.\-\_]+)/, '\1[FILTERED]') - end - faraday.headers['Accept'] = 'application/json' - faraday.adapter(:net_http) - faraday.request :basic_auth, BeyondApi.configuration.client_id, BeyondApi.configuration.client_secret - end - end - - def self.multipart - Faraday.new(ssl: { verify: true }) do |faraday| - faraday.options[:open_timeout] = BeyondApi.configuration.open_timeout.to_i - faraday.options[:timeout] = BeyondApi.configuration.timeout.to_i - faraday.request :multipart, { flat_encode: true } - faraday.adapter Faraday.default_adapter - end - end - end -end diff --git a/lib/beyond_api/error.rb b/lib/beyond_api/error.rb index de48a8a..fd4be4c 100644 --- a/lib/beyond_api/error.rb +++ b/lib/beyond_api/error.rb @@ -2,7 +2,7 @@ module BeyondApi class Error < StandardError - attr_reader :error_id, :details, :trace_id, :full_message, :status_code, :error, :error_description + attr_reader :response def initialize(data, status_code = nil) data ||= {} @@ -15,19 +15,7 @@ def initialize(data, status_code = nil) @full_message = data @status_code = status_code - super(data["message"] || data["error_description"]) - end - - def to_json - { - error_id: @error_id, - message: @message, - details: @details, - error: @error, - error_description: @error_description, - trace_id: @trace_id, - status_code: @status_code - } + super end end end diff --git a/lib/beyond_api/ext.rb b/lib/beyond_api/ext.rb deleted file mode 100644 index 8d21dcf..0000000 --- a/lib/beyond_api/ext.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -class Hash - def deep_transform_keys(&block) - result = {} - each do |key, value| - result[yield(key)] = case value - when Hash - value.deep_transform_keys(&block) - when Array - value.camelize_keys - else - value - end - end - result - end - - def camelize_keys - deep_transform_keys { |key| key.to_s.camelize(false) } - end - - def underscorize_keys - deep_transform_keys { |key| key.to_s.underscore } - end -end - -class String - def blank? - respond_to?(:empty?) ? !!empty? : !self - end - - def underscore - gsub(/::/, "/") - .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2') - .gsub(/([a-z\d])([A-Z])/, '\1_\2') - .tr("-", "_") - .downcase - end - - def camelize(uppercase_first_letter = true) - string = self - if uppercase_first_letter - string = string.sub(/^[a-z\d]*/, &:capitalize) - else - string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/, &:downcase) - end - string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub("/", "::") - end -end - -class Array - def camelize_keys - map do |elem| - case elem - when Hash, Array then elem.camelize_keys - else; elem - end - end - end -end diff --git a/lib/beyond_api/faraday_error.rb b/lib/beyond_api/faraday_error.rb new file mode 100644 index 0000000..934871a --- /dev/null +++ b/lib/beyond_api/faraday_error.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module BeyondApi + class FaradayError < Error; end +end diff --git a/lib/beyond_api/request.rb b/lib/beyond_api/request.rb deleted file mode 100644 index 0f60304..0000000 --- a/lib/beyond_api/request.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -require "json" -require "faraday" -require "beyond_api/utils" - -module BeyondApi - class Request - class << self - [:get, :delete].each do |method| - define_method(method) do |session, path, params = {}| - response = BeyondApi::Connection.default.send(method) do |request| - request.url(session.api_url + path) - request.headers["Authorization"] = "Bearer #{session.access_token}" unless session.access_token.nil? - request.params = params.to_h.camelize_keys - end - - [response.body.blank? ? nil : JSON.parse(response.body), response.status] - end - end - - [:post, :put, :patch].each do |method| - define_method(method) do |session, path, body = {}, params = {}, content_type = 'application/json'| - response = BeyondApi::Connection.default.send(method) do |request| - request.url(session.api_url + path) - request.headers["Authorization"] = "Bearer #{session.access_token}" unless session.access_token.nil? - request.headers["Content-Type"] = content_type - request.params = params.to_h.camelize_keys - - request.body = body.respond_to?(:camelize_keys) ? body.camelize_keys.to_json : body - end - - [response.body.blank? ? nil : JSON.parse(response.body), response.status] - end - end - end - - def self.upload(session, path, file_binary, content_type, params) - response = BeyondApi::Connection.default.post do |request| - request.url(session.api_url + path) - request.headers["Authorization"] = "Bearer #{session.access_token}" unless session.access_token.nil? - request.headers["Content-Type"] = content_type - request.params = params.to_h.camelize_keys - request.body = file_binary - end - - [response.body.blank? ? nil : JSON.parse(response.body), response.status] - end - - def self.token(url, params) - response = BeyondApi::Connection.token.post do |request| - request.url(url) - request.params = params - end - - [response.body.blank? ? nil : JSON.parse(response.body), response.status] - end - - def self.upload_by_form(session, path, files, params) - response = BeyondApi::Connection.multipart.post do |request| - request.url(session.api_url + path) - request.headers["Authorization"] = "Bearer #{session.access_token}" unless session.access_token.nil? - request.options[:params_encoder] = Faraday::FlatParamsEncoder - request.params = params.to_h.camelize_keys - files = files.split unless files.is_a? Array - upload_files = files.map{ |file| Faraday::FilePart.new(File.open(file), - BeyondApi::Utils.file_content_type(file)) } - request.body = { image: upload_files } - end - - [response.body.blank? ? nil : JSON.parse(response.body), response.status] - end - end -end diff --git a/lib/beyond_api/resources/base.rb b/lib/beyond_api/resources/base.rb deleted file mode 100644 index 116b698..0000000 --- a/lib/beyond_api/resources/base.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module BeyondApi - class Base - class InvalidSessionError < StandardError; end - - attr_reader :session - - def initialize(session) - @session = session - - raise InvalidSessionError, "Invalid session" unless session.is_a? BeyondApi::Session - raise InvalidSessionError, "Session api_url cannot be nil" if session.api_url.nil? - end - end -end diff --git a/lib/beyond_api/resources/carts.rb b/lib/beyond_api/resources/carts.rb deleted file mode 100644 index 16f2ad4..0000000 --- a/lib/beyond_api/resources/carts.rb +++ /dev/null @@ -1,585 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Carts < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to add a line item to the cart. Currently only product line items are supported. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/6d529573-b39e-4cd4-99fe-856432ea97f3/line-items' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -d '{"_type":"PRODUCT","_ref":"c3a52c19-2b43-4ceb-a7ca-00c558aec072","quantity":1}' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "_type" => "PRODUCT", - # "_ref" => "c3a52c19-2b43-4ceb-a7ca-00c558aec072", - # "quantity" => 1 - # } - # @cart = session.carts.add_line_item("6d529573-b39e-4cd4-99fe-856432ea97f3", body) - # - def add_line_item(cart_id, body) - response, status = BeyondApi::Request.post(@session, - "/carts/#{cart_id}/line-items", - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts' -i -X POST \ - # -H 'Accept: application/hal+json' - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.create - # - def create - response, status = BeyondApi::Request.post(@session, - "/carts") - - handle_response(response, status) - end - - # - # A +POST+ request is used to initiate the creation of a payment. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/158bdcee-178a-4b5f-88ff-1953f5ea8e09/create-payment' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -d '{ - # "returnUri" : "http://some.com/return", - # "cancelUri" : "http://some.com/cancel" - # }' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "returnUri" => "http://some.com/return", - # "cancelUri" => "http://some.com/cancel" - # } - # @payment = session.carts.create_payment("158bdcee-178a-4b5f-88ff-1953f5ea8e09/", body) - # - def create_payment(cart_id, body) - response, status = BeyondApi::Request.post(@session, - "/carts/#{cart_id}/create-payment", - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create an order from a cart and initiate the payment. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/f6c6615b-a9f6-420e-be1d-46339ddc5fda/create-payment-and-order' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -d '{ - # "returnUri" : "http://some.com/return", - # "cancelUri" : "http://some.com/cancel", - # "customerComment" : "Send it fast please!", - # "salesChannel" : "Storefront", - # "marketingChannel" : "Google", - # "marketingSubchannel" : "Search page 2", - # "testOrder" : false, - # "termsAndConditionsExplicitlyAccepted" : false - # }' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "returnUri" => "http://some.com/return", - # "cancelUri" => "http://some.com/cancel", - # "customerComment" => "Send it fast please!", - # "salesChannel" => "Storefront", - # "marketingChannel" => "Google", - # "marketingSubchannel" => "Search page 2", - # "testOrder" => false, - # "termsAndConditionsExplicitlyAccepted" => false - # } - # @payment = session.carts.create_payment_and_order("f6c6615b-a9f6-420e-be1d-46339ddc5fda", body) - # - def create_payment_and_order(cart_id, body) - response, status = BeyondApi::Request.post(@session, - "/carts/#{cart_id}/create-payment-and-order", - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create an order from the cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/986247da-b78f-422c-a273-917804896974/order' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -d '{"customerComment": "send it fast please", - # "salesChannel": "DifferentChannel", - # "marketingChannel": "Google", - # "marketingSubchannel": "Search page 2", - # "testOrder": false, - # "termsAndConditionsExplicitlyAccepted": true - # }' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "customerComment" => "send it fast please", - # "salesChannel" => "DifferentChannel", - # "marketingChannel" => "Google", - # "marketingSubchannel" => "Search page 2", - # "testOrder" => false, - # "termsAndConditionsExplicitlyAccepted" => true - # } - # @order = session.carts.create_order("986247da-b78f-422c-a273-917804896974", body) - # - def create_order(cart_id, body) - response, status = BeyondApi::Request.post(@session, - "/carts/#{cart_id}/order", - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/1a58f22f-481a-4993-9947-62c1c2857f87' -i -X DELETE - # - # @param cart_id [String] the cart UUID - # - # @return true - # - # @example - # session.carts.delete("1a58f22f-481a-4993-9947-62c1c2857f87") - # - def delete(cart_id) - response, status = BeyondApi::Request.delete(@session, - "/carts/#{cart_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +DELETE+ request is used to delete a line item from the cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/3fb55475-f6d2-471a-90ac-ccee7896b9f7/line-items/51c86195-d2b9-4073-9a14-7ddd5a76b6a7' -i -X DELETE - # - # @param cart_id [String] the cart UUID - # @param line_item_id [String] the line item UUID - # - # @return true - # - # @example - # @cart = session.carts.delete_line_item("3fb55475-f6d2-471a-90ac-ccee7896b9f7", "51c86195-d2b9-4073-9a14-7ddd5a76b6a7") - # - def delete_line_item(cart_id, line_item_id) - response, status = BeyondApi::Request.delete(@session, - "/carts/#{cart_id}/line-items/#{line_item_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +DELETE+ request is used to remove the shipping address of the cart. After deletion, the shipping address will default to the billing address. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/2fa7dc36-8305-4628-b961-f2c3f7dda47d/shipping-address' -i -X DELETE \ - # -H 'Accept: application/hal+json' - # - # @param cart_id [String] the cart UUID - # - # @return true - # - # @example - # session.carts.delete_shipping_address("2fa7dc36-8305-4628-b961-f2c3f7dda47d") - # - def delete_shipping_address(cart_id) - response, status = BeyondApi::Request.delete(@session, - "/carts/#{cart_id}/shipping-address") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/26857145-aeab-4210-9191-3906573a14ae' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.find("26857145-aeab-4210-9191-3906573a14ae") - # - def find(cart_id) - response, status = BeyondApi::Request.get(@session, - "/carts/#{cart_id}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the current payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/6d9de289-d6a7-44d6-afb3-c31bb0a792ff/payment-methods/current' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @payment_method = session.carts.payment_method("26857145-aeab-4210-9191-3906573a14ae") - # - def payment_method(cart_id) - response, status = BeyondApi::Request.get(@session, - "/carts/#{cart_id}/payment-methods/current") - - handle_response(response, status) - end - - # - # A +GET+ request is used to get the applicable payment methods of a cart. - # The selectable field indicates if a payment method is currently selectable. Non-selectable payment methods are currently restricted because of rules that apply to a cart. - # Trying to set such a payment method as the current one of the cart will fail. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/45f9009d-4d2f-43b1-9cd2-ea29ff0d46d6/payment-methods' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @payment_methods = session.carts.payment_methods("45f9009d-4d2f-43b1-9cd2-ea29ff0d46d6") - # - def payment_methods(cart_id) - response, status = BeyondApi::Request.get(@session, - "/carts/#{cart_id}/payment-methods") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to replace only one line item in the cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/f73629e5-fecf-4474-9b04-6b2fcd4663c4/line-items/2c9c0f38-0b9e-4fa7-bcbe-960098ff63aa' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -d '{"_type":"PRODUCT","_ref":"f084553c-ea77-4745-b1bd-71c64c8419fd","quantity":2}' - # - # @param cart_id [String] the cart UUID - # @param line_item_id [String] the line item UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "_type" => "PRODUCT", - # "_ref" => "f084553c-ea77-4745-b1bd-71c64c8419fd", - # "quantity" => 2 - # } - # - # @cart = session.carts.replace_line_item("f73629e5-fecf-4474-9b04-6b2fcd4663c4", "2c9c0f38-0b9e-4fa7-bcbe-960098ff63aa", body) - # - def replace_line_item(cart_id, line_item_id, body) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/line-items/#{line_item_id}", - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to replace the current line items in the cart with the given list. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/c1436110-e283-49b3-a748-0321efec6d35/line-items' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -d '[{"_type":"PRODUCT","_ref":"0612362d-9856-4b40-94c6-a36abec0cf8c","quantity":1}]' - # - # @param cart_id [String] the cart UUID - # @param body [String] the array of line items - # - # @return [OpenStruct] - # - # @example - # body = [ { - # "_type" => "PRODUCT", - # "_ref" => "0612362d-9856-4b40-94c6-a36abec0cf8c", - # "quantity" => 1 - # } ] - # - # @cart = session.carts.replace_line_items("c1436110-e283-49b3-a748-0321efec6d35", body) - # - def replace_line_items(cart_id, body) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/line-items", - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the billing address of the cart. The billing address is mandatory for a cart being ready to order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/01da6aa7-8aa2-4383-a496-6611a14afbc9/billing-address' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -d '{"salutation":"Mrs","gender":"FEMALE","title":"","firstName":"Astrid","middleName":"Agnes","lastName":"Alster","street":"Alsterwasserweg", - # "houseNumber":"2","street2":"Erdgeschoss","doorCode":"0185","addressExtension":"Hinterhof","postalCode":"20999","dependentLocality":"Seevetal", - # "city":"Alsterwasser","country":"DE","state":"Hamburg","email":"a.alsterh@example.com","phone":"(800) 555-0102","mobile":"(800) 555-0103", - # "vatId":"123456789","taxNumber":"123-34-6789","birthDate":"1985-03-20"}' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "salutation" => "Mrs", - # "gender" => "FEMALE", - # "title" => "", - # "firstName" => "Astrid", - # "middleName" => "Agnes", - # "lastName" => "Alster", - # "street" => "Alsterwasserweg", - # "houseNumber" => "2", - # "street2" => "Erdgeschoss", - # "doorCode" => "0185", - # "addressExtension" => "Hinterhof", - # "postalCode" => "20999", - # "dependentLocality" => "Seevetal", - # "city" => "Alsterwasser", - # "country" => "DE", - # "state" => "Hamburg", - # "email" => "a.alsterh@example.com", - # "phone" => "(800) 555-0102", - # "mobile" => "(800) 555-0103", - # "vatId" => "123456789", - # "taxNumber" => "123-34-6789", - # "birthDate" => "1985-03-20" - # } - # - # @cart = session.carts.set_billing_address("01da6aa7-8aa2-4383-a496-6611a14afbc9", body) - # - def set_billing_address(cart_id, body) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/billing-address", - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the current payment method of the cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/750c8a68-ef58-4955-b05f-29e35fa19687/payment-methods/current' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Accept: application/json' \ - # -d 'https://api-shop.beyondshop.cloud/api/payment-methods/6498f339-7fe6-43d4-8e2a-6da68d7cdfe3' - # - # @param cart_id [String] the cart UUID - # @param payment_method_id [String] the payment method UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.set_payment_method("750c8a68-ef58-4955-b05f-29e35fa19687", "6498f339-7fe6-43d4-8e2a-6da68d7cdfe3") - # - def set_payment_method(cart_id, payment_method_id) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/payment-methods/current", - "#{@session.api_url}/payment-methods/#{payment_method_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the payment method to the current default payment method. The default payment method is the one with the highest priority of the applicable payment methods. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/d1efcb74-ab96-43c5-b404-9c1f927dc3d2/payment-methods/default' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.set_payment_method_to_default("d1efcb74-ab96-43c5-b404-9c1f927dc3d2") - # - def set_payment_method_to_default(cart_id) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/payment-methods/default") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the shipping address of the cart. If a shipping address is not set, it will default to the billing address. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/01da6aa7-8aa2-4383-a496-6611a14afbc9/shipping-address' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -d '{"salutation":"Mrs","gender":"FEMALE","title":"","firstName":"Astrid","middleName":"Agnes","lastName":"Alster","street":"Alsterwasserweg", - # "houseNumber":"2","street2":"Erdgeschoss","doorCode":"0185","addressExtension":"Hinterhof","postalCode":"20999","dependentLocality":"Seevetal", - # "city":"Alsterwasser","country":"DE","state":"Hamburg","email":"a.alsterh@example.com","phone":"(800) 555-0102","mobile":"(800) 555-0103", - # "vatId":"123456789","taxNumber":"123-34-6789","birthDate":"1985-03-20"}' - # - # @param cart_id [String] the cart UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "salutation" => "Mrs", - # "gender" => "FEMALE", - # "title" => "", - # "firstName" => "Astrid", - # "middleName" => "Agnes", - # "lastName" => "Alster", - # "street" => "Alsterwasserweg", - # "houseNumber" => "2", - # "street2" => "Erdgeschoss", - # "doorCode" => "0185", - # "addressExtension" => "Hinterhof", - # "postalCode" => "20999", - # "dependentLocality" => "Seevetal", - # "city" => "Alsterwasser", - # "country" => "DE", - # "state" => "Hamburg", - # "email" => "a.alsterh@example.com", - # "phone" => "(800) 555-0102", - # "mobile" => "(800) 555-0103", - # "vatId" => "123456789", - # "taxNumber" => "123-34-6789", - # "birthDate" => "1985-03-20" - # } - # - # @cart = session.carts.set_shipping_address("01da6aa7-8aa2-4383-a496-6611a14afbc9", body) - # - def set_shipping_address(cart_id, body) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/shipping-address", - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the current shipping method of the cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/a4e7922a-f895-4a7d-8cb1-6ecf74d7ceba/shipping-methods/current' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Accept: application/json' \ - # -d 'https://api-shop.beyondshop.cloud/api/shipping-zones/59e26c99-ef1d-4ee8-a79f-d078cd6dfe24/shipping-methods/f3d3ce8d-eeab-44b6-81bb-67a4f1d7a57f' - # - # @param cart_id [String] the cart UUID - # @param shipping_zone_id [String] the shipping zone UUID - # @param shipping_method_id [String] the shipping method UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.set_shipping_method("a4e7922a-f895-4a7d-8cb1-6ecf74d7ceba", "59e26c99-ef1d-4ee8-a79f-d078cd6dfe24", "f3d3ce8d-eeab-44b6-81bb-67a4f1d7a57f") - # - def set_shipping_method(cart_id, shipping_zone_id, shipping_method_id) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/shipping-methods/current", - "#{session.api_url}/shipping-zones/#{shipping_zone_id}/shipping-methods/#{shipping_method_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to set the shipping method to the current default shipping method. - # The default shipping method is the one with the highest priority of the applicable shipping methods. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/c31c5d06-4460-4f89-9e09-47f9956dea98/shipping-methods/default' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.set_shipping_method_to_default("c31c5d06-4460-4f89-9e09-47f9956dea98") - # - def set_shipping_method_to_default(cart_id) - response, status = BeyondApi::Request.put(@session, - "/carts/#{cart_id}/shipping-methods/default") - - handle_response(response, status) - end - - # - # A +GET+ request is used to get the current shipping method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/9093a339-66fd-4cc1-9dcf-d23003c38b41/shipping-methods/current' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @shipping_method = session.carts.shipping_method("9093a339-66fd-4cc1-9dcf-d23003c38b41") - # - def shipping_method(cart_id) - response, status = BeyondApi::Request.get(@session, - "/carts/#{cart_id}") - - handle_response(response, status) - end - - # A +GET+ request is used to get the applicable shipping method of a cart. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/carts/05a547a0-80dc-4a8c-b9b6-aa028b6ef7d8/shipping-methods' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @cart = session.carts.shipping_methods("05a547a0-80dc-4a8c-b9b6-aa028b6ef7d8") - # - def shipping_methods(cart_id) - response, status = BeyondApi::Request.get(@session, - "/carts/#{cart_id}") - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/categories.rb b/lib/beyond_api/resources/categories.rb deleted file mode 100644 index 5ed7e4d..0000000 --- a/lib/beyond_api/resources/categories.rb +++ /dev/null @@ -1,167 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Categories < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all available categories in a paged manner. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +catg:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @categories = session.categories.all(size: 100, page: 0) - # - def all(params = {}) - handle_all_request("/categories", :categories, params) - end - - # - # A +POST+ request is used to create a category. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{"name":"Power Bars","label":"power-bar","type":"SMART","query":{"bool":{"filter":{"term":{"tags":"power-bar"}}}}}' - # - # @beyond_api.scopes +catg:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "Power Bars", - # "label" => "power-bar", - # "type" => "SMART", - # "query" => { "bool" => { "filter" => { "term" : { "tags" => "power-bar" } } } } - # } - # @category = session.categories.create(body) - # - def create(body) - response, status = BeyondApi::Request.post(@session, "/categories", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a category. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories/f461fb56-1984-4ade-bd4e-007c273cc923' -i -X DELETE \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +catg:d+ - # - # @param category_id [String] the category UUID - # - # @return true - # - # @example - # session.categories.delete("f461fb56-1984-4ade-bd4e-007c273cc923") - # - def delete(category_id) - response, status = BeyondApi::Request.delete(@session, "/categories/#{category_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a category. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories/27a94b71-9b17-4f06-9596-fbbf4d18021f' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +catg:r+ - # - # @param category_id [String] the category UUID - # - # @return [OpenStruct] - # - # @example - # @category = session.categories.find("27a94b71-9b17-4f06-9596-fbbf4d18021f") - # - def find(category_id) - response, status = BeyondApi::Request.get(@session, "/categories/#{category_id}") - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to update a category partially with json patch content type. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories/49250b7a-79a8-48d0-a71c-fc417965928d' -i -X PATCH \ - # -H 'Content-Type: application/json-patch+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{"name":"patched name","type":"MANUAL","query":{"bool":{"filter":[{"terms":{"id":["6c449297-65fc-41aa-a49c-68a3561b33e5","6c449297-65fc-41aa-a49c-68a3561b33e6"]}}]}}}' - # - # @beyond_api.scopes +catg:u+ - # - # @param category_id [String] the category UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "patched name", - # "type" => "MANUAL", - # "query" => {"bool" => { "filter" => [ { "terms" => { "id" => [ "6c449297-65fc-41aa-a49c-68a3561b33e5", "6c449297-65fc-41aa-a49c-68a3561b33e6" ] } } ] } } - # } - # @category = session.categories.update("49250b7a-79a8-48d0-a71c-fc417965928d", body) - # - def patch(category_id, body) - response, status = BeyondApi::Request.patch(@session, "/categories/#{category_id}", body) - - handle_response(response, status) - end - - # - # A +PUT+ request is issued to update all category properties with application/json content type. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/categories/cb2058dc-871a-4e64-83ac-39a0be9e6f82' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{"name":"updated name","label":"updated-name","type":"MANUAL","query":{"bool":{"filter":[{"terms":{"id":["6c449297-65fc-41aa-a49c-68a3561b33e5","6c449297-65fc-41aa-a49c-68a3561b33e6"]}}]}}}' - # - # @beyond_api.scopes +catg:u+ - # - # @param category_id [String] the category UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "updated name", - # "label" => "updated-name", - # "type" => "MANUAL", - # "query" => { "bool" => { "filter" => [ { "terms" => { "id" => [ "6c449297-65fc-41aa-a49c-68a3561b33e5", "6c449297-65fc-41aa-a49c-68a3561b33e6" ] } } ] } } - # } - # @category = session.categories.update(category_id, body) - # - def update(category_id, body) - response, status = BeyondApi::Request.put(@session, "/categories/#{category_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/categories_view.rb b/lib/beyond_api/resources/categories_view.rb deleted file mode 100644 index d466d77..0000000 --- a/lib/beyond_api/resources/categories_view.rb +++ /dev/null @@ -1,218 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class CategoriesView < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all product categories. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @categories = session.categories_view.all(size: 100, page: 0) - # - def all(params = {}) - handle_all_request("/product-view/categories", :categories, params) - end - - # - # A +GET+ request is used to retrieve the details of a product category. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/23bb1430-6e82-40e4-9a92-4cb404da74a8' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param category_id [String] the category UUID - # - # @return [OpenStruct] - # - # @example - # @category = session.categories_view.find("23bb1430-6e82-40e4-9a92-4cb404da74a8") - # - def find(category_id) - response, status = BeyondApi::Request.get(@session, - "/product-view/categories/#{category_id}") - - handle_response(response, status) - end - - # - # A +POST+ request is read-only and cannot create data. It is used to find products that match the filter criteria. - # Thus, it can be used to preview all products that are included in a category that shares the respective filter criteria. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/preview?page=0&size=10&sortBy=NEWEST_FIRST' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Content-Type: application/json' \ - # -d '{ - # "filters" : [ { - # "key" : "manufacturer", - # "values" : [ "Grape Vineyard" ] - # }, { - # "key" : "all_tags", - # "values" : [ "Power Bar", "Bestseller", "High Protein" ] - # }, { - # "key" : "price_range", - # "min" : 3.7, - # "max" : 13.7 - # } ] - # }' - # - # @param body [Hash] the request body - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # @option params [String] :sort_by the sorting applied to the list of products - # - # @return [OpenStruct] - # - # @example - # body = { - # filters => [ - # { - # key => "manufacturer", - # values => [ "Grape Vineyard" ] - # }, - # { - # key => "all_tags", - # values => [ "Power Bar", "Bestseller", "High Protein" ] - # }, - # { - # key => "price_range", - # min => 3.7, - # max => 13.7 - # } - # ] - # } - # - # @products = session.categories_view.preview(body, { size: 100, page: 0, sort_by: "NEWEST_FIRST" }) - # - def preview(body, params = {}) - response, status = BeyondApi::Request.post(@session, - "/product-view/categories/preview", - body, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all products of a category. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/681beef2-cd3e-4ce3-8034-4d07c1184447/products' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param category_id [String] the category UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @products = session.categories_view.products("681beef2-cd3e-4ce3-8034-4d07c1184447", { size: 100, page: 0 }) - # - def products(category_id, params = {}) - path = "/product-view/categories/#{category_id}/products" - - handle_all_request(path, :products, params) - end - - # - # A +GET+ request is used to find a product category by its unique label. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/search/find-by-label?label=power-bar' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param label [String] the label of the category - # - # @return [OpenStruct] - # - # @example - # @category = session.categories_view.search_by_label("power-bar") - # - def search_by_label(label) - response, status = BeyondApi::Request.get(@session, - "/product-view/categories/search/find-by-label", - { label: label }) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all product categories a product is part of using the request parameter productId. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/search/find-by-product?productId=ba68427f-603c-4741-9185-3b379f7769b5' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param product_id [String] the product UUID of the category - # - # @return [OpenStruct] - # - # @example - # @category = session.categories_view.search_by_product_id("ba68427f-603c-4741-9185-3b379f7769b5") - # - def search_by_product_id(product_id, params = {}) - response, status = BeyondApi::Request.get(@session, - "/product-view/categories/search/find-by-product", - params.merge(product_id: product_id)) - - handle_response(response, status) - end - - # - # A +POST+ request is used to search for categories a new product will be part of using the request body. An existing product can also be part of the call. This endpoint can handle all properties a product can have. - # This request is read-only and cannot create data. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/categories/search/find-by-product' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # -d '{ - # "tags" : [ "books" ], - # "manufacturer" : "The Standard Manufacturer", - # "salesPrice" : { - # "amount" : 10.0, - # "currency" : "EUR" - # } - # }' - # - # @param body [Hash] the request body - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # body = { - # "tags" => [ "books" ], - # "manufacturer" => "The Standard Manufacturer", - # "sales_price" => { - # "amount" => 10.0, - # "currency" => "EUR" - # } - # } - # - # @categories = session.categories_view.search_by_product(body, { size: 100, page: 0 }) - # - def search_by_product(body, params = {}) - response, status = BeyondApi::Request.post(@session, - "/product-view/categories/search/find-by-product", - body, - params) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/checkout_settings.rb b/lib/beyond_api/resources/checkout_settings.rb deleted file mode 100644 index 1cec015..0000000 --- a/lib/beyond_api/resources/checkout_settings.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class CheckoutSettings < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve the checkout settings. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/checkout-settings' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +cset:r+ - # - # @return [OpenStruct] - # - # @example - # @checkout_settiongs = session.checkout_settings.all - # - def all - response, status = BeyondApi::Request.get(@session, "/checkout-settings") - - handle_response(response, status) - end - - # A +PUT+ request is used to update the checkout settings. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/checkout-settings' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "minimumOrderValue" : { - # "currency" : "EUR", - # "amount" : 50 - # }, - # "mustAcceptTermsAndConditions" : true - # }' - # - # @beyond_api.scopes +cset:u+ - # - # @return [OpenStruct] - # - # @example - # body = { - # "minimum_order_value" => { - # "currency" => "EUR", - # "amount" => 50 - # }, - # "must_accept_terms_and_conditions" => true - # } - # @checkout_settiongs = session.checkout_settings.update(body) - # - def update(body) - response, status = BeyondApi::Request.put(@session, "/checkout-settings", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/customers.rb b/lib/beyond_api/resources/customers.rb deleted file mode 100644 index c378b80..0000000 --- a/lib/beyond_api/resources/customers.rb +++ /dev/null @@ -1,332 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Customers < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all customers of the shop in a paged way. Each item in the response represents a summary of the customer data. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/customers' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +cust:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @customers = session.customers.all(size: 20, page: 0) - # - def all(params = {}) - handle_all_request("/customers", :customers, params) - end - - # - # A +POST+ request is used to create a customer. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/customers' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "defaultPaymentMethodId" : "69923864-74a7-4ea9-92c7-0d17181b39f4", - # "defaultShippingMethodId" : "a5976ec2-d99a-4d16-bd2b-1fa5c48d68aa", - # "shippingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "doorCode" : "456", - # "_id" : null - # }, - # "email" : "a.alsterh@example.com", - # "initialPassword" : "MyVeryStrongPassword", - # "billingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "vatId" : "DE123456789", - # "taxNumber" : "HRE 987654/32123/864516", - # "birthDate" : "1985-05-11", - # "_id" : "b61ca0e0-411f-485e-83f3-035d717095da" - # } - # }' - # - # @beyond_api.scopes +cust:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "defaultPaymentMethodId" : "69923864-74a7-4ea9-92c7-0d17181b39f4", - # "defaultShippingMethodId" : "a5976ec2-d99a-4d16-bd2b-1fa5c48d68aa", - # "shippingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "doorCode" : "456", - # "_id" : null - # }, - # "email" : "a.alsterh@example.com", - # "initialPassword" : "MyVeryStrongPassword", - # "billingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "vatId" : "DE123456789", - # "taxNumber" : "HRE 987654/32123/864516", - # "birthDate" : "1985-05-11", - # "_id" : "b61ca0e0-411f-485e-83f3-035d717095da" - # } - # } - # - # @customer = session.customers.create(body) - # - def create(body) - response, status = BeyondApi::Request.post(@session, "/customers", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a customer. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/customers/9e2a61d9-a1ac-4771-bd02-32bf50386392' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +cust:d+ - # - # @param customer_id [String] the customer UUID - # - # @return true - # - # @example - # session.customers.delete("9e2a61d9-a1ac-4771-bd02-32bf50386392") - # - def delete(customer_id) - response, status = BeyondApi::Request.delete(@session, "/customers/#{customer_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a customer. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/customers/d6a8132e-29b3-4258-b8c0-aee34df42aa1' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +cust:r+ - # - # @param customer_id [String] the customer UUID - # - # @return [OpenStruct] - # - # @example - # @customer = session.customers.find("d6a8132e-29b3-4258-b8c0-aee34df42aa1") - # - def find(customer_id) - response, status = BeyondApi::Request.get(@session, "/customers/#{customer_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a customer. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/customers/34c5566b-e82a-486d-9a7d-3c3aafef6901' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "defaultPaymentMethodId" : "d94790cd-ec27-4461-85a9-457fffcc0271", - # "defaultShippingMethodId" : "976e7d66-0eb2-4ca3-8b44-5e6d0aeb9e63", - # "shippingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "doorCode" : "456", - # "_id" : "112d46ff-fc72-4be8-9e48-588b4f5c7829" - # }, - # "billingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "vatId" : "DE123456789", - # "taxNumber" : "HRE 987654/32123/864516", - # "birthDate" : "1985-05-11", - # "_id" : "85de80fc-8467-46ca-b20c-55f5d4d1eaec" - # } - # }' - # - # @beyond_api.scopes +cust:u+ - # - # @param customer_id [String] the customer UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "defaultPaymentMethodId" : "d94790cd-ec27-4461-85a9-457fffcc0271", - # "defaultShippingMethodId" : "976e7d66-0eb2-4ca3-8b44-5e6d0aeb9e63", - # "shippingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "doorCode" : "456", - # "_id" : "112d46ff-fc72-4be8-9e48-588b4f5c7829" - # }, - # "billingAddress" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : "", - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "Alsterwasserweg", - # "houseNumber" : "2", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "vatId" : "DE123456789", - # "taxNumber" : "HRE 987654/32123/864516", - # "birthDate" : "1985-05-11", - # "_id" : "85de80fc-8467-46ca-b20c-55f5d4d1eaec" - # } - # } - # @customer = session.customers.update("34c5566b-e82a-486d-9a7d-3c3aafef6901", body) - # - def update(customer_id, body) - response, status = BeyondApi::Request.put(@session, "/customers/#{customer_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/newsletter_target.rb b/lib/beyond_api/resources/newsletter_target.rb deleted file mode 100644 index befe51b..0000000 --- a/lib/beyond_api/resources/newsletter_target.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class NewsletterTarget < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to create the newsletter target. Each shop can only have one newsletter target. - # You can update this target at any time, or delete the existing one and create a new target. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/newsletter-target' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "submitUrl": "https://example.org/cgi-bin/subscribe.php" - # }' - # - # @beyond_api.scopes +nltg:m+ - # - # @param submit_url [String] the URL stating where to submit the newsletter - # - # @return [OpenStruct] - # - # @example - # session.newsletter_target.create({ submit_url: "https://example.org/cgi-bin/subscribe.php" }) - # - def create(submit_url) - response, status = BeyondApi::Request.post(@session, - "/newsletter-target", - { submit_url: submit_url }) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete the existing newsletter target. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/newsletter-target' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +nltg:m+ - # - # @return true - # - # @example - # session.newsletter_target.delete - # - def delete - response, status = BeyondApi::Request.delete(@session, - "/newsletter-target") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the newsletter target. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/newsletter-target' -i -X GET - # - # @return [OpenStruct] - # - # @example - # @newsletter_target = session.newsletter_target.find - # - def find - response, status = BeyondApi::Request.get(@session, - "/newsletter-target") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update the existing newsletter target - # - # $ curl 'https://api-shop.beyondshop.cloud/api/newsletter-target' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "submitUrl": "https://example.org/api/newsletter/subscription" - # }' - # - # @beyond_api.scopes +nltg:m+ - # - # @param submit_url [String] the URL stating where to submit the newsletter - # - # @return [OpenStruct] - # - # @example - # session.newsletter_target.update({ submit_url: "https://example.org/cgi-bin/subscribe.php" }) - # - def update(submit_url) - response, status = BeyondApi::Request.put(@session, - "/newsletter-target", - { submit_url: submit_url }) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/order_settings.rb b/lib/beyond_api/resources/order_settings.rb deleted file mode 100644 index fecf98d..0000000 --- a/lib/beyond_api/resources/order_settings.rb +++ /dev/null @@ -1,97 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class OrderSettings < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve the order settings. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/order-settings' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +oset:r+ - # - # @return [OpenStruct] - # - # @example - # @order_settings = session.payment_methods.all - # - def all - response, status = BeyondApi::Request.get(@session, "/order-settings") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update the order settings. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/order-settings' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "invoiceCancelationNote" : "This is an invoice cancelation note", - # "defaultDeliveryDateNote" : "This is the default delivery date note", - # "defaultInvoiceNote" : "This is the default invoice note", - # "orderNumberConfiguration" : { - # "stringPrefix" : "2017-shop-", - # "nextNumericSuffix" : 1000, - # "numericSuffixLength" : 4 - # }, - # "invoiceNumberConfiguration" : { - # "stringPrefix" : "2017-invoice-", - # "nextNumericSuffix" : 1000, - # "numericSuffixLength" : 4 - # }, - # "customOrderOpenMailText" : " Your
1", - # "customOrderCanceledMailText" : " Your
2", - # "customInvoiceCustomerMailText" : " Your
3", - # "customInvoiceCanceledMailText" : " Your
4", - # "customOrderShippedMailText" : " Your
5", - # "customOrderPendingMailText" : " Your
6", - # "customOrderReturnedMailText" : " Your
7" - # }' - # - # @beyond_api.scopes +oset:u+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "invoiceCancelationNote" : "This is an invoice cancelation note", - # "defaultDeliveryDateNote" : "This is the default delivery date note", - # "defaultInvoiceNote" : "This is the default invoice note", - # "orderNumberConfiguration" : { - # "stringPrefix" : "2017-shop-", - # "nextNumericSuffix" : 1000, - # "numericSuffixLength" : 4 - # }, - # "invoiceNumberConfiguration" : { - # "stringPrefix" : "2017-invoice-", - # "nextNumericSuffix" : 1000, - # "numericSuffixLength" : 4 - # }, - # "customOrderOpenMailText" : " Your
1", - # "customOrderCanceledMailText" : " Your
2", - # "customInvoiceCustomerMailText" : " Your
3", - # "customInvoiceCanceledMailText" : " Your
4", - # "customOrderShippedMailText" : " Your
5", - # "customOrderPendingMailText" : " Your
6", - # "customOrderReturnedMailText" : " Your
7" - # } - # - # @order_settings = session.order_settings.update(body) - # - def update(body) - response, status = BeyondApi::Request.put(@session, "/order-settings", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/orders.rb b/lib/beyond_api/resources/orders.rb deleted file mode 100644 index 229bd4f..0000000 --- a/lib/beyond_api/resources/orders.rb +++ /dev/null @@ -1,1174 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Orders < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve the active payment processes. There is only one active payment process. See {Show payment process details}[http://docs.beyondshop.cloud/#resources-payment-process-get] for more information about the request and response structure. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/208e2c1d-6610-43c7-b2f1-20aad6f029b9/processes/payments/active' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pypr:r+ - # - # @param order_id [String] the order UUID - # - # @return [OpenStruct] - # - # @example - # @payment_process = session.orders.active_payment_process("208e2c1d-6610-43c7-b2f1-20aad6f029b9") - # - def active_payment_process(order_id) - path = "/orders/#{order_id}/processes/payments/active" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the active refund processes. There is only one active refund process. See {Show refund process details}[http://docs.beyondshop.cloud/#resources-refund-process-get] for more information about the request and response structure. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/8613295f-4d44-4143-bfd0-6b81fc178618/processes/refunds/active' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +rfpr:r+ - # - # @param order_id [String] the order UUID - # - # @return [OpenStruct] - # - # @example - # @refund_process = session.orders.active_refund_process("8613295f-4d44-4143-bfd0-6b81fc178618") - # - def active_refund_process(order_id) - path = "/orders/#{order_id}/processes/refunds/active" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all orders of the shop in a paged way. Each item in the response represents a summary of the order data. - # - # @beyond_api.scopes +ordr:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @orders = session.orders.all(size: 100, page: 0) - # - def all(params = {}) - path = "/orders" - - handle_all_request(path, :orders, params) - end - - # - # A +POST+ request is used to cancel an order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/e3f9264a-395b-407d-9036-00f38f609be6/cancel' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "This needs to be done fast!" - # }' - # - # @beyond_api.scopes +clpr:c+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment"=> "This needs to be done fast!" - # } - # @order = session.orders.cancel("e3f9264a-395b-407d-9036-00f38f609be6", body) - # - def cancel(order_id, body) - path = "/orders/#{order_id}/cancel" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the cancelation process details of an order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/f16cf0db-7449-4029-a886-76f38b4aa464/processes/cancelations/365b4b63-45a8-49f6-94c5-a65e0dee83b5' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +clpr:r+ - # - # @param order_id [String] the order UUID - # @param cancelation_id [String] the cancelation UUID - # - # @return [OpenStruct] - # - # @example - # @pcancelation_process = session.orders.cancelation_process("f16cf0db-7449-4029-a886-76f38b4aa464", "365b4b63-45a8-49f6-94c5-a65e0dee83b5") - # - def cancelation_process(order_id, cancelation_id) - path = "/orders/#{order_id}/processes/payments/cancelations/#{cancelation_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all cancelation processes of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/b8cb904d-4c82-4c39-a3a4-de7cb181a5d3/processes/cancelations?page=0&size=20' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +clpr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @pcancelation_processes = session.orders.cancelation_processes("b8cb904d-4c82-4c39-a3a4-de7cb181a5d3", {page: 0, size: 20}) - # - def cancelation_processes(order_id, params = {}) - path = "/orders/#{order_id}/processes/payments/cancelations" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +POST+ request is used to capture the payment. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/ebfd99d6-f025-4c97-96d2-d5adbb45d6c2/processes/payments/2936deca-fd56-4c0d-88e2-8030c897bf90/capture' -i -X POST \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pypr:u+ - # - # @param order_id [String] the order UUID - # @param payment_id [String] the payment UUID - # - # @return [OpenStruct] - # - # @example - # @payment_process = session.orders.capture_payment_process("ebfd99d6-f025-4c97-96d2-d5adbb45d6c2", "2936deca-fd56-4c0d-88e2-8030c897bf90") - # - def capture_payment_process(order_id, payment_id) - path = "/orders/#{order_id}/processes/payments/#{payment_id}/capture" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a new cancelation process for an order. Cancelation processes trigger a refund process. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/9072c00d-1bc7-4fd8-8836-94ada5084e7a/processes/cancelations' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "This needs to be done fast!", - # "lineItems" : [ { - # "quantity" : 3, - # "productLineItemId" : "0e1f8ab4-ec78-42a6-9a46-a3384cd17d52" - # } ] - # }' - # - # @beyond_api.scopes +clpr:c+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment"=> "This needs to be done fast!", - # "lineItems"=> [{ - # "quantity"=> 3, - # "productLineItemId"=> "0e1f8ab4-ec78-42a6-9a46-a3384cd17d52" - # }] - # } - # @cancelation_process = session.orders.create_cancelation_process("9072c00d-1bc7-4fd8-8836-94ada5084e7a", body) - # - def create_cancelation_process(order_id, body) - path = "/orders/#{order_id}/processes/payments/cancelations" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create an invoice for the order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/a5d4d6c6-e77d-4180-8dbf-729f38a698b2/create-invoice' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{"deliveryDateNote": "Test DeliveryDateNote", "invoiceNote": "Test invoiceNote"}' - # - # @beyond_api.scopes +ordr:u+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "deliveryDateNote" => "Test DeliveryDateNote", - # "invoiceNote" => "Test invoiceNote" - # } - # @order = session.orders.create_invoice("a5d4d6c6-e77d-4180-8dbf-729f38a698b2", body) - # - def create_invoice(order_id, body) - path = "/orders/#{order_id}/create-invoice" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a new return process for an order. Return processes trigger a refund process. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/29007bb7-739a-46f5-8c70-4e1029b52fa5/processes/returns' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "This needs to be done fast!", - # "sendMail" : true, - # "lineItems" : [ { - # "quantity" : 3, - # "productLineItemId" : "bb9ad011-6417-4f04-8bc2-39651edebd2f", - # "status" : "RETURNED" - # } ], - # "shippingPriceRefund" : { - # "currency" : "EUR", - # "amount" : 19.99 - # } - # }' - # - # @beyond_api.scopes +rtpr:c+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment": "This needs to be done fast!", - # "sendMail": true, - # "lineItems": [{ - # "quantity": 3, - # "productLineItemId": "bb9ad011-6417-4f04-8bc2-39651edebd2f", - # "status": "RETURNED" - # }], - # "shippingPriceRefund": { - # "currency": "EUR", - # "amount": 19.99 - # } - # } - # @return_process = session.orders.create_return_process("29007bb7-739a-46f5-8c70-4e1029b52fa5", body) - # - def create_return_process(order_id, body) - path = "/orders/#{order_id}/processes/returns" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is ussed to create a new shipping processes for an order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/8df2fe3b-5149-492f-932a-073f012305eb/processes/shippings' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "This needs to be done fast!", - # "sendMail" : true, - # "createPackingSlip" : true, - # "trackingCode" : "lookAtMyTrackingCodeWow", - # "trackingLink" : "http://tracking.is/fun?code=lookAtMyTrackingCodeWow", - # "lineItems" : [ { - # "quantity" : 3, - # "productLineItemId" : "e96e1b33-d9e9-4508-862a-816235b541f7" - # } ] - # }' - # - # @beyond_api.scopes +shpr:c+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "This needs to be done fast!", - # "send_mail" => true, - # "create_packing_slip" => true, - # "tracking_code" => "lookAtMyTrackingCodeWow", - # "tracking_link" => "http=>//tracking.is/fun?code=lookAtMyTrackingCodeWow", - # "line_items" => [ { - # "quantity" => 3, - # "product_line_item_id" => "e96e1b33-d9e9-4508-862a-816235b541f7" - # } ] - # } - # @shipping_process = session.orders.create_shipping_process("8df2fe3b-5149-492f-932a-073f012305eb", body) - # - def create_shipping_process(order_id, body) - path = "/orders/#{order_id}/processes/shippings" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all events of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/66b6aab5-2ed4-4f36-855e-3adb2ea873ee/events' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @events = session.orders.find("66b6aab5-2ed4-4f36-855e-3adb2ea873ee", { size: 100, page: 0 }) - # - def events(order_id, params = {}) - path = "/orders/#{order_id}/events" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the details of an order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/a27f1019-3690-40d1-bd9d-d60dff4c4cf8' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+ - # - # @param order_id [String] the order UUID - # - # @return [OpenStruct] - # - # @example - # @order = session.orders.find("a27f1019-3690-40d1-bd9d-d60dff4c4cf8") - # - def find(order_id) - path = "/orders/#{order_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to mark the payment process as paid. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/9a1a1aaa-e37d-4c71-bc95-cbc228463fec/processes/payments/cb8c9a16-2d81-4ec1-9a4a-84a4c36124ae/mark-paid' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "comment", - # "details" : { - # "amount" : { - # "currency" : "EUR", - # "amount" : 77.44 - # } - # } - # }' - # - # @beyond_api.scopes +pypr:u+ - # - # @param order_id [String] the order UUID - # @param payment_id [String] the payment UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "comment", - # "details" => { - # "amount" => { - # "currency" => "EUR", - # "amount" => 77.44 - # } - # } - # } - # - # @payment_process = session.orders.mark_payment_process_as_paid("9a1a1aaa-e37d-4c71-bc95-cbc228463fec", "cb8c9a16-2d81-4ec1-9a4a-84a4c36124ae", body) - # - def mark_payment_process_as_paid(order_id, payment_id, body) - path = "/orders/#{order_id}/processes/payments/#{payment_id}/mark-paid" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to mark the payment process as voided. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/a5558b7f-55f4-47d4-b603-9bf7eb59c05b/processes/payments/5bcc48e7-2641-42a8-a042-189ae92e9901/mark-voided' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "comment" - # }' - # - # @beyond_api.scopes +pypr:u+ - # - # @param order_id [String] the order UUID - # @param payment_id [String] the payment UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "comment" - # } - # - # @payment_process = session.orders.mark_payment_process_as_voided("a5558b7f-55f4-47d4-b603-9bf7eb59c05b", "5bcc48e7-2641-42a8-a042-189ae92e9901", body) - # - def mark_payment_process_as_voided(order_id, payment_id, body) - path = "/orders/#{order_id}/processes/payments/#{payment_id}/mark-voided" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to mark the refund process as paid. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/60baa84c-9e11-4d55-97a9-1a7b00a0691c/processes/refunds/active/mark-paid' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "comment", - # "details" : { - # "amount" : { - # "currency" : "EUR", - # "amount" : 19.98 - # } - # } - # }' - # - # @beyond_api.scopes +rfpr:r+ - # - # @param order_id [String] the order UUID - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "comment", - # "details" => { - # "amount" => { - # "currency" => "EUR", - # "amount" => 19.98 - # } - # } - # } - # @refund_process = session.orders.mark_refund_process_as_paid("60baa84c-9e11-4d55-97a9-1a7b00a0691c", body) - # - def mark_refund_process_as_paid(order_id) - path = "/orders/#{order_id}/processes/refunds/active/mark-paid" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to mark the shipment as delivered. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/b5642d1f-0f7f-444e-96d5-1c1d1642ea5e/processes/shippings/619d06d8-0077-4efd-b341-5103f71bfb2d/mark-delivered' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "comment" - # }' - # - # @beyond_api.scopes +shpr:u+ - # - # @param order_id [String] the order UUID - # @param shipping_id [String] the shipping UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "comment", - # } - # - # @shipping_process = session.orders.mark_shipping_process_as_delivered("b5642d1f-0f7f-444e-96d5-1c1d1642ea5e", "619d06d8-0077-4efd-b341-5103f71bfb2d", body) - # - def mark_shipping_process_as_delivered(order_id, shipping_process_id, body) - path = "/orders/#{order_id}/processes/shippings/#{shipping_process_id}/mark-delivered" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to mark the shipment as shipped. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/dd6a7e20-16be-4509-bf83-fb8ee072ddad/processes/shippings/a0b0c4a5-0c80-47f4-98c3-0f55f4161176/mark-shipped' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "comment" : "This needs to be done fast!", - # "sendMail" : true, - # "details" : { - # "trackingCode" : "lookAtMyTrackingCodeWow", - # "trackingLink" : "http://tracking.is/fun?code=lookAtMyTrackingCodeWow" - # } - # }' - # - # @beyond_api.scopes +shpr:u+ - # - # @param order_id [String] the order UUID - # @param shipping_id [String] the shipping UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "comment" => "This needs to be done fast!", - # "sendMail" => true, - # "details" => { - # "trackingCode" => "lookAtMyTrackingCodeWow", - # "trackingLink" => "http://tracking.is/fun?code=lookAtMyTrackingCodeWow" - # } - # } - # - # @shipping_process = session.orders.mark_shipping_process_as_shipped("dd6a7e20-16be-4509-bf83-fb8ee072ddad", "a0b0c4a5-0c80-47f4-98c3-0f55f4161176", body) - # - def mark_shipping_process_as_shipped(order_id, shipping_id, body) - path = "/orders/#{order_id}/processes/shippings/#{shipping_id}/mark-shipped" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the payment processes. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/d44ed295-6a08-47ba-a288-90d4f3ba9fff/processes/payments/be56bfbd-af95-45b9-8b0e-cb0c184aaf60' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pypr:r+ - # - # @param order_id [String] the order UUID - # @param payment_id [String] the payment UUID - # - # @return [OpenStruct] - # - # @example - # @payment_process = session.orders.payment_process("d44ed295-6a08-47ba-a288-90d4f3ba9fff", "be56bfbd-af95-45b9-8b0e-cb0c184aaf60") - # - def payment_process(order_id, payment_id) - path = "/orders/#{order_id}/processes/payments/#{payment_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all payment processes of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/2012b775-a706-41e0-b0f9-5142864ca4a0/processes/payments?page=0&size=20' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pypr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @payment_processes = session.orders.payment_processes("2012b775-a706-41e0-b0f9-5142864ca4a0", {page: 0, size: 20}) - # - def payment_processes(order_id, params = {}) - path = "/orders/#{order_id}/processes/payments" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all order processes. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/934ece52-055c-4896-8d16-560f1461ea56/processes' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+ - # - # @param order_id [String] the order UUID - # - # @return [OpenStruct] - # - # @example - # @processes = session.orders.processes("934ece52-055c-4896-8d16-560f1461ea56") - # - def processes(order_id) - path = "/orders/#{order_id}/processes" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the refund processes. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/801885c8-0b25-44a2-a1a4-60cbf3f9ecca/processes/refunds/4c02883f-be31-4fb2-ad0d-ccbc3678a9f5' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +rfpr:r+ - # - # @param order_id [String] the order UUID - # @param refund_id [String] the refund UUID - # - # @return [OpenStruct] - # - # @example - # @refund_process = session.orders.refund_process("801885c8-0b25-44a2-a1a4-60cbf3f9ecca", "4c02883f-be31-4fb2-ad0d-ccbc3678a9f5") - # - def refund_process(order_id, refund_id) - path = "/orders/#{order_id}/processes/refunds/#{refund_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all refund processes of an order in a paged way. Refunds are triggered if either a cancelation or return process is created. See {Create cancelation processes}[http://docs.beyondshop.cloud/#resources-cancel-processes-create] and {Create return processes}[http://docs.beyondshop.cloud/#resources-return-processes-create] for more information. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/6f86e42f-763e-4514-a37d-fb8f88cdc14c/processes/refunds?page=0&size=20' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +rfpr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @refund_processes = session.orders.refund_processes("6f86e42f-763e-4514-a37d-fb8f88cdc14c", {page: 0, size: 20}) - # - def refund_processes(order_id, params = {}) - path = "/orders/#{order_id}/processes/refunds" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all return processes of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/cb9927e4-60d1-4a90-b40c-f5a8e2b25301/processes/returns/910a3fde-cb23-418f-876a-694ce42245ef' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +rtpr:r+ - # - # @param order_id [String] the order UUID - # @param return_process_id [String] the return process UUID - # - # @return [OpenStruct] - # - # @example - # @return_process = session.orders.return_process("cb9927e4-60d1-4a90-b40c-f5a8e2b25301", "910a3fde-cb23-418f-876a-694ce42245ef") - # - def return_process(order_id, return_process_id) - path = "/orders/#{order_id}/processes/returns/#{return_process_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all return processes of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/9e26232f-aa7a-408b-8041-9439999268c5/processes/returns?page=0&size=20' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +rtpr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @return_processes = session.orders.return_processes("9e26232f-aa7a-408b-8041-9439999268c5", {page: 0, size: 20}) - # - def return_processes(order_id, params = {}) - path = "/orders/#{order_id}/processes/returns" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the details of an order by cart ID. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/search/find-by-cart-id?cartId=82e859a8-7f70-4c19-83c1-ed03457b2ceb' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+ - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @order = session.orders.search_by_cart_id("82e859a8-7f70-4c19-83c1-ed03457b2ceb") - # - def search_by_cart_id(cart_id) - path = "/orders/search/find-by-cart-id" - - response, status = BeyondApi::Request.get(@session, - path, - { cart_id: cart_id }) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the +orderNumber+ and +orderId+ of an order by cart Id. If there is no order for the given cart Id, a HTTP 404 - NOT FOUND response is returned. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/search/find-order-number-by-cart-id?cartId=7f1cf6c8-7780-430f-9de0-91cbe31c4bf6' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+ - # - # @param cart_id [String] the cart UUID - # - # @return [OpenStruct] - # - # @example - # @order = session.orders.search_order_number_by_cart_id("7f1cf6c8-7780-430f-9de0-91cbe31c4bf6") - # - def search_order_number_by_cart_id(cart_id) - path = "/orders/search/find-order-number-by-cart-id" - - response, status = BeyondApi::Request.get(@session, - path, - { cart_id: cart_id }) - - handle_response(response, status) - end - - # - # A +GET+ request is used to send an invoice for the order. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/acc1f22f-a992-4534-be92-b378a0319fcd/send-order-document' -i -X POST \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "orderDocumentUri" : "https://myshop.com/api/pdf-storage/attachments/invoice_10003.pdf?hash=9e5e2631c6f5877d64cb3d40db46ec6eb48a3a92" - # }' - # - # @beyond_api.scopes +ordr:u+ - # - # @param order_id [String] the order UUID - # @param order_document_uri [String] the document url - # - # @return [OpenStruct] - # - # @example - # @order = session.orders.send_order_document("acc1f22f-a992-4534-be92-b378a0319fcd", - # "https://myshop.com/api/pdf-storage/attachments/invoice_10003.pdf?hash=9e5e2631c6f5877d64cb3d40db46ec6eb48a3a92") - # - def send_order_document(order_id, order_document_uri) - path = "/orders/#{order_id}/send-order-document" - - response, status = BeyondApi::Request.post(@session, - path, - { order_document_uri: order_document_uri }) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the shipping process details. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/af42860f-2813-4130-85d9-2d315a4f802e/processes/shippings/80ebe96b-bcd5-4a34-a428-8a67ed114ce6' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpr:r+ - # - # @param order_id [String] the order UUID - # @param shipping_process_id [String] the shipping process UUID - # - # @return [OpenStruct] - # - # @example - # @shipping_process = session.orders.refund_process("af42860f-2813-4130-85d9-2d315a4f802e", "80ebe96b-bcd5-4a34-a428-8a67ed114ce6") - # - def shipping_process(order_id, shipping_process_id) - path = "/orders/#{order_id}/processes/shippings/#{shipping_process_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all shipping processes of an order in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/d6387876-5e93-48dc-a6f3-f85893149819/processes/shippings?page=0&size=20' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpr:r+ - # - # @param order_id [String] the order UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @shipping_processes = session.orders.shipping_processes("268a8629-55cd-4890-9013-936b9b5ea14c", {page: 0, size: 20}) - # - def shipping_processes(order_id, params = {}) - path = "/orders/#{order_id}/processes/shippings" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to change the customer’s billing address. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/6c36e5e3-dc4c-4d00-b4e8-3fbf9a4bed14/billing-address' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "address" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : null, - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "AlsterwasserstraĂŸe", - # "houseNumber" : "3", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "vatId" : "DE123456789", - # "taxNumber" : "HRE 987654/32123/864516", - # "birthDate" : "1985-05-11", - # "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ], - # "_id" : null - # }, - # "comment" : "Updated billing address" - # }' - # - # @beyond_api.scopes +ordr:u+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "address" => { - # "salutation" => "Mrs", - # "gender" => "FEMALE", - # "company" => "Astrid Alster GmbH", - # "title" => nil, - # "firstName" => "Astrid", - # "middleName" => "Agnes", - # "lastName" => "Alster", - # "street" => "AlsterwasserstraĂŸe", - # "houseNumber" => "3", - # "street2" => "Erdgeschoss", - # "addressExtension" => "Hinterhof", - # "postalCode" => "20999", - # "dependentLocality" => "Seevetal", - # "city" => "Alsterwasser", - # "country" => "DE", - # "state" => "Hamburg", - # "email" => "a.alsterh@example.com", - # "phone" => "(800) 555-0102", - # "mobile" => "(800) 555-0103", - # "vatId" => "DE123456789", - # "taxNumber" => "HRE 987654/32123/864516", - # "birthDate" => "1985-05-11", - # "displayAddressLines" => [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ], - # "_id" => null - # }, - # "comment" => "Updated billing address" - # } - # @order = session.orders.update_billing_address("6c36e5e3-dc4c-4d00-b4e8-3fbf9a4bed14", body) - # - def update_billing_address(order_id, body) - path = "/orders/#{order_id}/billing-address" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to change the order note. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/58545e43-f4ba-48e2-b0bf-e340fd64f7b8/order-note' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "orderNote" : "not paid yet" - # }' - # - # @beyond_api.scopes +ordr:u+ - # - # @param order_id [String] the order UUID - # @param order_note [String] the order note - # - # @return [OpenStruct] - # - # @example - # @order = session.orders.update_order_note("58545e43-f4ba-48e2-b0bf-e340fd64f7b8", "not paid yet" ) - # - def update_order_note(order_id, order_note) - path = "/orders/#{order_id}/order-note" - - response, status = BeyondApi::Request.put(@session, - path, - { order_note: order_note }) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to change the customer's shipping address. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/orders/30327fed-812f-4b70-8931-43e34d8c8181/shipping-address' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "address" : { - # "salutation" : "Mrs", - # "gender" : "FEMALE", - # "company" : "Astrid Alster GmbH", - # "title" : null, - # "firstName" : "Astrid", - # "middleName" : "Agnes", - # "lastName" : "Alster", - # "street" : "AlsterwasserstraĂŸe", - # "houseNumber" : "3", - # "street2" : "Erdgeschoss", - # "addressExtension" : "Hinterhof", - # "postalCode" : "20999", - # "dependentLocality" : "Seevetal", - # "city" : "Alsterwasser", - # "country" : "DE", - # "state" : "Hamburg", - # "email" : "a.alsterh@example.com", - # "phone" : "(800) 555-0102", - # "mobile" : "(800) 555-0103", - # "doorCode" : "456", - # "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ], - # "_id" : null - # }, - # "comment" : "Updated shipping address" - # }' - # @beyond_api.scopes +ordr:u+ - # - # @param order_id [String] the order UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "address" => { - # "salutation" => "Mrs", - # "gender" => "FEMALE", - # "company" => "Astrid Alster GmbH", - # "title" => nil, - # "firstName" => "Astrid", - # "middleName" => "Agnes", - # "lastName" => "Alster", - # "street" => "AlsterwasserstraĂŸe", - # "houseNumber" => "3", - # "street2" => "Erdgeschoss", - # "addressExtension" => "Hinterhof", - # "postalCode" => "20999", - # "dependentLocality" => "Seevetal", - # "city" => "Alsterwasser", - # "country" => "DE", - # "state" => "Hamburg", - # "email" => "a.alsterh@example.com", - # "phone" => "(800) 555-0102", - # "mobile" => "(800) 555-0103", - # "vatId" => "DE123456789", - # "taxNumber" => "HRE 987654/32123/864516", - # "birthDate" => "1985-05-11", - # "displayAddressLines" => [ "Astrid Alster GmbH", "Astrid Agnes Alster", "Alsterwasserweg 2", "Erdgeschoss", "Seevetal", "20999 Alsterwasser", "Germany" ], - # "_id" => null - # }, - # "comment" => "Updated shipping address" - # } - # @order = session.orders.update_shipping_address("30327fed-812f-4b70-8931-43e34d8c8181", body) - # - def update_shipping_address(order_id, body) - path = "/orders/#{order_id}/shipping-address" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/payment_method_definitions.rb b/lib/beyond_api/resources/payment_method_definitions.rb deleted file mode 100644 index 3d50c34..0000000 --- a/lib/beyond_api/resources/payment_method_definitions.rb +++ /dev/null @@ -1,182 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class PaymentMethodDefinitions < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to create a payment method definition on system level. - # - # $ curl 'https://system.beyondshop.cloud/api/payment-method-definitions' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name": "credit-card", - # "referralUriTemplate": "https://example.com/merchants", - # "statusUriTemplate": "https://example.com/merchants/{shopId}/status", - # "disconnectUriTemplate": "https://example.com/merchants/{shopId}/disconnect", - # "createPaymentUriTemplate": "https://example.com/payments", - # "capturePaymentUriTemplate": "https://example.com/payments/{paymentId}/capture", - # "refundPaymentUriTemplate": "https://example.com/payments/{paymentId}/refund", - # "sandbox": "true", - # "workflow": "PAYMENT_ON_BUY", - # "captureWorkflow": "CAPTURE_ON_ORDER", - # "refund": "NO_REFUND", - # "logos": [{ - # "setName" : "official", - # "variant" : "STOREFRONT", - # "uri" : "https://example.com/static/storefront.png" - # }], - # "officialName": {"de-DE" : "Ermögliche deinen Kunden, mit Kreditkarte zu bezahlen.", - # "en-US" : "Allow your customers to pay by credit card." - # }, - # "officialDescription": { - # "de-DE" : "Ermögliche deinen Kunden, mit Kreditkarte zu bezahlen.", - # "en-US" : "Allow your customers to pay by credit card." - # }, - # "defaultName": { - # "de-DE" : "Kreditkarte", - # "en-US" : "Credit card" - # }, - # "defaultDescription": {"de-DE" : "Bezahlen Sie mit Kreditkarte.","en-US" : "Pay by credit card."}}' - # - # @beyond_api.scopes +paym:m+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # @payment_method_definitions = session.payment_method_definitions.create(body) - # - def create(body) - response, status = BeyondApi::Request.post(@session, - "/payment-method-definitions", - body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all payment method definitions on system level. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-method-definitions' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +paym:m+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @payment_method_definitions = session.payment_method_definitions.all(size: 100, page: 0) - # - def all(params = {}) - handle_all_request("/payment-method-definitions", :payment_method_definitions, params) - end - - # - # A +GET+ request is used to deactivate a payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-method-definitions/credit-card' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pymt:u+ - # - # @param payment_method_definition_id [String] the payment method definition UUID - # - # @return [OpenStruct] - # - # @example - # @payment_method_definition = session.payment_methods.find("credit-card") - # - def find(payment_method_definition_id) - response, status = BeyondApi::Request.get(@session, - "/payment-method-definitions/#{payment_method_definition_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a payment method definition on system level. - # - # $ curl 'https://system.beyondshop.cloud/api/payment-method-definitions/credit-card' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name": "credit-card-updated", - # "referralUriTemplate": "https://example.com/merchants", - # "statusUriTemplate": "https://example.com/merchants/{shopId}/status", - # "disconnectUriTemplate": "https://example.com/merchants/{shopId}/disconnect", - # "createPaymentUriTemplate": "https://example.com/payments", - # "capturePaymentUriTemplate": "https://example.com/payments/{paymentId}/capture", - # "refundPaymentUriTemplate": "https://example.com/payments/{paymentId}/refund", - # "workflow": "PAYMENT_ON_SELECTION", - # "captureWorkflow": "CAPTURE_ON_DEMAND", - # "refund": "NO_REFUND", - # "logos": [{ - # "setName" : "official", - # "variant" : "STOREFRONT", - # "uri" : "https://example.com/static/storefront.png" - # }], - # "officialName": {"de-DE" : "Ermögliche deinen Kunden, mit Kreditkarte zu bezahlen.", - # "en-US" : "Allow your customers to pay by credit card." - # }, - # "officialDescription": { - # "de-DE" : "Ermögliche deinen Kunden, mit Kreditkarte zu bezahlen.", - # "en-US" : "Allow your customers to pay by credit card." - # }, - # "defaultName": { - # "de-DE" : "Kreditkarte", - # "en-US" : "Credit card" - # }, - # "defaultDescription": {"de-DE" : "Bezahlen Sie mit Kreditkarte.","en-US" : "Pay by credit card."}}' - # - # @beyond_api.scopes +paym:m+ - # - # @param payment_method_definition_id [String] the payment method definition UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # @payment_method_definition = session.payment_method_definitions.update("credit_card", body) - # - def update(payment_method_definition_id, body) - response, status = BeyondApi::Request.put(@session, - "/payment-method-definitions/#{payment_method_definition_id}", - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a payment method definition on system level. - # - # $ curl 'https://system.beyondshop.cloud/api/payment-method-definitions/credit-card' -i -X DELETE \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @return true - # - # @example - # session.payment_method_definitions.delete("credit-card") - # - def delete(payment_method_definition_id) - response, status = BeyondApi::Request.delete(@session, - "/payment-method-definitions/#{payment_method_definition_id}", - body) - - handle_response(response, status, respond_with_true: true) - end - end -end diff --git a/lib/beyond_api/resources/payment_methods.rb b/lib/beyond_api/resources/payment_methods.rb deleted file mode 100644 index e10dbb2..0000000 --- a/lib/beyond_api/resources/payment_methods.rb +++ /dev/null @@ -1,194 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class PaymentMethods < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to activate a payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods/da313b73-ea6b-49c7-8a3d-d707934098b8/activate' -i -X POST \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pymt:u+ - # - # @param payment_method_id [String] the payment method UUID - # - # @return true - # - # @example - # session.payment_methods.activate("da313b73-ea6b-49c7-8a3d-d707934098b8") - # - def activate(payment_method_id) - response, status = BeyondApi::Request.post(@session, "/payment-methods/#{payment_method_id}/activate") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to list all payment methods in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pymt:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @payment_methods = session.payment_methods.all(size: 100, page: 0) - # - def all(params = {}) - handle_all_request("/payment-methods", :payment_methods, params) - end - - # - # A +POST+ request is used to deactivate a payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods/157f930f-328a-4d7a-974d-66bc3b4dd28e/deactivate' -i -X POST \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pymt:u+ - # - # @param payment_method_id [String] the payment method UUID - # - # @return true - # - # @example - # session.payment_methods.deactivate("157f930f-328a-4d7a-974d-66bc3b4dd28e") - # - def deactivate(payment_method_id) - response, status = BeyondApi::Request.post(@session, "/payment-methods/#{payment_method_id}/deactivate") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods/7d964402-8f67-48f3-af86-6c35abe4fa08' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +pymt:r+ - # - # @param payment_method_id [String] the payment method UUID - # - # @return [OpenStruct] - # - # @example - # @payment_method = session.payment_methods.find("7d964402-8f67-48f3-af86-6c35abe4fa08") - # - def find(payment_method_id) - response, status = BeyondApi::Request.get(@session, "/payment-methods/#{payment_method_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to sort payment methods. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/payment-methods/dd59a52b-0661-49f9-82c3-e063ff80328f - # https://api-shop.beyondshop.cloud/api/payment-methods/66b22fb2-2184-4ea1-9143-44ae1d230d49 - # https://api-shop.beyondshop.cloud/api/payment-methods/a9462eae-ed72-4e29-b853-f04537c8ab11 - # https://api-shop.beyondshop.cloud/api/payment-methods/84172da4-5baa-4a99-b779-33d673bed6d1' - # - # @beyond_api.scopes +pymt:u+ - # - # @param payment_method_ids [Array] the payment method UUIDs - # - # @return [OpenStruct] - # - # @example - # payment_method_ids = [ - # "dd59a52b-0661-49f9-82c3-e063ff80328f", - # "66b22fb2-2184-4ea1-9143-44ae1d230d49", - # "a9462eae-ed72-4e29-b853-f04537c8ab11", - # "84172da4-5baa-4a99-b779-33d673bed6d1" - # ] - # - # session.payment_methods.sort(payment_method_ids) - # - def sort(payment_method_ids) - body = payment_method_ids.map { |id| "#{@session.api_url}/payment-methods/#{id}" } - response, status = BeyondApi::Request.put(@session, "/payment-methods", body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update a payment method. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/payment-methods/dc00a5af-d21e-49f0-99f2-ef67ca6fa782' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "Another name", - # "description" : "Pay by ACME.", - # "taxClass" : "REGULAR", - # "discountOrFee" : { - # "type" : "ABSOLUTE", - # "absoluteValue" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 2.0 - # } - # }, - # "serviceableCountries" : [ "DE" ], - # "minimumOrderValue" : { - # "currency" : "EUR", - # "amount" : 10.0 - # } - # }' - # - # @beyond_api.scopes +pymt:u+ - # - # @param payment_method_id [String] the payment method UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "Another name", - # "description" => "Pay by ACME.", - # "tax_class" => "REGULAR", - # "discount_or_fee" => { - # "type" => "ABSOLUTE", - # "absolute_value" => { - # "tax_model" => "GROSS", - # "currency" => "EUR", - # "amount" => 2.0 - # } - # }, - # "serviceable_countries" => [ "DE" ], - # "minimum_order_value" => { - # "currency" => "EUR", - # "amount" => 10.0 - # } - # } - # - # @payment_method = session.payment_methods.update("dc00a5af-d21e-49f0-99f2-ef67ca6fa782", body) - # - def update(payment_method_id, body) - response, status = BeyondApi::Request.put(@session, "/payment-methods/#{payment_method_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/pickup_options.rb b/lib/beyond_api/resources/pickup_options.rb deleted file mode 100644 index f1bb6f2..0000000 --- a/lib/beyond_api/resources/pickup_options.rb +++ /dev/null @@ -1,216 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class PickupOptions < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all pickup options of the shop in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @pickup_options = session.pickup_options.all(size: 100, page: 0) - # - def all(params = {}) - handle_all_request("/pickup-options", :pickup_options, params) - end - - # - # A +POST+ request is used to create a pickup option. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "My little Cornershop - St.Ives", - # "description" : "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.", - # "taxClass" : "REGULAR", - # "freePickupValue" : { - # "currency" : "EUR", - # "amount" : 50 - # }, - # "fixedPrice" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 1 - # }, - # "phoneNumberRequired" : true, - # "locationId" : "cb554eb6-2768-4491-afd2-6bcd0aec0937" - # }' - # - # @beyond_api.scopes +shpz:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # name: "My little Cornershop - St.Ives", - # description: "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.", - # tax_class: "REGULAR", - # free_pickup_value: { - # currency: "EUR", - # amount: 50 - # }, - # fixed_price: { - # tax_model: "GROSS", - # currency: "EUR", - # amount: 1 - # }, - # phone_number_required: true, - # location_id: "cb554eb6-2768-4491-afd2-6bcd0aec0937" - # } - # - # @pickup_option = session.pickup_options.create(body) - # - def create(body) - response, status = BeyondApi::Request.post(@session, "/pickup-options", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a pickup option. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options/d253a31b-3892-4196-ae16-c5d8d6b05791' -i -X DELETE - # - # @beyond_api.scopes +shpz:d+ - # - # @param pickup_option_id [String] the pickup option UUID - # - # @return true - # - # @example - # session.pickup_options.delete("d253a31b-3892-4196-ae16-c5d8d6b05791") - # - def delete(pickup_option_id) - response, status = BeyondApi::Request.delete(@session, "/pickup-options/#{pickup_option_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a pickup option. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options/76302c10-761f-43c1-9d18-52ad16bd52e8' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:r+ - # - # @param pickup_option_id [String] the pickup option UUID - # - # @return [OpenStruct] - # - # @example - # @pickup_option = session.pickup_options.find("76302c10-761f-43c1-9d18-52ad16bd52e8") - # - def find(pickup_option_id) - response, status = BeyondApi::Request.get(@session, "/pickup-options/#{pickup_option_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to sort the pickup options. This is done by passing the self-links of the pickup options in the desired order. The request must contain URIs for all pickup options of the given page. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/pickup-options/bff3673f-91c1-4e09-a8ab-562a3a553fac - # https://api-shop.beyondshop.cloud/api/pickup-options/7b4d36fc-ac0f-44a3-8655-f2bd05c2a42d - # https://api-shop.beyondshop.cloud/api/pickup-options/630b63ee-c7d8-4953-9b7c-c874fd795154' - # - # @beyond_api.scopes +shpz:u+ - # - # @param pickup_option_ids [Array] the pickup option UUIDs - # - # @return [OpenStruct] - # - # @example - # pickup_option_ids = [ - # "bff3673f-91c1-4e09-a8ab-562a3a553fac", - # "7b4d36fc-ac0f-44a3-8655-f2bd05c2a42d", - # "630b63ee-c7d8-4953-9b7c-c874fd795154" - # ] - # - # session.pickup_options.sort(pickup_option_ids) - # - def sort(pickup_option_ids) - body = pickup_option_ids.map { |id| "#{@session.api_url}/pickup-options/#{id}" } - response, status = BeyondApi::Request.put(@session, "/pickup-options", body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update a pickup option. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/pickup-options/5765b837-db5b-49a9-a659-68d00376e42a' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "New name", - # "description" : "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.", - # "taxClass" : "REGULAR", - # "freePickupValue" : { - # "currency" : "EUR", - # "amount" : 50 - # }, - # "fixedPrice" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 1 - # }, - # "phoneNumberRequired" : true, - # "locationId" : "c9179393-abcc-450a-8cf4-875b39647ab6" - # }' - # - # @beyond_api.scopes +shpz:u+ - # - # @param pickup_option_id [String] the pickup option UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # name: "New name", - # description: "We will send you an email when your items are ready for pickup. Please bring a copy of your order confirmation.", - # tax_class: "REGULAR", - # free_pickup_value: { - # currency: "EUR", - # amount: 50 - # }, - # fixed_price: { - # tax_model: "GROSS", - # currency: "EUR", - # amount: 1 - # }, - # phone_number_required: true, - # location_id: "c9179393-abcc-450a-8cf4-875b39647ab6" - # } - # - # @pickup_option = session.pickup_options.update("5765b837-db5b-49a9-a659-68d00376e42a", body) - # - def update(pickup_option_id, body) - response, status = BeyondApi::Request.put(@session, "/pickup-options/#{pickup_option_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/product_attribute_definitions.rb b/lib/beyond_api/resources/product_attribute_definitions.rb deleted file mode 100644 index 4296bdb..0000000 --- a/lib/beyond_api/resources/product_attribute_definitions.rb +++ /dev/null @@ -1,118 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class ProductAttributeDefinitions < Base - include BeyondApi::Utils - - # - # A +GET+ request will list the available product attribute definitions. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-attribute-definitions' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prad:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @product_attribute_definitions = session.product_attribute_definitions.all(size: 100, page: 0) - # - def all(params = {}) - path = "/product-attribute-definitions" - - handle_all_request(path, :product_attribute_definitions, params) - end - - # - # A +POST+ request is used to create a product attribute definition. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-attribute-definitions' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "key" : "filling_capacity", - # "type" : "NUMBER", - # "displayName" : "Filling Capacity", - # "format" : "#,###.## ml" - # }' - # - # @beyond_api.scopes +prad:c+ - # - # @param product_attribute_name [String] the product attribute key - # - # @return [OpenStruct] - # - # @example - # body = { - # "key": "filling_capacity", - # "type": "NUMBER", - # "displayName": "Filling Capacity", - # "format": "#,###.## ml" - # } - # @product_attribute_definition = session.product_attribute_definitions.create(body) - # - def create(body) - path = "/product-attribute-definitions" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product attribute definition. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-attribute-definitions/color' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prad:d+ - # - # @param product_attribute_name [String] the product attribute key - # - # @return [true] - # - # @example - # session.product_attribute_definitions.delete("color") - # - def delete(product_attribute_name) - path = "/product-attribute-definitions/#{product_attribute_name}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve a single product attribute definition by name. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-attribute-definitions/filling_capacity' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prad:r+ - # - # @param product_attribute_name [String] the product attribute key - # - # @return [OpenStruct] - # - # @example - # @product_attribute_definition = session.product_attribute_definitions.find("filling_capacity") - # - def find(product_attribute_name) - path = "/product-attribute-definitions/#{product_attribute_name}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products.rb b/lib/beyond_api/resources/products.rb deleted file mode 100644 index 6da3a50..0000000 --- a/lib/beyond_api/resources/products.rb +++ /dev/null @@ -1,302 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - autoload :ProductAttachments, "beyond_api/resources/products/attachments" - autoload :ProductAvailability, "beyond_api/resources/products/availability" - autoload :ProductCrossSells, "beyond_api/resources/products/cross_sells" - autoload :ProductCustomAttributes, "beyond_api/resources/products/custom_attributes" - autoload :ProductImages, "beyond_api/resources/products/images" - autoload :ProductSearches, "beyond_api/resources/products/searches" - autoload :ProductVariationProperties, "beyond_api/resources/products/variation_properties" - autoload :ProductVideos, "beyond_api/resources/products/videos" - - class Products < Base - include BeyondApi::ProductAttachments - include BeyondApi::ProductAvailability - include BeyondApi::ProductCrossSells - include BeyondApi::ProductCustomAttributes - include BeyondApi::ProductImages - include BeyondApi::ProductSearches - include BeyondApi::ProductVariationProperties - include BeyondApi::ProductVideos - include BeyondApi::Utils - - # - # A +GET+ request will list all of the products in a paged manner. The returned data is an excerpt projection, which includes a small subset of product properties. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @products = session.products.all(size: 100, page: 0) - # - def all(params = {}) - path = "/products" - - handle_all_request(path, :products, params) - end - - # - # A +POST+ request is used to create a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "sku" : "123456789-001", - # "name" : "Rioja Castillo de Puerto (2013)", - # "description" : "Spain\nRioja Tempranillo", - # "manufacturer" : "Grape Vineyard", - # "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", - # "tags" : [ "Bestseller", "Red Wine", "Sale" ], - # "productIdentifiers" : [ { - # "type" : "EAN", - # "value" : "9780134308135" - # } ], - # "salesPrice" : { - # "taxModel" : "NET", - # "amount" : 8.7, - # "currency" : "EUR" - # }, - # "listPrice" : { - # "taxModel" : "NET", - # "amount" : 10.95, - # "currency" : "EUR" - # }, - # "manufacturerPrice" : { - # "taxModel" : "NET", - # "amount" : 99.95, - # "currency" : "EUR" - # }, - # "visible" : true, - # "taxClass" : "REGULAR", - # "shippingWeight" : 100, - # "maxOrderQuantity" : 6, - # "shippingDimension" : { - # "length" : 1500, - # "width" : 1000, - # "height" : 2000 - # }, - # "refPrice" : { - # "refQuantity" : 1, - # "unit" : "LITER", - # "quantity" : 0.75, - # "price" : { - # "taxModel" : "NET", - # "amount" : 11.6, - # "currency" : "EUR" - # } - # }, - # "shippingPeriod" : { - # "min" : 2, - # "max" : 4, - # "displayUnit" : "WEEKS" - # } - # }' - # - # @beyond_api.scopes +prod:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "sku": "123456789-001", - # "name": "Rioja Castillo de Puerto (2013)", - # "description": "Spain\nRioja Tempranillo", - # "manufacturer": "Grape Vineyard", - # "essentialFeatures": "Dry. 12% alcohol. Best vine variety.", - # "tags": ["Bestseller", "Red Wine", "Sale"], - # "productIdentifiers": [{ - # "type": "EAN", - # "value": "9780134308135" - # }], - # "salesPrice": { - # "taxModel": "NET", - # "amount": 8.7, - # "currency": "EUR" - # }, - # "listPrice": { - # "taxModel": "NET", - # "amount": 10.95, - # "currency": "EUR" - # }, - # "manufacturerPrice": { - # "taxModel": "NET", - # "amount": 99.95, - # "currency": "EUR" - # }, - # "visible": true, - # "taxClass": "REGULAR", - # "shippingWeight": 100, - # "maxOrderQuantity": 6, - # "shippingDimension": { - # "length": 1500, - # "width": 1000, - # "height": 2000 - # }, - # "refPrice": { - # "refQuantity": 1, - # "unit": "LITER", - # "quantity": 0.75, - # "price": { - # "taxModel": "NET", - # "amount": 11.6, - # "currency": "EUR" - # } - # }, - # "shippingPeriod": { - # "min": 2, - # "max": 4, - # "displayUnit": "WEEKS" - # } - # } - # - # @product = session.products.create(body) - # - def create(body) - path = "/products" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product or variation product. When a variation product is deleted, all its variations are deleted as well. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/c06c61af-f99a-4698-90fa-8c3199ca732f' -i -X DELETE \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:d+ - # - # @param product_id [String] the product UUID - # - # @return true - # - # @example - # session.products.delete("c06c61af-f99a-4698-90fa-8c3199ca732f") - # - def delete(product_id) - path = "/products/#{product_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/75ebcb57-aefb-4963-8225-060c528e070d' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # @product = session.products.find("75ebcb57-aefb-4963-8225-060c528e070d") - # - def find(product_id) - path = "/products/#{product_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to update a product partially with json content type. - # - # @beyond_api.scopes +prod:u+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/b69e3f47-03b8-40d2-843c-ae89a3d9bcdd' -i -X PATCH \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "patched name", - # "description" : "patched description.


  1. \n

    this is my test html\n
", - # "productIdentifiers" : null, - # "manufacturer" : "patched manufacturer" - # }' - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name": "patched name", - # "description": "patched description.


  1. \n

    this is my test html\n
", - # "productIdentifiers": null, - # "manufacturer": "patched manufacturer" - # } - # @product = session.products.update("b69e3f47-03b8-40d2-843c-ae89a3d9bcdd", body) - # - def update(product_id, body) - path = "/products/#{product_id}" - - response, status = BeyondApi::Request.patch(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to assign a variation attribute as the variation images differentiator for a variation product. - # - # @beyond_api.scopes +prod:u+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/f205294b-17dc-4f75-8b5e-5df72abb96df/variation-attributes/491fedf4-37a9-4bcf-98b8-cff2f82879b7/make-differentiator' -i -X POST \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @param product_id [String] the product UUID - # @param variation_attribute_id [String] the variation attribute UUID - # - # @return [true] - # - # @example - # session.products.assign_variation_images_differentiator("f205294b-17dc-4f75-8b5e-5df72abb96df", "491fedf4-37a9-4bcf-98b8-cff2f82879b7") - # - def assign_variation_attribute_as_differentiator(product_id, variation_attribute_id) - path = "/products/#{product_id}/variation-attributes/#{variation_attribute_id}/make-differentiator" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - alias create_variation create - alias find_variation find - alias update_variation update - end -end diff --git a/lib/beyond_api/resources/products/attachments.rb b/lib/beyond_api/resources/products/attachments.rb deleted file mode 100644 index c02a79f..0000000 --- a/lib/beyond_api/resources/products/attachments.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductAttachments - # - # A +POST+ request is used to create an attachment and add it to a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/ecb997ce-79c3-4367-9373-058089a313e3/attachments' -i -X POST \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "mimeType" : "application/pdf", - # "length" : 1, - # "label" : "Handbuch", - # "dataUri" : "my_document_1.pdf?hash=8a627f655c68f56dfbbf217ab7d5563281225666" - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "mime_type" => "application/pdf", - # "length" => 1, - # "label" => "Handbuch", - # "data_uri" => "my_document_1.pdf?hash=8a627f655c68f56dfbbf217ab7d5563281225666" - # } - # @attachment = session.products.add_attachment("ecb997ce-79c3-4367-9373-058089a313e3", body) - # - def add_attachment(product_id, body) - response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/attachments", body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve a single attachment of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/eb11b53a-5017-4ae7-9ba1-c02c12c80b61/attachments/36933722-f13f-4ee2-858c-0835ae0a884e' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param attachment_id [String] the attachment UUID - # - # @return [OpenStruct] - # - # @example - # @attachment = session.products.attachment("eb11b53a-5017-4ae7-9ba1-c02c12c80b61", "36933722-f13f-4ee2-858c-0835ae0a884e") - # - def attachment(product_id, attachment_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/attachments/#{attachment_id}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all the attachments of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/fd60a63e-c4c0-496d-af49-c4ed224cca2a/attachments' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @attachments = session.products.attachments("fd60a63e-c4c0-496d-af49-c4ed224cca2a", {size: 100, page: 0}) - # - def attachments(product_id, params = {}) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/attachments", params) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product attachment - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/00add006-beaa-46fe-bb73-f8ebae15082d/attachments/9a44e585-571a-4253-9248-54a4c418c7e2' -i -X DELETE \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param attachment_id [String] the attachment UUID - # - # @return [true] - # - # @example - # session.products.delete_attachment("00add006-beaa-46fe-bb73-f8ebae15082d", "9a44e585-571a-4253-9248-54a4c418c7e2") - # - def delete_attachment(product_id, attachment_id) - response, status = BeyondApi::Request.delete(@session, "/products/#{product_id}/attachments/#{attachment_id}") - - handle_response(response, status, respond_with_true: true) - end - end -end diff --git a/lib/beyond_api/resources/products/availability.rb b/lib/beyond_api/resources/products/availability.rb deleted file mode 100644 index a17d0a2..0000000 --- a/lib/beyond_api/resources/products/availability.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductAvailability - # - # A +POST+ request is used to adjust the available stock of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/685f483e-cdda-40af-8091-d5bc31249409/availability/adjust-available-stock' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ "relativeAmount" : -1 }' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # @param relative_amount [Integer] the relative amount - # - # @return [OpenStruct] - # - # @example - # @availability = session.products.adjust_stock_level("685f483e-cdda-40af-8091-d5bc31249409", -1) - # - def adjust_stock_level(product_id, relative_amount) - response, status = BeyondApi::Request.post(@session, - "/products/#{product_id}/availability/adjust-available-stock", - { relative_amount: relative_amount }) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the availability of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/fb22d408-00dc-47e3-ae58-e35769bdb428/availability' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:r+ - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # @availability = session.products.availability("fb22d408-00dc-47e3-ae58-e35769bdb428") - # - def availability(product_id) - response, status = BeyondApi::Request.get(@session, - "/products/#{product_id}/availability") - - handle_response(response, status) - end - - # - # A +POST+ request is used to disable purchasability for a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/6b30255e-650f-475c-b345-e7247f957689/availability/disable-purchasability' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # - # @return true - # - # @example - # session.products.disable_purchasability("6b30255e-650f-475c-b345-e7247f957689") - # - def disable_purchasability(product_id) - response, status = BeyondApi::Request.post(@session, - "/products/#{product_id}/availability/disable-purchasability") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to disable stock management for a product or variation product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/e966cb17-4047-4b82-ade4-33e7f0978c89/availability/disable-stock-management' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # - # @return true - # - # @example - # session.products.disable_stock_management("e966cb17-4047-4b82-ade4-33e7f0978c89") - # - def disable_stock_management(product_id) - response, status = BeyondApi::Request.post(@session, - "/products/#{product_id}/availability/disable-stock-management") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to enable purchasability for a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/17e3a92b-6f3b-4415-bd8f-c9c8921a5a73/availability/enable-purchasability' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # - # @return true - # - # @example - # session.products.enable_purchasability("17e3a92b-6f3b-4415-bd8f-c9c8921a5a73") - # - def enable_purchasability(product_id) - response, status = BeyondApi::Request.post(@session, - "/products/#{product_id}/availability/enable-purchasability") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to enable stock management for a product or variation product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/101fa968-9bb8-4dbe-b166-3add1fc1b35e/availability/enable-stock-management' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ "initialAvailableStock" : 100, "stockThreshold" : 2 }' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "initial_available_stock" => 100, - # "stock_threshold" => 2 - # } - # @availability = session.products.enable_stock_management("101fa968-9bb8-4dbe-b166-3add1fc1b35e", body) - # - def enable_stock_management(product_id, body) - response, status = BeyondApi::Request.post(@session, - "/products/#{product_id}/availability/enable-stock-management", - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update the reserve stock by changing the +stockThreshold+ value of a product or variation product (incl. all of its variations). Reserve stock refers to an inventory level that indicates that a product needs to be reordered. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/f74b5f57-43cc-4176-97aa-c6eb9fdeb37c/availability/update-stock-threshold' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ "stockThreshold" : 5 }' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # @param stock_threshold [Integer] the stock threshold - # - # @return [OpenStruct] - # - # @example - # session.products.update_reserve_stock("f74b5f57-43cc-4176-97aa-c6eb9fdeb37c", 5) - # - def update_reserve_stock(product_id, stock_threshold) - response, status = BeyondApi::Request.put(@session, - "/products/#{product_id}/availability/update-stock-threshold", - { stock_threshold: stock_threshold }) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/cross_sells.rb b/lib/beyond_api/resources/products/cross_sells.rb deleted file mode 100644 index 3ae9a64..0000000 --- a/lib/beyond_api/resources/products/cross_sells.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductCrossSells - # - # A +POST+ request is used to create a cross-sell for a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/43df85ec-e123-4a56-bcc3-c3c52eb23ca9/cross-sells' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "Red wines from Spain cross-sell", - # "type" : "MANUAL", - # "queries" : [ { - # "ids" : [ "22e8b6a6-7d8e-4b08-be63-dde9bced2604", "b18e9e3c-685c-4e37-837c-9047b88fc91e" ], - # "strategy" : "all-ids-match" - # } ] - # }' - # - # @beyond_api.scopes +prcs:c+ - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # name => "Red wines from Spain cross-sell", - # type => "MANUAL", - # queries => [ { - # "ids" : [ "22e8b6a6-7d8e-4b08-be63-dde9bced2604", "b18e9e3c-685c-4e37-837c-9047b88fc91e" ], - # "strategy" : "all-ids-match" - # } ] - # } - # - # @cross_sell = session.products.create_cross_sell("43df85ec-e123-4a56-bcc3-c3c52eb23ca9", body) - # - def create_cross_sell(product_id, body) - response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/cross-sells", body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the cross-sell of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/20174c3f-1a3f-4401-91f6-c7498e897c82/cross-sells/6176b350-06ff-4c52-b3cf-ba032ea79468' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prcs:r+ - # - # @param product_id [String] the product UUID - # @param cross_sell_id [String] the cross-sell UUID - # - # @return [OpenStruct] - # - # @example - # - # @cross_sell = session.products.cross_sell("20174c3f-1a3f-4401-91f6-c7498e897c82", "6176b350-06ff-4c52-b3cf-ba032ea79468") - # - def cross_sell(product_id, cross_sell_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/cross-sells/#{cross_sell_id}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the cross-sells of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/a21188a2-7109-4cd1-8253-2f366d86ff5d/cross-sells' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prcs:r+ - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # - # @cross_sells = session.products.cross_sells("a21188a2-7109-4cd1-8253-2f366d86ff5d") - # - def cross_sells(product_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/cross-sells") - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product attribute. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/b80cdb11-0e97-41e3-8559-4d426bd28ba1/cross-sells/67ecb3ef-8472-4509-9e5a-c76945e8d963' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prcs:d+ - # - # @param product_id [String] the product UUID - # @param cross_sell_id [String] the cross-sell UUID - # - # @return [OpenStruct] - # - # @example - # - # session.products.cross_sell("b80cdb11-0e97-41e3-8559-4d426bd28ba1", "67ecb3ef-8472-4509-9e5a-c76945e8d963") - # - def delete_cross_sell(product_id, cross_sell_id) - response, status = BeyondApi::Request.delete(@session, "/products/#{product_id}/cross-sells/#{cross_sell_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update a cross-sell for a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/4ed7a15a-9ef8-415f-8161-87498b1ecd4f/cross-sells/b18d96f4-dfdf-47f3-b2dc-ce1653829674' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "sale rose wine cross-selling", - # "type" : "SMART", - # "queries" : [ { - # "tags" : [ "Rosé Wine", "Sale" ], - # "strategy" : "any-tags-match" - # } ] - # }' - # - # @beyond_api.scopes +prcs:u+ - # - # @param product_id [String] the product UUID - # @param cross_sell_id [String] the cross-sell UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # name => "sale rose wine cross-selling", - # type => "SMART", - # queries => [ { - # tags => [ "Rosé Wine", "Sale" ], - # strategy => "any-tags-match" - # } ] - # } - # - # @cross_sell = session.products.update_cross_sell("4ed7a15a-9ef8-415f-8161-87498b1ecd4f", "b18d96f4-dfdf-47f3-b2dc-ce1653829674", body) - # - def update_cross_sell(product_id, attribute_name, body) - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/cross-sells/#{cross_sell_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/custom_attributes.rb b/lib/beyond_api/resources/products/custom_attributes.rb deleted file mode 100644 index 694bd70..0000000 --- a/lib/beyond_api/resources/products/custom_attributes.rb +++ /dev/null @@ -1,140 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductCustomAttributes - # - # A +POST+ request is used to create a product attribute, which defines the value of a certain {product attribute definition}[http://docs.beyondshop.cloud/#resources-product-attribute-definitions] for a specific {product}[http://docs.beyondshop.cloud/#resources-products]. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/0c0e1699-d2a4-44d0-bed9-64b2fa1a7713/attributes' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "key" : "colour", - # "value" : "Yellow" - # }' - # - # @beyond_api.scopes +prat:c+ - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "key" => "colour", - # "value" => "Yellow" - # } - # - # @custom_attribute = session.products.create_custom_attribute("0c0e1699-d2a4-44d0-bed9-64b2fa1a7713", body) - # - def create_custom_attribute(product_id, body) - response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/attributes", body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve detailed information about a specific product attribute. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/d389347c-568e-4785-8216-91e4f8850c66/attributes/key' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prat:r+ - # - # @param product_id [String] the product UUID - # @param attribute_name [String] the key of custom attribute - # - # @return [OpenStruct] - # - # @example - # - # @custom_attribute = session.products.custom_attribute("d389347c-568e-4785-8216-91e4f8850c66", "key") - # - def custom_attribute(product_id, attribute_name) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/attributes/#{attribute_name}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve all product attributes for a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/57f0ef04-9dac-462f-9dd4-606f7551cc7b/attributes' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prat:r+ - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # - # @custom_attributes = session.products.custom_attributes("57f0ef04-9dac-462f-9dd4-606f7551cc7b") - # - def custom_attributes(product_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/attributes") - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product attribute. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/fec3b6f3-83d0-467a-abc5-d51019e57b51/attributes/farbe' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prat:d+ - # - # @param product_id [String] the product UUID - # @param attribute_name [String] the key of custom attribute - # - # @return [OpenStruct] - # - # @example - # - # session.products.delete_custom_attribute("fec3b6f3-83d0-467a-abc5-d51019e57b51", "farbe") - # - def delete_custom_attribute(product_id, attribute_name) - response, status = BeyondApi::Request.delete(@session, "/products/#{product_id}/attributes/#{attribute_name}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update the value of a product attribute. If the specified product attribute doesn’t exist, it will be created with the response as described in {Create product attribute}[http://docs.beyondshop.cloud/#resources-product-attribute-create]. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/82ed44e9-664d-47c0-8b07-09adecfdbf20/attributes/key' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "value" : "green" - # }' - # - # @beyond_api.scopes +prat:u+ - # - # @param product_id [String] the product UUID - # @param attribute_name [String] the key of custom attribute - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "value" : "green" - # } - # - # @custom_attribute = session.products.update_custom_attribute("82ed44e9-664d-47c0-8b07-09adecfdbf20", "key", body) - # - def update_custom_attribute(product_id, attribute_name, body) - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/attributes/#{attribute_name}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/images.rb b/lib/beyond_api/resources/products/images.rb deleted file mode 100644 index 329fad2..0000000 --- a/lib/beyond_api/resources/products/images.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductImages - # - # A +POST+ request is used to create an image and add it to a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/7a7d1f18-f760-46a9-b794-dbe5a88c6b44/images' -i -X POST \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "dataUri" : "photostore-2.JPG?hash=8a627f655c68f56dfbbf217ab7d5563281225998", - # "width" : 600, - # "height" : 300 - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param image_uri [String] the image url - # - # @return [OpenStruct] - # - # @example - # body = { - # "data_uri" => "photostore-2.JPG?hash=8a627f655c68f56dfbbf217ab7d5563281225998", - # "width" => 600, - # "height" => 300 - # } - # @image = session.products.add_image("7a7d1f18-f760-46a9-b794-dbe5a88c6b44", body) - # - def add_image(product_id, body) - response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/images", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product image. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/8f5e979e-4a47-47ca-84ce-7c026d623974/images/ac318d53-df29-4f43-9356-d91aed8bdb39' -i -X DELETE \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param image_id [String] the image UUID - # - # @return true - # - # @example - # session.products.delete_image("8f5e979e-4a47-47ca-84ce-7c026d623974", "ac318d53-df29-4f43-9356-d91aed8bdb39") - # - def delete_image(product_id, image_id) - response, status = BeyondApi::Request.delete(@session, "/products/#{product_id}/images/#{image_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the images of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/7f32696a-df56-4380-a91b-fffb97f025b4/images' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @images = session.products.images("7f32696a-df56-4380-a91b-fffb97f025b4", { size: 20, page: 0 }) - # - def images(product_id, params = {}) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/images", params) - - handle_response(response, status) - end - - # A +GET+ request is used to retrieve a single image of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/124c5c94-4e62-410a-8599-e5b29dae3491/images/715f5154-9fde-4213-bcab-41ceaaf8b70e' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param image_id [String] the image UUID - # - # @return [OpenStruct] - # - # @example - # @image = session.products.image("124c5c94-4e62-410a-8599-e5b29dae3491", "715f5154-9fde-4213-bcab-41ceaaf8b70e") - # - def image(product_id, image_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/images/#{image_id}") - - handle_response(response, status) - end - - # A +PUT+ request is used to assign a product image as the default image. The request contains a single URI of the image to assign. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/150015b9-0b9b-45a2-bcfb-f9006b16a8b8/default-image' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d 'http://localhost/products/images/8ef3591c-d05f-4aa1-acf6-950ba51ec4f7' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param image_id [String] the image UUID - # - # @return true - # - # @example - # session.products.set_image_as_default("150015b9-0b9b-45a2-bcfb-f9006b16a8b8", "8ef3591c-d05f-4aa1-acf6-950ba51ec4f7") - # - def set_image_as_default(product_id, image_id) - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}", - "#{@session.api_url}/images/#{image_id}") - - handle_response(response, status, respond_with_true: true) - end - - # A +PUT+ request is used to sort the product images. This is done by passing the self-links of the images to the desired product. The request must contain URIs for all images of the given page. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb/images' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d 'http://localhost/products/3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb/images/c9082802-a0d0-416e-9039-02fa465a027e - # http://localhost/products/3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb/images/78e9993d-8db3-45d8-8f76-6b8f2aea9c45 - # http://localhost/products/3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb/images/9233ee97-5dbb-4c00-a7b2-e1512c69a938' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param images [Array] the image UUIDS - # - # @return true - # - # @example - # body = [ - # "c9082802-a0d0-416e-9039-02fa465a027e", - # "78e9993d-8db3-45d8-8f76-6b8f2aea9c45", - # "9233ee97-5dbb-4c00-a7b2-e1512c69a938" - # ] - # session.products.sort_images("3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb", body) - # - def sort_images(product_id, image_ids) - body = image_ids.map { |image_id| "#{@session.api_url}/products/#{product_id}/images/#{image_id}" } - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/images", body.join("\n"), {}, 'text/uri-list') - - handle_response(response, status, respond_with_true: true) - end - - # A +POST+ request is used to upload an image and add it to a product. The body of the request must contain the content of the image. - # - # $ curl --data-binary '@/home/epages/file.png' 'https://api-shop.beyondshop.cloud/api/products/4125b993-49fc-47c8-b9b3-76d8871e4e06/images?fileName=file.png' -X POST \ - # -H 'Content-Type: image/png' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param image_path [String] the image path - # @param image_name [String] the image name - # - # @return true - # - # @example - # session.products.upload_image("4125b993-49fc-47c8-b9b3-76d8871e4e06", "/home/epages/file.png", "file.png") - # - def upload_image(product_id, image_path, image_name) - content_type = file_content_type(image_path) - image_binary = File.binread(image_path) - - response, status = BeyondApi::Request.upload(@session, - "/products/#{product_id}/images", - image_binary, - content_type, - { file_name: image_name }) - - handle_response(response, status, respond_with_true: true) - end - - # A +POST+ request is used to upload up to 10 images and add them to a product. The body of the request must contain the content of the images. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/4125b993-49fc-47c8-b9b3-76d8871e4e06/images?fileName=file.png&fileName=file2.png' -i -X POST \ - # -H 'Content-Type: multipart/form-data' \ - # -H 'Authorization: Bearer ' \ - # -F 'image=@/home/epages/file.png' \ - # -F 'image=@/home/epages/file2.png' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param images_path [Array] the images path - # @param images_name [Array] the images name - # - # @return true - # - # @example - # session.products.upload_multiple_images("4125b993-49fc-47c8-b9b3-76d8871e4e06", - # ["/home/epages/file.png", "/home/epages/file2.png"], ["file.png", "file2.png"]) - # - def upload_multiple_images(product_id, images_path, images_name) - response, status = BeyondApi::Request.upload_by_form(@session, - "/products/#{product_id}/images", - images_path, - file_name: images_name.map { |e| URI.encode_www_form([e]) }) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/searches.rb b/lib/beyond_api/resources/products/searches.rb deleted file mode 100644 index 22d8419..0000000 --- a/lib/beyond_api/resources/products/searches.rb +++ /dev/null @@ -1,113 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductSearches - # - # A +POST+ request is used to search for products by a search term. Optionally, you can also filter the search results. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/search' -i -X POST \ - # -H 'Content-Type: application/hal+json;charset=UTF-8' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # -d '{ - # "search" : { - # "term" : "Tony Highfinger, Poloshirt, Men", - # "category" : "NAME" - # }, - # "filters" : [ { - # "key" : "status", - # "values" : [ "PUBLISHED" ] - # } ], - # "paging" : { - # "page" : 0, - # "pageSize" : 20, - # "sort" : { - # "property" : "name", - # "direction" : "ASC" - # } - # } - # }' - # - # @beyond_api.scopes +prod:r+ - # - # @param body [String] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # search: { - # term: "Tony Highfinger, Poloshirt, Men", - # category: "NAME" - # }, - # filters: [ { - # key: "status", - # values: [ "PUBLISHED" ] - # } ], - # paging: { - # page: 0, - # page_size: 20, - # sort: { - # property: "name", - # direction: "ASC" - # } - # } - # } - # @products = session.product.search(body) - # - def search(body) - response, status = BeyondApi::Request.post(@session, - "/products/search", - body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to search for a product by SKU. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/search/find-by-sku?sku=vino020' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param sku [String] the product sku to search - # - # @return [OpenStruct] - # - # @example - # @product = session.product.search_by_sku("vino020") - # - def search_by_sku(sku) - response, status = BeyondApi::Request.get(@session, "/products/search/find-by-sku", sku: sku) - - handle_response(response, status) - end - - # - # A +GET+ request is used to search used tags by a starting string. All strings are sorted by usage, starting with the biggest. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/search/tags?startsWith=aw' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param starts_with [String] the tag start to search - # @option param [Integer] :size the page size - # @option param [Integer] :page the page numbe - # - # @return [OpenStruct] - # - # @example - # @tags = session.product.search_tags_starting_by("aw") - # - def search_tags_starting_by(starts_with, params = {}) - response, status = BeyondApi::Request.get(@session, "/products/search/tags", - params.merge(starts_with: starts_with)) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/variation_properties.rb b/lib/beyond_api/resources/products/variation_properties.rb deleted file mode 100644 index b4d4664..0000000 --- a/lib/beyond_api/resources/products/variation_properties.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductVariationProperties - # - # A +PATCH+ request is used to update the variation properties of a variation product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/51953b86-7ccc-4e80-acbd-1a2fc921fc2e/variation-properties' -i -X PATCH \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '[ { - # "property" : "salesPrice", - # "enabled" : true - # }, { - # "property" : "listPrice", - # "enabled" : true - # }, { - # "property" : "refPrice", - # "enabled" : true - # }, { - # "property" : "manufacturerPrice", - # "enabled" : true - # }, { - # "property" : "productIdentifiers", - # "enabled" : true - # } ]' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param body [Array] the request body - # - # @return [OpenStruct] - # - # @example - # body = [{ - # "property": "salesPrice", - # "enabled": true - # }, { - # "property": "listPrice", - # "enabled": true - # }, { - # "property": "refPrice", - # "enabled": true - # }, { - # "property": "manufacturerPrice", - # "enabled": true - # }, { - # "property": "productIdentifiers", - # "enabled": true - # }] - # - # @variation_properties = session.products.update_variation_properties("7f32696a-df56-4380-a91b-fffb97f025b4", body) - # - def update_variation_properties(product_id, body) - response, status = BeyondApi::Request.patch(@session, "/products/#{product_id}/variation-properties", body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the variation properties of a variation product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/ea81446c-8fec-418c-8b3c-6e43fdee713a/variation-properties' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # @variation_properties = session.products.variation_properties("7f32696a-df56-4380-a91b-fffb97f025b4") - # - def variation_properties(product_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/variation-properties") - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products/videos.rb b/lib/beyond_api/resources/products/videos.rb deleted file mode 100644 index 11977bd..0000000 --- a/lib/beyond_api/resources/products/videos.rb +++ /dev/null @@ -1,147 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ProductVideos - # - # A +POST+ request is used to create a video and add it to a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/f7716244-568c-4536-bc25-317030f83395/videos' -i -X POST \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "type" : "VIMEO", - # "source" : "https://vimeo.com/7265982" - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "type" => "VIMEO", - # "source" => "https://vimeo.com/7265982" - # } - # @video = session.products.add_video("f7716244-568c-4536-bc25-317030f83395", body) - # - def add_video(product_id, body) - response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/videos", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a product video - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/1cc9ef5e-62b1-43c7-8745-f4aa8be79934/videos/60869f60-1a4b-4013-b86c-00a2ab9ddc2c' -i -X DELETE \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param video_id [String] the video UUID - # - # @return [true] - # - # @example - # session.products.delete_video("1cc9ef5e-62b1-43c7-8745-f4aa8be79934", "60869f60-1a4b-4013-b86c-00a2ab9ddc2c") - # - def delete_video(product_id, video_id) - response, status = BeyondApi::Request.delete(@session, "/products/#{product_id}/videos/#{video_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update a video. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/9d33da61-1f60-4ad3-9de0-2f1dc0910ebb/videos/ef51af21-5381-4ccb-a107-8bfa574d3556' -i -X PUT \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "type" : "VIMEO", - # "source" : "https://vimeo.com/7265982" - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param video_id [String] the video UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "type" => "VIMEO", - # "source" => "https://vimeo.com/7265982" - # } - # @video = session.products.update_video("9d33da61-1f60-4ad3-9de0-2f1dc0910ebb", "ef51af21-5381-4ccb-a107-8bfa574d3556", body) - # - def update_video(product_id, video_id, body) - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/videos/#{video_id}", body) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve a single video of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/94c3baf9-1390-4bf8-a6c1-fb234533fa14/videos/ada27b8c-ddf0-489a-9143-5bec938c1e17' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param video_id [String] the video UUID - # - # @return [OpenStruct] - # - # @example - # @video = session.products.video("94c3baf9-1390-4bf8-a6c1-fb234533fa14", "ada27b8c-ddf0-489a-9143-5bec938c1e17") - # - def video(product_id, video_id) - response, status = BeyondApi::Request.get(@session, "/products/#{product_id}/videos/#{video_id}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the videos of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/04c6ad65-465d-405e-a428-f73349104b65/videos' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @videos = session.products.videos("04c6ad65-465d-405e-a428-f73349104b65", size: 100, page: 0) - # - def videos(product_id, params = {}) - response, status = BeyondApi::Request.get(@session, - "/products/#{product_id}/videos", - params) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/products_view.rb b/lib/beyond_api/resources/products_view.rb deleted file mode 100644 index b341e2a..0000000 --- a/lib/beyond_api/resources/products_view.rb +++ /dev/null @@ -1,128 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class ProductsView < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all products. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/products' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @products = session.products_view.all(page: 0, size: 100) - # - def all(params = {}) - path = "/product-view/products" - - handle_all_request(path, :products, params) - end - - # - # A +GET+ request is used to list all available tags. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/products/search/find-available-tags' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @return [OpenStruct] - # - # @example - # @tags = session.products_view.available_tags - # - def available_tags - path = "/product-view/products/search/find-available-tags" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # TODO: To be documented. - # NOTE: 10.4 10.5 and 10.6 are the same call with different response. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/products/f75f8fb2-5a48-4d94-aad6-3d3692c06472' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param product_id [String] the product UUID - # - # @return [OpenStruct] - # - # @example - # @product = session.products_view.find("f75f8fb2-5a48-4d94-aad6-3d3692c06472") - # - def find(product_id) - path = "/product-view/products/#{product_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to search for products matching any tag of the list given by a client. The intention is to offer product search capabilities for a shop’s storefront. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/products/search/find-by-tags?tag=number0' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param tag [String] the tag to search - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @products = session.products_view.search_by_tag("number0", {page: 0, size: 100}) - # - def search_by_tag(tag, params = {}) - path = "/product-view/products/search/find-by-tags" - - response, status = BeyondApi::Request.get(@session, - path, - params.merge(tag: tag)) - - handle_response(response, status) - end - - # - # A +GET+ request is used to search for products matching any tag of the list given by a client. The intention is to offer product search capabilities for a shop’s storefront. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/product-view/products/search/find-by-term?query=search+snippet' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' - # - # @param term [String] the term to search - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @products = session.products_view.search_by_term("search snippet", {page: 0, size: 100}) - # - def search_by_term(term, params = {}) - path = "/product-view/products/search/find-by-term" - - response, status = BeyondApi::Request.get(@session, - path, - params.merge(query: term)) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/script_tags.rb b/lib/beyond_api/resources/script_tags.rb deleted file mode 100644 index bab9aaa..0000000 --- a/lib/beyond_api/resources/script_tags.rb +++ /dev/null @@ -1,140 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class ScriptTags < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve a list of all script tags for a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @option params [Boolean] :paginated - # @option params [Boolean] :only_own - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @script_tags = session.script_tags.all(size: 20, page: 0) - # - def all(params = {}) - path = "/script-tags" - - params.merge!(client_id: BeyondApi.configuration.client_id) if params[:only_own] - - handle_all_request(path, :script_tags, params) - end - - # - # A +GET+ request is used to retrieve a single script tag. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags/df170ab1-13ae-4955-8b51-2478246acf59' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @param script_tag_id [String] the script tag UUID - # - # @return [OpenStruct] - # - # @example - # @script_tag = session.script_tags.find("df170ab1-13ae-4955-8b51-2478246acf59") - # - def find(script_tag_id) - path = "/script-tags/#{script_tag_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a script tag. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "scriptUrl": "https://example.org/js/fancy-script.js" - # }' - # - # @beyond_api.scopes +sctg:m+ - # - # @param script_tag_url [String] the url of the script - # - # @return [OpenStruct] - # - # @example - # @script_tag = session.script_tags.create("https://example.org/js/fancy-script.js") - # - def create(script_tag_url) - path = "/script-tags" - - response, status = BeyondApi::Request.post(@session, - path, - { script_url: script_tag_url }) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a script tag. You can only delete a script tag created by your app. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags/4a9f7776-d74d-4311-8ddb-121bd5407520' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +sctg:m+ - # - # @param script_tag_id [String] the script tag UUID - # - # @return true - # - # @example - # session.script_tags.delete("4a9f7776-d74d-4311-8ddb-121bd5407520") - # - def delete(script_tag_id) - path = "/script-tags/#{script_tag_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update an existing script tag. You can only update a script tag created by your app. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/script-tags/d6c7b3d2-4984-4fa6-b5f2-b0f5cfc63bd3' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "scriptUrl": "https://example.org/scripts/someOtherScript.js" - # }' - # - # @beyond_api.scopes +sctg:m+ - # - # @param script_tag_id [String] the script tag UUID - # @param script_tag_url [String] the url of the script - # - # @return [OpenStruct] - # - # @example - # @script_tag = session.script_tags.create("https://example.org/scripts/someOtherScript.js") - # - def update(script_tag_id, script_tag_url) - path = "/script-tags/#{script_tag_id}" - - response, status = BeyondApi::Request.put(@session, - path, - { script_url: script_tag_url }) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shipping_zones.rb b/lib/beyond_api/resources/shipping_zones.rb deleted file mode 100644 index 87b996f..0000000 --- a/lib/beyond_api/resources/shipping_zones.rb +++ /dev/null @@ -1,420 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class ShippingZones < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all shipping zones in a paged way. - # - # @beyond_api.scopes +shpz:r+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @shipping_zones = session.shipping_zones.all(size: 20, page: 0) - # - def all(params = {}) - path = "/shipping-zones" - - handle_all_request(path, :shipping_zones, params) - end - - # - # A +POST+ request is used to create a shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "BE-NL-LU", - # "serviceableCountries" : [ "BE", "NL", "LU" ] - # }' - # - # @beyond_api.scopes +shpz:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "BE-NL-LU", - # "serviceableCountries" => [ "BE", "NL", "LU" ] - # } - # @shipping_zone = session.shipping_zones.create(body) - # - def create(body) - path = "/shipping-zones" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a shipping method in a shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/905e981c-1489-45af-9138-0a7dc1f0b085/shipping-methods' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "Standard Shipping 2", - # "description" : "Standard Shipping", - # "taxClass" : "REGULAR", - # "freeShippingValue" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 400 - # }, - # "fixedPrice" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : "19.99" - # } - # }' - # - # @beyond_api.scopes +shpz:u+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "Standard Shipping 2", - # "description" => "Standard Shipping", - # "taxClass" => "REGULAR", - # "freeShippingValue" => { - # "taxModel" => "GROSS", - # "currency" => "EUR", - # "amount" => 400 - # }, - # "fixedPrice" => { - # "taxModel" => "GROSS", - # "currency" => "EUR", - # "amount" => "19.99" - # } - # } - # @shipping_method = session.shipping_zones.create_shipping_method("905e981c-1489-45af-9138-0a7dc1f0b085", body) - # - def create_shipping_method(shipping_zone_id, body) - path = "/shipping-zones/#{shipping_zone_id}/shipping-methods" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a shipping zone. You cannot delete the shipping zone if it contains the last shipping method of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/c871b402-b6d9-4c6d-b76c-440f61175805' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:d+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # - # @return true - # - # @example - # session.shipping_zones.delete("c871b402-b6d9-4c6d-b76c-440f61175805") - # - def delete(shipping_zone_id) - path = "/shipping-zones/#{shipping_zone_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +DELETE+ request is used to delete a shipping method in a shipping zone. You cannot delete the last shipping method of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/61c14c3c-ce26-4524-9713-f2ede7ff22fa/shipping-methods/d2eee203-a1c6-4035-8e7a-74bb77cfde47' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:u+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @param shipping_method_id [String] the shipping method UUID - # - # @return true - # - # @example - # session.shipping_zones.delete_shipping_method("61c14c3c-ce26-4524-9713-f2ede7ff22fa", "d2eee203-a1c6-4035-8e7a-74bb77cfde47") - # - def delete_shipping_method(shipping_zone_id, shipping_method_id) - path = "/shipping-zones/#{shipping_zone_id}/shipping_methods/#{shipping_method_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a shipping zone. - # - # @beyond_api.scopes +shpz:r+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/27914098-c1f6-46aa-9e78-c7ac873e25b3' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @param shipping_zone_id [String] the shipping zone UUID - # - # @return [OpenStruct] - # - # @example - # @shipping_zone = session.shipping_zones.find("27914098-c1f6-46aa-9e78-c7ac873e25b3") - # - def find(shipping_zone_id) - path = "/shipping-zones/#{shipping_zone_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to find the serviceable countries. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/search/find-all-serviceable-countries' -i -X GET \ - # -H 'Accept: application/hal+json' - # - # @return [OpenStruct] - # - # @example - # @serviceable_countries = session.shipping_zones.find_serviceable_countries - # - def find_serviceable_countries - path = "/shipping-zones/search/find-all-serviceable-countries" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # A +GET+ request is used to retrieve the details of a shipping method in a shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/61780dd6-0150-4fcf-953c-d10c52bab4ab/shipping-methods/13bd1fc9-706c-4774-923a-484a41aaab89' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:r+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @param shipping_method_id [String] the shipping method UUID - # - # @return [OpenStruct] - # - # @example - # @shipping_method = session.shipping_zones.shipping_method("61780dd6-0150-4fcf-953c-d10c52bab4ab", "13bd1fc9-706c-4774-923a-484a41aaab89") - # - def shipping_method(shipping_zone_id, shipping_method_id) - path = "/shipping-zones/#{shipping_zone_id}/shipping-methods/#{shipping_method_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all shipping-methods of a shipping zone in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/8cc24465-3573-4eca-8323-b076bb724080/shipping-methods' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:r+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @shipping_methods = session.shipping_zones.shipping_methods("8cc24465-3573-4eca-8323-b076bb724080", { size: 20, page: 0 }) - # - def shipping_methods(shipping_zone_id, params = {}) - path = "/shipping-zones/#{shipping_zone_id}/shipping-methods" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to sort the shipping zones. This is done by passing the self-links of the shipping zones in the desired order.all - # The request must contain URIs for all shipping zones of the given page. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/shipping-zones/9fa80513-be11-494f-ac01-61832e0d7808 - # https://api-shop.beyondshop.cloud/api/shipping-zones/f0911d4c-1ab0-4bbd-88e3-cb675cbb7da7 - # https://api-shop.beyondshop.cloud/api/shipping-zones/ef2e7cb7-820e-4d62-b361-12240f635164' - # - # @beyond_api.scopes +shpz:u+ - # - # @param shipping_zone_ids [Array] the list of shipping zone UUIDs - # - # @return [OpenStruct] - # - # @example - # shipping_zone_ids = ["9fa80513-be11-494f-ac01-61832e0d7808", "f0911d4c-1ab0-4bbd-88e3-cb675cbb7da7", "ef2e7cb7-820e-4d62-b361-12240f635164"] - # session.shipping_zones.sort(shipping_zone_ids) - # - def sort(shipping_zone_ids) - path = "/shipping-zones" - - body = shipping_zone_ids.map { |id| "#{session.api_url}/shipping-zones/#{id}" } - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to sort the shipping methods inside a shipping zone. - # This is done by passing the self-links of the shipping methods in the desired order. The request must contain URIs for all shipping methods of this shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/e54af33b-fadc-4524-8eec-7e0b3e20f625/shipping-methods' -i -X PUT \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shpz:r+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # - # @return [OpenStruct] - # - # @example - # session.shipping_zones.sort_shipping_methods(shipping_zone_id) - # - def sort_shipping_methods(shipping_zone_id) - path = "/shipping-zones/#{shipping_zone_id}/shipping-methods" - - response, status = BeyondApi::Request.put(@session, - path) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/727b3cbf-01b1-442a-bd5c-94c51901f090' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "BENELUX region", - # "serviceableCountries" : [ "BE", "NL", "LU", "DE" ] - # }' - # - # @beyond_api.scopes +shpz:u+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @param body [String] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "BENELUX region", - # "serviceableCountries" => [ "BE", "NL", "LU", "DE" ] - # } - # @shipping_zone = session.shipping_zones.update("727b3cbf-01b1-442a-bd5c-94c51901f090", body) - # - def update(shipping_zone_id, body) - path = "/shipping-zones/#{shipping_zone_id}" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a shipping method in a shipping zone. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shipping-zones/c4137d8b-3dd1-4b73-91f0-32f1433c8195/shipping-methods/25df7018-a7a2-4903-85fa-6a3a73ae40b2' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "Express", - # "description" : "Shipping overnight. Delivery on the next day.", - # "taxClass" : "REGULAR", - # "freeShippingValue" : { - # "currency" : "EUR", - # "amount" : 200 - # }, - # "fixedPrice" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 25 - # } - # }' - # - # @beyond_api.scopes +shpz:u+ - # - # @param shipping_zone_id [String] the shipping zone UUID - # @param shipping_method_id [String] the shipping method UUID - # @param body [String] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" : "Express", - # "description" : "Shipping overnight. Delivery on the next day.", - # "taxClass" : "REGULAR", - # "freeShippingValue" : { - # "currency" : "EUR", - # "amount" : 200 - # }, - # "fixedPrice" : { - # "taxModel" : "GROSS", - # "currency" : "EUR", - # "amount" : 25 - # } - # } - # @shipping_method = session.shipping_zones.update_shipping_method("c4137d8b-3dd1-4b73-91f0-32f1433c8195", "25df7018-a7a2-4903-85fa-6a3a73ae40b2", body) - # - def update_shipping_method(shipping_zone_id, shipping_method_id, body) - path = "/shipping-zones/#{shipping_zone_id}/shipping-methods/#{shipping_method_id}" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shop.rb b/lib/beyond_api/resources/shop.rb deleted file mode 100644 index 2bc9b02..0000000 --- a/lib/beyond_api/resources/shop.rb +++ /dev/null @@ -1,96 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - autoload :ShopAddress, "beyond_api/resources/shops/address" - autoload :ShopAttributes, "beyond_api/resources/shops/attributes" - autoload :ShopImages, "beyond_api/resources/shops/images" - autoload :ShopLegals, "beyond_api/resources/shops/legals" - autoload :ShopLocations, "beyond_api/resources/shops/locations" - - class Shop < Base - include BeyondApi::ShopAddress - include BeyondApi::ShopAttributes - include BeyondApi::ShopImages - include BeyondApi::ShopLegals - include BeyondApi::ShopLocations - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve the details of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop' -i -X GET \ - # -H 'Accept: application/hal+json' - # - # @return [OpenStruct] - # - # @example - # session.shop.current - # - def current - path = "/shop" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to change attributes of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop' -i -X PATCH \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "anotherName", - # "primaryHostname" : "cornershop.amazingdiscounts.xyz", - # "fallbackHostname" : "cornershop.beyondshop.cloud", - # "tax" : { - # "taxModel" : "GROSS", - # "vatExempted" : false - # }, - # "currencies" : [ "EUR", "USD", "GBP" ], - # "defaultCurrency" : "USD", - # "locales" : [ "en-GB", "de-DE" ], - # "defaultLocale" : "en-GB", - # "closedByMerchant" : false - # }' - # - # @beyond_api.scopes +shop:u+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "anotherName", - # "primary_hostname" => "cornershop.amazingdiscounts.xyz", - # "fallback_hostname" => "cornershop.beyondshop.cloud", - # "tax" => { - # "taxModel" => "GROSS", - # "vatExempted" => false - # }, - # "currencies" => [ "EUR", "USD", "GBP" ], - # "default_currency" => "USD", - # "locales" => [ "en-GB", "de-DE" ], - # "default_locale" => "en-GB", - # "closed_by_merchant" => false - # } - # - # session.shop.update(body) - # - def update(body) - path = "/shop" - - response, status = BeyondApi::Request.patch(@session, - path, - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shops/address.rb b/lib/beyond_api/resources/shops/address.rb deleted file mode 100644 index e477b0a..0000000 --- a/lib/beyond_api/resources/shops/address.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ShopAddress - # - # A +GET+ request is used to retrieve the details of a shop’s address. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/address' -i -X GET - # - # @return [OpenStruct] - # - # @example - # session.shop.address - # - def address - response, status = BeyondApi::Request.get(@session, "/shop/address") - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to patch a shop’s address partially with json content type. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/address' -i -X PATCH \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "city" : "Barcelona" - # }' - # - # @beyond_api.scopes +shad:u+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "city" => "Barcelona" - # } - # - # session.shop.update_address(body) - # - def update_address(body) - response, status = BeyondApi::Request.patch(@session, "/shop/address", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shops/attributes.rb b/lib/beyond_api/resources/shops/attributes.rb deleted file mode 100644 index 6986a11..0000000 --- a/lib/beyond_api/resources/shops/attributes.rb +++ /dev/null @@ -1,136 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ShopAttributes - # - # A +GET+ request is used to retrieve a particular shop attribute by its name. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/attributes/second-unknown-attribute-name' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shat:r+ - # - # @param attribute_name [String] the attribute name - # - # @return [OpenStruct] - # - # @example - # @shop_attribute = session.shop.attribute("second-unknown-attribute-name") - # - def attribute(attribute_name) - response, status = BeyondApi::Request.get(@session, "/shop/attributes/#{attribute_name}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve a list of all shop attributes. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/attributes' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shat:r+ - # - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @shop_attributes = session.shop.attributes(size: 5, page: 1) - # - def attributes(params = {}) - response, status = BeyondApi::Request.get(@session, "/shop/attributes", params) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a shop attribute. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/attributes' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "name" : "second-unknown-attribute-name", - # "value" : "correct-value", - # "public" : false - # }' - # - # @beyond_api.scopes +shat:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "name" => "second-unknown-attribute-name", - # "value" => "correct-value", - # "public" => false - # } - # - # session.shop.create_attribute(body) - # - def create_attribute(body) - response, status = BeyondApi::Request.post(@session, "/shop/attributes", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete an shop attribute. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/attributes/second-unknown-attribute-name' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shat:d+ - # - # @param attribute_name [String] the attribute name - # - # @return true - # - # @example - # session.shop.delete_attribute("second-unknown-attribute-name") - # - def delete_attribute(attribute_name) - response, status = BeyondApi::Request.delete(@session, "/shop/attributes/#{attribute_name}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used to update a shop attribute. This operation is idempotent and will create a new shop attribute if required. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/attributes/second-unknown-attribute-name' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "value" : "new-value", - # "public" : false - # }' - # - # @beyond_api.scopes +shat:u+ - # - # @param attribute_name [String] the attribute name - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "value" => "new-value", - # "public" => false - # } - # - # session.shop.update_attribute("second-unknown-attribute-name", body) - # - def update_attribute(attribute_name, body) - response, status = BeyondApi::Request.put(@session, "/shop/attributes/#{attribute_name}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shops/images.rb b/lib/beyond_api/resources/shops/images.rb deleted file mode 100644 index 2bf289e..0000000 --- a/lib/beyond_api/resources/shops/images.rb +++ /dev/null @@ -1,158 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ShopImages - # - # A +POST+ request is used to create a shop image. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/images' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "dataUri" : "file.png?hash=212-2323-4343", - # "label" : "logo" - # }' - # - # @beyond_api.scopes +shim:c+ - # - # @param body [Hash] the request body - # - # @return true - # - # @example - # body = { - # "data_uri" => "file.png?hash=212-2323-4343", - # "label" => "logo" - # } - # - # session.shop.create_image(body) - # - def create_image(body) - response, status = BeyondApi::Request.post(@session, "/shop/images", body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +DELETE+ request is used to delete a shop image. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/images/6a7646dc-7f26-4730-a98f-52f9b63978fb' -i -X DELETE \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shim:d+ - # - # @param image_id [String] the image UUID - # - # @return true - # - # @example - # session.shop.delete_image("6a7646dc-7f26-4730-a98f-52f9b63978fb") - # - def delete_image(image_id) - response, status = BeyondApi::Request.delete(@session, "/shop/images/#{image_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve a single shop image. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/images/2feee7ac-f1cb-4faf-9488-f3ce07394141' -i -X GET \ - # -H 'Accept: application/hal+json' - # - # @param image_id [String] the image UUID - # - # @return [OpenStruct] - # - # @example - # @image = session.shop.image("2feee7ac-f1cb-4faf-9488-f3ce07394141") - # - def image(image_id) - response, status = BeyondApi::Request.get(@session, "/shop/images/#{image_id}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the images of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/images' -i -X GET \ - # -H 'Accept: application/hal+json' - # - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @images = session.shop.images(size: 5, page: 1) - # - def images(params = {}) - response, status = BeyondApi::Request.get(@session, "/shop/images", params) - - handle_response(response, status) - end - - # - # A +GET+ request is issued to search for shop images by label. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/images/search/find-by-label?label=logo' -i -X GET \ - # -H 'Accept: application/hal+json' - # - # @param label [String] the image label - # - # @return [OpenStruct] - # - # @example - # session.shop.search_images_by_label("logo") - # - def search_images_by_label(label) - response, status = BeyondApi::Request.get(@session, "/shop/images/search/find-by-label", { label: label }) - - handle_response(response, status) - end - - # - # A +POST+ request is used to upload a shop image. The body of the request must contain the content of the image. - # - # $ curl --data-binary '@/home/epages/sample.png' 'https://api-shop.beyondshop.cloud/api/shop/images?fileName=sample.png&label=invoice logo' -X POST \ - # -H 'Content-Type: image/png' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +shim:c+ - # - # @param image_path [String] the image path - # @param image_name [String] the image name - # @param label [String] the image label - # - # @return true - # - # @example - # session.shop.upload_image("/home/epages/sample.png", "sample.png", "invoice logo") - # - def upload_image(image_path, image_name, label) - content_type = case File.extname(image_path) - when ".png" - "image/png" - when ".jpg", ".jpeg" - "image/jpeg" - when ".gif" - "image/gif" - end - image_binary = File.binread(image_path) - - response, status = BeyondApi::Request.upload(@session, - "/shop/images", - image_binary, - content_type, - { file_name: image_name, label: label }) - - handle_response(response, status, respond_with_true: true) - end - end -end diff --git a/lib/beyond_api/resources/shops/legals.rb b/lib/beyond_api/resources/shops/legals.rb deleted file mode 100644 index e324d87..0000000 --- a/lib/beyond_api/resources/shops/legals.rb +++ /dev/null @@ -1,131 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ShopLegals - # - # A +GET+ request is used to retrieve a specific part of the legal content information. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/legal-content/right-of-withdrawal' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' - # - # @param legal_content_type [String] the legal content type - # - # @return [OpenStruct] - # - # @example - # @legal_content = session.shop.legal_content("right-of-withdrawal") - # - def legal_content(legal_content_type) - response, status = BeyondApi::Request.get(@session, - "/legal-content/#{legal_content_type}") - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the legal content of a shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/legal-content' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' - # - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @legal_content = session.shop.legal_contents(size: 5, page: 1) - # - def legal_contents(params = {}) - response, status = BeyondApi::Request.get(@session, - "/legal-content", - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the details of the legal resource. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/legal' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +legl:r+ - # - # @return [OpenStruct] - # - # @example - # @legal_details = session.shop.legal_details - # - def legal_details - response, status = BeyondApi::Request.get(@session, - "/shop/legal") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update the content of a specific part of the legal content information. Changes on the properties type and mandatory will be ignored. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/legal-content/legal-notice' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "content" : "new legal content" - # }' - # - # @beyond_api.scopes +lcnt:u+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # session.shop.update_legal_content(body) - # - def update_legal_content(body) - response, status = BeyondApi::Request.put(@session, - "/legal-content/legal-notice", - body) - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to update a legal resource partially with json content type. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/shop/legal' -i -X PATCH \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "vatId" : "GB 111111111" - # }' - # - # @beyond_api.scopes +legl:u+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "vat_id" => "GB 111111111" - # } - # - # session.shop.update_legal_details(body) - # - def update_legal_details(body) - response, status = BeyondApi::Request.patch(@session, - "/shop/legal", - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/shops/locations.rb b/lib/beyond_api/resources/shops/locations.rb deleted file mode 100644 index 92e4217..0000000 --- a/lib/beyond_api/resources/shops/locations.rb +++ /dev/null @@ -1,251 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module ShopLocations - # - # A +GET+ request is used to retrieve a list of all locations for the current shop. - # - # $ curl 'https://yourshop.api.urn/shop/locations' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +loca:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @locations = session.shop.locations(size: 100, page: 0) - # - def locations(params = {}) - handle_all_request("/shop/locations", :locations, params) - end - - # - # A +POST+ request is used to create a location. - # - # $ curl 'https://yourshop.api.urn/shop/locations' -i -X POST \ - # -H 'Content-Type: application/json;charset=UTF-8' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "languageCode" : "de", - # "storeCode" : "", - # "locationName" : "HealthyThings", - # "primaryPhone" : "01522 3097093", - # "address" : { - # "locality" : "Hamburg", - # "postalCode" : "20253", - # "regionCode" : "DE", - # "addressLines" : [ "Pilatuspool 2", "ePages GmbH" ] - # }, - # "primaryCategory" : { - # "categoryId" : "gcid:store", - # "displayName" : "Geschaeft" - # }, - # "websiteUrl" : "", - # "regularHours" : { - # "periods" : [ { - # "openDay" : "MONDAY", - # "openTime" : "18:00", - # "closeDay" : "TUESDAY", - # "closeTime" : "03:00" - # }, { - # "openDay" : "WEDNESDAY", - # "openTime" : "17:00", - # "closeDay" : "WEDNESDAY", - # "closeTime" : "23:00" - # } ] - # }, - # "latLng" : { - # "latitude" : 53.5847424, - # "longitude" : 9.968901 - # } - # }' - # - # @beyond_api.scopes +loca:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "languageCode" => "de", - # "storeCode" => "", - # "locationName" => "HealthyThings", - # "primaryPhone" => "01522 3097093", - # "address" => { - # "locality" => "Hamburg", - # "postalCode" => "20253", - # "regionCode" => "DE", - # "addressLines" => [ "Pilatuspool 2", "ePages GmbH" ] - # }, - # "primaryCategory" => { - # "categoryId" => "gcid:store", - # "displayName" => "Geschaeft" - # }, - # "websiteUrl" => "", - # "regularHours" => { - # "periods" => [ { - # "openDay" => "MONDAY", - # "openTime" => "18:00", - # "closeDay" => "TUESDAY", - # "closeTime" => "03:00" - # }, { - # "openDay" => "WEDNESDAY", - # "openTime" => "17:00", - # "closeDay" => "WEDNESDAY", - # "closeTime" => "23:00" - # } ] - # }, - # "latLng" : { - # "latitude" => 53.5847424, - # "longitude" => 9.968901 - # } - # } - # @location = session.shop.create_location(body) - # - def create_location(body) - response, status = BeyondApi::Request.post(@session, "/shop/locations", body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a location. - # - # $ curl 'https://yourshop.api.urn/shop/locations/5bcf7c0a-d130-4cf8-af0c-5e57d4605be0' -i -X DELETE \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +loca:d+ - # - # @param location_id [String] the location UUID - # - # @return true - # - # @example - # session.shop.delete_location("f461fb56-1984-4ade-bd4e-007c273cc923") - # - def delete_location(location_id) - response, status = BeyondApi::Request.delete(@session, "/shop/locations/#{location_id}") - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve a particular location by its id. - # - # $ curl 'https://yourshop.api.urn/shop/locations/09ca2715-cdf7-4af3-8b22-9ecf39d1e202' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +loca:r+ - # - # @param location_id [String] the location UUID - # - # @return [OpenStruct] - # - # @example - # @location = session.shop.location("27a94b71-9b17-4f06-9596-fbbf4d18021f") - # - def location(location_id) - response, status = BeyondApi::Request.get(@session, "/shop/locations/#{location_id}") - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a location. - # - # $ curl 'https://yourshop.api.urn/shop/locations/a7a2acfa-0243-4e52-8b56-81cb781ce61d' -i -X PUT \ - # -H 'Content-Type: application/json;charset=UTF-8' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "languageCode" : "en", - # "storeCode" : "", - # "locationName" : "UnhealthyThings", - # "primaryPhone" : "01234 691997", - # "address" : { - # "locality" : "London", - # "postalCode" : "1", - # "regionCode" : "GB", - # "addressLines" : [ "St. James Square", "ePages Ltd" ] - # }, - # "primaryCategory" : { - # "categoryId" : "gcid:store", - # "displayName" : "Shop" - # }, - # "websiteUrl" : "", - # "regularHours" : { - # "periods" : [ { - # "openDay" : "SATURDAY", - # "openTime" : "06:00", - # "closeDay" : "SATURDAY", - # "closeTime" : "22:00" - # } ] - # }, - # "latLng" : { - # "latitude" : 51.5072, - # "longitude" : -0.1353 - # } - # }' - # - # @beyond_api.scopes +loca:u+ - # - # @param location_id [String] the location UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "languageCode" => "de", - # "storeCode" => "", - # "locationName" => "HealthyThings", - # "primaryPhone" => "01522 3097093", - # "address" => { - # "locality" => "Hamburg", - # "postalCode" => "20253", - # "regionCode" => "DE", - # "addressLines" => [ "Pilatuspool 2", "ePages GmbH" ] - # }, - # "primaryCategory" => { - # "categoryId" => "gcid:store", - # "displayName" => "Geschaeft" - # }, - # "websiteUrl" => "", - # "regularHours" => { - # "periods" => [ { - # "openDay" => "MONDAY", - # "openTime" => "18:00", - # "closeDay" => "TUESDAY", - # "closeTime" => "03:00" - # }, { - # "openDay" => "WEDNESDAY", - # "openTime" => "17:00", - # "closeDay" => "WEDNESDAY", - # "closeTime" => "23:00" - # } ] - # }, - # "latLng" : { - # "latitude" => 53.5847424, - # "longitude" => 9.968901 - # } - # } - # @location = session.shop.update_location("27a94b71-9b17-4f06-9596-fbbf4d18021f", body) - # - def update_location(location_id, body) - response, status = BeyondApi::Request.put(@session, "/shop/locations/#{location_id}", body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/signers.rb b/lib/beyond_api/resources/signers.rb deleted file mode 100644 index 02a92c3..0000000 --- a/lib/beyond_api/resources/signers.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Signers < Base - include BeyondApi::Utils - - # - # A +GET+ request is used to list all signers. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/signers' -i -X GET \ - # H 'Accept: application/hal+json' \ - # H 'Authorization: Bearer ' - # - # @return [OpenStruct] - # - # @example - # @signers = session.signers.all - # - def all - path = "/signers" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a signer. You cannot create more than five signers. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/signers' -i -X POST \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @return [OpenStruct] - # - # @example - # @signer = session.signers.create - # - def create - path = "/signers" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a signer. If at least one signer has been created, you cannot delete the last signer. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/signers/6bb72afd-340e-439a-9990-eef2e0883e1e' -i -X DELETE \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @return [OpenStruct] - # - # @example - # session.signers.delete("6bb72afd-340e-439a-9990-eef2e0883e1e") - # - def delete(signer_id) - path = "/signers/#{signer_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - end -end diff --git a/lib/beyond_api/resources/token.rb b/lib/beyond_api/resources/token.rb deleted file mode 100644 index 75d729a..0000000 --- a/lib/beyond_api/resources/token.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Token - class InvalidSessionError < StandardError; end - - include BeyondApi::Utils - - attr_reader :session - - def initialize(session) - @session = session - - raise InvalidSessionError, "Invalid session" unless session.is_a? BeyondApi::Session - raise InvalidSessionError, "Session api_url cannot be nil" if session.api_url.nil? - end - - def authorization_code(code) - handle_token_call("authorization_code", code: code) - end - - def refresh_token - handle_token_call("refresh_token", refresh_token: @session.refresh_token) - end - - def client_credentials - handle_token_call("client_credentials") - end - - alias refresh refresh_token - alias create authorization_code - - private - - def handle_token_call(grant_type, params = {}) - path = "#{@session.api_url}/oauth/token" - params.merge!(grant_type: grant_type) - - response, status = BeyondApi::Request.token(path, - params) - - handle_response(response, status) - end - - def handle_response(response, status) - if status.between?(200, 299) - @session.access_token = response["access_token"] - @session.refresh_token = response["refresh_token"] - @session - else - handle_error(response, status) - end - end - end -end diff --git a/lib/beyond_api/resources/users.rb b/lib/beyond_api/resources/users.rb deleted file mode 100644 index dd270d9..0000000 --- a/lib/beyond_api/resources/users.rb +++ /dev/null @@ -1,436 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class Users < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to add the roles of a user. - # - # @beyond_api.scopes +user:r+, +user:u+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/ac186856-59c4-4d78-a444-8c47ff623525/roles' -i -X POST \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/roles/4553f87f-d232-4bf6-8e15-34c373661e82' - # - # @param user_id [String] the user UUID - # @param body [Hash] the request body - # - # @return true - # - # @example - # session.users.add_roles(user_id, body) - # - def add_roles(user_id, body) - path = "/users/#{user_id}/roles" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to list all users visible to the current user. This request will not list the support user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:r+ - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @users = session.users.all(size: 100, page: 0) - # - def all(params = {}) - path = "/users" - - handle_all_request(path, :users, params) - end - - # - # A +POST+ request is used to change the password of a user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/e112b1fe-5f67-4e22-a3c7-a1f6d1891b22/change-password' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "currentPassword" : "GoodPassword01!;)", - # "newPassword" : "ValidPassword123" - # }' - # - # @beyond_api.scopes ++ - # - # @param user_id [String] the user UUID - # @param current_password [String] the current password - # @param new_password [String] the new password - # - # @return [OpenStruct] - # - # @example - # session.users.change_password(user_id, current_password, new_password) - # - def change_password(user_id, current_password, new_password) - path = "/users/#{user_id}/change-password" - - response, status = BeyondApi::Request.post(@session, - path, - current_password: current_password, - new_password: new_password) - - handle_response(response, status) - end - - # - # A +POST+ request is used to change the username of a user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/ea0ddc0b-e3fb-47c7-9133-e9f5fc0ec442/change-username' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "currentPassword" : "GoodPassword01!;)", - # "newUsername" : "new username" - # }' - # - # @param user_id [String] the user UUID - # @param new_username [String] the new username - # @param current_password [String] the current password - # - # @return [OpenStruct] - # - # @example - # session.users.change_username(user_id, new_username, current_password) - # - def change_username(user_id, new_username, current_password) - path = "/users/#{user_id}/change-username" - - response, status = BeyondApi::Request.post(@session, - path, - new_username: new_username, - current_password: current_password) - - handle_response(response, status) - end - - # - # A +POST+ request is used to create a user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "username" : "user", - # "password" : "GoodPassword01!;)", - # "email" : "baxter@example.org" - # }' - # - # @beyond_api.scopes +user:c+ - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "username" => "user", - # "password" => "GoodPassword01!;)", - # "email" => "baxter@example.org" - # } - # @user = session.users.create(body) - # - def create(body) - path = "/users" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to enable support access for a shop. If enabled, the customer support will receive specific rights for direct support in the merchant’s cockpit. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/support' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:c+ - # - # @return true - # - # @example - # session.users.enable_support_access - # - def enable_support_access - path = "/users/support" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to disable support access. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/support' -i -X DELETE \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:c+ - # - # @return true - # - # @example - # session.users.disable_support_access - # - def disable_support_access - path = "/users/support" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/e4b528ce-bb9e-4cc5-95e1-7dadfa4cf0f3' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:r+ - # - # @param user_id [String] the user UUID - # - # @return [OpenStruct] - # - # @example - # @user = session.users.find("e4b528ce-bb9e-4cc5-95e1-7dadfa4cf0f3") - # - def find(user_id) - path = "/users/#{user_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to list all roles of a user. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/0d4bd0a5-94dc-498e-b6a6-305c619bb20d/roles' -i -X GET \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:r+ - # - # @param user_id [String] the user UUID - # - # @return [OpenStruct] - # - # @example - # @roles = session.users.roles("0d4bd0a5-94dc-498e-b6a6-305c619bb20d") - # - def roles(user_id) - path = "/users/#{user_id}/roles" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to find a user by username. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/search/find-by-username?username=username' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:r+ - # - # @param username [String] the user username - # - # @return [OpenStruct] - # - # @example - # @user = session.users.search_by_username(username) - # - def search_by_username(username) - path = "/users/search/find-by-username" - - response, status = BeyondApi::Request.get(@session, - path, - username: username) - - handle_response(response, status) - end - - # - # A +POST+ request is used to trigger an email address change. A confirmation email to change the email address will be sent to the user. The confirmation email will contain a link to the email address change page of the merchant’s cockpit. The link includes a JWT to authorize the email address change. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/8f5fd817-0ea1-4550-b4b9-fc437b1b6905/change-email-request?locale=en-US' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "currentPassword" : "GoodPassword01!;)", - # "newEmail" : "newEmail@Gmail.com" - # }' - # - # @beyond_api.scopes ++ - # - # @param user_id [String] the user UUID - # @param new_email [String] the new email address - # @param current_password [String] the current password - # @param locale [String] the email locale - # - # @return true - # - # @example - # session.users.send_email_address_change(user_id, new_email, current_password, locale) - # - def send_email_address_change(user_id, new_email, current_password, locale) - path = "/users/#{user_id}/change-email-request" - - response, status = BeyondApi::Request.post(@session, - path, - { new_email: new_email, current_password: current_password }, - { locale: locale }) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to trigger a password reset email to be sent to a user. The email will contain a link to the change password settings page of the merchant’s cockpit. The link includes a JWT to authorize the password reset. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/reset-password-request?locale=en-US' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -d '{ - # "email" : "customer@host.tld" - # }' - # - # @beyond_api.scopes ++ - # - # @param email [String] the user email - # @param locale [String] the email locale - # - # @return true - # - # @example - # session.users.send_reset_password_email(email, locale) - # - def send_reset_password_email(email, locale) - path = "/users/reset-password-request" - - response, status = BeyondApi::Request.post(@session, - path, - { email: email }, - { locale: locale }) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +PUT+ request is used set the roles of a user. - # - # @beyond_api.scopes +user:u+ - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/cfd08a92-dc96-4947-8142-1b6021177f60/roles' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/roles/165fee2b-f87e-4f33-b036-14b8d96d927a' - # - # @param user_id [String] the user UUID - # @param body [Hash] the request body - # - # @return true - # - # @example - # session.users.set_roles(user_id, body) - # - def set_roles(user_id, body) - path = "/users/#{user_id}/roles" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the status of the support access for a shop, i.e. if the support user is enabled or disabled for the shop. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/support' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +user:r+ - # - # @return [OpenStruct] - # - # @example - # session.users.support_access - # - def support_access - path = "/users/support" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to verify a password against the password guidelines. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/users/verify-password?userRole=merchant' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/json' \ - # -d '{ - # "password" : "ValidPassword!" - # }' - # - # @beyond_api.scopes ++ - # - # @param password [String] the password to verify - # - # @return true - # - # @example - # session.users.verify_password(password) - # - def verify_password(password, user_role) - path = "/users/verify-password" - - response, status = BeyondApi::Request.post(@session, - path, - password: password, - user_role: user_role) - - handle_response(response, status, respond_with_true: true) - end - end -end diff --git a/lib/beyond_api/resources/variations.rb b/lib/beyond_api/resources/variations.rb deleted file mode 100644 index 4746f37..0000000 --- a/lib/beyond_api/resources/variations.rb +++ /dev/null @@ -1,162 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - autoload :VariationImages, "beyond_api/resources/variations/images" - autoload :VariationAvailability, "beyond_api/resources/variations/availability" - - class Variations < Base - include BeyondApi::VariationImages - include BeyondApi::VariationAvailability - include BeyondApi::Utils - - # - # A +GET+ request is used to retrieve the variations of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/dc1b5caf-51ea-4fcd-b1ba-0c5128e91d17/variations' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @variations = session.variations.all("dc1b5caf-51ea-4fcd-b1ba-0c5128e91d17", { size: 100, page: 0 }) - # - def all(product_id, params = {}) - path = "/products/#{product_id}/variations" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the variation of a product. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/5f6e426e-c8d9-48ba-9b37-9a8eb6381373/variations/f6e5bb16-af2e-440f-acd3-a883ad3c1922' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # - # @return [OpenStruct] - # - # @example - # @variation = session.variations.find("5f6e426e-c8d9-48ba-9b37-9a8eb6381373", "f6e5bb16-af2e-440f-acd3-a883ad3c1922") - # - def find(product_id, variation_id) - path = "/products/#{product_id}/variations/#{variation_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +PATCH+ request is used to update a variation partially with json content type. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/7cf4b5b1-b141-4869-96d1-4eaee8bf7563/variations/9f93fdd0-2d21-4ea9-b9d7-e9a53edb091b' -i -X PATCH \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "salesPrice" : { - # "taxModel" : "NET", - # "amount" : 8.7, - # "currency" : "EUR" - # }, - # "listPrice" : { - # "taxModel" : "NET", - # "amount" : 10.95, - # "currency" : "EUR" - # }, - # "manufacturerPrice" : { - # "taxModel" : "NET", - # "amount" : 99.95, - # "currency" : "EUR" - # }, - # "refPrice" : { - # "refQuantity" : 1, - # "unit" : "LITER", - # "quantity" : 0.75, - # "price" : { - # "taxModel" : "NET", - # "amount" : 11.6, - # "currency" : "EUR" - # } - # }, - # "sku" : "my-new-sku", - # "productIdentifiers" : [ { - # "type" : "EAN", - # "value" : "9780134308135" - # } ] - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "sales_price" => { - # "taxModel": "NET", - # "amount": 8.7, - # "currency": "EUR" - # }, - # "list_price" => { - # "taxModel": "NET", - # "amount": 10.95, - # "currency": "EUR" - # }, - # "manufacturer_price" => { - # "taxModel": "NET", - # "amount": 99.95, - # "currency": "EUR" - # }, - # "ref_price" => { - # "refQuantity": 1, - # "unit": "LITER", - # "quantity": 0.75, - # "price": { - # "taxModel": "NET", - # "amount": 11.6, - # "currency": "EUR" - # } - # }, - # "sku" => "my-new-sku", - # "product_identifiers" => [{ - # "type": "EAN", - # "value": "9780134308135" - # }] - # } - # - # @variation = session.variations.update("7cf4b5b1-b141-4869-96d1-4eaee8bf7563", "9f93fdd0-2d21-4ea9-b9d7-e9a53edb091b", body) - # - def update(product_id, variation_id, body) - path = "/products/#{product_id}/variations/#{variation_id}" - - response, status = BeyondApi::Request.patch(@session, - path, - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/variations/availability.rb b/lib/beyond_api/resources/variations/availability.rb deleted file mode 100644 index fe7871d..0000000 --- a/lib/beyond_api/resources/variations/availability.rb +++ /dev/null @@ -1,117 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module VariationAvailability - # - # A +POST+ request is used to adjust the available stock of a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/9171c3ed-0b53-43ef-8fed-c081f55560f4/variations/a6d8275f-66cd-4cd7-8623-2d005f1ab7fc/availability/adjust-available-stock' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ "relativeAmount" : -1 }' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the product variation UUID - # @param relative_amount [Integer] the relative amount - # - # @return [OpenStruct] - # - # @example - # @availability = session.variations.adjust_stock_level(product_id, variation_id, { relativeAmount => -1 }) - # - def adjust_stock_level(product_id, variation_id, relative_amount) - path = "/products/#{product_id}/variations/#{variation_id}/availability/adjust-available-stock" - - response, status = BeyondApi::Request.post(@session, - path, - relative_amount: relative_amount) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the availability of a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/7fdc9424-1ddd-4fba-a59d-3d5de08d89d1/variations/13b28149-975a-4f47-ad54-bdc4ca4a07ec/availability' -i -X GET \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:r+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the product variation UUID - # - # @return [OpenStruct] - # - # @example - # @availability = session.variations.availability("fb22d408-00dc-47e3-ae58-e35769bdb428", "13b28149-975a-4f47-ad54-bdc4ca4a07ec") - # - def availability(product_id, variation_id) - path = "/products/#{product_id}/variations/#{variation_id}/availability" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to enable purchasability for a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/131400c9-54f1-4510-a0c4-2c7e34c57336/variations/cec06f66-5a80-4638-a74c-c916e1173c21/availability/enable-purchasability' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the product variation UUID - # - # @return [OpenStruct] - # - # @example - # @availability = session.variations.enable_purchaability("1e3a92b-6f3b-4415-bd8f-c9c8921a5a73", "13b28149-975a-4f47-ad54-bdc4ca4a07ec") - # - def enable_purchasability(product_id, variation_id) - path = "/products/#{product_id}/variations/#{variation_id}/availability/enable-purchasability" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status) - end - - # - # A +POST+ request is used to disable purchasability for a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/f3b9d880-b73e-45a4-b04c-e03acae4fcdd/variations/40337e9c-a187-4bb6-9a0d-c8d66386cb8d/availability/disable-purchasability' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prda:u+ - # - # @param product_id [String] the product UUID - # - # @return true - # - # @example - # @availability = session.variations.disable_purchasability("17e3a92b-6f3b-4415-bd8f-c9c8921a5a73", "13b28149-975a-4f47-ad54-bdc4ca4a07ec") - # - def disable_purchasability(product_id, variation_id) - path = "/products/#{product_id}/variations/#{variation_id}/availability/disable-purchasability" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/variations/images.rb b/lib/beyond_api/resources/variations/images.rb deleted file mode 100644 index 82a7801..0000000 --- a/lib/beyond_api/resources/variations/images.rb +++ /dev/null @@ -1,234 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - module VariationImages - # - # A +POST+ request is used to create an image and add it to a variation. The URL of the image will be assigned to the variation. The image URL has to be provided in body of the request. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/a08ca814-52e9-4e00-82a2-3e9b012e5f9d/variations/4b58cdb7-4d3d-419a-ae27-8469f8b04276/images' -i -X POST \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "dataUri" : "photostore-2.JPG?hash=8a627f655c68f56dfbbf217ab7d5563281225998", - # "width" : 100, - # "height" : 200 - # }' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "data_uri" => "photostore-2.JPG?hash=8a627f655c68f56dfbbf217ab7d5563281225998", - # "width" => 100, - # "height" => 200 - # } - # @image = session.variations.add_image("a08ca814-52e9-4e00-82a2-3e9b012e5f9d", "4b58cdb7-4d3d-419a-ae27-8469f8b04276", body) - # - def add_image(product_id, variation_id, body) - path = "/products/#{product_id}/variations/#{variation_id}/images" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +DELETE+ request is used to delete a variation image - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/8f5736f8-0a5f-4c08-bbac-3c524e2a6294/variations/86f3047c-ff29-4906-83c1-93e24ef88f3e/images/193d2ba4-3cf0-4326-a655-ef46e8a97c6a' -i -X DELETE \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param image_id [String] the image UUID - # - # @return [true] - # - # @example - # session.variations.delete_image("8f5736f8-0a5f-4c08-bbac-3c524e2a6294", "86f3047c-ff29-4906-83c1-93e24ef88f3e", "193d2ba4-3cf0-4326-a655-ef46e8a97c6a") - # - def delete_image(product_id, variation_id, image_id) - path = "/products/#{product_id}/variations/#{variation_id}/images/#{image_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve a single image of a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/8665fc36-003e-4120-8a74-a9d6449644ae/variations/9163db42-92e7-418c-a3d8-651e7aaca569/images/86fc2691-5dfb-47e1-aae7-4bc2f658a80b' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param image_id [String] the image UUID - # - # @return [OpenStruct] - # - # @example - # @image = session.variations.image("8665fc36-003e-4120-8a74-a9d6449644ae", "a9163db42-92e7-418c-a3d8-651e7aaca569", "86fc2691-5dfb-47e1-aae7-4bc2f658a80b") - # - def image(product_id, image_id) - path = "/products/#{product_id}/variations/#{variation_id}/images/#{image_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +GET+ request is used to retrieve the images of a variation. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/b4948e53-05af-4e0b-8877-28bc8811f73e/variations/50c5bf45-5dd6-4bae-babf-813c7cdca488/images' -i -X GET \ - # -H 'Content-Type: application/hal+json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:r+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @images = session.variations.images("b4948e53-05af-4e0b-8877-28bc8811f73e", "50c5bf45-5dd6-4bae-babf-813c7cdca488", size: 100, page: 0) - # - def images(product_id, variation_id, params = {}) - path = "/products/#{product_id}/variations/#{variation_id}/images" - - response, status = BeyondApi::Request.get(@session, - path, - params) - - handle_response(response, status) - end - - # A +PUT+ request is used to sort the variation images. This is done by passing the self-links of the images to the desired variation. The request must contain URIs for all images of the given page. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/8a8a7002-f864-4011-9991-d6ffb1bd1085/variations/60c2c2a5-ece0-4d04-b90d-f38ee710961c/images' -i -X PUT \ - # -H 'Content-Type: text/uri-list' \ - # -H 'Authorization: Bearer ' \ - # -d 'https://api-shop.beyondshop.cloud/api/products/8a8a7002-f864-4011-9991-d6ffb1bd1085/variations/60c2c2a5-ece0-4d04-b90d-f38ee710961c/images/a12cae49-3efb-4874-989e-37df6981a4db - # https://api-shop.beyondshop.cloud/api/products/8a8a7002-f864-4011-9991-d6ffb1bd1085/variations/60c2c2a5-ece0-4d04-b90d-f38ee710961c/images/4f562165-968c-42fd-a245-1dcc045f8151 - # https://api-shop.beyondshop.cloud/api/products/8a8a7002-f864-4011-9991-d6ffb1bd1085/variations/60c2c2a5-ece0-4d04-b90d-f38ee710961c/images/93cd0802-15db-4772-b524-e1c4c6c27b77' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param images [Array] the image UUIDS - # - # @return true - # - # @example - # body = [ - # "c9082802-a0d0-416e-9039-02fa465a027e", - # "78e9993d-8db3-45d8-8f76-6b8f2aea9c45", - # "9233ee97-5dbb-4c00-a7b2-e1512c69a938" - # ] - # session.variations.sort_images("3f4b2b56-c22d-4d80-b4ed-d5b33ed161eb", body) - # - def sort_images(product_id, variation_id, image_ids) - body = image_ids.map { |image_id| "#{@session.api_url}/products/#{product_id}/variations/#{variation_id}/images/#{image_id}" } - response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/variations/#{variation_id}/images", body.join("\n"), {}, 'text/uri-list') - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to upload an image to the image storage and assign the URL of the image to the variation. The body of the request must contain the content of the image. - # - # $ curl --data-binary '@/home/epages/file.png' 'https://api-shop.beyondshop.cloud/api/products/4125b993-49fc-47c8-b9b3-76d8871e4e06/variations/d7fecf94-2e57-4122-8c94-a0acd840c111/images?fileName=file.png' -X POST \ - # -H 'Content-Type: image/png' \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param images_path [Array] the images path - # @param images_name [Array] the images name - # - # @return [OpenStruct] - # - # @example - # body = { - # "type" => "VIMEO", - # "source" => "https://vimeo.com/7265982" - # } - # - # session.variations.upload_image("4125b993-49fc-47c8-b9b3-76d8871e4e06", "d7fecf94-2e57-4122-8c94-a0acd840c111", "/home/epages/file.png", "file.png") - # - def upload_image(product_id, variation_id, image_path, image_name) - content_type = file_content_type(image_path) - path = "/products/#{product_id}/variations/#{variation_id}/images" - - image_binary = File.binread(image_path) - - response, status = BeyondApi::Request.upload(@session, - path, - image_binary, - content_type, - { file_name: image_name }) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +POST+ request is used to upload up to 10 images to the image storage and assign the URL of the images to up to 30 variations. The body of the request must contain the content of the images. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/products/4125b993-49fc-47c8-b9b3-76d8871e4e06/variations/images?fileName=file.png&fileName=file2.png&variation=ca53ae26-e7c6-44a4-8070-9fca08cc87ed&variation=ab63fa3a-c2ac-4074-aaa3-b547217b042d' -i -X POST \ - # -H 'Content-Type: multipart/form-data' \ - # -H 'Authorization: Bearer ' \ - # -F 'image=@/home/epages/file.png' \ - # -F 'image=@/home/epages/file2.png' - # - # @beyond_api.scopes +prod:u+ - # - # @param product_id [String] the product UUID - # @param variation_id [String] the variation UUID - # @param images_path [String] the image path - # @param images_name [String] the image name - # - # @return [OpenStruct] - # - # @example - # session.variations.upload_multiple_images("4125b993-49fc-47c8-b9b3-76d8871e4e06", "d7fecf94-2e57-4122-8c94-a0acd840c111", - # ["/home/epages/file.png", "/home/epages/file2.png"], ["file.png", "file2.png"]) - # - def upload_multiple_images(product_id, variation_id, images_path, images_name) - response, status = BeyondApi::Request.upload_by_form(@session, - "/products/#{product_id}/variations/#{variation_id}/images", - images_path, - file_name: images_name.map { |e| URI.encode_www_form([e]) }) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/resources/webhook_subscriptions.rb b/lib/beyond_api/resources/webhook_subscriptions.rb deleted file mode 100644 index eaea331..0000000 --- a/lib/beyond_api/resources/webhook_subscriptions.rb +++ /dev/null @@ -1,197 +0,0 @@ -# frozen_string_literal: true - -require "beyond_api/utils" - -module BeyondApi - class WebhookSubscriptions < Base - include BeyondApi::Utils - - # - # A +POST+ request is used to activate a webhook subscription. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions/268a8629-55cd-4890-9013-936b9b5ea14c/activate' -i -X POST \ - # -H 'Authorization: Bearer ' - # - # @beyond_api.scopes +ordr:r+, +prod:r+ - # - # @param webhook_subscription_id [String] the webhook subscription UUID - # - # @return true - # - # @example Ruby example request - # session.webhook_subscriptions.activate("268a8629-55cd-4890-9013-936b9b5ea14c") - # - def activate(webhook_subscription_id) - path = "/webhook-subscriptions/#{webhook_subscription_id}/activate" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to list all of the webhook subscriptions in a paged way. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @option params [Boolean] :paginated - # @option params [Integer] :size the page size - # @option params [Integer] :page the page number - # - # @return [OpenStruct] - # - # @example - # @webhook_subscriptions = session.webhook_subscriptions.all(size: 100, page: 0) - # - def all(params = {}) - path = "/webhook-subscriptions" - - handle_all_request(path, :webhook_subscriptions, params) - end - - # - # A +POST+ request is used to create a webhook subscription. - # - # The scopes needed for the operation depend on the event types you register for. e.g. Order events require the scope +orde:r+. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions' -i -X POST \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "callbackUri":"http://example.com/test", - # "eventTypes": ["order.created", "product.created"] - # }' - # - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "callback_uri" => "http://example.com/test", - # "event_types" => ["order.created", "product.created"] - # } - # - # @webhook_subscription = session.webhook_subscriptions.create(body) - # - def create(body) - path = "/webhook-subscriptions" - - response, status = BeyondApi::Request.post(@session, - path, - body) - - handle_response(response, status) - end - - # - # A +POST+ request is used to deactivate a webhook subscription. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions/a597cea4-b688-4164-8c56-b6568ea4d5aa/deactivate' -i -X POST \ - # -H 'Authorization: Bearer ' - # - # @param webhook_subscription_id [String] the webhook subscription UUID - # - # @return true - # - # @example - # session.webhook_subscriptions.deactivate("a597cea4-b688-4164-8c56-b6568ea4d5aa") - # - def deactivate(webhook_subscription_id) - path = "/webhook-subscriptions/#{webhook_subscription_id}/deactivate" - - response, status = BeyondApi::Request.post(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +DELETE+ request is used to delete a webhook subscription. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions/c6076a5a-a8ad-443f-b20b-8a1b268b069e' -i -X DELETE \ - # -H 'Authorization: Bearer ' - # - # @param webhook_subscription_id [String] the webhook subscription UUID - # - # @return true - # - # @example - # session.webhook_subscriptions.delete("c6076a5a-a8ad-443f-b20b-8a1b268b069e") - # - def delete(webhook_subscription_id) - path = "/webhook-subscriptions/#{webhook_subscription_id}" - - response, status = BeyondApi::Request.delete(@session, - path) - - handle_response(response, status, respond_with_true: true) - end - - # - # A +GET+ request is used to retrieve the details of a webook subscription. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions/3d44ec71-768c-4927-9069-a96a5153e87c' -i -X GET \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' - # - # @param webhook_subscription_id [String] the webhook subscription UUID - # - # @return [OpenStruct] - # - # @example - # @webhook_subscription = session.webhook_subscriptions.find("3d44ec71-768c-4927-9069-a96a5153e87c") - # - def find(webhook_subscription_id) - path = "/webhook-subscriptions/#{webhook_subscription_id}" - - response, status = BeyondApi::Request.get(@session, - path) - - handle_response(response, status) - end - - # - # A +PUT+ request is used to update a subscription. - # - # The scopes needed for the operation depend on the event types you register for. e.g. Order events require the scope +orde:r+. - # - # $ curl 'https://api-shop.beyondshop.cloud/api/webhook-subscriptions/6f3bc033-c2d1-4f44-80e3-1b668f6bd699' -i -X PUT \ - # -H 'Content-Type: application/json' \ - # -H 'Accept: application/hal+json' \ - # -H 'Authorization: Bearer ' \ - # -d '{ - # "callbackUri":"http://example.com/test/updated", - # "eventTypes": ["product.updated"] - # }' - # - # @beyond_api.scopes +ordr:r+, +prod:r+ - # - # @param webhook_subscription_id [String] the webhook subscription UUID - # @param body [Hash] the request body - # - # @return [OpenStruct] - # - # @example - # body = { - # "callback_uri" => "http://example.com/test/updated", - # "event_types" => ["product.updated"] - # } - # - # @webhook_subscription = session.webhook_subscriptions.update("6f3bc033-c2d1-4f44-80e3-1b668f6bd699", body) - # - def update(webhook_subscription_id, body) - path = "/webhook-subscriptions/#{webhook_subscription_id}" - - response, status = BeyondApi::Request.put(@session, - path, - body) - - handle_response(response, status) - end - end -end diff --git a/lib/beyond_api/response.rb b/lib/beyond_api/response.rb new file mode 100644 index 0000000..5d8683e --- /dev/null +++ b/lib/beyond_api/response.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module BeyondApi + class Response + extend Forwardable + + def_delegators :@response, :success?, :body, :status + + def initialize(response) + @response = response + end + + def parse + success? ? parsed_response : raise_error + end + + private + + def parsed_response + return {} if body.blank? + + body.deep_transform_keys! do |key| + key = remove_initial_underscore(key) + key = snake_case_key(key) + key.to_sym + end + end + + def remove_initial_underscore(key) + key.to_s.starts_with?('_') ? key[1..] : key + end + + def snake_case_key(key) + key.to_s.underscore + end + + def raise_error + raise Error, parsed_response + end + end +end diff --git a/lib/beyond_api/services/authentication/email_address.rb b/lib/beyond_api/services/authentication/email_address.rb new file mode 100644 index 0000000..d55d6e2 --- /dev/null +++ b/lib/beyond_api/services/authentication/email_address.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module BeyondApi + module Authentication + # @example How to instantiate a client + # @client = BeyondApi::Authentication::EmailAddress.new( + # api_url: 'https://example.com/api', + # access_token: 'your_token' + # ) + class EmailAddress < BaseService + # Trigger an email address change + # + # @see https://developer.epages.com/beyond-docs/#trigger_email_address_change + # + # @option params [Integer] :user_id + # @option params [String] :locale defines the language of the confirmation email is to be sent. + # @option params [String] :current_password the current password of the user account. + # @option params [String] :new_email the new email address for the user to set. + # + # @example + # @client.trigger_change( + # "9ed8418f-d568-4327-9f20-ec1d00614398", + # "en-US", + # "GoodPassword01!;)", + # "new.email@epages.com" + # ) + def trigger_change(user_id, locale, current_password, new_email) + post( + "users/#{user_id}/change-email-request", + { current_password:, new_email: }, # body + locale # query params + ) + end + end + end +end diff --git a/lib/beyond_api/services/authentication/signer.rb b/lib/beyond_api/services/authentication/signer.rb new file mode 100644 index 0000000..21d00eb --- /dev/null +++ b/lib/beyond_api/services/authentication/signer.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module BeyondApi + module Authentication + # @example How to instantiate a client + # @client = BeyondApi::Authentication::Signer.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Signer < BaseService + # List all signers. + # + # @see https://developer.epages.com/beyond-docs/#list_signers + # + # @return [Hash] + # + # @example + # @client.all + def all + get('signers') + end + + # Create a signer. + # + # @see https://developer.epages.com/beyond-docs/#create_signer + # + # @return [Hash] + # + # @example + # @client.create + def create + post('signers') + end + + # Delete a signer. If at least one signer has been created, you cannot delete the last signer. + # + # @see https://developer.epages.com/beyond-docs/#delete_signer + # + # @return [Hash] + # + # @example + # @client.delete('aa859c3c-702c-4310-9b23-638fbc468f33') + def delete(id) + super("signers/#{id}") # Concerns::Connection delete method + end + end + end +end diff --git a/lib/beyond_api/services/authentication/token.rb b/lib/beyond_api/services/authentication/token.rb new file mode 100644 index 0000000..222d84d --- /dev/null +++ b/lib/beyond_api/services/authentication/token.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module BeyondApi + module Authentication + # @example How to instantiate a client + # @client = BeyondApi::Authentication::Token.new(api_url: 'https://example.com/api') + class Token < BaseService + def initialize(**params) + super + @authorization = :basic + @camelize_keys = false + end + + # Create a JsonWebToken from a refresh token. + # + # @see https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_refresh_token + # + # @return [Hash] + # + # @example + # @client.refresh_token('your_refresh_token') + def refresh(refresh_token) + post('oauth/token', {}, { grant_type: 'refresh_token', refresh_token: }) + end + + # Create a JsonWebToken from a refresh token. + # + # @see https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_refresh_token + # + # @return [Hash] + # + # @example + # @client.get('GY_GTp') + def get(code) + post('oauth/token', {}, { grant_type: 'authorization_code', code: }) + end + + # Create a a JsonWebToken using the client_credentials grant type. + # + # @see https://developer.epages.com/beyond-docs/#create_a_jsonwebtoken_from_client_credentials + # + # @return [Hash] + # + # @example + # @client.client_credentials + def client_credentials + post('oauth/token', {}, { grant_type: 'client_credentials' }) + end + end + end +end diff --git a/lib/beyond_api/services/authentication/user_and_password.rb b/lib/beyond_api/services/authentication/user_and_password.rb new file mode 100644 index 0000000..46e141f --- /dev/null +++ b/lib/beyond_api/services/authentication/user_and_password.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module BeyondApi + module Authentication + # @example How to instantiate a client + # @client = BeyondApi::Authentication::UserAndPassword.new( + # api_url: 'https://example.com/api', + # access_token: 'your_token' + # ) + class UserAndPassword < BaseService + # Verify a password against the password guidelines. + # + # @see https://developer.epages.com/beyond-docs/#verify_password + # + # @option params [Integer] :user_role the type of user. Can be one of merchant, support, or customer. + # @option params [String] :password the password that needs to be verified. + # + # @example + # @client.verify_password( + # "merchant", + # "ValidPassword!" + # ) + def verify_password(user_role, password) + post( + 'users/verify-password', + { password: }, # body + user_role # query params + ) + end + + # Trigger an email address change + # + # @see https://developer.epages.com/beyond-docs/#change_password + # + # @option params [Integer] :user_id + # @option params [String] :current_password the current password of the user. This is verified before the password change. + # @option params [String] :new_password the new password to set in order to change the password. + # + # @example + # @client.change_password( + # "9ed8418f-d568-4327-9f20-ec1d00614398", + # "GoodPassword01!;)", + # "ValidPassword123" + # ) + def change_password(user_id, current_password, new_password) + post( + "users/#{user_id}/change-password", + { current_password:, new_password: } # body + ) + end + + # Trigger an email address change + # + # @see https://developer.epages.com/beyond-docs/#trigger_password_reset_email + # + # @option params [String] :email the email address of the user account. + # + # @example + # @client.password_reset_email( + # "baxter@example.org" + # ) + def password_reset_email(email) + post( + 'users/reset-password-request', + { email: } # body + ) + end + + # Change the username of a user. + # + # @see https://developer.epages.com/beyond-docs/#change_username + # + # @option params [Integer] :user_id the email address of the user account. + # @option params [String] :current_password The current password of the user. This is verified before the username change. + # @option params [String] :new_username The new username to set in order to change the username. + # + # @example + # @client.change_username( + # "9ed8418f-d568-4327-9f20-ec1d00614398", + # "ValidPassword123", + # "baxter2@example.org" + # ) + def change_username(user_id, current_password, new_username) + post( + "users/#{user_id}/change-username", + { current_password:, new_username: }, # body + user_role # query params + ) + end + end + end +end diff --git a/lib/beyond_api/services/base_service.rb b/lib/beyond_api/services/base_service.rb new file mode 100644 index 0000000..7fb4c53 --- /dev/null +++ b/lib/beyond_api/services/base_service.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module BeyondApi + class BaseService + include Concerns::Connection # @session, @authorization + include Concerns::Pagination + + ServiceSession = Struct.new(:api_url, :access_token, :refresh_token) + + def initialize(**params) + @session = initialize_session(params) + @authorization = :bearer + @camelize_keys = true + end + + private + + def initialize_session(session) + ServiceSession.new( + session[:api_url], + session[:access_token], + session[:refresh_token] + ) + end + end +end diff --git a/lib/beyond_api/services/checkout/cart.rb b/lib/beyond_api/services/checkout/cart.rb new file mode 100644 index 0000000..16e87e9 --- /dev/null +++ b/lib/beyond_api/services/checkout/cart.rb @@ -0,0 +1,476 @@ +# frozen_string_literal: true + +module BeyondApi + module Checkout + # @example How to instantiate a client + # @client = BeyondApi::Checkout::Cart.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Cart < BaseService + # Create a cart. + # + # @see https://developer.epages.com/beyond-docs/#create_cart + # + # @return [Hash] + # + # @example + # @client.create + def create + post('carts') + end + + # Retrieve the details of a cart. + # + # @see https://developer.epages.com/beyond-docs/#show_cart_details + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.find('1b9ab4a0-c1c4-4373-b35d-ee36e004e860') + def find(id) + get("carts/#{id}") + end + + # Remove a cart. + # + # @see https://developer.epages.com/beyond-docs/#delete_cart + # + # @param id [String] the cart UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('c4368b98-d291-45b9-815c-eb5e835ea07d') + def delete(id) + super("carts/#{id}") + end + + # Create order from cart. + # + # @see https://developer.epages.com/beyond-docs/#create_order_from_cart + # + # @param id [String] the cart UUID + # @param body [Hash] the order data + # + # @return [Hash] + # + # @example + # body = { + # customer_comment: 'Please send with UPS.', + # sales_channel: 'Storefront', + # marketing_channel: 'Google Shopping', + # marketing_subchannel: 'Summer Sale', + # test_order: false, + # terms_and_conditions_explicitly_accepted: true + # } + # @client.create_order_from('bbfe107a-4583-44b0-afc8-f09e7c679996') + def create_order_from(id, body) + post("carts/#{id}/order", body) + end + + # Add a line item to the cart. Currently only product line items are supported. + # + # @see https://developer.epages.com/beyond-docs/#add_single_line_item_to_cart + # + # @param id [String] the cart UUID + # @param body [Hash] the order data + # @param body [Hash] the line item data + # + # @return [Hash] + # + # @example + # body = { + # _type: "PRODUCT", + # _ref: "068a0635-7a4a-435b-82d4-479112319b22", + # quantity: 1, + # custom_text: "John Doe" + # } + # @client.add_line_item('98db82a0-d5b8-458d-95d1-6f6cd7467320', body) + def add_line_item(id, body) + post("carts/#{id}/line-items", body) + end + + # Replace only one item in the cart. + # + # @see https://developer.epages.com/beyond-docs/#replace_single_line_item + # + # @param cart_id [String] the cart UUID + # @param line_item_id [String] the line item UUID + # @param body [Hash] the line item data + # + # @return [Hash] + # + # @example + # body = { + # _type: "PRODUCT", + # _ref: "61aeebfb-68c7-4bab-a460-64234f48c99b", + # quantity: 2 + # } + # @client.replace_line_item('a64545e4-b06e-4067-aa6a-5aa1124990fa', + # '86c72e9b-1db2-4ce0-966f-67ecbca71a7d', body) + def replace_line_item(cart_id, line_item_id, body) + put("carts/#{cart_id}/line-items/#{line_item_id}", body) + end + + # Delete a line item from the cart. + # + # @see https://developer.epages.com/beyond-docs/#delete_line_item + # + # @param cart_id [String] the cart UUID + # @param line_item_id [String] the line item UUID + # + # @return [Hash] + # + # @example + # @client.delete_line_item('7c109d12-6598-4150-810c-24006e8e6780', + # 'fb459c80-b745-46f6-83ae-f533236c9f26') + def delete_line_item(cart_id, line_item_id) + super("carts/#{cart_id}/line-items/#{line_item_id}") + end + + # Set the billing address of the cart. The billing address is mandatory for a cart being ready to order. + # + # @see https://developer.epages.com/beyond-docs/#set_cart_billing_address + # + # @param cart_id [String] the cart UUID + # @param body [Hash] the billing address data + # + # @return [Hash] + # + # @example + # body = { + # customer_data = { + # salutation: 'Mrs', + # gender: 'FEMALE', + # title: 'Dr', + # first_name: 'Astrid', + # middle_name: 'Agnes', + # last_name: 'Alster', + # street: 'Alsterwasserweg', + # house_number: '2', + # street2: 'Erdgeschoss', + # door_code: '0185', + # address_extension: 'Hinterhof', + # postal_code: '20999', + # dependent_locality: 'Seevetal', + # city: 'Alsterwasser', + # country: 'DE', + # state: 'Hamburg', + # email: 'a.alsterh@example.com', + # phone: '(800) 555-0102', + # mobile: '(800) 555-0103', + # vat_id: '123456789', + # tax_number: '123-34-6789', + # birth_date: '1985-03-20' + # } + # @client.billing_address('f1209f49-e225-4840-8897-2cf0d59268ef', body) + def billing_address(cart_id, body) + put("carts/#{cart_id}/billing-address", body) + end + + # Set the shipping address of the cart. If no shipping address is set and no pickup line item is available, it will default to the billing address. + # + # @see https://developer.epages.com/beyond-docs/#set_cart_shipping_address + # + # @param cart_id [String] the cart UUID + # @param body [Hash] the shipping address data + # + # @return [Hash] + # + # @example + # body = { + # customer_data = { + # salutation: 'Mrs', + # gender: 'FEMALE', + # title: 'Dr', + # first_name: 'Astrid', + # middle_name: 'Agnes', + # last_name: 'Alster', + # street: 'Alsterwasserweg', + # house_number: '2', + # street2: 'Erdgeschoss', + # door_code: '0185', + # address_extension: 'Hinterhof', + # postal_code: '20999', + # dependent_locality: 'Seevetal', + # city: 'Alsterwasser', + # country: 'DE', + # state: 'Hamburg', + # email: 'a.alsterh@example.com', + # phone: '(800) 555-0102', + # mobile: '(800) 555-0103', + # vat_id: '123456789', + # tax_number: '123-34-6789', + # birth_date: '1985-03-20' + # } + # @client.shipping_address('f1209f49-e225-4840-8897-2cf0d59268ef', body) + def shipping_address(cart_id, body) + put("carts/#{cart_id}/shipping-address", body) + end + + # Remove the shipping address of the cart. After deletion, the shipping address will default to the billing address. + # + # @see https://developer.epages.com/beyond-docs/#remove_cart_shipping_address + # + # @param id [String] the cart UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete_shipping_address('4aef7525-0742-4a0d-9285-dee00693fd1a') + def delete_shipping_address(id) + super("carts/#{id}/shipping-address") + end + + # List all applicable payment methods for the current cart. + # + # @see https://developer.epages.com/beyond-docs/#list_applicable_payment_methods_for_current_cart + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.payment_methods('e4ab6de8-9877-4552-9c6b-0544ee769f6f') + def payment_methods(id) + get("carts/#{id}/payment-methods") + end + + # Set the current payment method of a cart. + # + # @see https://developer.epages.com/beyond-docs/#set_current_cart_payment_method + # + # @param cart_id [String] the cart UUID + # @param payment_method_id [Array] the payment method id + # + # @return [Hash] + # + # @example + # @client.assign_current_payment_method('f5945d59-9d0e-4ecc-818a-6cdbfd772ae2', + # '5f9c32c4-8598-4510-a468-33d156a3570f') + def assign_current_payment_method(cart_id, payment_method_id) + body = "#{@session.api_url}/payment-methods/#{payment_method_id}" + put("carts/#{cart_id}/payment-methods/current", body) + end + + # Set the cart payment method to the current default payment method. + # + # @see https://developer.epages.com/beyond-docs/#set_cart_payment_method_to_current_default + # + # @param cart_id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.assign_payment_method_to_default('ce1f18a0-bae9-4807-bf12-964d2ad02c1c') + def assign_payment_method_to_default(cart_id) + put("carts/#{cart_id}/payment-methods/default") + end + + # Retrieve the details of the current payment method of a cart. + # + # @see https://developer.epages.com/beyond-docs/#show_current_cart_payment_method_details + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.payment_method('be513bae-f515-4ec4-a430-ee070f398f56') + def payment_method(id) + get("carts/#{id}/payment-methods/current") + end + + # Initiate the creation of a payment. + # + # @see https://developer.epages.com/beyond-docs/#create_payment + # + # @param id [String] the cart UUID + # @param body [Hash] the payment data + # + # @return [Hash] + # + # @example + # body = { + # return_uri: 'https://example.com/return', + # cancel_uri: 'https://example.com/cancel', + # } + # @client.create_payment('0fd2455e-f9a0-4180-b26a-032837c13ab1', body) + def create_payment(id, body) + post("carts/#{id}/create-payment", body) + end + + # Initiate the creation of a payment and order for the cart. + # + # @see https://developer.epages.com/beyond-docs/#create_payment_and_order + # + # @param id [String] the cart UUID + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # body = { + # return_uri: 'https://example.com/return', + # cancel_uri: 'https://example.com/cancel', + # customer_comment: 'Please send with UPS.', + # sales_channel: 'Storefront', + # marketing_channel: 'Google Shopping', + # marketing_subchannel: 'Summer Sale', + # test_order: false, + # terms_and_conditions_explicitly_accepted: true + # } + # @client.create_payment('0fd2455e-f9a0-4180-b26a-032837c13ab1', body) + def create_payment_and_order(id, body) + post("carts/#{id}/create-payment", body) + end + + # Set the current shipping method of the cart. + # + # @see https://developer.epages.com/beyond-docs/#set_current_cart_shipping_method + # + # @param cart_id [String] the cart UUID + # @param shipping_zone_id [String] the shipping zone UUID + # @param shipping_method_id [String] the shipping method UUID + # + # @return [Hash] + # + # @example + # @client.assign_current_shipping_method('d806c45a-c799-493a-8d91-57c51e6adc2c' + # 'bd5be855-24d9-4f38-9469-4089c0083c87', + # 'a12e4246-0b72-4ac4-943d-79ab792965dd') + def assign_current_shipping_method(cart_id, shipping_zone_id, shipping_method_id) + body = "#{@session.api_url}/shipping-zones/#{shipping_zone_id}/shipping-methods/#{shipping_method_id}" + put("carts/#{cart_id}/shipping-methods", body) + end + + # Set the cart shipping method to the current default shipping method. + # + # @see https://developer.epages.com/beyond-docs/#set_cart_shipping_method_to_current_default + # + # @param cart_id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.assign_shipping_method_to_default('0295ce92-9604-46b7-a995-608f9c966753') + def assign_shipping_method_to_default(cart_id) + put("carts/#{cart_id}/payment-methods/default") + end + + # Retrieve the details of the current shipping method of a cart. + # + # @see https://developer.epages.com/beyond-docs/#show_current_cart_shipping_method_details + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.shipping_method('fd54acab-bc23-4d81-bef2-77c8f3150a3b') + def shipping_method(id) + get("carts/#{id}/shipping-methods/current") + end + + # List all countries that are assigned to at least one shipping zone of the shop. Orders can only be shipped to such servicable countries. + # + # @see https://developer.epages.com/beyond-docs/#find_serviceable_countries + # + # @return [Hash] + # + # @example + # @client.serviceable_countries + def serviceable_countries + get('shipping-zones/search/find-all-serviceable-countries') + end + + # List all applicable pickup options for the current cart. + # + # @see https://developer.epages.com/beyond-docs/#list_applicable_pickup_options_for_current_cart + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.pickup_options('00954827-a00a-444e-beba-26ea3ffaf4db') + def pickup_options(id) + get("carts/#{id}/pickup-options") + end + + # Set the current pickup option of the cart. + # + # @see https://developer.epages.com/beyond-docs/#set_current_cart_pickup_option + # + # @param cart_id [String] the cart UUID + # @param pickup_option_id [String] the pickup option UUID + # + # @return [Hash] + # + # @example + # @client.assign_current_pickup_option('6d16f50b-a0f9-4797-b524-77ade8d2c14b', + # '7bb761bf-5bab-4baa-8e9d-0c86491e0850') + def assign_current_pickup_option(cart_id, pickup_option_id) + body = "#{@session.api_url}/pickup-options/#{pickup_option_id}" + put("carts/#{cart_id}/pickup-options/current", body) + end + + # Retrieve the details of the current pickup option of a cart. + # + # @see https://developer.epages.com/beyond-docs/#show_current_cart_pickup_option_details + # + # @param id [String] the cart UUID + # + # @return [Hash] + # + # @example + # @client.current_pickup_option('53e4e9d3-54d2-4eb8-ba6c-346d665d71ae') + def pickup_option(id) + get("carts/#{id}/pickup-options/current") + end + + # Remove the current pickup option from the cart. + # + # @see https://developer.epages.com/beyond-docs/#remove_current_cart_pickup_option + # + # @param id [String] the cart UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('c6d3a1e8-db98-412a-a4ca-0489d0e210f5') + def delete_current_pickup_option(id) + super("carts/#{id}/pickup-options/current") + end + + # Redeem a coupon. + # + # @see https://developer.epages.com/beyond-docs/#redeem_coupon + # + # @param id [String] the cart UUID + # @param coupon_code [String] the coupon codee + # + # @return [Hash] + # + # @example + # @client.redeem_coupon('5667fb86-69ec-4b9c-97b4-293c5132309c', 'FIRST-ORDER') + def redeem_coupon(id, coupon_code) + post("carts/#{id}/coupon", { code: coupon_code }) + end + + # Remove the current pickup option from the cart. + # + # @see https://developer.epages.com/beyond-docs/#remove_coupon_from_cart + # + # @param id [String] the cart UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('7563919e-5b00-4300-bb59-7f7cbf35f01f') + def delete_coupon(id) + super("carts/#{id}/coupon") + end + end + end +end diff --git a/lib/beyond_api/services/checkout/shipping_zone.rb b/lib/beyond_api/services/checkout/shipping_zone.rb new file mode 100644 index 0000000..e40aae1 --- /dev/null +++ b/lib/beyond_api/services/checkout/shipping_zone.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module BeyondApi + module Checkout + # @example How to instantiate a client + # @client = BeyondApi::Checkout::ShippingZone.new(api_url: 'https://example.com/api', access_token: 'your_token') + class ShippingZone < BaseService + # List all shipping zones in a paged way. + # + # @see https://developer.epages.com/beyond-docs/#list_shipping_zones + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shipping-zones', params) + end + end + end +end diff --git a/lib/beyond_api/services/customer.rb b/lib/beyond_api/services/customer.rb new file mode 100644 index 0000000..b24d626 --- /dev/null +++ b/lib/beyond_api/services/customer.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +module BeyondApi + # @example How to instantiate a client + # @client = BeyondApi::Customer.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Customer < BaseService + # Retrieve the details of a customer. + # + # @see https://developer.epages.com/beyond-docs/#show_customer_details + # + # @param id [String] the customer UUID + # + # @return [Hash] + # + # @example + # @client.find('5afcf0ce-4e39-4b4d-88bb-82d5cc07c83a') + def find(id) + get("customers/#{id}") + end + + # List all customers of the shop in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_customers + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('customers', params) + end + + # Create a `COCKPIT` customer. + # + # @see https://developer.epages.com/beyond-docs/#create_customer + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # customer_data = { + # billing_address: { + # gender: "FEMALE", + # company: "Astrid Alster GmbH", + # first_name: "Astrid", + # last_name: "Alster", + # street: "Alsterwasserweg", + # house_number: "2", + # postal_code: "20999", + # city: "Alsterwasser", + # country: "DE", + # state: "Hamburg", + # email: "a.alsterh@example.com", + # phone: "(800) 555-0102" + # }, + # email: "a.alsterh@example.com", + # customer_comment: "A reliable customer", + # shipping_address: { + # company: "ePages GmbH", + # first_name: "Chayanne", + # last_name: "Team42", + # street: "Pilatuspool", + # house_number: "2", + # postal_code: "20999", + # city: "Alsterwasser", + # country: "DE", + # state: "Hamburg", + # email: "a.chayanne@example.com", + # phone: "(800) 555-0102" + # } + # } + # @client.create(customer_data) + def create(body) + post('customers', body) + end + + # Update a customer. + # + # @see https://developer.epages.com/beyond-docs/#update_customer + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # customer_data = { + # billing_address: { + # company: "ePages GmbH", + # first_name: "Chayanne", + # last_name: "Team42", + # street: "Pilatuspool", + # house_number: "2", + # postal_code: "20999", + # city: "Alsterwasser", + # country: "DE", + # state: "Hamburg", + # email: "a.chayanne@example.com", + # phone: "(800) 555-0102" + # }, + # email: "a.alsterh@example.com", + # customer_comment: "A reliable customer", + # shipping_address: { + # gender: "FEMALE", + # company: "Astrid Alster GmbH", + # first_name: "Astrid", + # last_name: "Alster", + # street: "Alsterwasserweg", + # house_number: "2", + # postal_code: "20999", + # city: "Alsterwasser", + # country: "DE", + # state: "Hamburg", + # email: "a.alsterh@example.com", + # phone: "(800) 555-0102" + # } + # } + # @client.update('2bdc787e-4643-4eeb-babf-06bc1d4b1c1b', customer_data) + def update(id, body) + put("customers/#{id}", body) + end + + # Delete a customer. + # + # @see https://developer.epages.com/beyond-docs/#delete_customer + # + # @param id [String] the customer UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('71b62b1d-271a-4b56-9514-77b79f8e910a') + def delete(id) + super("customers/#{id}") # Concerns::Connection delete method + end + + # List all events of a customer. + # + # @see https://developer.epages.com/beyond-docs/#list_customer_events + # + # @param id [String] the customer UUID + # + # @return [Hash] + # + # @example + # @client.events('df184f00-2367-417f-bc23-c7f927dbf636') + def events(id) + get("customers/#{id}/events") + end + end +end diff --git a/lib/beyond_api/services/product_management/category.rb b/lib/beyond_api/services/product_management/category.rb new file mode 100644 index 0000000..775af2d --- /dev/null +++ b/lib/beyond_api/services/product_management/category.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductManagement + # @example How to instantiate a client + # @client = BeyondApi::ProductManagement::Category.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Category < BaseService + # Retrieve the details of a category. + # + # @see https://developer.epages.com/beyond-docs/#show_category_details + # + # @param id [String] the category UUID + # + # @return [Hash] + # + # @example + # @client.find('e97226a6-9412-481f-b1d7-e64fc58df88e') + def find(id) + get("categories/#{id}") + end + + # List all available categories in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_categories + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('categories', params) + end + + # Create a product category. + # + # @see https://developer.epages.com/beyond-docs/#create_category + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # @client.create(name: 'Power Bars', type: 'SMART', default_sort: 'NEWEST_FIRST') + def create(body) + post('categories', body) + end + + # Update all product category properties. + # + # @see https://developer.epages.com/beyond-docs/#update_all_category_properties + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # @client.update(name: 'High Protein Power Bars', type: 'SMART', default_sort: 'NEWEST_FIRST') + def update(id, body) + put("categories/#{id}", body) + end + + # Delete a product category. + # + # @see https://developer.epages.com/beyond-docs/#list_categories + # + # @param id [String] the category UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('c8cc52ec-fe57-4d4d-a2e3-f1756e767724') + def delete(id) + super("categories/#{id}") # Concerns::Connection delete method + end + end + end +end diff --git a/lib/beyond_api/services/product_management/image.rb b/lib/beyond_api/services/product_management/image.rb new file mode 100644 index 0000000..b681d9f --- /dev/null +++ b/lib/beyond_api/services/product_management/image.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductManagement + # @example How to instantiate a client + # @client = BeyondApi::ProductManagement::Image.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Image < BaseService + # Retrieve the images of a product. + # + # @see https://developer.epages.com/beyond-docs/#list_product_images + # + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(id, params = {}) + get("products/#{id}/images", params) + end + + # Upload an image and add it to a product. The body of the request must contain the content of the image. + # The maximum image size is 7000 × 7000 px, and the maximum file size per image is 8 MB. + # + # @see https://developer.epages.com/beyond-docs/#upload_product_image + # + # @param product_id [String] the product UUID + # @param image_path [String] the image path + # @param image_name [String] the image file name + # + # @return [Hash] + # + # @example + # @client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', '/home/epages/file.png', 'file.png') + def upload(product_id, image_path, image_name) + upload_file("products/#{product_id}/images", + image_path, + Utils.file_content_type(image_path), + file_name: image_name) + end + + # Upload up to 10 images and add them to a product. The body of the request must contain the content of the images. + # The maximum image size is 7000 × 7000px, and the maximum file size per image is 8 MB. + # + # @see https://developer.epages.com/beyond-docs/#upload_multiple_product_images + # + # @param id [String] the product UUID + # @param id [Array] an array of strings containing the path of each image + # @param id [Array] an array of strings containing the file name of each image + # + # @return [Hash] + # + # @example + # image_paths = ['/home/epages/file1.png', '/home/epages/file2.png'] + # image_names = ['file1.png', 'file2.png'] + # @client.upload('4125b993-49fc-47c8-b9b3-76d8871e4e06', image_paths, image_names) + def upload_multiple(product_id, image_paths, image_names) + upload_files("products/#{product_id}/images", + { image: Utils.faraday_file_parts(image_paths) }, # body + { file_name: Utils.encode_filenames(image_names) }) # params + end + end + end +end diff --git a/lib/beyond_api/services/product_management/product.rb b/lib/beyond_api/services/product_management/product.rb new file mode 100644 index 0000000..a30b427 --- /dev/null +++ b/lib/beyond_api/services/product_management/product.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductManagement + # @example How to instantiate a client + # @client = BeyondApi::ProductManagement::Product.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Product < BaseService + # List all products in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_products + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('products', params) + end + + # Create a product. + # + # @see https://developer.epages.com/beyond-docs/#create_product + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # product_data = { + # sku: '123456789-001', + # name: 'Rioja Castillo de Puerto (2013)', + # description: 'Spain\nRioja Tempranillo', + # manufacturer: 'Grape Vineyard', + # essential_features: 'Dry. 12% alcohol. Best vine variety.', + # tags: ['Bestseller', 'Red Wine', 'Sale'], + # product_identifiers: [ + # { + # type: 'EAN', + # value: '9780134308135' + # } + # ], + # sales_price: { + # tax_model: 'GROSS', + # amount: 8.7, + # currency: 'EUR' + # }, + # list_price: { + # tax_model: 'GROSS', + # amount: 10.95, + # currency: 'EUR' + # }, + # manufacturer_price: { + # tax_model: 'GROSS', + # amount: 11.95, + # currency: 'EUR' + # }, + # visible: true, + # tax_class: 'REGULAR', + # shipping_weight: { + # value: 1175.0, + # display_unit: 'GRAMS' + # }, + # max_order_quantity: 6, + # shipping_dimension: { + # length: 1500, + # width: 1000, + # height: 2000 + # }, + # ref_price: { + # ref_quantity: 1, + # unit: 'LITER', + # quantity: 0.75, + # price: { + # tax_model: 'GROSS', + # amount: 11.6, + # currency: 'EUR' + # } + # }, + # shipping_period: { + # min: 2, + # max: 4, + # display_unit: 'WEEKS' + # }, + # pickup_period: { + # min: 1, + # max: 2, + # display_unit: 'WEEKS' + # }, + # product_labels: [ + # { + # type: 'NEW', + # active_from: '2024-08-19T13:04:55.897122293', + # active_until: '2024-09-16T13:04:55.897122293' + # } + # ] + # } + # @client.create(product_data) + def create(body) + post('products', body) + end + + # Retrieve the details of a product. + # + # @see https://developer.epages.com/beyond-docs/#show_product_details + # + # @param id [String] the product UUID + # + # @return [Hash] + # + # @example + # @client.find('985efde9-577c-4752-9556-af5ed8a81b1b') + def find(id) + get("products/#{id}") + end + end + end +end diff --git a/lib/beyond_api/services/product_management/variation.rb b/lib/beyond_api/services/product_management/variation.rb new file mode 100644 index 0000000..f7fffaf --- /dev/null +++ b/lib/beyond_api/services/product_management/variation.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductManagement + # @example How to instantiate a client + # @client = BeyondApi::ProductManagement::Variation.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Variation < BaseService + # Retrieve the variations of a variation product in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_variations + # + # @param id [String] the product UUID + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(id, params = {}) + get("products/#{id}/variations", params) + end + end + end +end diff --git a/lib/beyond_api/services/product_management/variation_image.rb b/lib/beyond_api/services/product_management/variation_image.rb new file mode 100644 index 0000000..62e538e --- /dev/null +++ b/lib/beyond_api/services/product_management/variation_image.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductManagement + # @example How to instantiate a client + # @client = BeyondApi::ProductManagement::VariationImage.new(api_url: 'https://example.com/api', access_token: 'your_token') + class VariationImage < BaseService + # Retrieve the images of a single variation of a variation product in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_variation_images + # + # @param product_id [String] the product UUID + # @param variation_id [String] the variation UUID + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(product_id, variation_id, _params = {}) + get("products/#{product_id}/variations/#{variation_id}/images") + end + end + end +end diff --git a/lib/beyond_api/services/product_view/category.rb b/lib/beyond_api/services/product_view/category.rb new file mode 100644 index 0000000..5dc7b93 --- /dev/null +++ b/lib/beyond_api/services/product_view/category.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module BeyondApi + module ProductView + # @example How to instantiate a client + # @client = BeyondApi::ProductView::Category.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Category < BaseService + # List all product categories in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_product_categories + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('product-view/categories', params) + end + + # Retrieve the details of a category. + # + # @see https://developer.epages.com/beyond-docs/#show_product_category_details + # + # @param id [String] the category UUID + # + # @return [Hash] + # + # @example + # @client.find('823c12ed-1f1b-47c6-8fc8-51fb7338be84') + def find(id) + get("product-view/categories/#{id}") + end + + # Preview products included in category in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#preview_products_included_in_category + # + # @param body [Hash] the product filters + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # body = { + # filters: [ + # { + # key: "manufacturer", + # values: ["Grape Vineyard"] + # }, + # { + # key: "all_tags", + # values: ["Power Bar", "Bestseller", "High Protein"] + # }, + # { + # key: "price_range", + # min: 3.7, + # max: 13.7 + # } + # ] + # } + # @client.preview(body, { size: 100, page: 0 }) + def preview(body, params = {}) + post('product-view/categories/preview', body, params) + end + end + end +end diff --git a/lib/beyond_api/services/shop/address.rb b/lib/beyond_api/services/shop/address.rb new file mode 100644 index 0000000..5e5470a --- /dev/null +++ b/lib/beyond_api/services/shop/address.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Address.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Address < BaseService + # Retrieve the details of a shop's address. + # + # @see https://developer.epages.com/beyond-docs/#show_address_details + # + # @return [Hash] + # + # @example + # @client.show + def show + get('shop/address') + end + end + end +end diff --git a/lib/beyond_api/services/shop/attribute.rb b/lib/beyond_api/services/shop/attribute.rb new file mode 100644 index 0000000..2070a77 --- /dev/null +++ b/lib/beyond_api/services/shop/attribute.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Attribute.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Attribute < BaseService + # Create a shop attribute. + # + # @see https://developer.epages.com/beyond-docs/#create_shop_attribute + # + # @param name [String] the attribute name + # @param value [String] the attribute value + # @param public [Boolean] flag to indicate if the attribute is public + # + # @return [Hash] + # + # @example + # @client.create('createSku', 'autogenerateSku', true) + def create(name, value, public) + post('shop/attributes', { name:, value:, public: }) + end + + # List of all shop attributes. + # + # @see https://developer.epages.com/beyond-docs/#list_shop_attributes + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/attributes', params) + end + + # Retrieve a particular shop attribute by its name. + # + # @see https://developer.epages.com/beyond-docs/#show_shop_attribute_details + # + # @param name [String] the attribute name + # + # @return [Hash] + # + # @example + # @client.find('createSku') + def find(name) + get("shop/attributes/#{name}") + end + + # Update a shop attribute. This operation is idempotent and will create a new shop attribute if required. + # + # @see https://developer.epages.com/beyond-docs/#update_shop_attribute + # + # @param name [String] the attribute name + # @param value [String] the attribute value + # @param public [Boolean] flag to indicate if the attribute is public + # + # @return [Hash] + # + # @example + # @client.update('createSku', 'autogenerateSku', false) + def update(name, value, public) + put("shop/attributes/#{name}", { value:, public: }) + end + + # Delete a shop attribute. + # + # @see https://developer.epages.com/beyond-docs/#delete_shop_attribute + # + # @param name [String] the attribute name + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('createSku') + def delete(name) + super("shop/attributes/#{name}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/feature.rb b/lib/beyond_api/services/shop/feature.rb new file mode 100644 index 0000000..ba74be8 --- /dev/null +++ b/lib/beyond_api/services/shop/feature.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Feature.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Feature < BaseService + # List all features that are assigned to a specific shop identified by the current hostname. + # + # @see https://developer.epages.com/beyond-docs/#list_feature_assignments + # + # @return [Hash] + # + # @example + # @client.all + def all + get('shop/features') + end + + # Retrieve the details of a specific feature assignment of a merchant’s shop identified by the current hostname. + # + # @see https://developer.epages.com/beyond-docs/#show_feature_assignment_details + # + # @param feature_name [String] The feature name + # + # @return [Hash] + # + # @example + # @client.find('product-management.max-products') + def find(feature_name) + get("shop/features/#{feature_name}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/image.rb b/lib/beyond_api/services/shop/image.rb new file mode 100644 index 0000000..c4d4c32 --- /dev/null +++ b/lib/beyond_api/services/shop/image.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Image.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Image < BaseService + # Create a shop image. + # + # @see https://developer.epages.com/beyond-docs/#create_shop_image + # + # @param body [String] the request body + # + # @return [Hash] + # + # @example + # @client.create(data_uri: 'file.png?hash=212-2323-4343', width: 250, height: 300, label: 'logo') + def create(body) + post('shop/images', body) + end + + # Retrieve the images of a shop. + # + # @see https://developer.epages.com/beyond-docs/#list_shop_images + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/images', params) + end + + # Search for shop images by label. + # + # @see https://developer.epages.com/beyond-docs/#find_shop_images_by_label + # + # @param label [String] the label to search for + # + # @return [Hash] + # + # @example + # @client.find_by_label('logo') + def find_by_label(label) + get('shop/images/search/find-by-label', label:) + end + + # Retrieve a single shop image. + # + # @see https://developer.epages.com/beyond-docs/#show_shop_image_details + # + # @param id [String] the image UUID + # + # @return [Hash] + # + # @example + # @client.find('de5eaacf-8e85-46cf-8bea-d629e52cf987') + def find(id) + get("shop/images/#{id}") + end + + # Upload a shop image. The request body must contain the content of the shop image. The maximum image size for shop images is 8 MB. + # + # @see https://developer.epages.com/beyond-docs/#upload_shop_image + # + # @param image_path [String] the image path + # @param image_name [String] the image file name + # @param label [String] the image label + # + # @return [Hash] + # + # @example + # @client.upload('/home/epages/file.png', 'file.png', 'logo') + def upload(image_path, image_name, label) + upload_file('shop/images', + image_path, + 'multipart/form-data', + { file_name: image_name, label: }) + end + + # Delete a shop image. + # + # @see https://developer.epages.com/beyond-docs/#delete_shop_image + # + # @param id [String] the image UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('ec535cb3-3155-4c8f-b3cc-2bb94db7c530') + def delete(id) + super("shop/images/#{id}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/language.rb b/lib/beyond_api/services/shop/language.rb new file mode 100644 index 0000000..dcb2f4c --- /dev/null +++ b/lib/beyond_api/services/shop/language.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Language.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Language < BaseService + # Create a language for a specified shop. + # + # @see https://developer.epages.com/beyond-docs/#create_language + # + # @param locale [String] the locale + # + # @return [Hash] + # + # @example + # @client.create('de-DE') + def create(locale) + post('shop/languages', locale:) + end + + # Retrieve detailed information about a single language of the shop. The language is specified by its id. + # + # @see https://developer.epages.com/beyond-docs/#show_language_details + # + # @param id [String] The language UUID + # + # @return [Hash] + # + # @example + # @client.find('750958a7-7924-4028-8f44-260f8fb11cbb') + def find(id) + get("shop/languages/#{id}") + end + + # Retrieve the currently active languages of a specified shop in a paged way. + # + # @see https://developer.epages.com/beyond-docs/#list_languages + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/languages', params) + end + + # Retrieve all languages that can be created for a shop. Languages that are not on the list are not supported. + # + # @see https://developer.epages.com/beyond-docs/#list_supported_languages + # + # @return [Hash] + # + # @example + # @client.supported_languages + def supported_languages + get('shop/languages/supported') + end + + # Delete a language from a specified shop. + # + # @see https://developer.epages.com/beyond-docs/#delete_language + # + # @param id [String] the language UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('750958a7-7924-4028-8f44-260f8fb11cbb') + def delete(id) + super("shop/languages/#{id}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/location.rb b/lib/beyond_api/services/shop/location.rb new file mode 100644 index 0000000..04bf509 --- /dev/null +++ b/lib/beyond_api/services/shop/location.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Location.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Location < BaseService + # Create a location. + # + # @see https://developer.epages.com/beyond-docs/#create_location + # + # param body [Hash] the request body + # + # return [hash] + # + # @example + # body = { + # "languageCode": "de", + # "storeCode": "MLC-St-Ives", + # "companyName": "My little Cornershop - St.Ives", + # "primaryPhone": "(800) 555-0102", + # "address": { + # "postalCode": "90999", + # "street": "Hudson Way", + # "houseNumber": "27", + # "city": "St.Ives", + # "country": "GB", + # "dependentLocality": "", + # "state": "Cornwall" + # }, + # "googleStatus": "ACTIVE", + # "googlePrimaryCategory": { + # "categoryId": "gcid:storefood", + # "displayName": "Food" + # }, + # "googleAdditionalCategories": [ { + # "displayName": "Drinks", + # "categoryId": "gcid:storedrinks" + # } ], + # "regularHours": { + # "periods": [ { + # "openDay": "MONDAY", + # "openTime": "08:00", + # "closeDay": "MONDAY", + # "closeTime": "17:00" + # }, { + # "openDay": "SATURDAY", + # "openTime": "10:00", + # "closeDay": "SATURDAY", + # "closeTime": "16:00" + # } ] + # }, + # "latLng": { + # "latitude": 53.5847424, + # "longitude": 9.968901 + # } + # } + # @client.create(body) + def create(body) + post('shop/locations', body) + end + + # Retrieve a list of all locations for the current shop + # + # @see https://developer.epages.com/beyond-docs/#list_locations + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + get('shop/locations', params) + end + + # Retrieve details of a location + # + # @see https://developer.epages.com/beyond-docs/#show_location_details + # + # @param id [String] the location UUID + # + # @return [Hash] + # + # @example + # @client.find('869fe0f1-e5ce-491c-914e-5160a4b1cf2f') + def find(location_id) + get("shop/locations/#{location_id}") + end + + # Update a location + # + # @see https://developer.epages.com/beyond-docs/#update_location + # + # @param id [String] The language UUID + # param body [Hash] the request body + # + # @return [Hash] + # + # @example + # @client.update('869fe0f1-e5ce-491c-914e-5160a4b1cf2f', body) + def update(location_id, body) + put("shop/locations/#{location_id}", body) + end + + # Delete a location + # + # @see https://developer.epages.com/beyond-docs/#delete_location + # + # @param id [String] The language UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('869fe0f1-e5ce-491c-914e-5160a4b1cf2f') + def delete(location_id) + super("shop/locations/#{location_id}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/shop.rb b/lib/beyond_api/services/shop/shop.rb new file mode 100644 index 0000000..b722e72 --- /dev/null +++ b/lib/beyond_api/services/shop/shop.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Shop.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Shop < BaseService + # Retrieve the details of a shop. + # + # @see https://developer.epages.com/beyond-docs/#show_shop_details + # + # @return [Hash] + # + # @example + # @client.show + def show + get('shop') + end + end + end +end diff --git a/lib/beyond_api/services/storefront/script_tag.rb b/lib/beyond_api/services/storefront/script_tag.rb new file mode 100644 index 0000000..d101d7e --- /dev/null +++ b/lib/beyond_api/services/storefront/script_tag.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module BeyondApi + module Storefront + # @example How to instantiate a client + # @client = BeyondApi::Storefront::ScriptTag.new(api_url: 'https://example.com/api', access_token: 'your_token') + class ScriptTag < BaseService + def all(params = {}) + params.merge!(client_id: BeyondApi.configuration.client_id) if params[:only_own] + + get('script-tags', params) + end + + def create(script_url) + post('script-tags', script_url:) + end + + def delete(id) + super("script-tags/#{id}") # Concerns::Connection delete method + end + end + end +end diff --git a/lib/beyond_api/services/webhook/subscription.rb b/lib/beyond_api/services/webhook/subscription.rb new file mode 100644 index 0000000..1b8016d --- /dev/null +++ b/lib/beyond_api/services/webhook/subscription.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module BeyondApi + module Webhook + # @example How to instantiate a client + # @client = BeyondApi::Webhook::Subscription.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Subscription < BaseService + # List all webhooks subscriptions in a paged manner. + # + # @see https://developer.epages.com/beyond-docs/#list_webhook_subscriptions + # + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + get('webhook-subscriptions', params) + end + + # Create a webhook subscription. + # + # @see https://developer.epages.com/beyond-docs/#create_webhook_subscription + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # webhook_data = { + # callback_uri: 'http://example.com/test', + # event_types: ['order.created', 'product.created'] + # } + # @client.create(webhook_data) + def create(body) + post('webhook-subscriptions', body) + end + + # Delete all webhook subscriptions. + # + # @param body [Hash] the request body + # + # @return [Hash] + # + # @example + # @client.delete_all + def delete_all + all.dig(:embedded, :subscriptions).each do |subscription| + delete(subscription[:id]) + end + end + + # Delete a webhook subscription. + # + # @see https://developer.epages.com/beyond-docs/#delete_webhook_subscription + # + # @param id [String] the webhook subscription UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('84ce4b3a-9a10-46d0-afcd-a71bcd0c0e9a') + def delete(id) + super("webhook-subscriptions/#{id}") + end + + # Retrieve the details of a webhook subscription. + # + # @see https://developer.epages.com/beyond-docs/#show_webhook_subscription_details + # + # @param id [String] the webhook subscription UUID + # + # @return [Hash] + # + # @example + # @client.find('a2e39f0f-7728-40ca-88e4-cb8cea9ecf5e') + def find(id) + get("webhook-subscriptions/#{id}") + end + + # Activate a webhook subscription. You might want to use this request for a deactivated webhook. + # + # @see https://developer.epages.com/beyond-docs/#activate_webhook_subscription + # + # @param id [String] the webhook subscription UUID + # + # @return [Hash] + # + # @example + # @client.activate('1d61c1b4-49aa-4827-bd04-b1c4374f3499') + def activate(id) + post("webhook-subscriptions/#{id}/activate") + end + + # Deactivate a webhook subscription. You might want to use this request for a currently active webhook. + # + # @see https://developer.epages.com/beyond-docs/#deactivate_webhook_subscription + # + # @param id [String] the webhook subscription UUID + # + # @return [Hash] + # + # @example + # @client.deactivate('8517ab39-db0e-417a-87ed-f96e437c03e4') + def deactivate(id) + post("webhook-subscriptions/#{id}/deactivate") + end + + # List all failed deliveries of a webhook subscription in a paged way. + # + # @see https://developer.epages.com/beyond-docs/#list_failed_webhook_deliveries + # + # @param id [String] the webhook subscription UUID + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.failures('a3dd55a4-dbc3-4f20-8a5e-d0fe4ba59afd', { size: 100, page: 0 }) + def failures(id, params = {}) + fetch_all_pages("webhook-subscriptions/#{id}/failures", params) + end + + # Retry a failed webhook delivery. + # + # @see https://developer.epages.com/beyond-docs/#retry_failed_webhook_delivery + # + # @param webhook_id [String] the webhook subscription UUID + # @param failure_id [String] the failure UUID + # + # @return [Hash] + # + # @example + # @client.retry('d9828fba-3922-4750-a70c-174daeeb37e4', + # 'b21146e0-16b9-468f-806b-a23c8e04a7fc') + def retry(webhook_id, failure_id) + post("webhook-subscriptions/#{webhook_id}/failures/#{failure_id}/retry") + end + + # Delete a webhook failure. + # + # @see https://developer.epages.com/beyond-docs/#delete_webhook_delivery_failure + # + # @param webhook_id [String] the webhook subscription UUID + # @param failure_id [String] the failure UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete_failure('cbcebfc4-9dee-4344-83b2-8c25b2287a60', + # 'f090610b-19da-4e40-a986-3c9562fefeab') + def delete_failure(webhook_id, failure_id) + delete("webhook-subscriptions/#{webhook_id}/failures/#{failure_id}") + end + end + end +end diff --git a/lib/beyond_api/session.rb b/lib/beyond_api/session.rb deleted file mode 100644 index 8ef6e09..0000000 --- a/lib/beyond_api/session.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -module BeyondApi - autoload :Base, "beyond_api/resources/base" - autoload :Carts, "beyond_api/resources/carts" - autoload :CategoriesView, "beyond_api/resources/categories_view" - autoload :Categories, "beyond_api/resources/categories" - autoload :CheckoutSettings, "beyond_api/resources/checkout_settings" - autoload :Customers, "beyond_api/resources/customers" - autoload :NewsletterTarget, "beyond_api/resources/newsletter_target" - autoload :OrderSettings, "beyond_api/resources/order_settings" - autoload :Orders, "beyond_api/resources/orders" - autoload :PaymentMethodDefinitions, "beyond_api/resources/payment_method_definitions" - autoload :PickupOptions, "beyond_api/resources/pickup_options" - autoload :PaymentMethods, "beyond_api/resources/payment_methods" - autoload :ProductAttributeDefinitions, "beyond_api/resources/product_attribute_definitions" - autoload :ProductsView, "beyond_api/resources/products_view" - autoload :Products, "beyond_api/resources/products" - autoload :ScriptTags, "beyond_api/resources/script_tags" - autoload :ShippingZones, "beyond_api/resources/shipping_zones" - autoload :Shop, "beyond_api/resources/shop" - autoload :Signers, "beyond_api/resources/signers" - autoload :Token, "beyond_api/resources/token" - autoload :Users, "beyond_api/resources/users" - autoload :Variations, "beyond_api/resources/variations" - autoload :WebhookSubscriptions, "beyond_api/resources/webhook_subscriptions" - - class Session - class InvalidUriProtocolError < StandardError; end - - attr_reader :api_url - attr_accessor :access_token, :refresh_token - - def initialize(api_url:, access_token: nil, refresh_token: nil) - raise InvalidUriProtocolError, "Invalid URI protocol" unless api_url.start_with? "https://" - - uri = URI.parse(api_url) - - @api_url = "#{uri.scheme}://#{uri.host}/api" - @access_token = access_token - @refresh_token = refresh_token - end - - def carts - BeyondApi::Carts.new(self) - end - - def categories_view - BeyondApi::CategoriesView.new(self) - end - - def categories - BeyondApi::Categories.new(self) - end - - def checkout_settings - BeyondApi::CheckoutSettings.new(self) - end - - def customers - BeyondApi::Customers.new(self) - end - - def newsletter_target - BeyondApi::NewsletterTarget.new(self) - end - - def order_settings - BeyondApi::OrderSettings.new(self) - end - - def orders - BeyondApi::Orders.new(self) - end - - def payment_method_definitions - BeyondApi::PaymentMethodDefinitions.new(self) - end - - def payment_methods - BeyondApi::PaymentMethods.new(self) - end - - def pickup_options - BeyondApi::PickupOptions.new(self) - end - - def product_attribute_definitions - BeyondApi::ProductAttributeDefinitions.new(self) - end - - def products_view - BeyondApi::ProductsView.new(self) - end - - def products - BeyondApi::Products.new(self) - end - - def script_tags - BeyondApi::ScriptTags.new(self) - end - - def shipping_zones - BeyondApi::ShippingZones.new(self) - end - - def shop - BeyondApi::Shop.new(self) - end - - def signers - BeyondApi::Signers.new(self) - end - - def token - BeyondApi::Token.new(self) - end - - def users - BeyondApi::Users.new(self) - end - - def variations - BeyondApi::Variations.new(self) - end - - def webhook_subscriptions - BeyondApi::WebhookSubscriptions.new(self) - end - end -end diff --git a/lib/beyond_api/utils.rb b/lib/beyond_api/utils.rb index 36a4d03..3bdf6a1 100644 --- a/lib/beyond_api/utils.rb +++ b/lib/beyond_api/utils.rb @@ -1,102 +1,32 @@ # frozen_string_literal: true -require "ostruct" +require 'ostruct' module BeyondApi module Utils - extend self - - def file_content_type(file_path) + def self.file_content_type(file_path) case File.extname(file_path) - when ".png" - "image/png" - when ".jpg", ".jpeg" - "image/jpeg" - when ".gif" - "image/gif" - end - end - - def handle_all_request(url, resource, params = {}) - paginated_size = BeyondApi.configuration.all_pagination_size - - if params[:paginated] == false - result = all_paginated(url, params.merge(page: 0, size: paginated_size)) - - (1..result[:page][:total_pages] - 1).each do |page| - result[:embedded][resource].concat( - all_paginated(url, - params.merge(page: page, - size: paginated_size))[:embedded][resource] - ) - end - - result[:page][:size] = result[:page][:total_elements] - result[:page][:total_pages] = 1 - result[:page][:number] = 0 - - result - else - all_paginated(url, params) + when '.png' + 'image/png' + when '.jpg', '.jpeg' + 'image/jpeg' + when '.gif' + 'image/gif' end end - def handle_error(response, status) - BeyondApi.logger.error "[Beyond API] #{status}: #{response}" - error = BeyondApi::Error.new(response, status) - BeyondApi.configuration.raise_error_requests ? raise(error) : error + def self.camelize_keys(hash) + hash.deep_transform_keys { |key| key.to_s.camelize(:lower) } end - def handle_response(response, status, respond_with_true: false) - if status.between?(200, 299) - return true if respond_with_true - - response = sanitize_response(response) - BeyondApi.configuration.object_struct_responses ? to_object_struct(response) : response - else - handle_error(response, status) + def self.faraday_file_parts(file_paths) + file_paths.map do |file_path| + Faraday::FilePart.new(File.open(file_path), Utils.file_content_type(file_path)) end end - def sanitize_key(key) - key.chars.first == "_" ? key[1..-1] : key - end - - def sanitize_response(hash) - {}.tap do |h| - hash.each do |key, value| - next if key == "_links" && BeyondApi.configuration.remove_response_links - - key = sanitize_key(key) if BeyondApi.configuration.remove_response_key_underscores - h[key.underscore.to_sym] = transform(value) - end - end - end - - def to_object_struct(data) - if data.is_a? Hash - OpenStruct.new(data.map { |key, val| [key, to_object_struct(val)] }.to_h) - elsif data.is_a? Array - data.map { |o| to_object_struct(o) } - else - data - end - end - - private - - def all_paginated(url, params = {}) - response, status = BeyondApi::Request.get(@session, url, params) - - handle_response(response, status) - end - - def transform(thing) - case thing - when Hash then sanitize_response(thing) - when Array then thing.map { |v| transform(v) } - else; thing - end + def self.encode_filenames(filenames) + filenames.map { |e| URI.encode_www_form([e]) } end end end diff --git a/lib/generators/beyond_api/install_generator.rb b/lib/generators/beyond_api/install_generator.rb index d1d61e5..e132c59 100644 --- a/lib/generators/beyond_api/install_generator.rb +++ b/lib/generators/beyond_api/install_generator.rb @@ -3,10 +3,10 @@ module BeyondApi module Generators class InstallGenerator < Rails::Generators::Base - source_root File.expand_path("../templates", __dir__) + source_root File.expand_path('../templates', __dir__) def copy_initializer - template "beyond_api_initializer.rb", "config/initializers/beyond_api.rb" + template 'beyond_api_initializer.rb', 'config/initializers/beyond_api.rb' end end end diff --git a/lib/generators/templates/beyond_api_initializer.rb b/lib/generators/templates/beyond_api_initializer.rb index 9b74b94..7e6218f 100644 --- a/lib/generators/templates/beyond_api_initializer.rb +++ b/lib/generators/templates/beyond_api_initializer.rb @@ -12,7 +12,8 @@ # Configure the request timeout in seconds. Default is 5 seconds. # config.timeout = 5.seconds - # Configure the pagination size when `paginated: false` is sent on `.all()` requests. Value must be between 1 and 1000. + # Configure the pagination size when `paginated: false` is sent on `.all()` requests. + # Value must be between 1 and 1000. # config.all_pagination_size = 200 # ==> Log configuration @@ -30,27 +31,6 @@ # # config.log_bodies = false - # ==> Response configuration - # Configure if :_links should be removed from response. Default is false and - # :_links are gonna be part of the response. - # config.remove_response_links = false - - # Configure if first character underescores should be removed on response hash - # keys. For example, if set to true, :_id will become :id. Default is false. - # config.remove_response_key_underscores = false - - # Configure if responses should be transformed to ObjectStructs. If set to - # true, it gives you the posibility to access response data on a doted way. - # With OpenStructs => response.embeded.products.first.id - # Without OpenStructs => response["embeded"]["products"].first["id"] - # config.object_struct_responses = false - - # Configure if the gem should raise on error requests. Setting it to true is - # useful for working with exceptions. Setting it to false will return a - # BeyondApi::Error object with detailed information of the error. - # Default is false. - # config.raise_error_requests = false - # ==> Retry configuration # Configure the retry options for requests. Default is: # config.retry_options = { diff --git a/spec/beyond_api/resources/products_spec.rb b/spec/beyond_api/resources/products_spec.rb deleted file mode 100644 index db72897..0000000 --- a/spec/beyond_api/resources/products_spec.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe 'BeyondApi::Products' do - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { @product = session.products.create(FactoryBot.build(:product)) } - - let!(:file_path) do - app_root = File.expand_path(File.dirname("ext.rb")) - "#{app_root}/spec/files/" - end - - describe "non existing product" do - it "create a new regular product and " do - product = session.products.create(FactoryBot.build(:product)) - - expect(product).not_to be nil - expect(product.id).not_to be nil - end - end - - - describe "product exist" do - it "find a product sending an ID" do - response = session.products.find(product.id) - expect(response).not_to be nil - expect(response.id).to eq(product.id) - end - - - it "upload multiple images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - images = session.products.upload_multiple_images(product.id, - files, - ["image1.png", "image2.png"]) - expect(images).not_to be nil - expect(images.embedded.images.is_a?(Array)).to eq true - end - - it "upload a single image" do - file = "#{file_path}image1.png" - - image = session.products.upload_image(product.id, file, "image3.png") - expect(image).not_to be nil - expect(image).to eq true - end - - it "sort product images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - session.products.upload_multiple_images(product.id, - files, - ["image1.png", "image2.png"]) - - images = session.products.images(product.id) - - images_sorted = images.embedded.images.sort_by(&:position).reverse.map(&:id) - - sorted = session.products.sort_images(product.id, images_sorted) - - images = session.products.images(product.id) - - expect(sorted).not_to be nil - expect(sorted).to eq true - expect(images.embedded.images.map(&:id)).to eq images_sorted - end - end -end diff --git a/spec/beyond_api/resources/products_view_spec.rb b/spec/beyond_api/resources/products_view_spec.rb deleted file mode 100644 index d76d054..0000000 --- a/spec/beyond_api/resources/products_view_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -RSpec.describe 'BeyondApi::ProductsView' do - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { @product = session.products.create(FactoryBot.build(:product)) } - - it "list products with specific tag" do - response = session.products_view.search_by_tag("beyond_api-ruby_client") - expect(response).not_to be nil - expect(response.embedded.products.class).to be(Array) - expect(response.embedded.products.size).to be >= 1 - end -end diff --git a/spec/beyond_api/resources/variations_spec.rb b/spec/beyond_api/resources/variations_spec.rb deleted file mode 100644 index af774b5..0000000 --- a/spec/beyond_api/resources/variations_spec.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe 'BeyondApi::Variations' do - let!(:file_path) do - app_root = File.expand_path(File.dirname("ext.rb")) - "#{app_root}/spec/files/" - end - - let!(:session) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials - end - - let(:product) { session.products.create(FactoryBot.build(:product, :with_variations)) } - let(:variation) do - session.variations.all(product.id).embedded.variations.first - end - let(:default_image_property) do - body = [{ - property: "defaultImage", - enabled: true - }] - session.products.update_variation_properties(product.id, body) - end - - context "Create variation" do - it "Update image variation property" do - body = [{ - property: "defaultImage", - enabled: true - }] - response = session.products.update_variation_properties(product.id, body) - - expect(response).not_to be nil - default_image_prop = response.embedded.variation_properties.find { |prop| prop.property == "defaultImage" } - - expect(default_image_prop).not_to be nil - expect(default_image_prop.enabled).to be true - end - - it "Upload multiple images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - files, - ["image1.png", "image2.png"]) - - expect(response).not_to be nil - end - - it "Upload a single image" do - file = "#{file_path}image1.png" - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - file, - "variation1.png") - - expect(response).not_to be nil - end - - it "sort variation images" do - files = [ - "#{file_path}image1.png", - "#{file_path}image2.png" - ] - - default_image_property - response = session.variations.upload_multiple_images(product.id, - variation.id, - files, - ["image1.png", "image2.png"]) - - images = session.variations.images(product.id, variation.id) - - images_sorted = images.embedded.images.sort_by(&:position).reverse.map(&:id) - - sorted = session.variations.sort_images(product.id, variation.id, images_sorted) - - images = session.variations.images(product.id, variation.id) - - expect(sorted).not_to be nil - expect(sorted).to eq true - expect(images.embedded.images.map(&:id)).to eq images_sorted - end - end -end diff --git a/spec/beyond_api/services/authentication/email_address_spec.rb b/spec/beyond_api/services/authentication/email_address_spec.rb new file mode 100644 index 0000000..c213ac6 --- /dev/null +++ b/spec/beyond_api/services/authentication/email_address_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Authentication::EmailAddress, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + let(:user_id) { ENV.fetch('COCKPIT_USER_ID', nil) } + let(:user_email) { ENV.fetch('COCKPIT_USER_EMAIL', nil) } + let(:user_password) { ENV.fetch('COCKPIT_USER_PASSWORD', nil) } + + let(:new_email) { 'team42-new@epages.com' } + + describe '#trigger_change' do + # client.trigger_change(user_id, 'en-US', user_password, new_email) + it 'change email address' + + after do + # # Rollback email address change + # client.trigger_change(user_id, 'en-US', user_password, user_email) + end + end +end diff --git a/spec/beyond_api/services/authentication/signer_spec.rb b/spec/beyond_api/services/authentication/signer_spec.rb new file mode 100644 index 0000000..8bf53b2 --- /dev/null +++ b/spec/beyond_api/services/authentication/signer_spec.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Authentication::Signer, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '#all' do + it 'returns all signers' do + signers = client.all + + expect(signers.dig(:embedded, :signers)).to be_an(Array) + end + end + + context 'with signer' do + before(:each) do + @signer = client.create + end + + describe '#create' do + it 'creates a new signer' do + expect(@signer).to be_a(Hash) + end + end + + describe '#delete' do + it 'deletes a signer' do + response = client.delete(@signer[:id]) + expect(response).to eq({}) + end + end + end +end diff --git a/spec/beyond_api/services/authentication/token_spec.rb b/spec/beyond_api/services/authentication/token_spec.rb new file mode 100644 index 0000000..b1dce82 --- /dev/null +++ b/spec/beyond_api/services/authentication/token_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Authentication::Token, vcr: true do + it 'retrieves token via client credentials' do + response = auth_client.client_credentials + + expect(response).not_to be nil + expect(response[:access_token].class).to be(String) + expect(response[:refresh_token]).to be(nil) + end + + it 'retrieves token via authorization code' do + expect { auth_client.get('abcde') }.to raise_error(BeyondApi::Error) do |error| + expect(error.response[:error]).to eq('invalid_grant') + expect(error.response[:error_description]).to eq('Invalid authorization code: abcde') + end + end + + it 'refreshes the token' do + response = auth_client.refresh(ENV.fetch('REFRESH_TOKEN', nil)) + + expect(response).not_to be nil + expect(response[:access_token].class).to be(String) + expect(response[:refresh_token].class).to be(String) + end +end diff --git a/spec/beyond_api/services/authentication/user_and_password_spec.rb b/spec/beyond_api/services/authentication/user_and_password_spec.rb new file mode 100644 index 0000000..248315d --- /dev/null +++ b/spec/beyond_api/services/authentication/user_and_password_spec.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Authentication::UserAndPassword, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + let(:user_id) { ENV.fetch('COCKPIT_USER_ID', nil) } + let(:user_name) { ENV.fetch('COCKPIT_USER_NAME', nil) } + let(:user_email) { ENV.fetch('COCKPIT_USER_EMAIL', nil) } + let(:user_password) { ENV.fetch('COCKPIT_USER_PASSWORD', nil) } + + describe '#verify_password' do + let(:new_password) { 'ValidPassword123' } + + # client.verify_password('merchant', new_password) + it 'sends a post request with the correct parameters' + end + + describe '#change_password' do + let(:new_password) { 'ValidPassword123' } + + # client.change_password( + # user_id, + # user_password, + # new_password + # ) + it 'sends a post request with the correct parameters' + + after do + # # Rollback the password change + # client.change_password( + # user_id, + # new_password, + # user_password + # ) + end + end + + describe '#password_reset_email' do + # client.password_reset_email(user_email) + it 'sends a post request with the correct parameters' + end + + describe '#change_username' do + let(:new_name) { 'test-user' } + + # client.change_username( + # user_id, + # user_password, + # new_name + # ) + it 'sends a post request with the correct parameters' + + after do + # # Rollback the username change + # client.change_username( + # user_id, + # user_password, + # user_name + # ) + end + end +end diff --git a/spec/beyond_api/services/checkout/cart_spec.rb b/spec/beyond_api/services/checkout/cart_spec.rb new file mode 100644 index 0000000..cccb127 --- /dev/null +++ b/spec/beyond_api/services/checkout/cart_spec.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Checkout::Cart, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + context 'with cart' do + before(:each) do + @cart = client.create + end + + describe '.create' do + it 'creates a new cart' do + expect(@cart).not_to be nil + expect(@cart[:id]).to be_kind_of(String) + end + end + + describe '.find' do + it 'retrieves the details of a cart' do + cart_details = client.find(@cart[:id]) + expect(cart_details).not_to be nil + expect(cart_details[:id]).to eq(@cart[:id]) + end + end + + describe '.billing_address' do + it 'sets the billing address of the cart' do + body = build(:address_data) + billing_address = client.billing_address(@cart[:id], body) + expect(billing_address).not_to be nil + expect(billing_address[:billing_address][:first_name]).to eq(body[:first_name]) + end + end + + describe '.shipping_address' do + it 'sets the shipping address of the cart' do + body = build(:address_data) + shipping_address = client.shipping_address(@cart[:id], body) + expect(shipping_address).not_to be nil + expect(shipping_address[:shipping_address][:first_name]).to eq(body[:first_name]) + end + end + + describe '.payment_methods' do + it 'lists all applicable payment methods for the current cart' do + response = client.payment_methods(@cart[:id]) + expect(response).not_to be nil + expect(response.dig(:embedded, :payment_methods)).to be_an(Array) + end + end + + describe '.assign_payment_method_to_default' do + it 'sets the cart payment method to the current default payment method' do + response = client.assign_payment_method_to_default(@cart[:id]) + expect(response).not_to be nil + end + end + + describe '.create_payment' do + it 'initiates the creation of a payment' do + body = { + return_uri: 'https://example.com/return', + cancel_uri: 'https://example.com/cancel' + } + # There is no payment method definition associated with this payment method + expect { client.create_payment(@cart[:id], body) }.to raise_error(BeyondApi::Error) + end + end + + describe '.create_payment_and_order' do + it 'initiates the creation of a payment and order for the cart' do + body = build(:payment_data) + # There is no payment method definition associated with this payment method + expect { client.create_payment_and_order(@cart[:id], body) }.to raise_error(BeyondApi::Error) + end + end + + describe '.assign_shipping_method_to_default' do + it 'sets the cart shipping method to the current default shipping method' do + response = client.assign_shipping_method_to_default(@cart[:id]) + expect(response).not_to be nil + end + end + + describe '.pickup_options' do + it 'lists all applicable pickup options for the current cart' do + response = client.pickup_options(@cart[:id]) + expect(response).not_to be nil + expect(response.dig(:embedded, :pickup_options)).to be_an(Array) + end + end + + describe '.redeem_coupon' do + it 'redeems a coupon' do + coupon_code = 'FIRST-ORDER' + # The coupon code validation failed with following messages: Code doesn't exist + expect { client.redeem_coupon(@cart[:id], coupon_code) }.to raise_error(BeyondApi::Error) + end + end + + describe '.delete_coupon' do + it 'removes a coupon from the cart' do + coupon_code = 'FIRST-ORDER' + # The coupon code validation failed with following messages: Code doesn't exist + expect { client.redeem_coupon(@cart[:id], coupon_code) } .to raise_error(BeyondApi::Error) + end + end + + describe '.delete' do + it 'deletes a cart' do + response = client.delete(@cart[:id]) + expect(response).to eq({}) + end + end + + after(:each) do + client.delete(@cart[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/checkout/shipping_zone_spec.rb b/spec/beyond_api/services/checkout/shipping_zone_spec.rb new file mode 100644 index 0000000..8abbd33 --- /dev/null +++ b/spec/beyond_api/services/checkout/shipping_zone_spec.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Checkout::ShippingZone, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shipping_zones' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :shipping_zones)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end +end diff --git a/spec/beyond_api/services/customer_spec.rb b/spec/beyond_api/services/customer_spec.rb new file mode 100644 index 0000000..de27bbb --- /dev/null +++ b/spec/beyond_api/services/customer_spec.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Customer, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all customers' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :customers)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with customer' do + before(:each) do + @customer = client.create(build(:customer_data)) + end + + describe '.create' do + it 'creates a new customer' do + expect(@customer).not_to be nil + expect(@customer.dig(:default_billing_address, :company)).to eq('ePages GmbH') + expect(@customer.dig(:default_billing_address, :first_name)).to eq('Chayanne') + expect(@customer.dig(:default_billing_address, :last_name)).to eq('Team42') + expect(@customer.dig(:default_billing_address, :street)).to eq('Pilatuspool') + expect(@customer.dig(:default_billing_address, :house_number)).to eq('2') + expect(@customer.dig(:default_billing_address, :postal_code)).to eq('20999') + expect(@customer.dig(:default_billing_address, :city)).to eq('Alsterwasser') + expect(@customer.dig(:default_billing_address, :country)).to eq('DE') + expect(@customer.dig(:default_billing_address, :state)).to eq('Hamburg') + expect(@customer.dig(:default_billing_address, :email)).to eq('chayanne@example.com') + expect(@customer.dig(:default_billing_address, :phone)).to eq('(800) 555-0102') + end + end + + describe '.find' do + it 'returns a customer' do + response = client.find(@customer[:id]) + expect(response.dig(:default_billing_address, :first_name)).to eq('Chayanne') + end + end + + describe '.update' do + it 'updates an existing customer' do + updated_customer_data = FactoryBot.build(:customer_data, :berlin_shipping) + + updated_customer = client.update(@customer[:id], updated_customer_data) + expect(updated_customer).not_to be nil + expect(updated_customer.dig(:default_shipping_address, :company)).to eq('Updated GmbH') + end + end + + describe '.events' do + it 'returns all events for a customer' do + response = client.events(@customer[:id]) + expect(response).not_to be nil + expect(response.dig(:embedded, :customer_events)).to be_kind_of(Array) + end + end + + describe '.delete' do + it 'deletes a customer' do + response = client.delete(@customer[:id]) + expect(response).to eq({}) + end + end + + after(:each) do + client.delete(@customer[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/product_management/category_spec.rb b/spec/beyond_api/services/product_management/category_spec.rb new file mode 100644 index 0000000..fae10b8 --- /dev/null +++ b/spec/beyond_api/services/product_management/category_spec.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::ProductManagement::Category, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all categories' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :categories)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with category' do + before(:each) do + @category = client.create(build(:category_data)) + end + + after(:each) do + client.delete(@category[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + + describe '.create' do + it 'creates a new category' do + expect(@category).not_to be nil + expect(@category[:name]).to eq('Team42 Category') + expect(@category[:type]).to eq('SMART') + expect(@category[:default_sort]).to eq('HIGHEST_PRICE_FIRST') + end + end + + describe '.find' do + it 'returns a category' do + response = client.find(@category[:id]) + expect(response[:name]).to eq('Team42 Category') + end + end + + describe '.update' do + it 'updates an existing category' do + updated_category_data = FactoryBot.build(:category_data, :lowest_price_first) + + updated_category = client.update(@category[:id], updated_category_data) + expect(updated_category).not_to be nil + expect(updated_category[:name]).to eq('Category with lowest price first') + expect(updated_category[:default_sort]).to eq('LOWEST_PRICE_FIRST') + end + end + + describe '.delete' do + it 'deletes a category' do + response = client.delete(@category[:id]) + expect(response).to eq({}) + end + end + end +end diff --git a/spec/beyond_api/services/product_management/image_spec.rb b/spec/beyond_api/services/product_management/image_spec.rb new file mode 100644 index 0000000..87e2555 --- /dev/null +++ b/spec/beyond_api/services/product_management/image_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::ProductManagement::Image, vcr: { match_requests_on: [:method, :uri] } do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all images' do + response = client.all('4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc') + + expect(response).not_to be nil + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + describe '.upload' do + it 'uploads an image' do + response = client.upload('4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc', + 'spec/files/image1.png', + 'new-image.png') + + expect(response).not_to be nil + expect(response.dig(:links, :data, :href)).to include('new-image.png') + end + + it 'uploads multiple images' do + response = client.upload_multiple('4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc', + ['spec/files/image2.png', 'spec/files/image3.png'], + ['new-image2.png', 'new-image3.png']) + expect(response).not_to be nil + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + end + end +end diff --git a/spec/beyond_api/services/product_management/product_spec.rb b/spec/beyond_api/services/product_management/product_spec.rb new file mode 100644 index 0000000..b6b6fe7 --- /dev/null +++ b/spec/beyond_api/services/product_management/product_spec.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::ProductManagement::Product, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all products' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :products)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with product' do + before(:each) do + @product = client.create(build(:product_data)) + end + + describe '.create' do + it 'creates a new product' do + expect(@product).not_to be nil + expect(@product[:name]).to eq('Team42 Product') + expect(@product[:essential_features]).to eq('Dry. 12% alcohol. Best vine variety.') + expect(@product[:tags]).to eq(['Bestseller', 'Red Wine', 'Sale']) + expect(@product[:product_identifiers]).to eq([{ type: 'EAN', value: '9780134308135' }]) + end + end + + describe '.find' do + it 'returns a product' do + response = client.find(@product[:id]) + expect(response[:name]).to eq('Team42 Product') + end + end + end +end diff --git a/spec/beyond_api/services/shop/address_spec.rb b/spec/beyond_api/services/shop/address_spec.rb new file mode 100644 index 0000000..78a9505 --- /dev/null +++ b/spec/beyond_api/services/shop/address_spec.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Address, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.get' do + it 'returns the shop address' do + response = client.show + expect(response).not_to be nil + expect(response.keys).to include(:company, :first_name, :last_name, :email, + :phone, :street, :postal_code, :dependent_locality, :city, :state, :country) + end + end +end diff --git a/spec/beyond_api/services/shop/attribute_spec.rb b/spec/beyond_api/services/shop/attribute_spec.rb new file mode 100644 index 0000000..43366ab --- /dev/null +++ b/spec/beyond_api/services/shop/attribute_spec.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Attribute, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop attributes' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :attributes)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with shop attribute' do + before(:each) do + @shop_attribute = client.create('createSku', 'autogenerateSku', true) + end + + describe '.create' do + it 'creates a new shop attribute' do + expect(@shop_attribute).not_to be nil + expect(@shop_attribute[:name]).to eq('createSku') + expect(@shop_attribute[:value]).to eq('autogenerateSku') + expect(@shop_attribute[:public]).to eq(true) + end + end + + describe '.find' do + it 'returns a shop attribute' do + response = client.find('createSku') + expect(response[:value]).to eq('autogenerateSku') + end + end + + describe '.update' do + it 'updates an existing shop attribute' do + response = client.update('createSku', 'autogenerateSku', false) + expect(response).not_to be nil + expect(response[:name]).to eq('createSku') + expect(response[:value]).to eq('autogenerateSku') + expect(response[:public]).to eq(false) + end + end + + describe '.delete' do + it 'deletes a shop attribute' do + expect(client.delete('createSku')).to eq({}) + end + end + + after(:each) do + client.delete('createSku') + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/shop/feature_spec.rb b/spec/beyond_api/services/shop/feature_spec.rb new file mode 100644 index 0000000..e712ee3 --- /dev/null +++ b/spec/beyond_api/services/shop/feature_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Feature, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop features' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :features)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + describe '.find' do + it 'returns a shop feature' do + response = client.find('product-management.max-products') + expect(response[:name]).to eq('product-management.max-products') + end + end +end diff --git a/spec/beyond_api/services/shop/image_spec.rb b/spec/beyond_api/services/shop/image_spec.rb new file mode 100644 index 0000000..2249447 --- /dev/null +++ b/spec/beyond_api/services/shop/image_spec.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Image, vcr: { match_requests_on: [:method, :uri] } do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop images' do + response = client.all + puts response.dig(:embedded, :images).first[:id] + + expect(response).not_to be nil + puts response.dig(:embedded, :images) + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + describe '.find_by_label' do + it 'finds a shop image by label' do + response = client.find_by_label('logo') + + expect(response).not_to be nil + expect(response.dig(:embedded, :images)).to be_kind_of(Array) + end + end + + context 'with a shop image' do + before(:each) do + @image = client.upload('spec/files/image1.png', 'new-image.png', 'logo') + end + + describe '.upload' do + it 'uploads an image' do + expect(@image).not_to be nil + expect(@image.dig(:links, :data, :href)).to include('new-image.png') + end + end + + describe '.find' do + it 'finds a shop image' do + response = client.find(@image[:id]) + + expect(response).not_to be nil + expect(response[:id]).to eq(@image[:id]) + end + end + + describe '.delete' do + it 'deletes a shop image' do + expect(client.delete(@image[:id])).to eq({}) + end + end + + after(:each) do + client.delete(@image[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/shop/language_spec.rb b/spec/beyond_api/services/shop/language_spec.rb new file mode 100644 index 0000000..6400a9e --- /dev/null +++ b/spec/beyond_api/services/shop/language_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Language, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop languages' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :languages)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with language' do + before(:each) do + @response = client.create('it-IT') + end + + describe '.create' do + it 'creates a new shop language' do + expect(@response).not_to be nil + expect(@response[:locale]).to eq('it-IT') + end + end + + describe '.find' do + it 'returns a shop language' do + response = client.find(@response[:id]) + expect(response[:locale]).to eq('it-IT') + end + end + + describe '.delete' do + it 'deletes a shop language' do + response = client.delete(@response[:id]) + expect(response).to eq({}) + end + end + end +end diff --git a/spec/beyond_api/services/shop/location_spec.rb b/spec/beyond_api/services/shop/location_spec.rb new file mode 100644 index 0000000..45ada88 --- /dev/null +++ b/spec/beyond_api/services/shop/location_spec.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Location, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop locations' do + response = client.all + + expect(response).to be_present + expect(response.dig(:embedded, :locations)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with location' do + before(:each) do + @location = client.create(build(:location_data)) + end + + after(:each) do + client.delete(@location[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + + describe '.create' do + it 'creates a new shop location' do + expect(@location).to be_present + expect(@location[:store_code]).to eq('MLC-St-Ives') + end + end + + describe '.find' do + it 'returns a shop location' do + response = client.find(@location[:id]) + expect(response[:store_code]).to eq('MLC-St-Ives') + end + end + + describe '.update' do + it 'updates a shop location' do + updated_location_data = FactoryBot.build(:location_data, :alternative_name) + response = client.update(@location[:id], updated_location_data) + + expect(response).to be_present + expect(response[:company_name]).to eq('Updated Cornershop') + end + end + + describe '.delete' do + it 'deletes a shop location' do + response = client.delete(@location[:id]) + expect(response).to eq({}) + end + end + end +end diff --git a/spec/beyond_api/services/shop/shop_spec.rb b/spec/beyond_api/services/shop/shop_spec.rb new file mode 100644 index 0000000..4920295 --- /dev/null +++ b/spec/beyond_api/services/shop/shop_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Shop, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.get' do + it 'returns the shop details' do + response = client.show + expect(response).not_to be nil + expect(response.keys).to include(:name, :reseller_name, :primary_hostname, :default_locale) + end + end +end diff --git a/spec/beyond_api/services/storefront/script_tag_spec.rb b/spec/beyond_api/services/storefront/script_tag_spec.rb new file mode 100644 index 0000000..36b497f --- /dev/null +++ b/spec/beyond_api/services/storefront/script_tag_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Storefront::ScriptTag, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all script tags' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :script_tags)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with script tag' do + before(:each) do + @script_tag = client.create('https://example.com/scripts/exampleScript.js') + end + + describe '.create' do + it 'creates a new category' do + expect(@script_tag).not_to be nil + expect(@script_tag[:script_url]).to eq('https://example.com/scripts/exampleScript.js') + end + end + + describe '.delete' do + it 'deletes a script tag' do + response = client.delete(@script_tag[:id]) + expect(response).to eq({}) + end + end + + after(:each) do + client.delete(@script_tag[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/services/webhook/subscription_spec.rb b/spec/beyond_api/services/webhook/subscription_spec.rb new file mode 100644 index 0000000..91dcab8 --- /dev/null +++ b/spec/beyond_api/services/webhook/subscription_spec.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Webhook::Subscription, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all webhook subscriptions' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :subscriptions)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with webhook subscription' do + before(:each) do + @webhook_subscription = client.create(build(:webhook_data)) + end + + describe '.create' do + it 'creates a new webhook subscription' do + expect(@webhook_subscription).not_to be nil + expect(@webhook_subscription[:callback_uri]).to eq('http://example.com/test') + expect(@webhook_subscription[:event_types]).to eq(['order.created', 'product.created']) + end + end + + describe '.find' do + it 'returns a webhook subscription' do + response = client.find(@webhook_subscription[:id]) + expect(response[:callback_uri]).to eq('http://example.com/test') + end + end + + describe '.delete' do + it 'deletes a webhook subscription' do + response = client.delete(@webhook_subscription[:id]) + expect(response).to eq({}) + end + end + + describe '.deactivate' do + it 'deactivates a webhook subscription' do + response = client.deactivate(@webhook_subscription[:id]) + expect(response).not_to be nil + expect(response[:active]).to eq(false) + end + end + + describe '.activate' do + it 'activates a webhook subscription' do + response = client.activate(@webhook_subscription[:id]) + expect(response).not_to be nil + expect(response[:active]).to eq(true) + end + end + + describe '.failures' do + it 'lists all failed deliveries of a webhook subscription' do + response = client.failures(@webhook_subscription[:id], { size: 100, page: 0 }) + expect(response).not_to be nil + expect(response.dig(:embedded, :failures)).to be_kind_of(Array) + end + end + + describe '.retry' do + it 'retries a failed webhook delivery' do + failure_id = '987e6543-e21b-45d3-b123-654321098765' + # Non existing failure ID will raise an error + expect { client.retry(@webhook_subscription[:id], failure_id) }.to raise_error(BeyondApi::Error) + end + end + + describe '.delete_failure' do + it 'deletes a webhook failure' do + failure_id = '123e4567-e89b-12d3-a456-426614174000' + # Non existing failure ID will raise an error + expect { client.delete_failure(@webhook_subscription[:id], failure_id) }.to raise_error(BeyondApi::Error) + end + end + + after(:each) do + client.delete(@webhook_subscription[:id]) + rescue BeyondApi::Error # rubocop:disable Lint/SuppressedException + end + end +end diff --git a/spec/beyond_api/utils_spec.rb b/spec/beyond_api/utils_spec.rb index d1c8d85..fd22958 100644 --- a/spec/beyond_api/utils_spec.rb +++ b/spec/beyond_api/utils_spec.rb @@ -2,17 +2,17 @@ RSpec.describe 'BeyondApi::Utils' do let!(:file_path) do - app_root = File.expand_path(File.dirname("ext.rb")) + app_root = File.expand_path(File.dirname('ext.rb')) "#{app_root}/spec/files/" end - it "return image content type" do + it 'return image content type' do file = "#{file_path}image1.png" - expect(BeyondApi::Utils.file_content_type(file)).to eq "image/png" + expect(BeyondApi::Utils.file_content_type(file)).to eq 'image/png' end - it "parse snakecase to camelcase" do - expect("sales_price".camelize(false)).to eq "salesPrice" + it 'parse snakecase to camelcase' do + expect('sales_price'.camelize(:lower)).to eq 'salesPrice' end end diff --git a/spec/beyond_api_spec.rb b/spec/beyond_api_spec.rb index 71fe28e..362cb39 100644 --- a/spec/beyond_api_spec.rb +++ b/spec/beyond_api_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true RSpec.describe BeyondApi do - it "has a version number" do + it 'has a version number' do expect(BeyondApi::VERSION).not_to be nil end end diff --git a/spec/factories/address_data.rb b/spec/factories/address_data.rb new file mode 100644 index 0000000..d5760b5 --- /dev/null +++ b/spec/factories/address_data.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :address_data, class: Hash do + salutation { 'Mrs' } + gender { 'FEMALE' } + title { 'Dr' } + first_name { 'Astrid' } + middle_name { 'Agnes' } + last_name { 'Alster' } + street { 'Alsterwasserweg' } + house_number { '2' } + street2 { 'Erdgeschoss' } + door_code { '0185' } + address_extension { 'Hinterhof' } + postal_code { '20999' } + dependent_locality { 'Seevetal' } + city { 'Alsterwasser' } + country { 'DE' } + state { 'Hamburg' } + email { 'a.alsterh@example.com' } + phone { '(800) 555-0102' } + mobile { '(800) 555-0103' } + vat_id { '123456789' } + tax_number { '123-34-6789' } + birth_date { '1985-03-20' } + + initialize_with { attributes } + end +end diff --git a/spec/factories/category_data.rb b/spec/factories/category_data.rb new file mode 100644 index 0000000..d150967 --- /dev/null +++ b/spec/factories/category_data.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :category_data, class: Hash do + name { 'Team42 Category' } + type { 'SMART' } + default_sort { 'HIGHEST_PRICE_FIRST' } + + trait :lowest_price_first do + name { 'Category with lowest price first' } + default_sort { 'LOWEST_PRICE_FIRST' } + end + + initialize_with { attributes } + end +end diff --git a/spec/factories/customer_data.rb b/spec/factories/customer_data.rb new file mode 100644 index 0000000..abbc1c1 --- /dev/null +++ b/spec/factories/customer_data.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :customer_data, class: Hash do + email { 'chayanne@example.com' } + customer_comment { 'A reliable customer' } + + billing_address do + { + company: 'ePages GmbH', + first_name: 'Chayanne', + last_name: 'Team42', + street: 'Pilatuspool', + house_number: '2', + postal_code: '20999', + city: 'Alsterwasser', + country: 'DE', + state: 'Hamburg', + email: 'chayanne@example.com', + phone: '(800) 555-0102' + } + end + + shipping_address do + { + gender: 'FEMALE', + company: 'Astrid Alster GmbH', + first_name: 'Astrid', + last_name: 'Alster', + street: 'Alsterwasserweg', + house_number: '2', + postal_code: '20999', + city: 'Alsterwasser', + country: 'DE', + state: 'Hamburg', + email: 'alsterh@example.com', + phone: '(800) 555-0102' + } + end + + trait :berlin_shipping do + shipping_address do + { + gender: 'FEMALE', + company: 'Updated GmbH', + first_name: 'Astrid', + last_name: 'Alster', + street: 'Berlin Street', + house_number: '42', + postal_code: '12345', + city: 'Berlin', + country: 'DE', + state: 'Berlin', + email: 'alsterh@example.com', + phone: '(800) 555-0102' + } + end + end + + initialize_with { attributes } + end +end diff --git a/spec/factories/location_data.rb b/spec/factories/location_data.rb new file mode 100644 index 0000000..8cd1d28 --- /dev/null +++ b/spec/factories/location_data.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :location_data, class: Hash do + language_code { 'en' } + store_code { 'MLC-St-Ives' } + company_name { 'My little Cornershop - St.Ives' } + primary_phone { '(800) 555-0102' } + + address do + { + postal_code: '90999', + street: 'Hudson Way', + house_number: '27', + city: 'St.Ives', + country: 'GB', + dependent_locality: '', + state: 'Cornwall' + } + end + + google_status { 'ACTIVE' } + + google_primary_category do + { + category_id: 'gcid:storefood', + display_name: 'Food' + } + end + + google_additional_categories do + [ + { + display_name: 'Drinks', + category_id: 'gcid:storedrinks' + } + ] + end + + regular_hours do + { + periods: [ + { + open_day: 'MONDAY', + open_time: '08:00', + close_day: 'MONDAY', + close_time: '17:00' + }, + { + open_day: 'SATURDAY', + open_time: '10:00', + close_day: 'SATURDAY', + close_time: '16:00' + } + ] + } + end + + lat_lng do + { + latitude: 53.5847424, + longitude: 9.968901 + } + end + + trait :alternative_name do + company_name { 'Updated Cornershop' } + end + + initialize_with { attributes } + end +end diff --git a/spec/factories/payment_data.rb b/spec/factories/payment_data.rb new file mode 100644 index 0000000..7282d12 --- /dev/null +++ b/spec/factories/payment_data.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :payment_data, class: Hash do + initialize_with { + { + return_uri: 'https://example.com/return', + cancel_uri: 'https://example.com/cancel', + customer_comment: 'Please send with UPS.', + sales_channel: 'Storefront', + marketing_channel: 'Google Shopping', + marketing_subchannel: 'Summer Sale', + test_order: false, + terms_and_conditions_explicitly_accepted: true + } + } + end +end diff --git a/spec/factories/product_data.rb b/spec/factories/product_data.rb new file mode 100644 index 0000000..8f08410 --- /dev/null +++ b/spec/factories/product_data.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :product_data, class: Hash do + name { 'Team42 Product' } + description { "Spain\nRioja Tempranillo" } + manufacturer { 'Grape Vineyard' } + essential_features { 'Dry. 12% alcohol. Best vine variety.' } + tags { ['Bestseller', 'Red Wine', 'Sale'] } + + product_identifiers do + [ + { + type: 'EAN', + value: '9780134308135' + } + ] + end + + sales_price do + { + tax_model: 'GROSS', + amount: 8.7, + currency: 'GBP' + } + end + + list_price do + { + tax_model: 'GROSS', + amount: 10.95, + currency: 'GBP' + } + end + + manufacturer_price do + { + tax_model: 'GROSS', + amount: 11.95, + currency: 'GBP' + } + end + + visible { true } + tax_class { 'REGULAR' } + + shipping_weight do + { + value: 1175.0, + display_unit: 'GRAMS' + } + end + + max_order_quantity { 6 } + + shipping_dimension do + { + length: 1500, + width: 1000, + height: 2000 + } + end + + ref_price do + { + ref_quantity: 1, + unit: 'LITER', + quantity: 0.75, + price: { + tax_model: 'GROSS', + amount: 11.6, + currency: 'GBP' + } + } + end + + shipping_period do + { + min: 2, + max: 4, + display_unit: 'WEEKS' + } + end + + pickup_period do + { + min: 1, + max: 2, + display_unit: 'WEEKS' + } + end + + product_labels do + [ + { + type: 'NEW', + active_from: '2024-08-13T11:31:30.210787732', + active_until: '2024-09-10T11:31:30.210787732' + } + ] + end + + initialize_with { attributes } + end +end diff --git a/spec/factories/products.rb b/spec/factories/products.rb index d3fd11b..105481d 100644 --- a/spec/factories/products.rb +++ b/spec/factories/products.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "faker" +require 'faker' FactoryBot.define do factory :product, class: Hash do @@ -8,23 +8,23 @@ description { Faker::Lorem.paragraph } manufacturer { Faker::Company.name } essential_features { Faker::Lorem.paragraph } - tags { Faker::Lorem.words(number: 3).push("beyond_api-ruby_client") } + tags { Faker::Lorem.words(number: 3).push('beyond_api-ruby_client') } default = { sales_price: { - tax_model: "GROSS", + tax_model: 'GROSS', amount: 8.7, - currency: "GBP" + currency: 'GBP' }, list_price: { - tax_model: "GROSS", + tax_model: 'GROSS', amount: 10.95, - currency: "GBP" + currency: 'GBP' }, manufacturer_price: { - tax_model: "GROSS", + tax_model: 'GROSS', amount: 99.95, - currency: "GBP" + currency: 'GBP' }, shipping_dimension: { length: 1500, @@ -33,23 +33,23 @@ }, ref_price: { ref_quantity: 1, - unit: "LITER", + unit: 'LITER', quantity: 0.75, price: { - tax_model: "GROSS", + tax_model: 'GROSS', amount: 11.6, - currency: "GBP" + currency: 'GBP' } }, shipping_period: { min: 2, max: 4, - display_unit: "WEEKS" + display_unit: 'WEEKS' }, pickup_period: { min: 1, max: 2, - display_unit: "WEEKS" + display_unit: 'WEEKS' } } @@ -62,8 +62,8 @@ trait :with_variations do variation_attributes do [ - { display_name: "size", values: %w[s m] }, - { display_name: "color", values: %w[red green blue] } + { display_name: 'size', values: %w[s m] }, + { display_name: 'color', values: %w[red green blue] } ] end end diff --git a/spec/factories/webhook_data.rb b/spec/factories/webhook_data.rb new file mode 100644 index 0000000..dd5aa67 --- /dev/null +++ b/spec/factories/webhook_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :webhook_data, class: Hash do + callback_uri { 'http://example.com/test' } + event_types { ['order.created', 'product.created'] } + + initialize_with { attributes } + end +end diff --git a/spec/files/image3.png b/spec/files/image3.png new file mode 100644 index 0000000..ae85c3d Binary files /dev/null and b/spec/files/image3.png differ diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a2f6a4d..6550c50 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,13 +1,15 @@ # frozen_string_literal: true -require "bundler/setup" -require "dotenv/load" -require "beyond_api" -require "factory_bot" +require 'bundler/setup' +require 'dotenv/load' +require 'beyond_api' +require 'factory_bot' + +Dotenv.load('.env.test') RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" + config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! @@ -22,27 +24,20 @@ FactoryBot.find_definitions end - config.after(:suite) do - session = BeyondApi::Session.new(api_url: ENV["SHOP_URL"]) - session.token.client_credentials + app_root = File.expand_path(File.dirname('vcr.rb')) - products = session.products.all - products.embedded.products.each do |product| - session.products.delete(product.id) - end - end + load "#{app_root}/spec/support/vcr.rb" +end - AppRoot = File.expand_path(File.dirname("ext.rb")) +BeyondApi.setup do |config| + config.client_id = ENV.fetch('CLIENT_ID', nil) + config.client_secret = ENV.fetch('CLIENT_SECRET', nil) +end - load "#{AppRoot}/lib/beyond_api/ext.rb" +def auth_client + BeyondApi::Authentication::Token.new(api_url: ENV.fetch('API_URL', nil)) end -unless ENV["CLIENT_ID"].nil? && ENV["CLIENT_SECRET"].nil? - BeyondApi.setup do |config| - config.client_id = ENV["CLIENT_ID"] - config.client_secret = ENV["CLIENT_SECRET"] - config.remove_response_links = false - config.remove_response_key_underscores = true - config.object_struct_responses = true - end +def beyond_access_token + auth_client.client_credentials[:access_token] end diff --git a/spec/support/vcr.rb b/spec/support/vcr.rb new file mode 100644 index 0000000..d2f2258 --- /dev/null +++ b/spec/support/vcr.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require 'jwt' +require 'vcr' + +VCR.configure do |config| + config.cassette_library_dir = 'spec/vcr_cassettes' + config.hook_into :webmock + config.configure_rspec_metadata! + config.ignore_localhost = true + config.default_cassette_options = { + match_requests_on: [:method, :uri, :body] + } + + config.filter_sensitive_data('') do |interaction| + authorizations = interaction.request.headers['Authorization'].first + if (match = authorizations.match(/^(Bearer|Basic)\s+([^,\s]+)/)) + match.captures.last + end + end + + config.filter_sensitive_data('') do |interaction| + response_body = JSON.parse(interaction.response.body) + response_body['access_token'] if response_body.is_a?(Hash) + rescue JSON::ParserError + nil + end + + config.filter_sensitive_data('') do |interaction| + response_body = JSON.parse(interaction.response.body) + response_body['refresh_token'] if response_body.is_a?(Hash) + rescue JSON::ParserError + nil + end + + config.filter_sensitive_data('') do |_interaction| + ENV.fetch('REFRESH_TOKEN', nil) + end + + config.filter_sensitive_data('') do |_interaction| + JWT.encode({ exp: (DateTime.now + 1.year).to_i }, nil, 'HS256') + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml new file mode 100644 index 0000000..030cc77 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/_all/returns_all_signers.yml @@ -0,0 +1,159 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.097' + X-B3-Traceid: + - '0636875c3bbcbab7867bda535fe5e243' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "8JwEzj6jy1EWDAYb40//fdukLso=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.025' + X-B3-Traceid: + - 50d800fb4b92bedd1b243cbfadba6fb4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "signers" : [ { + "_id" : "3c910dd7-65d8-4ee5-af7d-dd82de834d4b", + "createdAt" : "2024-08-19T06:37:59.951", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/3c910dd7-65d8-4ee5-af7d-dd82de834d4b" + } + } + }, { + "_id" : "7add803f-df8a-46a4-9e75-5afd75b01adc", + "createdAt" : "2024-08-19T06:36:40.976", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/7add803f-df8a-46a4-9e75-5afd75b01adc" + } + } + }, { + "_id" : "82920cfb-e1ab-4b3c-8e33-5702d86f6876", + "createdAt" : "2024-08-19T06:37:28.279", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/82920cfb-e1ab-4b3c-8e33-5702d86f6876" + } + } + }, { + "_id" : "b3de5fef-8385-4df4-a9a5-74a5aacb1277", + "createdAt" : "2024-08-19T06:35:38.891", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/b3de5fef-8385-4df4-a9a5-74a5aacb1277" + } + } + } ] + } + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml new file mode 100644 index 0000000..f826990 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_create/creates_a_new_signer.yml @@ -0,0 +1,131 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.107' + X-B3-Traceid: + - 76c69d85f495cae946b442180d524db6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "J/GfScnFC3pMwwgs5YDiIVP1HXo=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - 701352c68f255753f503b83c7fc89eba + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "2248041d-692c-4367-afc0-345cc68eab34", + "sharedSecret" : "59dh9nooefbgcqjnqtggu5s5j4", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/2248041d-692c-4367-afc0-345cc68eab34" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml new file mode 100644 index 0000000..dc2e937 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_delete/deletes_a_signer.yml @@ -0,0 +1,185 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:22:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - 27d6f6696bed6e3f01e81ab3577000d5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055779, + "jti" : "l7k8DMT7GM5WeH61G8VGwETkteM=" + } + recorded_at: Mon, 19 Aug 2024 08:22:59 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.041' + X-B3-Traceid: + - 6e71c1fa205231a52c7a58429b64b89b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "92cb69c7-a830-4312-9dae-ffcf6603bba7", + "sharedSecret" : "u3v38frnqt59vka22kqaumpgft", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/92cb69c7-a830-4312-9dae-ffcf6603bba7" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/signers/92cb69c7-a830-4312-9dae-ffcf6603bba7 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.043' + X-B3-Traceid: + - 34a99a554db99d028a1c47648840cf07 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml new file mode 100644 index 0000000..7b368bd --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Signer/with_signer/_destroy/deletes_a_signer.yml @@ -0,0 +1,185 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:41 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.109' + X-B3-Traceid: + - d72048fff4e94acf0c52280599675dd9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049641, + "jti" : "DjCpOBsqfphiDcCkDgpoRP4k5EM=" + } + recorded_at: Mon, 19 Aug 2024 06:40:41 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/signers + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - c0ee336f1e05d262a21d2b02500caa18 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "494bf9b6-6550-486c-af70-1f6ba20efc15", + "sharedSecret" : "7i089vqpip8rp1rr8knpvtn9vf", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/signers/494bf9b6-6550-486c-af70-1f6ba20efc15" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/signers/494bf9b6-6550-486c-af70-1f6ba20efc15 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - 4ff4a18a386e580d5cb7bad07cd18f96 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml new file mode 100644 index 0000000..b3d84ca --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/refreshes_the_token.yml @@ -0,0 +1,67 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=refresh_token&refresh_token= + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.068' + X-B3-Traceid: + - 763a7dd5f009d1ffbc6fbf526ebed43e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "refresh_token" : "", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "DrMFA8sRZZLLJO+ba+Jand8vQA0=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml new file mode 100644 index 0000000..33b231f --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_authorization_code.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?code=abcde&grant_type=authorization_code + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.065' + X-B3-Traceid: + - f7ff23495578391a48e8521e43b1713c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "error" : "invalid_grant", + "error_description" : "Invalid authorization code: abcde" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml new file mode 100644 index 0000000..ef2289a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Authentication_Token/retrieves_token_via_client_credentials.yml @@ -0,0 +1,66 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - 7bdb93b33bd69b735ecb9e195d0f5480 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "0kCHmq0DeCKbXbVed8Em4P49/SM=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_payment_method/sets_the_current_payment_method_of_a_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_payment_method/sets_the_current_payment_method_of_a_cart.yml new file mode 100644 index 0000000..24cb679 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_payment_method/sets_the_current_payment_method_of_a_cart.yml @@ -0,0 +1,482 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:04:38 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - 77f0257a5ccfbc4c32587f233fae302b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813078, + "jti" : "6M7nLBHzrTav8bpe8UCgNnPbA8s=" + } + recorded_at: Tue, 01 Oct 2024 20:04:38 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:04:38 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - dcaa001f17275403d751969870620c95 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "b32c12fe-da0a-4100-b0bb-21c35a2233ce", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:04:38 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/payment-methods + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:04:38 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.041' + X-B3-Traceid: + - fa950b00f3ae4387384668f1f4f31914 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "payment-methods" : [ { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "147d2711-367f-4344-8637-f4b88418b751", + "name" : "Payment in advance", + "description" : null, + "officialName" : "Payment in advance", + "officialDescription" : "You only dispatch the goods upon receipt of the customer payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 2, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751/deactivate" + } + } + } + } + }, { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "245bf7d1-507d-442e-b9cb-7c8bca086cdf", + "name" : "Cash", + "description" : null, + "officialName" : "Cash", + "officialDescription" : "The customer pays the invoice in cash.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 3, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf/deactivate" + } + } + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce/payment-methods" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:04:38 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/b32c12fe-da0a-4100-b0bb-21c35a2233ce + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:04:38 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - bef8f058d161ef5fd78ecf6d9afa31a9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:04:38 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_pickup_option/sets_the_current_pickup_option_of_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_pickup_option/sets_the_current_pickup_option_of_the_cart.yml new file mode 100644 index 0000000..70461d2 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_pickup_option/sets_the_current_pickup_option_of_the_cart.yml @@ -0,0 +1,350 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:52 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.082' + X-B3-Traceid: + - c3cf2c3bcd83e24e365631c2a2cb29d8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813272, + "jti" : "tSvKcnmWQMcJ3IT9TjTYOdjSzQY=" + } + recorded_at: Tue, 01 Oct 2024 20:07:52 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:07:52 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.081' + X-B3-Traceid: + - e8867039a94ad1f56c02cd1249c453ef + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "25cb7a7b-ca72-45f4-8408-0c3cc37d413f", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:52 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/pickup-options + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:53 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.032' + X-B3-Traceid: + - 84c1001da08c7dabd034e0b053996b62 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "pickup-options" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f/pickup-options" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:53 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/25cb7a7b-ca72-45f4-8408-0c3cc37d413f + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:07:53 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.066' + X-B3-Traceid: + - aacbeee416e129f1b59e12947d06bb3c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:07:53 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_shipping_method/sets_the_current_shipping_method_of_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_shipping_method/sets_the_current_shipping_method_of_the_cart.yml new file mode 100644 index 0000000..80dce76 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_shipping_method/sets_the_current_shipping_method_of_the_cart.yml @@ -0,0 +1,356 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:06:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.079' + X-B3-Traceid: + - 05f724f0f7b499f6b68d7a232c545943 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813209, + "jti" : "3bFpbL5cwdCZm66kdEfShzvztPw=" + } + recorded_at: Tue, 01 Oct 2024 20:06:49 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:06:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.087' + X-B3-Traceid: + - 764b1db0c32fb170524e2762be7a71e3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "a1f7f04a-92e5-4b73-b54f-6fd840132c8d", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:06:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shipping-zones/search/find-all-serviceable-countries + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:06:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - a2ecd77d3ff7851e2b8469c76d81fc09 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "countryCodes" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shipping-zones/search/find-all-serviceable-countries?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Tue, 01 Oct 2024 20:06:49 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/a1f7f04a-92e5-4b73-b54f-6fd840132c8d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:06:49 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 6320d2b73176dfa028469c45d0a2e888 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:06:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_payment_method_to_default/sets_the_cart_payment_method_to_the_current_default_payment_method.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_payment_method_to_default/sets_the_cart_payment_method_to_the_current_default_payment_method.yml new file mode 100644 index 0000000..b48372a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_payment_method_to_default/sets_the_cart_payment_method_to_the_current_default_payment_method.yml @@ -0,0 +1,454 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:04:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.391' + X-B3-Traceid: + - fce230b509155b9ced2f69ba54927c2c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813099, + "jti" : "NBudFzfaMV2OWWKngrsF078fEhE=" + } + recorded_at: Tue, 01 Oct 2024 20:04:59 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:04:59 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.093' + X-B3-Traceid: + - 139c36d45247c14d4c7a80e92fa805dd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "d9e2cadf-d1ea-4091-a275-7eea4cb88f84", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:04:59 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods/default + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:05:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.124' + X-B3-Traceid: + - cd9ddd4ca14720b59d577278ea5d738a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "d9e2cadf-d1ea-4091-a275-7eea4cb88f84", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:05:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/d9e2cadf-d1ea-4091-a275-7eea4cb88f84 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:05:00 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.160' + X-B3-Traceid: + - e6dd26b42d6802fb8bd85d7c33ca9cbb + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:05:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_shipping_method_to_default/sets_the_cart_shipping_method_to_the_current_default_shipping_method.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_shipping_method_to_default/sets_the_cart_shipping_method_to_the_current_default_shipping_method.yml new file mode 100644 index 0000000..398f7d9 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_shipping_method_to_default/sets_the_cart_shipping_method_to_the_current_default_shipping_method.yml @@ -0,0 +1,454 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:23 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.102' + X-B3-Traceid: + - 34c8f2353316c212674f06be0c44a72a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813243, + "jti" : "XgcBJcZIj3i8XsnbhpizCfxtkL4=" + } + recorded_at: Tue, 01 Oct 2024 20:07:23 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:07:24 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.081' + X-B3-Traceid: + - fd79b030573545428a7d4798b94450f7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "46a79192-24c9-496c-bca0-1ded8375fb2f", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:24 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods/default + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:24 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.100' + X-B3-Traceid: + - 1bace450daac807d8a450d0941d555e4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "46a79192-24c9-496c-bca0-1ded8375fb2f", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:24 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/46a79192-24c9-496c-bca0-1ded8375fb2f + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:07:24 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.047' + X-B3-Traceid: + - 1586d3dbb40c1f5152a90aac1729715a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:07:24 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_billing_address/sets_the_billing_address_of_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_billing_address/sets_the_billing_address_of_the_cart.yml new file mode 100644 index 0000000..6226fe7 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_billing_address/sets_the_billing_address_of_the_cart.yml @@ -0,0 +1,479 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:16 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.101' + X-B3-Traceid: + - 85ec9b1cce9397312009dd3f126b3fc4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727812996, + "jti" : "5w3jsqpuSH4YCd4UHatsR438nSg=" + } + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:16 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - b6b8d86a53da625352b25d2983e41f21 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "8aa01a0c-ebda-4124-bbee-cd7ca377dcbf", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/billing-address + body: + encoding: UTF-8 + string: '{"salutation":"Mrs","gender":"FEMALE","title":"Dr","firstName":"Astrid","middleName":"Agnes","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","street2":"Erdgeschoss","doorCode":"0185","addressExtension":"Hinterhof","postalCode":"20999","dependentLocality":"Seevetal","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"a.alsterh@example.com","phone":"(800) + 555-0102","mobile":"(800) 555-0103","vatId":"123456789","taxNumber":"123-34-6789","birthDate":"1985-03-20"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:16 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.111' + X-B3-Traceid: + - 87f3d7afbac7397832ba815d3ecdc7e4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "8aa01a0c-ebda-4124-bbee-cd7ca377dcbf", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : { + "salutation" : "Mrs", + "gender" : "FEMALE", + "company" : null, + "title" : "Dr", + "firstName" : "Astrid", + "middleName" : "Agnes", + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : "Erdgeschoss", + "addressExtension" : "Hinterhof", + "postalCode" : "20999", + "dependentLocality" : "Seevetal", + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "a.alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : "(800) 555-0103", + "displayAddressLines" : [ "Astrid Agnes Alster", "Seevetal", "Alsterwasserweg 2", "Erdgeschoss", "Hinterhof", "20999 Alsterwasser", "GERMANY" ], + "vatId" : "123456789", + "taxNumber" : "123-34-6789", + "birthDate" : "1985-03-20" + }, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : false, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : true, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/8aa01a0c-ebda-4124-bbee-cd7ca377dcbf + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:16 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 44c95c385c6d21cb283b03380f7d75d8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create/creates_a_new_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create/creates_a_new_cart.yml new file mode 100644 index 0000000..76257c0 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create/creates_a_new_cart.yml @@ -0,0 +1,286 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - fd033537449745e7082e60517bfaa397 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727812995, + "jti" : "8v32vw6JOhZ7W37UlXmBl4rXWh0=" + } + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - dfd6b786ea2cbc6c8630c92a50ba7dff + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "d1de800e-b0b5-498b-819b-9ff0cc49bc61", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/d1de800e-b0b5-498b-819b-9ff0cc49bc61 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.042' + X-B3-Traceid: + - 365c452cd2d30ad8fdb3bf5be24cdd17 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment/initiates_the_creation_of_a_payment.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment/initiates_the_creation_of_a_payment.yml new file mode 100644 index 0000000..4eceb68 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment/initiates_the_creation_of_a_payment.yml @@ -0,0 +1,346 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:05:10 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.097' + X-B3-Traceid: + - 96d30f67297d71844092adac149334e5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813110, + "jti" : "1MNpkATSZ5FbBCuGnFiZ0DMj9wc=" + } + recorded_at: Tue, 01 Oct 2024 20:05:10 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:05:11 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.094' + X-B3-Traceid: + - 544df6fadc6c8162f7c19c4d2dbdf2b3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "484bb211-fd69-406a-92f5-c1ce98aacf62", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:05:11 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62/create-payment + body: + encoding: UTF-8 + string: '{"returnUri":"https://example.com/return","cancelUri":"https://example.com/cancel"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Tue, 01 Oct 2024 20:05:11 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - e4c13f7e022065274abf2ae8f2c2136a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "payment-method-error", + "details" : { }, + "message" : "There is no payment method definition associated with this payment method!", + "traceId" : "e4c13f7e022065274abf2ae8f2c2136a" + } + recorded_at: Tue, 01 Oct 2024 20:05:11 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/484bb211-fd69-406a-92f5-c1ce98aacf62 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:05:11 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.051' + X-B3-Traceid: + - 754b32b2c849f4bd7a1b7f2715a3419a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:05:11 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment_and_order/initiates_the_creation_of_a_payment_and_order_for_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment_and_order/initiates_the_creation_of_a_payment_and_order_for_the_cart.yml new file mode 100644 index 0000000..df79645 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment_and_order/initiates_the_creation_of_a_payment_and_order_for_the_cart.yml @@ -0,0 +1,348 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:06:19 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.099' + X-B3-Traceid: + - f36ce2bf2a71478f2de2889dcce45830 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813179, + "jti" : "r8ZL54Cu4EmXWQDpeCymzQZ/geQ=" + } + recorded_at: Tue, 01 Oct 2024 20:06:19 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:06:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.122' + X-B3-Traceid: + - '08d77776ca281acbf9d51e8b77ae826b' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "350f2378-11dd-4635-a1c0-0cfcb8fc128d", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:06:19 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d/create-payment + body: + encoding: UTF-8 + string: '{"returnUri":"https://example.com/return","cancelUri":"https://example.com/cancel","customerComment":"Please + send with UPS.","salesChannel":"Storefront","marketingChannel":"Google Shopping","marketingSubchannel":"Summer + Sale","testOrder":false,"termsAndConditionsExplicitlyAccepted":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Tue, 01 Oct 2024 20:06:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.035' + X-B3-Traceid: + - ea06e638dfe86ffa059a7622edc6d0ec + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "payment-method-error", + "details" : { }, + "message" : "There is no payment method definition associated with this payment method!", + "traceId" : "ea06e638dfe86ffa059a7622edc6d0ec" + } + recorded_at: Tue, 01 Oct 2024 20:06:19 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/350f2378-11dd-4635-a1c0-0cfcb8fc128d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:06:19 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.038' + X-B3-Traceid: + - 80d8efac6e53eacbb4a3e176e40bdb2f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:06:19 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete/deletes_a_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete/deletes_a_cart.yml new file mode 100644 index 0000000..bec2b23 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete/deletes_a_cart.yml @@ -0,0 +1,336 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.079' + X-B3-Traceid: + - 2dd0c2c1c4adb3cfa1f2c9f795490392 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727812997, + "jti" : "TNSxsfAbKA1G0B+/GzMi0aCAthU=" + } + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.082' + X-B3-Traceid: + - 0df83e6c15708c0949413b3e2f504883 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ec83da0e-e467-4b68-9bfe-01d6c2662594", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:18 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.041' + X-B3-Traceid: + - 03ad1c14c8442b09ee4d048ef55db953 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/ec83da0e-e467-4b68-9bfe-01d6c2662594 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:18 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.025' + X-B3-Traceid: + - da5e20e16540b8b11f6046d8f2f25e12 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:18 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete_coupon/removes_a_coupon_from_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete_coupon/removes_a_coupon_from_the_cart.yml new file mode 100644 index 0000000..b029135 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete_coupon/removes_a_coupon_from_the_cart.yml @@ -0,0 +1,346 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:08:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.121' + X-B3-Traceid: + - 5e05b616a566f5a7dcfb16a13ee5cf4b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813325, + "jti" : "1kOHABnuzD+GtLFX/pjkjUURlzA=" + } + recorded_at: Tue, 01 Oct 2024 20:08:45 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:08:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.212' + X-B3-Traceid: + - f86d792147d371f3a08c09545f43203b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "41ea4466-3ccd-4675-842f-e3721678239b", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:08:45 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b/coupon + body: + encoding: UTF-8 + string: '{"code":"FIRST-ORDER"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Tue, 01 Oct 2024 20:08:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.030' + X-B3-Traceid: + - 823181aa2bacae8d10a4af07ce03a134 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "invalid-coupon-code", + "details" : { }, + "message" : "The coupon code validation failed with following messages: Code doesn't exist", + "traceId" : "823181aa2bacae8d10a4af07ce03a134" + } + recorded_at: Tue, 01 Oct 2024 20:08:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/41ea4466-3ccd-4675-842f-e3721678239b + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:08:46 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.043' + X-B3-Traceid: + - fcc87b22386ce76298cc0842c76c868f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:08:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_find/retrieves_the_details_of_a_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_find/retrieves_the_details_of_a_cart.yml new file mode 100644 index 0000000..1583162 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_find/retrieves_the_details_of_a_cart.yml @@ -0,0 +1,454 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 75894d0f21155c965ac551b7d4d81b8a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727812995, + "jti" : "OcIliKw8V/7D0h/D9fWjtTLdb78=" + } + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.083' + X-B3-Traceid: + - 9a0557ae2058c8e6b7561597f069b117 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "bcabd1d7-b760-4d7e-8147-2154b173f5bd", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:15 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.071' + X-B3-Traceid: + - fb74825159d6dc421db0613e00ced273 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "bcabd1d7-b760-4d7e-8147-2154b173f5bd", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:15 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/bcabd1d7-b760-4d7e-8147-2154b173f5bd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:16 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - 224850fa49e340a4f35e68cba87794a6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_payment_methods/lists_all_applicable_payment_methods_for_the_current_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_payment_methods/lists_all_applicable_payment_methods_for_the_current_cart.yml new file mode 100644 index 0000000..b2471e8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_payment_methods/lists_all_applicable_payment_methods_for_the_current_cart.yml @@ -0,0 +1,482 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:29 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.135' + X-B3-Traceid: + - c591b468bb51ab7f1bb4654191c06e62 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813009, + "jti" : "gevQXlbEKtF9jbitFeIFrVZNg6Q=" + } + recorded_at: Tue, 01 Oct 2024 20:03:29 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:29 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.099' + X-B3-Traceid: + - 787a4d3629fe4b1ffef8d4a3d0d530a8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "e31fc0ef-0944-4937-baed-090fda110441", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:29 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/payment-methods + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:29 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - 527514d489ad52b9621f748ca687f4a1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "payment-methods" : [ { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "147d2711-367f-4344-8637-f4b88418b751", + "name" : "Payment in advance", + "description" : null, + "officialName" : "Payment in advance", + "officialDescription" : "You only dispatch the goods upon receipt of the customer payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 2, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/147d2711-367f-4344-8637-f4b88418b751/deactivate" + } + } + } + } + }, { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "selectable" : true, + "_embedded" : { + "payment-method" : { + "_id" : "245bf7d1-507d-442e-b9cb-7c8bca086cdf", + "name" : "Cash", + "description" : null, + "officialName" : "Cash", + "officialDescription" : "The customer pays the invoice in cash.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 3, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/245bf7d1-507d-442e-b9cb-7c8bca086cdf/deactivate" + } + } + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441/payment-methods" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:29 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/e31fc0ef-0944-4937-baed-090fda110441 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:29 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.048' + X-B3-Traceid: + - 7f468f3f33a7d86f23e93a30887f80ab + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:29 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_pickup_options/lists_all_applicable_pickup_options_for_the_current_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_pickup_options/lists_all_applicable_pickup_options_for_the_current_cart.yml new file mode 100644 index 0000000..65e3741 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_pickup_options/lists_all_applicable_pickup_options_for_the_current_cart.yml @@ -0,0 +1,350 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:29 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.083' + X-B3-Traceid: + - 40710059aaf226a115100636fad6a8c6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813249, + "jti" : "+t7QtFvMaev8FhO2At0xifij/rM=" + } + recorded_at: Tue, 01 Oct 2024 20:07:29 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:07:30 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.087' + X-B3-Traceid: + - d6c27f9e4781082809b63c8bc3e94132 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:30 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/pickup-options + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:07:30 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - 22f30e320ce35516706dc816133fb004 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "pickup-options" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6/pickup-options" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:07:30 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/8c1b0d17-005f-41ff-a2e4-d0f71eaba4c6 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:07:30 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.042' + X-B3-Traceid: + - 36390fd7d279742f9e7d879de5a96b25 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:07:30 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_redeem_coupon/redeems_a_coupon.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_redeem_coupon/redeems_a_coupon.yml new file mode 100644 index 0000000..b05fb48 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_redeem_coupon/redeems_a_coupon.yml @@ -0,0 +1,346 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:08:04 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.082' + X-B3-Traceid: + - 7726ba263313a7957249873046b9ff24 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727813284, + "jti" : "BOHZFXD+OcVPLwuQqmFKh+Fpgmk=" + } + recorded_at: Tue, 01 Oct 2024 20:08:04 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:08:04 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.093' + X-B3-Traceid: + - 2a6efcc31916544ac6435c83ae3446da + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ed6e5f8c-7e42-415d-93fc-84b9495aeb63", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:08:04 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63/coupon + body: + encoding: UTF-8 + string: '{"code":"FIRST-ORDER"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Tue, 01 Oct 2024 20:08:04 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.052' + X-B3-Traceid: + - cd38557c8ee16d0614b1561cc27d2f25 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "invalid-coupon-code", + "details" : { }, + "message" : "The coupon code validation failed with following messages: Code doesn't exist", + "traceId" : "cd38557c8ee16d0614b1561cc27d2f25" + } + recorded_at: Tue, 01 Oct 2024 20:08:04 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/ed6e5f8c-7e42-415d-93fc-84b9495aeb63 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:08:04 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.063' + X-B3-Traceid: + - 27c3d43781b58f34f0991b9062e84d9b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:08:04 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_shipping_address/sets_the_shipping_address_of_the_cart.yml b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_shipping_address/sets_the_shipping_address_of_the_cart.yml new file mode 100644 index 0000000..d1a56f8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_shipping_address/sets_the_shipping_address_of_the_cart.yml @@ -0,0 +1,477 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.086' + X-B3-Traceid: + - 16a533e7536c1c3a95c738640c48c1e5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727812997, + "jti" : "GUQomqrrn03wFWG5AFz0SsVIz8g=" + } + recorded_at: Tue, 01 Oct 2024 20:03:16 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/carts + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - dfd31feb0ee7cc629c2ce18f6f973463 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "1b243ad5-692b-4cb4-a2b8-82f4df975b68", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : null, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : true, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/shipping-address + body: + encoding: UTF-8 + string: '{"salutation":"Mrs","gender":"FEMALE","title":"Dr","firstName":"Astrid","middleName":"Agnes","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","street2":"Erdgeschoss","doorCode":"0185","addressExtension":"Hinterhof","postalCode":"20999","dependentLocality":"Seevetal","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"a.alsterh@example.com","phone":"(800) + 555-0102","mobile":"(800) 555-0103","vatId":"123456789","taxNumber":"123-34-6789","birthDate":"1985-03-20"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.123' + X-B3-Traceid: + - 820b32519a35f8838d40eff45eea1447 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "1b243ad5-692b-4cb4-a2b8-82f4df975b68", + "lineItems" : [ ], + "shippingLineItem" : null, + "pickupLineItem" : null, + "paymentLineItem" : { + "lineItemPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "lineItemTaxes" : [ ], + "_embedded" : { + "payment-method" : { + "_id" : "c5cdf11e-6947-471e-a76a-1534a6ff5809", + "name" : "Invoice", + "description" : null, + "officialName" : "Invoice", + "officialDescription" : "You issue an invoice. After receipt of the goods, the customer transfers the payment.", + "defaultPaymentNote" : null, + "taxClass" : "REGULAR", + "discountOrFee" : { + "type" : "ABSOLUTE", + "absoluteValue" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 0 + }, + "percentageValue" : null + }, + "position" : 1, + "minimumOrderValue" : null, + "activated" : true, + "activeLogoSet" : null, + "onlinePayment" : false, + "workflow" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809" + }, + "deactivate-payment-method" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/payment-methods/c5cdf11e-6947-471e-a76a-1534a6ff5809/deactivate" + } + } + } + } + }, + "couponLineItem" : null, + "billingAddress" : null, + "shippingAddress" : { + "salutation" : "Mrs", + "gender" : "FEMALE", + "company" : null, + "title" : "Dr", + "firstName" : "Astrid", + "middleName" : "Agnes", + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : "Erdgeschoss", + "addressExtension" : "Hinterhof", + "postalCode" : "20999", + "dependentLocality" : "Seevetal", + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "a.alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : "(800) 555-0103", + "displayAddressLines" : [ "Astrid Agnes Alster", "Seevetal", "Alsterwasserweg 2", "Erdgeschoss", "Hinterhof", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : "0185" + }, + "subtotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "grandTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "netTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxTotal" : { + "currency" : "GBP", + "amount" : 0 + }, + "taxes" : [ ], + "taxable" : false, + "minimumOrderValue" : { + "currency" : "GBP", + "amount" : 0 + }, + "mustAcceptTermsAndConditions" : false, + "mustEnterPhoneNumber" : false, + "weight" : 0, + "checkoutState" : { + "shippingMethodValid" : false, + "shippingMethodSelectable" : false, + "pickupOptionValid" : false, + "paymentMethodValid" : true, + "paymentMethodSelectable" : true, + "billingAddressSet" : false, + "priceValidToOrder" : true, + "paymentTransactionStatus" : "NO_APPROVAL_NEEDED", + "readyToOrder" : false + }, + "customerEmail" : null, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68" + }, + "line-items" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/line-items" + }, + "payment-method-available" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods" + }, + "payment-method-default" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods/default" + }, + "payment-method-current" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/payment-methods/current" + }, + "billing-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68/billing-address" + }, + "shipping-address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/carts" + } + } + } + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/carts/1b243ad5-692b-4cb4-a2b8-82f4df975b68 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Tue, 01 Oct 2024 20:03:17 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 406b1c9a5ba51fc5a39ae46868eac926 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Tue, 01 Oct 2024 20:03:17 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml b/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml new file mode 100644 index 0000000..a6034cf --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Checkout_ShippingZone/_all/returns_all_shipping_zones.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:42 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.102' + X-B3-Traceid: + - ade04437123682156ae9bbd7667045a3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049642, + "jti" : "xEIok9IjDV4GjerA3jFWgrvFXhE=" + } + recorded_at: Mon, 19 Aug 2024 06:40:42 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shipping-zones + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.020' + X-B3-Traceid: + - a5f64146e475157a05c57418c445a262 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "shipping-zones" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shipping-zones?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/_all/returns_all_customers.yml b/spec/vcr_cassettes/BeyondApi_Customer/_all/returns_all_customers.yml new file mode 100644 index 0000000..ad477b4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/_all/returns_all_customers.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.107' + X-B3-Traceid: + - 2ac530d347565da9f565d6df651e5d0c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608085, + "jti" : "WlwVZBu3mn6PxSlPXI2D8alxDgQ=" + } + recorded_at: Fri, 06 Sep 2024 07:34:45 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.079' + X-B3-Traceid: + - c080a1385acada6b51c2d311182fc97e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "customers" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Fri, 06 Sep 2024 07:34:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_create/creates_a_new_customer.yml b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_create/creates_a_new_customer.yml new file mode 100644 index 0000000..6b406c8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_create/creates_a_new_customer.yml @@ -0,0 +1,261 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.100' + X-B3-Traceid: + - b03f9c28b22caaf7867420fe8b952e04 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608086, + "jti" : "G56YpddqUZJ6AD68z6ARhvLq9w4=" + } + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Astrid Alster GmbH","firstName":"Astrid","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.137' + X-B3-Traceid: + - c27da866a2b8e4fad235976d33b6ac0b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1008", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:46.29413293", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91/customer-groups" + } + }, + "_id" : "1877de01-eba4-4e42-805b-3408ff375b91" + } + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/1877de01-eba4-4e42-805b-3408ff375b91 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.058' + X-B3-Traceid: + - 19cade8642609c0f079d8016af1c0347 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_delete/deletes_a_customer.yml b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_delete/deletes_a_customer.yml new file mode 100644 index 0000000..4e292f8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_delete/deletes_a_customer.yml @@ -0,0 +1,313 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.083' + X-B3-Traceid: + - 4dc97a749e07e9c38bcba51d9995d655 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608088, + "jti" : "dYRgDKfN8buk+vVRIqFfoTSk1Zw=" + } + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Astrid Alster GmbH","firstName":"Astrid","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.081' + X-B3-Traceid: + - 121adc793826d2464816c0e7534ddd89 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1012", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:48.73401719", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8/customer-groups" + } + }, + "_id" : "00abc7e5-f708-4609-9f6c-b92406c2b2f8" + } + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - 3cc80114aadd012741905cfc2e83f882 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/00abc7e5-f708-4609-9f6c-b92406c2b2f8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.013' + X-B3-Traceid: + - f22d2ee2da14b08c9d68b8ddcdbd9b1e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_events/returns_all_events_for_a_customer.yml b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_events/returns_all_events_for_a_customer.yml new file mode 100644 index 0000000..83acfbf --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_events/returns_all_events_for_a_customer.yml @@ -0,0 +1,345 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.093' + X-B3-Traceid: + - 9a2f316a96cb4e0ff1958053e01a71f3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608087, + "jti" : "mZTHMuKS0YHRRj6b8bPgAll0z08=" + } + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Astrid Alster GmbH","firstName":"Astrid","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.088' + X-B3-Traceid: + - d1b2c78fc9d65f14d4ed54a9e3f9ee84 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1011", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:48.128473616", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1/customer-groups" + } + }, + "_id" : "fe4e14cf-06ed-43d0-86ba-b0ff40e579f1" + } + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1/events + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - cf48748a0e1f8682193ef0112de0e412 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "customer-events" : [ { + "type" : "customer-comment-created", + "comment" : "A reliable customer", + "eventTimestamp" : "2024-09-06T07:34:48.154", + "details" : { }, + "triggeredBy" : "merchant" + }, { + "type" : "customer-created", + "comment" : null, + "eventTimestamp" : "2024-09-06T07:34:48.128", + "details" : { + "origin" : "COCKPIT" + }, + "triggeredBy" : "merchant" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1/events?page=0&size=20&sort=eventTimestamp,desc" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/fe4e14cf-06ed-43d0-86ba-b0ff40e579f1 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Fri, 06 Sep 2024 07:34:48 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.045' + X-B3-Traceid: + - 352c8beb5134c286377074729c4cb0ce + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:48 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_find/returns_a_customer.yml b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_find/returns_a_customer.yml new file mode 100644 index 0000000..fe9e6ee --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_find/returns_a_customer.yml @@ -0,0 +1,401 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.086' + X-B3-Traceid: + - 5a26da8fcc9624a47a9a57868740fab7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608086, + "jti" : "ehrm8T60HaqIVDmHOTJqnIcxJjI=" + } + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Astrid Alster GmbH","firstName":"Astrid","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.082' + X-B3-Traceid: + - 449c5bdc4ef74a1acc5382fb22f940dc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1009", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:46.820923909", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6/customer-groups" + } + }, + "_id" : "f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + } + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - e2305f5a6f5cd0d68f001c651eec32d9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1009", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:46.821", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6/customer-groups" + } + }, + "_id" : "f9122ba1-91b9-448e-b28e-f027ce4ea5d6" + } + recorded_at: Fri, 06 Sep 2024 07:34:46 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/f9122ba1-91b9-448e-b28e-f027ce4ea5d6 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.077' + X-B3-Traceid: + - cd16a546b3bbea02d2b3c938bb0cf041 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_update/updates_an_existing_customer.yml b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_update/updates_an_existing_customer.yml new file mode 100644 index 0000000..68e1de8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Customer/with_customer/_update/updates_an_existing_customer.yml @@ -0,0 +1,405 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - daf221371168badd6c37feb412fd2b4d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1725608087, + "jti" : "ZTEKBBs76N9cpZnst22rXtXINiE=" + } + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/customers + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Astrid Alster GmbH","firstName":"Astrid","lastName":"Alster","street":"Alsterwasserweg","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - 66c66daa14fb3f20f4a94f206fa4ed12 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1010", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Astrid Alster GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Alsterwasserweg", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Astrid Alster GmbH", "Astrid Alster", "Alsterwasserweg 2", "20999 Alsterwasser", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:47.474604165", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49/customer-groups" + } + }, + "_id" : "327dbf86-bcca-49b4-97b7-45853f684b49" + } + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49 + body: + encoding: UTF-8 + string: '{"email":"chayanne@example.com","customerComment":"A reliable customer","billingAddress":{"company":"ePages + GmbH","firstName":"Chayanne","lastName":"Team42","street":"Pilatuspool","houseNumber":"2","postalCode":"20999","city":"Alsterwasser","country":"DE","state":"Hamburg","email":"chayanne@example.com","phone":"(800) + 555-0102"},"shippingAddress":{"gender":"FEMALE","company":"Updated GmbH","firstName":"Astrid","lastName":"Alster","street":"Berlin + Street","houseNumber":"42","postalCode":"12345","city":"Berlin","country":"DE","state":"Berlin","email":"alsterh@example.com","phone":"(800) + 555-0102"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.069' + X-B3-Traceid: + - 7872fda102ff05d8bf687043381d5e2b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "orderSummary" : { + "total" : 0, + "openOrders" : 0, + "grandTotal" : null, + "average" : null, + "lastOrderDate" : null, + "lastOrder" : null + }, + "recentOrders" : [ ], + "customerGroups" : [ ] + }, + "email" : "chayanne@example.com", + "customerNumber" : "1010", + "customerOrigin" : "COCKPIT", + "defaultShippingAddress" : { + "salutation" : null, + "gender" : "FEMALE", + "company" : "Updated GmbH", + "title" : null, + "firstName" : "Astrid", + "middleName" : null, + "lastName" : "Alster", + "street" : "Berlin Street", + "houseNumber" : "42", + "street2" : null, + "addressExtension" : null, + "postalCode" : "12345", + "dependentLocality" : null, + "city" : "Berlin", + "country" : "DE", + "state" : "Berlin", + "email" : "alsterh@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "Updated GmbH", "Astrid Alster", "Berlin Street 42", "12345 Berlin", "GERMANY" ], + "doorCode" : null + }, + "defaultBillingAddress" : { + "salutation" : null, + "gender" : null, + "company" : "ePages GmbH", + "title" : null, + "firstName" : "Chayanne", + "middleName" : null, + "lastName" : "Team42", + "street" : "Pilatuspool", + "houseNumber" : "2", + "street2" : null, + "addressExtension" : null, + "postalCode" : "20999", + "dependentLocality" : null, + "city" : "Alsterwasser", + "country" : "DE", + "state" : "Hamburg", + "email" : "chayanne@example.com", + "phone" : "(800) 555-0102", + "mobile" : null, + "displayAddressLines" : [ "ePages GmbH", "Chayanne Team42", "Pilatuspool 2", "20999 Alsterwasser", "GERMANY" ], + "vatId" : null, + "taxNumber" : null, + "birthDate" : null + }, + "defaultShippingMethodId" : null, + "defaultPaymentMethodId" : null, + "defaultPickupOptionId" : null, + "creationDate" : "2024-09-06T07:34:47.475", + "testCustomer" : false, + "customerComment" : "A reliable customer", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49" + }, + "customer" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49" + }, + "events" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49/events" + }, + "customer-groups" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49/customer-groups" + } + }, + "_id" : "327dbf86-bcca-49b4-97b7-45853f684b49" + } + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/customers/327dbf86-bcca-49b4-97b7-45853f684b49 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Fri, 06 Sep 2024 07:34:47 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.046' + X-B3-Traceid: + - '0950a5bd9ab975cdf726fdf3636f67ae' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Fri, 06 Sep 2024 07:34:47 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml new file mode 100644 index 0000000..46bc703 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/_all/returns_all_categories.yml @@ -0,0 +1,150 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - 2e5297c116f26110752a13767ed08317 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049643, + "jti" : "52PRN2EdpqkLoCJ/CEyh6beJ2d4=" + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.024' + X-B3-Traceid: + - da4b1b865b4142c6ab107d91109bd7af + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "categories" : [ { + "_id" : "8a4a8f6a-e3d9-4616-9e89-12c42c084534", + "name" : "DO-NOT-DELETE Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/8a4a8f6a-e3d9-4616-9e89-12c42c084534" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml new file mode 100644 index 0000000..9131453 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_create/creates_a_new_category.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 9c45eb30e4575f5f4fe5cc084546e684 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049643, + "jti" : "8dcnvbvxhvyHoBbeBAKfSw03gyc=" + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - af3aeca695c94c32801e0c662b63ddb9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "464df7fc-5801-4eda-8c38-22b6ffd2a823", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/464df7fc-5801-4eda-8c38-22b6ffd2a823 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:43 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.047' + X-B3-Traceid: + - 7eeb8ed8a7b09af81f8874d37bb821d0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:43 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml new file mode 100644 index 0000000..22cb4c8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_delete/deletes_a_category.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.095' + X-B3-Traceid: + - 55b33c0580da9f9255ff6ffdb6f8af47 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055780, + "jti" : "bo9G/OG2JbjIQVLDljv+XfIwu/Q=" + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.051' + X-B3-Traceid: + - a91a846530581b514551ae5ee861fdc4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "28171a9e-43d6-4786-9f1d-780152649363", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - fac194a82965a2f8226f3faa67af0b34 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/28171a9e-43d6-4786-9f1d-780152649363 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:00 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.013' + X-B3-Traceid: + - 6ba81a6b755682d168eecfa9c913f84e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "resource-not-found", + "details" : { }, + "message" : "No Category found for '28171a9e-43d6-4786-9f1d-780152649363'", + "traceId" : "6ba81a6b755682d168eecfa9c913f84e" + } + recorded_at: Mon, 19 Aug 2024 08:23:00 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml new file mode 100644 index 0000000..028cc62 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_destroy/deletes_a_category.yml @@ -0,0 +1,247 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.112' + X-B3-Traceid: + - dc5d18864eaf21f13f53b1fc42fa463a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049645, + "jti" : "HQfYmpl2Z0QRAzP1B3ryEq8CZ4U=" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.029' + X-B3-Traceid: + - 36495f254777047ecfac8921032839d3 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "349a769f-a19b-401f-bc29-45228f4d115a", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.040' + X-B3-Traceid: + - fb465a06f039def22ea6a2148387eeb7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/349a769f-a19b-401f-bc29-45228f4d115a + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.016' + X-B3-Traceid: + - 1e6bd69e50fa94a8dd2392ccdcd99aa6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "resource-not-found", + "details" : { }, + "message" : "No Category found for '349a769f-a19b-401f-bc29-45228f4d115a'", + "traceId" : "1e6bd69e50fa94a8dd2392ccdcd99aa6" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml new file mode 100644 index 0000000..c727718 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_find/returns_a_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.149' + X-B3-Traceid: + - 19f41c49ed1a0b4821d56b1f2a5199d0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049644, + "jti" : "YTMVOzRnfL3aopdXeSQQogD61VQ=" + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.025' + X-B3-Traceid: + - 872ce11570a2ae1a3862dad0b48fab19 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "380c8a2b-cff2-4789-9777-53a232f4d601", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.015' + X-B3-Traceid: + - e685a6f718f5fd74732f9fcdb9c80e2a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "380c8a2b-cff2-4789-9777-53a232f4d601", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/380c8a2b-cff2-4789-9777-53a232f4d601 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - '08eca00fb3f15ee4c11470044e64e130' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml new file mode 100644 index 0000000..6833082 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Category/with_category/_update/updates_an_existing_category.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - eb47a37565c0c4d86ddfbc23d37a76c5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049644, + "jti" : "Vy9nkOpiuE7poFaOts96U5zc7QI=" + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/categories + body: + encoding: UTF-8 + string: '{"name":"Team42 Category","type":"SMART","defaultSort":"HIGHEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - 1dc369d96881200e2c455f732c3c021c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5f37b352-8c12-414f-96cf-8152e4e23d4d", + "name" : "Team42 Category", + "type" : "SMART", + "defaultSort" : "HIGHEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + body: + encoding: UTF-8 + string: '{"name":"Category with lowest price first","type":"SMART","defaultSort":"LOWEST_PRICE_FIRST"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:44 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 38668d975055f9f37ede46c518c54907 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5f37b352-8c12-414f-96cf-8152e4e23d4d", + "name" : "Category with lowest price first", + "type" : "SMART", + "defaultSort" : "LOWEST_PRICE_FIRST", + "filters" : [ ], + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + }, + "category" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/categories/5f37b352-8c12-414f-96cf-8152e4e23d4d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - 2dd71cfed1e43d8570f1ab33ffcdf086 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 06:40:44 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml new file mode 100644 index 0000000..969edad --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_all/returns_all_images.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - 3f6f1d5807e8bf92dca5c2e04ae7048d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049645, + "jti" : "zq3hO+6bHPoM3k4RR8FK0e/RkmQ=" + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:45 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - e0ae07b6811b4d06362a57425a0a55b0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_an_image.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_an_image.yml new file mode 100644 index 0000000..142cb3d --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_an_image.yml @@ -0,0 +1,141 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 23 Aug 2024 06:24:40 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.123' + X-B3-Traceid: + - db6726c24244f7cfd6de9de4d765d463 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724394280, + "jti" : "oFIYaozJNpVa0pp3EiLllp/To1w=" + } + recorded_at: Fri, 23 Aug 2024 06:24:40 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images?fileName=new-image.png + body: + encoding: ASCII-8BIT + string: !binary |- + iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQBAMAAABykSv/AAAAG1BMVEUAAAD///8fHx+/v7/f399/f38/Pz+fn59fX1/Ew5I3AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAD1ElEQVR4nO3Zz0/bMBTAcSvQtMeZZj+ObVWhHekO244NYj+OVBqCY4s4cKTadqfTNvFnL/Z7TlI2lihKVjR9PwcaV/GLX+zYbjAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAID/QzQKR9dnF/mxiX+cfasXYJIfNQzQktlcDz5Za5NTLfTSrPSuTv29JBw1DNCSnp3LwZV9d3eeJiNfiNPk4scXe1wjwCIk0jRAS1aaSGzfZ38HqVx6lSyzv9+1VX8T2yQcNAvQllSH1nQoH75ZUXokH/PK+vtDTaRpgJb0hyu51lruZGTdIO/rnRw/rQywfq2JNA3Qks2xJBLZW/li4YrjF1LoJX+qUzZIDuWcpgFaEtmlJJJf0TfBN6bcugeNn8VSs2mAluw9NZLIfhgDfTfU0zCJro8qAsxONZGmAVqyONJExgf6zcC6+zjS0uZJOLOX1zk1hd7QaCKVAToVZxeURDZz/cq1YZCP7Lx5xa3tD0sBVgchkcoAndrPxrMkssiHQHrr7nPpBDEN362flQJkJ2silQE6tb4JibgjMTs1/eehsJdPn7oymL5dFvXdiZpIZYAu+REgiczykZ+1qLh60aLQJVsd4saTJlIdoENj1yhJJBsPRTuK8VBqh3TJVodErqCJVAfokL+L9xPJBnvRjl7pyfZdstUh/sb/lsiDATojF6mdiOuSrQ6RB/wRJLLyu6Paibgu2eqQ2G+odp9IlC7dR/1EovTNVodMfVa7T2RPnkOdtfJ2uEnngWd1assdYmZ+xg2zVp0A3dC1uO7060q2vHPS5Xvn02/YD9VcEP1JSXmg6O5j5wtiGMc1tyjGdchlWuoSfSp2vkXZJCdemn3e1NrzZVPWtOiSgZX6J9nnh11uGje2cCSLvG9foiu2nDQvKrg1JCq6ZFCqPzR1AnQkmojN8WRS/l3khnfxu+imqODXkFKXaP2XyWQyqhWgY3V/6sqiHpWfEu9x/NQ1IZHqdwe6qE/vr3Dxo3j5YEIiZiFvc2Lfnp6+zVkVc07YZf3WJZpIZYDOaSL7cukrueHyvjAuNXoRHub7XRISqQrQOU0kSj8a9yZY7us0uTXute4oP+1qqQfRx+36IZGqAJ3TRLKN1POzz3Y40lbZr+cz+6pG/ZBI4wBtCYmY725BuNXCwP1X4G2d+nkiTQO07/Du5ygvRNd3l/88AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj9gv2X223KqGyf0AAAAASUVORK5CYII= + headers: + Accept: + - application/json + Content-Type: + - image/png + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 23 Aug 2024 06:24:40 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/9d47a8ee-d2df-4227-acb1-ab1081777615 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.200' + X-B3-Traceid: + - abc4c43d5847237a86d1218306eef756 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "position" : 0, + "width" : 400, + "height" : 400, + "_id" : "9d47a8ee-d2df-4227-acb1-ab1081777615", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/9d47a8ee-d2df-4227-acb1-ab1081777615" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/9d47a8ee-d2df-4227-acb1-ab1081777615" + } + } + } + recorded_at: Fri, 23 Aug 2024 06:24:40 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_multiple_images.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_multiple_images.yml new file mode 100644 index 0000000..18f1794 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Image/_upload/uploads_multiple_images.yml @@ -0,0 +1,164 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 23 Aug 2024 06:24:40 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.114' + X-B3-Traceid: + - '09a5df9a5a4b44b7c177246e659cf042' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724394280, + "jti" : "X4uDg1Wy4xZKXylhjIHJQWMRAx0=" + } + recorded_at: Fri, 23 Aug 2024 06:24:40 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images?fileName=new-image3.png + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTc2MWE5ZTIzZjk5NzI2YzM2MDgyZTc2YjM0ZGIwYmEwDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMi5wbmciDQpDb250ZW50LUxlbmd0aDogMTc4Mw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAACWAAAAZAEAwAAAIAbA6sAAAAbUExURQAAAP///x8fH19fX5+fn7+/v9/f339/fz8/P6z6+bIAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAaCSURBVHic7dvNc9NGGMdxW37TsQtJ4GgX4uGIGaA9xi2017rThB4xLbRHXNIMxxjaaf7sSqvVvmgfGZRDu858P4cQ/7Bj+/Gj1Wol93oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L+49/zs9Kf3QfTP8zen76a9T2afLbsKbubnZ69fPOp9MkvOU6Ud/WGTbKmTw0vvXlLWwUI99G7dr57y594nsuSYWhXVstHSJIfT3s7s82XKL9awfsofd2fJOVbq10fT7MHjtS3WXKkXH3oPnih1u7cr62DsFytbq8P30+zjygulLDnFi/zF/Pani6pt4b574VLWxdJ/2NxszMWWfXtXlpy5OoijO+a3rbq7I+sgV2ETvbXxZXuWnlXcKEsb5XYck7IO5urCPc/Q9c5WvWzPkjOJmz73em1hPm8p62J1OHbF2qqT+tdB3bBSlpxZ/M7H3ic7VLdasw4m6pVXrLXXmks1bc2Ss4y3qa2/3zKfspR1sFWXY2879prZfFhSlpxMGK1Xfv1MMaWsg/VBzxVr5I9Jw+qGlCVnqH5oRlkwis30rknKOj3LS69YM3+XYj4tKUtOP37fg2BIGuuBV8o6WBSDkCvWIhiS1gdtWXIW8RYVNttEbxJSZuXBw/Np9Bd1X7piLQ/9/9wctWXJWcaf4TgYXnPdU1JmrYKJ2vZV9BdHZaldsdbB/mGre0rKkrOOR4fGlqnHDymrDYPxLFdBj2ibo6lfrHBEqv60lKUmU19EWeNj1Z+5lNm/ERwDbFXUWbmuhC1Woy9100pZcnI9+uTnZ2/c2t9CBXdZHbRk1rHXWsWx0LT5JNVbt8UahB/QqNxbSFlyJuWr+qtaRvptWmWN0VUPvVJm+a0lNJa5ty1WY/eg9x1Slpxh8aEfl8t+6+KH2bbCSlR1kjLHtZbUWGbaYYvVqISuk5QlZ6QeDpR6cVm8zQtlXnBjB6knF1LmuNaSGsvMN71infj/PaiKFWfJGavLTb3o/dTsx8IBqXj/LZmnbi2pserH2mI1BqS8HK6kLDl99dEeFRf9oVtrFR4mV8USMk/dWlJj1ZuUV6xgV2eKFWfJ6auFm9IMq7pdo1imtcTG2pon2P9izdTam1Guhcl0NcWSMl/VWlJjZfVDbbHGzcLckrPkzJT/Kmd65LhOsXRriY01qvdzN6FY/n5tqLv/Opuhbi2psYod57T65SZshv5xXbVqda1iFa11R2ostzR1E4oV9LteR2pMExbC1GERF6toLamx3NJX29RhIEwdBokWK5g564l690mpNpcay1uB3v9J6Sx8kbpjuh/uaFvpTLU3Uu//4U5fKFbnA2mtPOUcn3afuwLu/4F0o1h6StB5icY89Hfh3LZ3x/1fohkLxeq6+KeVc6zjqLUm3pi//4t/o7DfdQP1gwbJzLJynAXKOVYWtVZfvT6trVT5s7z2KqxpdV5NylLTGCt0sTqfsOjVR4VRa/VVU/nAfT1h0Rgr9Dgeng+uT4XFma+avEetJRcrPKFtToUJWWrCM83VeJw3Tqi+bck89VFhs7WyL525elT8LO8W9k3VU1KWnHC/Vr3X4LoPs8IiZX5QDeTxqOW4U2F9v9bVqR8xS87G/0TNavlSuAhEyiy33BDvEC1XrGCbNjekLDnBFH5c7Rs7X3Lklht2tNYNuOQouDDNXKo+8mZHI7MHkLKav47V3lrexWwr7yhypdqz1GTeglZmzlj4Z+A35i1KWc1fx2pvreAySTu7s1dpSllyNu5Fzusu29htc2BrJGWVcIG0tbW8Yk3cBaqL+umlLDkj+42JXLkVp/qFb2zTSFllEtzOhONGzStWsZ2d1I+1hZay5KzUwbT8N1/ZnrDfI/jbXZIuZcbF1L913NIWfrHm6uihec67u7LkDJU6fPfh6vFaHV3WWfkNla+vPn7nL35KWSXbccvxi1WMbEffXunnnO7K0mO/5/RNnB0I97vmJYx+sXqDtfljJ7uz9DxpfoGucBFcWNOefb6gWL3JOn5OKUtP/tWzZ80vXd47f/Z983uSUnZdmfCcUgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/7l/Aav8Mq93IWbxAAAAAElFTkSuQmCCDQotLS0tLS0tLS0tLS0tUnVieU11bHRpcGFydFBvc3QtNzYxYTllMjNmOTk3MjZjMzYwODJlNzZiMzRkYjBiYTANCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iaW1hZ2UiOyBmaWxlbmFtZT0iaW1hZ2UzLnBuZyINCkNvbnRlbnQtTGVuZ3RoOiAyNzIwDQpDb250ZW50LVR5cGU6IGltYWdlL3BuZw0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmluYXJ5DQoNColQTkcNChoKAAAADUlIRFIAAAJYAAABkAQDAAAAgBsDqwAAABtQTFRFIlKr////kKjVx9PqdJLKrL7f4+n0PWe1WX3AjbhdvwAAAAlwSFlzAAAOxAAADsQBlSsOGwAACitJREFUeJztnU1j28YVRWWJKrgMq5rtkrSVNMsyitMuJdlJvSxlO83Ssmq3y6hxIi8p1U31sysSAEkA8/XAQV5GPGcnAIN3cTWYeRhiBjs7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQGLtHc461ZYShLXZ/MOdvavFFaIvVji9CW6x2fBHaYrXji9AWqx1fhLZY7fgitMVqxxehLVY7vghtsdrxRWiL1Y4vQlusdnwR2mK144vQFqsdX4S2WO34IrTFascXoS1WO74IbbHa8UVoi9WOL0JbrHZ8EdpiteOL0BarHV+Etljt+CK0xWrHF6EtVju+CG2x2vFFaIvVji9CW6x2fBHaYrXji9AWqx1fhLZY7fgitMVqxxehLVY7vghtsdrxRWiL1Y4vQlusdnwR2mK144vQFrth/A+nL47evbs4Onv+vazgx0fzgnclXx3eBhdN2qybyWDFF/8LLtd/fD5Y5+IwrGzCZv17MqjyJqyKZI8HTd5+3q3YKLSOn33WvOKDvwYU7NU9Lgu/9Hqdqln9qfGK/+gt+KPZqoVdvtqVqFm26uF1y+HVHW9nXYiNRrv4fZtXg+Gxs+Cu0yufEgWzzj16lxzYzpBN7YUeulqezBv799HFbsbm8U9cpf7hCD32xrx3Zu2vDhmeHd5eXV19/PSr1baRNfL++slfHT57/uzZo1drJe+hWf3lCda7r/fTcutDa+TJ8tRna1lo9vHTlaT7ZtbyJvyy2jw9LbfbWuC98oA3s/qu99/eT7OWHdrf63vKtMBWtabF/r+YdvYf30ezykbakFGVbo2MBUuXjV7tFLXrfplVNtJ/Nu38Od/3O2Pc63yno7e8Ob9nZk1dl1wmYDPTvjzugSsP63/2azPrw+0a/1lE+u7WhGncpLiXbJdc7H5t2FVUSU/+PYspNjbSJ4gTzyXn+01N/KV1TzCJPRtmuVe/tR7Qs96Hk82vNDGz9rz30thyH+Y2D9toXJKYWWPvvbRvqXp5a/aHNhpr507FrOIu/JPrmLz/anQAv4lwoWmZld+FQ+f4b55OjcybZy0krkjLrJOAeym/3+r5Un4Db5gMpWXWecjR58ZGa9EZmlP7YJIyqxdwFxbVr9HtmeubjKTMypssX/XIm/Lj6sbMklGISMqsa39fuFPWv9pR/aCiHpIyaxrWo50b7rhejOtMyazQJHxsaOG3zqzdoCareGSuZQm75uxLRkpm7QU20vlx1T5zd9tq1mVg7egZusOtM2tsqDEmMkPPZ+wipaRk1sTQFtkP/KSyqbdtedbA0MsZGTdzhzzP+sRSIJCEzMqvN+SJ5brZa+a35mbDWSmZtRt8Jz2YH1gbIRwYtklJyKy94EMXR9aS14lhm5SEzHpgyAhcJ61uGweX9p03CbOuAzOHsuubGUq/litcIyGzzONUJvqGWpQP3Gw2+peQWdPQNKvo+kaGQEEV00pCZk1C06xikKZ60uKHoddihWskZNZ5+H208LX2bLOomJv9ZJGQWYsjw0bRF8bU0vXLwcaXmo5Z+X0U9sAyNfhaNFrOV448pGNWX9DmGB4Ol69auV799pCOWZJBlkWWUX8QLN78a76LGkw6ZkmG7wxP0su3kTZwKx2z9g3Jkw2jWav5Fd8JRVYlpGDWnsCsRc/XSMlWs5y+bNfKp2bWcdBZzWatTd15GDKNs0E6ZuUPd7Ogsy7Mag5e9Qcrvgg7U4X7aZZp9G/OD2tuDV+GnWuNdMzKh7MeBTG2mFWbfCetXamZJcD0GFif1vnkuBux3fALm9WcMCypXdtmVnPa/jA860rHrMs4ZhkmWD88ji62G355s9ZmcZaEVq5tNKu5MEvgUMRWmrWTNSpX0Do222nWfGZh7eiQwf10zMp7w7OwrHTOoft8H2qLHb2JKbYbpGbNIsbuV+36l7fANptVX0rLq2K7zaq2Xb6pGwmZZZw4EYGb1Zxx3+tbmLX+AOQ5ezpmSUZKZaxWxPP83p2aWaNOVHxTujVzHpaOWZ0qLUfn/6knIQDp74YbvsluI5vkZrnfG0nHrChvslspfyYbuQ7CrIJidN75lk46ZkV57d93evfL3+mYFeW1fwdF1XJl8emYJXnzrw1Fq+WSkpBZiw4r7J3SVky8jWJCZk39fftGXHrv84TMCn8Pvh273hY+IbPCZ1i0wz9fPSGzwufutGTq+28kZFb4rLCWXPv+GwmZFT7fsCX5iNnIfkBCZvU7zkr9WhIyK3yOdEu84xopmTXpOHfwTktIyax8hG7WmRbvslEpmXXZsVbv7KBfh1lh4597vovZkECzOhqsDUAyWNzruIX3mtXpyHYAouRp0G0L722zOs/0PIgGi6e+FHszvL1hxyPbXnqSdijGcgNeLY67TCS2A8IXmNkpW/jOGi3vJD2R2A4QjawXPyp0NUrj/c27658BvCzih46sTzrtji69TaJIbAeYF/e1cN2p2hNvvRWJ7YBFZQkdWS/Wzp91KMWZmYjEdsBUkjsVy364X99oS9/ffYjEdkDoqofrR3fzv93zN98ysfHxjuVWyAczu2niT/xZnExsfB6Irr5IHrqoWsWpj13HyMTGZ0+W6BVvJBg/frUZPw38DZJQbHR2ZVl5saLMcCaN89RTovg6ljstEYqNjjQrz/NSea51cjBz7s8rlufBs+NHCD9B36VYUVyUZ42UHxvnOxkMXZ9NLj/HOXNHF4qNzlhWU5Yf7B05DnravJ55Y+eYgzkdBN1hQrHRuQzohdYpq5b9i9G9qeGfv+gZrB/VLt/t9nV0UrGxKR5hmt9/trQMy6plua2yr413St6NWib4ll55Z+9IxcameISpz/fLHtt66NWyH6b1d24m5malXP7C8IH71XwU73OUWGxsSqnri+lkXze/+Llktf5O/cqz00mxx2rWXaGXFY/noUIrVguxkflpeRlvP198f/Lq44u5fmv81Yek51d+W17hh9MXq+0Os+64OHt+Nd+YVcqEpLpisZFZX3vo7r+7dMIe/4dKicG7oydHR++q29xmFeVqf4es6S0XGxnDdXjif2Mu4TKrufZFHXv3upnYuPTk8cfmIg6zdnbq8+3rhC0F2EJsXH4Wx8/cV27OEP7r/M6x7Vvcm4uNi/kWccd33Ym2lYsai/a08KqV2Kg0FmoKiG+tJ28d6/lZCwmW42wjNir9bxvhD0byMh6rdipZ1XqhWddi43JT/X/VMkcz71/UNA/P/B8Kz06/qlvVTOo7EBuVLM/u5lycha6M2T9dFho+CS51l4qWOdbw4mWbD7G3EhuZbP4V+Svhvym7mn96Xvq/zRZftb8SlqqcoY1YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgLb8H3QPzteiUZ6mAAAAAElFTkSuQmCCDQotLS0tLS0tLS0tLS0tUnVieU11bHRpcGFydFBvc3QtNzYxYTllMjNmOTk3MjZjMzYwODJlNzZiMzRkYjBiYTAtLQ0K + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-761a9e23f99726c36082e76b34db0ba0 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '5010' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Fri, 23 Aug 2024 06:24:40 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.192' + X-B3-Traceid: + - 4e354363500d84a9d2558ccaa270f669 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ { + "position" : 1, + "width" : 600, + "height" : 400, + "_id" : "c86a1d01-0efa-4af5-ae5e-12a9611f4cdd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/c86a1d01-0efa-4af5-ae5e-12a9611f4cdd" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image2.png?hash=69edee39d8acbbb605eb5116c46c3a2eb6b2429f{&width,height,upscale}", + "templated" : true + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/c86a1d01-0efa-4af5-ae5e-12a9611f4cdd" + } + } + }, { + "position" : 2, + "width" : 600, + "height" : 400, + "_id" : "3185b7d0-f27a-482f-85a7-cbbfaa82a114", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/3185b7d0-f27a-482f-85a7-cbbfaa82a114" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image3.png?hash=8eceffd9d90ca05a409de389a7c33669167eb423{&width,height,upscale}", + "templated" : true + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images/3185b7d0-f27a-482f-85a7-cbbfaa82a114" + } + } + } ] + } + } + recorded_at: Fri, 23 Aug 2024 06:24:40 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml new file mode 100644 index 0000000..87fb499 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/_all/returns_all_products.yml @@ -0,0 +1,2948 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:46 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.146' + X-B3-Traceid: + - 0ec04a3cce6cafd10f5ab15b6102e7b8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049646, + "jti" : "mu0JswmAtn8TgH3JWCQ9j902J4I=" + } + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:46 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.227' + X-B3-Traceid: + - af2a97f1e8074796ca4f5bd8c27aeb0e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "products" : [ { + "_id" : "4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc", + "lastModifiedAt" : "2024-08-18T21:43:42.669", + "sku" : "1000", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4bf6d53d-dfb2-4468-b6f9-f6e6265bc0bc/additional-descriptions" + } + } + }, { + "_id" : "cb3463f8-90b1-4d0b-a071-d577e9686696", + "lastModifiedAt" : "2024-08-19T05:59:22.945", + "sku" : "1006", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/cb3463f8-90b1-4d0b-a071-d577e9686696/additional-descriptions" + } + } + }, { + "_id" : "6c1fba11-2983-4cff-bdd1-8d485fd4e836", + "lastModifiedAt" : "2024-08-19T05:59:23.355", + "sku" : "1007", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/6c1fba11-2983-4cff-bdd1-8d485fd4e836/additional-descriptions" + } + } + }, { + "_id" : "622de456-b829-4840-ae51-908c3c4c6e72", + "lastModifiedAt" : "2024-08-19T06:13:43.612", + "sku" : "1008", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/622de456-b829-4840-ae51-908c3c4c6e72/additional-descriptions" + } + } + }, { + "_id" : "78c2e576-a3a2-4180-badc-02e9a5dbec1c", + "lastModifiedAt" : "2024-08-19T06:13:44.056", + "sku" : "1009", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/78c2e576-a3a2-4180-badc-02e9a5dbec1c/additional-descriptions" + } + } + }, { + "_id" : "d0a33d33-f629-46a5-a7d6-dbdb22dbae39", + "lastModifiedAt" : "2024-08-19T06:29:52.033", + "sku" : "1010", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d0a33d33-f629-46a5-a7d6-dbdb22dbae39/additional-descriptions" + } + } + }, { + "_id" : "4d16857a-a353-4e88-9cc7-ba0b9cf05c2b", + "lastModifiedAt" : "2024-08-19T06:29:52.458", + "sku" : "1011", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4d16857a-a353-4e88-9cc7-ba0b9cf05c2b/additional-descriptions" + } + } + }, { + "_id" : "2d9923be-cc36-41f7-8585-795883ceecdc", + "lastModifiedAt" : "2024-08-19T06:30:37.637", + "sku" : "1012", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/2d9923be-cc36-41f7-8585-795883ceecdc/additional-descriptions" + } + } + }, { + "_id" : "935f97ed-c875-4f24-9f6b-cdb6f09cbddd", + "lastModifiedAt" : "2024-08-19T06:30:38.101", + "sku" : "1013", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/935f97ed-c875-4f24-9f6b-cdb6f09cbddd/additional-descriptions" + } + } + }, { + "_id" : "7b16492b-8a5b-4597-8e9d-cd9fcd52af0c", + "lastModifiedAt" : "2024-08-19T06:31:58.649", + "sku" : "1014", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/7b16492b-8a5b-4597-8e9d-cd9fcd52af0c/additional-descriptions" + } + } + }, { + "_id" : "575da236-82ff-4e5c-84f9-a5514ef05b23", + "lastModifiedAt" : "2024-08-19T06:31:59.05", + "sku" : "1015", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/575da236-82ff-4e5c-84f9-a5514ef05b23/additional-descriptions" + } + } + }, { + "_id" : "26221231-953b-4a1c-9025-7c72e610facd", + "lastModifiedAt" : "2024-08-19T06:35:23.365", + "sku" : "1016", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/26221231-953b-4a1c-9025-7c72e610facd/additional-descriptions" + } + } + }, { + "_id" : "0b47984d-5322-4d11-9022-41137bd9ddc2", + "lastModifiedAt" : "2024-08-19T06:35:23.857", + "sku" : "1017", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0b47984d-5322-4d11-9022-41137bd9ddc2/additional-descriptions" + } + } + }, { + "_id" : "d4aa7727-aaa5-43d4-80f4-0f51bc8a688e", + "lastModifiedAt" : "2024-08-19T06:35:43.277", + "sku" : "1018", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/d4aa7727-aaa5-43d4-80f4-0f51bc8a688e/additional-descriptions" + } + } + }, { + "_id" : "b9bf2184-ae5b-4b06-be1a-f4d1140496e3", + "lastModifiedAt" : "2024-08-19T06:35:43.694", + "sku" : "1019", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/b9bf2184-ae5b-4b06-be1a-f4d1140496e3/additional-descriptions" + } + } + }, { + "_id" : "bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a", + "lastModifiedAt" : "2024-08-19T06:36:45.318", + "sku" : "1020", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/bf9665f8-0f16-449f-a6b3-4e6c4e44eb8a/additional-descriptions" + } + } + }, { + "_id" : "21cb741d-eb0c-4722-8622-a8b555d1fd03", + "lastModifiedAt" : "2024-08-19T06:36:45.749", + "sku" : "1021", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/21cb741d-eb0c-4722-8622-a8b555d1fd03/additional-descriptions" + } + } + }, { + "_id" : "687ac2a5-91a9-4d7e-917d-614fabcbc023", + "lastModifiedAt" : "2024-08-19T06:37:32.536", + "sku" : "1022", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/687ac2a5-91a9-4d7e-917d-614fabcbc023/additional-descriptions" + } + } + }, { + "_id" : "4312d633-0d56-4157-8b33-b587550cca1f", + "lastModifiedAt" : "2024-08-19T06:37:32.972", + "sku" : "1023", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/4312d633-0d56-4157-8b33-b587550cca1f/additional-descriptions" + } + } + }, { + "_id" : "88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d", + "lastModifiedAt" : "2024-08-19T06:38:04.141", + "sku" : "1024", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/88fd3c94-bdfe-48a1-bfe7-801ff40d9e0d/additional-descriptions" + } + } + } ] + }, + "_links" : { + "first" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=0&size=20" + }, + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=0&size=20" + }, + "next" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=1&size=20" + }, + "last" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products?page=1&size=20" + }, + "search" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/search" + } + }, + "page" : { + "size" : 20, + "totalElements" : 21, + "totalPages" : 2, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml new file mode 100644 index 0000000..88ae9c2 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_create/creates_a_new_product.yml @@ -0,0 +1,265 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:46 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.156' + X-B3-Traceid: + - 226eb06e8a88b8ba020d84ad6821fed5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049646, + "jti" : "ToaY1QbhYVnXdKVtbo9/zHGP1pY=" + } + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: UTF-8 + string: '{"name":"Team42 Product","description":"Spain\nRioja Tempranillo","manufacturer":"Grape + Vineyard","essentialFeatures":"Dry. 12% alcohol. Best vine variety.","tags":["Bestseller","Red + Wine","Sale"],"productIdentifiers":[{"type":"EAN","value":"9780134308135"}],"salesPrice":{"taxModel":"GROSS","amount":8.7,"currency":"GBP"},"listPrice":{"taxModel":"GROSS","amount":10.95,"currency":"GBP"},"manufacturerPrice":{"taxModel":"GROSS","amount":11.95,"currency":"GBP"},"visible":true,"taxClass":"REGULAR","shippingWeight":{"value":1175.0,"displayUnit":"GRAMS"},"maxOrderQuantity":6,"shippingDimension":{"length":1500,"width":1000,"height":2000},"refPrice":{"refQuantity":1,"unit":"LITER","quantity":0.75,"price":{"taxModel":"GROSS","amount":11.6,"currency":"GBP"}},"shippingPeriod":{"min":2,"max":4,"displayUnit":"WEEKS"},"pickupPeriod":{"min":1,"max":2,"displayUnit":"WEEKS"},"productLabels":[{"type":"NEW","activeFrom":"2024-08-13T11:31:30.210787732","activeUntil":"2024-09-10T11:31:30.210787732"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:47 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.145' + X-B3-Traceid: + - 29b58716c856411ff91c828f90cfecd2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "0c3d27de-5b4d-4432-bf7b-caf7ff289d93", + "lastModifiedAt" : "2024-08-19T06:40:47.012323725", + "sku" : "1026", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833333333333333333333, + "taxRate" : 0.2 + } + }, + "tags" : [ "Bestseller", "Red Wine", "Sale" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.210787732", + "activeUntil" : "2024-09-10T11:31:30.210787732" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/0c3d27de-5b4d-4432-bf7b-caf7ff289d93/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:46 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml new file mode 100644 index 0000000..111c0d4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_ProductManagement_Product/with_product/_find/returns_a_product.yml @@ -0,0 +1,460 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:47 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.087' + X-B3-Traceid: + - f7e13b884aa50e1d56de1244c68d8652 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724049647, + "jti" : "Bm+dFIVaS5YT9k2JXpxVf0D0haE=" + } + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/products + body: + encoding: UTF-8 + string: '{"name":"Team42 Product","description":"Spain\nRioja Tempranillo","manufacturer":"Grape + Vineyard","essentialFeatures":"Dry. 12% alcohol. Best vine variety.","tags":["Bestseller","Red + Wine","Sale"],"productIdentifiers":[{"type":"EAN","value":"9780134308135"}],"salesPrice":{"taxModel":"GROSS","amount":8.7,"currency":"GBP"},"listPrice":{"taxModel":"GROSS","amount":10.95,"currency":"GBP"},"manufacturerPrice":{"taxModel":"GROSS","amount":11.95,"currency":"GBP"},"visible":true,"taxClass":"REGULAR","shippingWeight":{"value":1175.0,"displayUnit":"GRAMS"},"maxOrderQuantity":6,"shippingDimension":{"length":1500,"width":1000,"height":2000},"refPrice":{"refQuantity":1,"unit":"LITER","quantity":0.75,"price":{"taxModel":"GROSS","amount":11.6,"currency":"GBP"}},"shippingPeriod":{"min":2,"max":4,"displayUnit":"WEEKS"},"pickupPeriod":{"min":1,"max":2,"displayUnit":"WEEKS"},"productLabels":[{"type":"NEW","activeFrom":"2024-08-13T11:31:30.210787732","activeUntil":"2024-09-10T11:31:30.210787732"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 06:40:47 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.129' + X-B3-Traceid: + - 5148ada46a37287265e528a0d4a794bc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "532065c3-5d71-44a6-8b8d-764c798f3b95", + "lastModifiedAt" : "2024-08-19T06:40:47.429253718", + "sku" : "1027", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833333333333333333333, + "taxRate" : 0.2 + } + }, + "tags" : [ "Bestseller", "Red Wine", "Sale" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.210787732", + "activeUntil" : "2024-09-10T11:31:30.210787732" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 06:40:47 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.035' + X-B3-Traceid: + - 7a1e8f0003d347ff5d78ddadbf098880 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "532065c3-5d71-44a6-8b8d-764c798f3b95", + "lastModifiedAt" : "2024-08-19T06:40:47.429", + "sku" : "1027", + "salesPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 8.7, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 7.25, + "taxRate" : 0.2 + } + }, + "listPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 10.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.125, + "taxRate" : 0.2 + } + }, + "manufacturerPrice" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.95, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.95833, + "taxRate" : 0.2 + } + }, + "tags" : [ "Sale", "Bestseller", "Red Wine" ], + "productIdentifiers" : [ { + "type" : "EAN", + "value" : "9780134308135" + } ], + "visible" : true, + "taxClass" : "REGULAR", + "shippingWeight" : { + "value" : 1175.0, + "displayUnit" : "GRAMS" + }, + "maxOrderQuantity" : 6, + "shippingDimension" : { + "length" : 1500, + "width" : 1000, + "height" : 2000 + }, + "refPrice" : { + "refQuantity" : 1, + "unit" : "LITER", + "quantity" : 0.75, + "price" : { + "taxModel" : "GROSS", + "currency" : "GBP", + "amount" : 11.6, + "derivedPrice" : { + "taxModel" : "NET", + "currency" : "GBP", + "amount" : 9.6667, + "taxRate" : 0.2 + } + } + }, + "shippingPeriod" : { + "min" : 2, + "max" : 4, + "displayUnit" : "WEEKS" + }, + "pickupPeriod" : { + "min" : 1, + "max" : 2, + "displayUnit" : "WEEKS" + }, + "name" : "Team42 Product", + "description" : "Spain\nRioja Tempranillo", + "manufacturer" : "Grape Vineyard", + "essentialFeatures" : "Dry. 12% alcohol. Best vine variety.", + "variationAttributes" : [ ], + "customText" : null, + "productLabels" : [ { + "type" : "NEW", + "activeFrom" : "2024-08-13T11:31:30.211", + "activeUntil" : "2024-09-10T11:31:30.211" + } ], + "isVariationProduct" : false, + "_embedded" : { + "availability" : { + "availabilityState" : "IN_STOCK", + "availableStock" : null, + "stockThreshold" : null, + "purchasable" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" + } + } + } + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95" + }, + "availability" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/availability" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attributes" + }, + "attachments" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/attachments" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/images" + }, + "default-image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/default-image" + }, + "videos" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/videos" + }, + "cross-sells" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/cross-sells" + }, + "multiple-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/multiple-images" + }, + "external-images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/external-images" + }, + "additional-descriptions" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/products/532065c3-5d71-44a6-8b8d-764c798f3b95/additional-descriptions" + } + } + } + recorded_at: Mon, 19 Aug 2024 06:40:47 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml b/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml new file mode 100644 index 0000000..b672485 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Address/_get/returns_the_shop_address.yml @@ -0,0 +1,146 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:29:59 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - da5289c9d5b4a4f03418f74baa9563e1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052599, + "jti" : "+3Bi9GKMlZei8yQdrBRl8otJG9o=" + } + recorded_at: Mon, 19 Aug 2024 07:29:58 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/address + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:29:59 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.139' + X-B3-Traceid: + - 6c81891217360b02b1c94ad8e223efa4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "company" : "Team42", + "firstName" : "Team42", + "lastName" : "Team42", + "email" : "k.salazar@epages.com", + "phone" : "Team42", + "fax" : null, + "street" : "Team42", + "street2" : null, + "postalCode" : "12345", + "dependentLocality" : null, + "city" : "Somewhere", + "state" : "", + "country" : "GB", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:29:59 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml new file mode 100644 index 0000000..d55f7c6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/_all/returns_all_shop_attributes.yml @@ -0,0 +1,150 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:25 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.119' + X-B3-Traceid: + - 8061fb12abaaaed969b01e87ebb70d3f + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728307585, + "jti" : "S2OvWnGiX3IS8Vy8xozQLNpT0Vw=" + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:25 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.207' + X-B3-Traceid: + - 193217d6206c887afd0b7124e2cf54a8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "attributes" : [ { + "name" : "ecommerce:disabled", + "value" : "true", + "public" : true, + "readOnly" : true, + "owner" : "cockpit", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/ecommerce:disabled" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml new file mode 100644 index 0000000..c3436f7 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_create/creates_a_new_shop_attribute.yml @@ -0,0 +1,187 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:25 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.112' + X-B3-Traceid: + - 21a8957760d94780732768d41a857dc0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728307585, + "jti" : "yWoz0EMkisjH/6gDxvfSlCLDeS4=" + } + recorded_at: Mon, 07 Oct 2024 13:26:25 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 13:26:26 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.208' + X-B3-Traceid: + - d875c07eaa14d112deea30d14ee43f91 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 13:26:26 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.202' + X-B3-Traceid: + - 60d7f72a94f2551603db4d7be6067ec6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml new file mode 100644 index 0000000..3277186 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_delete/deletes_a_shop_attribute.yml @@ -0,0 +1,237 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:29 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.134' + X-B3-Traceid: + - 27498e04a98671ce64f297e146eaf723 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728307589, + "jti" : "glJyw4D/ZD6mizXfRm+LEj0mNsw=" + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 13:26:29 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.173' + X-B3-Traceid: + - 3be4c542f3eb80439cb4cb005dc02d38 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 13:26:29 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.181' + X-B3-Traceid: + - 8d062fbd066e494dfa88ea3e45fffb8d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 13:26:29 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.178' + X-B3-Traceid: + - fa723e03c37975230baf25b59f1db5f4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:29 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml new file mode 100644 index 0000000..4af3c9a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_find/returns_a_shop_attribute.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:26 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.106' + X-B3-Traceid: + - 000ded4eccef126b9a897f5aae802a79 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728307586, + "jti" : "gzd6nSZWYtGyJmR1lAKgemldHB0=" + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 13:26:26 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.190' + X-B3-Traceid: + - d0cd310231424bd144ffff75ebc92ef2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:26 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:27 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.193' + X-B3-Traceid: + - 496496367788b532d3db9f32667fedfa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 13:26:27 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.213' + X-B3-Traceid: + - ef23fb78830fecdf3833a10bde410450 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml new file mode 100644 index 0000000..fcc6d82 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Attribute/with_shop_attribute/_update/updates_an_existing_shop_attribute.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:27 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.127' + X-B3-Traceid: + - 5dbd1a808402666a12fe5013190439e8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728307587, + "jti" : "Wc5DG2H6ucrWbgK/HG/kl6ahon0=" + } + recorded_at: Mon, 07 Oct 2024 13:26:27 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes + body: + encoding: UTF-8 + string: '{"name":"createSku","value":"autogenerateSku","public":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 13:26:28 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.252' + X-B3-Traceid: + - bae8f8609a69f4ba4d641ef9691c15cd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : true, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: UTF-8 + string: '{"value":"autogenerateSku","public":false}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 13:26:28 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.214' + X-B3-Traceid: + - 7667e5211a5dddda7ed58fc69c29573d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "createSku", + "value" : "autogenerateSku", + "public" : false, + "readOnly" : false, + "owner" : "ea9423f8-9969-4b0b-b83c-1f4e1ca13bfd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku" + }, + "owner" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + } + } + } + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/attributes/createSku + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 13:26:28 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.322' + X-B3-Traceid: + - 2a674e744b82b42c6e331abe21ff4758 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 13:26:28 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml new file mode 100644 index 0000000..d1293fb --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml @@ -0,0 +1,139 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.116' + X-B3-Traceid: + - fa44cdc1b1ed04f1eb6fd71f2aa6daa9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727966149, + "jti" : "/vD005oJgNnKqkX0vCFmyX7uN4E=" + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/features + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.006' + X-B3-Traceid: + - d057c4f7c94b8329953d59ab4233af6c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "features" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/features?page=0&size=20" + }, + "owner" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml new file mode 100644 index 0000000..eadaf84 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml @@ -0,0 +1,141 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.114' + X-B3-Traceid: + - 9b9fd559577b4859295938bb62a99dfd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727966149, + "jti" : "15+/3WWjnbld4XnafwjV6RHfvsU=" + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/features/product-management.max-products + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Content-Disposition: + - inline;filename=f.txt + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.011' + X-B3-Traceid: + - 31afcc7e8cd621053bcf55cd7e24db70 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "product-management.max-products", + "type" : "COUNTER", + "details" : { + "maxValue" : 100, + "currentValue" : 0 + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/features/product-management.max-products" + }, + "owner" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop" + }, + "feature-definition" : { + "href" : "https://api-shop.beyondshop.cloud/api/feature-definitions/product-management.max-products" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml new file mode 100644 index 0000000..9963871 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_all/returns_all_shop_images.yml @@ -0,0 +1,153 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:03 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.159' + X-B3-Traceid: + - 9fa4b5497c2d2627a2c6e02e7d2c56f4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728327723, + "jti" : "rvLiOICi0krh2q8oUCmmj4tYixI=" + } + recorded_at: Mon, 07 Oct 2024 19:02:03 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:04 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.020' + X-B3-Traceid: + - a6eaa8d55b5fb060f31804d759b87edc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ { + "_id" : "5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9", + "label" : "invoice logo", + "width" : 1140, + "height" : 420, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/5c4fcf2b-3297-4d6d-b97e-ca1b4584e5d9" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/logo.png?hash=e4f3d85e586988cb6acc53da319ee8c9d0f3c697{&width,height,upscale}", + "templated" : true + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Mon, 07 Oct 2024 19:02:04 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml new file mode 100644 index 0000000..bfe1492 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_find_by_label/finds_a_shop_image_by_label.yml @@ -0,0 +1,153 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 11 Oct 2024 08:57:35 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.093' + X-B3-Traceid: + - beb2caaff28153fea3a51b881cb3a55a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728637055, + "jti" : "PKkxY2Rg0G39s9Zi7bheFh6myiE=" + } + recorded_at: Fri, 11 Oct 2024 08:57:35 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/search/find-by-label?label=logo + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Fri, 11 Oct 2024 08:57:35 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.015' + X-B3-Traceid: + - 694a309ec0393f6bf310a965823d53b6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "images" : [ { + "_id" : "0fde5629-ba76-412d-898c-f127b733958b", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0fde5629-ba76-412d-898c-f127b733958b" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0fde5629-ba76-412d-898c-f127b733958b" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/search/find-by-label?label=logo&page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 1, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Fri, 11 Oct 2024 08:57:35 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml new file mode 100644 index 0000000..c42f6f2 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/_upload_test/uploads_an_image.yml @@ -0,0 +1,143 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 08 Oct 2024 12:30:55 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.069' + X-B3-Traceid: + - ae2d798ba684d58f600ebf34e6c42ddd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728390655, + "jti" : "qNz1tE3wjWryHTCXHSa+Xx41emM=" + } + recorded_at: Tue, 08 Oct 2024 12:30:55 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image-2.png&label=test + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTE3MWRhY2Q5NGQxOGJlOWE5NTFkODc4OTNhNzY0MmI0DQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMi5wbmciDQpDb250ZW50LUxlbmd0aDogMTc4Mw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAACWAAAAZAEAwAAAIAbA6sAAAAbUExURQAAAP///x8fH19fX5+fn7+/v9/f339/fz8/P6z6+bIAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAaCSURBVHic7dvNc9NGGMdxW37TsQtJ4GgX4uGIGaA9xi2017rThB4xLbRHXNIMxxjaaf7sSqvVvmgfGZRDu858P4cQ/7Bj+/Gj1Wol93oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L+49/zs9Kf3QfTP8zen76a9T2afLbsKbubnZ69fPOp9MkvOU6Ud/WGTbKmTw0vvXlLWwUI99G7dr57y594nsuSYWhXVstHSJIfT3s7s82XKL9awfsofd2fJOVbq10fT7MHjtS3WXKkXH3oPnih1u7cr62DsFytbq8P30+zjygulLDnFi/zF/Pani6pt4b574VLWxdJ/2NxszMWWfXtXlpy5OoijO+a3rbq7I+sgV2ETvbXxZXuWnlXcKEsb5XYck7IO5urCPc/Q9c5WvWzPkjOJmz73em1hPm8p62J1OHbF2qqT+tdB3bBSlpxZ/M7H3ic7VLdasw4m6pVXrLXXmks1bc2Ss4y3qa2/3zKfspR1sFWXY2879prZfFhSlpxMGK1Xfv1MMaWsg/VBzxVr5I9Jw+qGlCVnqH5oRlkwis30rknKOj3LS69YM3+XYj4tKUtOP37fg2BIGuuBV8o6WBSDkCvWIhiS1gdtWXIW8RYVNttEbxJSZuXBw/Np9Bd1X7piLQ/9/9wctWXJWcaf4TgYXnPdU1JmrYKJ2vZV9BdHZaldsdbB/mGre0rKkrOOR4fGlqnHDymrDYPxLFdBj2ibo6lfrHBEqv60lKUmU19EWeNj1Z+5lNm/ERwDbFXUWbmuhC1Woy9100pZcnI9+uTnZ2/c2t9CBXdZHbRk1rHXWsWx0LT5JNVbt8UahB/QqNxbSFlyJuWr+qtaRvptWmWN0VUPvVJm+a0lNJa5ty1WY/eg9x1Slpxh8aEfl8t+6+KH2bbCSlR1kjLHtZbUWGbaYYvVqISuk5QlZ6QeDpR6cVm8zQtlXnBjB6knF1LmuNaSGsvMN71infj/PaiKFWfJGavLTb3o/dTsx8IBqXj/LZmnbi2pserH2mI1BqS8HK6kLDl99dEeFRf9oVtrFR4mV8USMk/dWlJj1ZuUV6xgV2eKFWfJ6auFm9IMq7pdo1imtcTG2pon2P9izdTam1Guhcl0NcWSMl/VWlJjZfVDbbHGzcLckrPkzJT/Kmd65LhOsXRriY01qvdzN6FY/n5tqLv/Opuhbi2psYod57T65SZshv5xXbVqda1iFa11R2ostzR1E4oV9LteR2pMExbC1GERF6toLamx3NJX29RhIEwdBokWK5g564l690mpNpcay1uB3v9J6Sx8kbpjuh/uaFvpTLU3Uu//4U5fKFbnA2mtPOUcn3afuwLu/4F0o1h6StB5icY89Hfh3LZ3x/1fohkLxeq6+KeVc6zjqLUm3pi//4t/o7DfdQP1gwbJzLJynAXKOVYWtVZfvT6trVT5s7z2KqxpdV5NylLTGCt0sTqfsOjVR4VRa/VVU/nAfT1h0Rgr9Dgeng+uT4XFma+avEetJRcrPKFtToUJWWrCM83VeJw3Tqi+bck89VFhs7WyL525elT8LO8W9k3VU1KWnHC/Vr3X4LoPs8IiZX5QDeTxqOW4U2F9v9bVqR8xS87G/0TNavlSuAhEyiy33BDvEC1XrGCbNjekLDnBFH5c7Rs7X3Lklht2tNYNuOQouDDNXKo+8mZHI7MHkLKav47V3lrexWwr7yhypdqz1GTeglZmzlj4Z+A35i1KWc1fx2pvreAySTu7s1dpSllyNu5Fzusu29htc2BrJGWVcIG0tbW8Yk3cBaqL+umlLDkj+42JXLkVp/qFb2zTSFllEtzOhONGzStWsZ2d1I+1hZay5KzUwbT8N1/ZnrDfI/jbXZIuZcbF1L913NIWfrHm6uihec67u7LkDJU6fPfh6vFaHV3WWfkNla+vPn7nL35KWSXbccvxi1WMbEffXunnnO7K0mO/5/RNnB0I97vmJYx+sXqDtfljJ7uz9DxpfoGucBFcWNOefb6gWL3JOn5OKUtP/tWzZ80vXd47f/Z983uSUnZdmfCcUgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/7l/Aav8Mq93IWbxAAAAAElFTkSuQmCCDQotLS0tLS0tLS0tLS0tUnVieU11bHRpcGFydFBvc3QtMTcxZGFjZDk0ZDE4YmU5YTk1MWQ4Nzg5M2E3NjQyYjQtLQ0K + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-171dacd94d18be9a951d87893a7642b4 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '2070' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Tue, 08 Oct 2024 12:30:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.168' + X-B3-Traceid: + - 600a3aac128d942a1c52cf2fcdce2e6e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ff1a5fbd-67ed-49a8-8026-a6e5df02d05c", + "label" : "test", + "width" : 600, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/ff1a5fbd-67ed-49a8-8026-a6e5df02d05c" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image-2.png?hash=69edee39d8acbbb605eb5116c46c3a2eb6b2429f{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Tue, 08 Oct 2024 12:30:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml new file mode 100644 index 0000000..a40d9a6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_delete/deletes_a_shop_image.yml @@ -0,0 +1,245 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:06 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.175' + X-B3-Traceid: + - 3c7df241da651b776ed71288e7759a17 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728327726, + "jti" : "Po9mxmRGMwTEPxx+cSBNg6t0Y0k=" + } + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWNkNzVmZWQwMTk2NmYyNGUwMzc5YTUwMzY0NjczNzI3DQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA5Nw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAABkAAAAZAEAwAAAHKRK/8AAAAbUExURQAAAP///x8fH7+/v9/f339/fz8/P5+fn19fX8TDkjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAPUSURBVHic7dnPT9swFMBxK9C0x5lmP45tVaEd6Q7bjg1iP45UGoJjizhwpNp2p9M28Wcv9ntOUjaWKEpWNH0/BxpX8Ytf7NhuMAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgP9DNApH12cX+bGJf5x9qxdgkh81DNCS2VwPPllrk1Mt9NKs9K5O/b0kHDUM0JKencvBlX13d54mI1+I0+Tixxd7XCPAIiTSNEBLVppIbN9nfwepXHqVLLO/37VVfxPbJBw0C9CWVIfWdCgfvllReiQf88r6+0NNpGmAlvSHK7nWWu5kZN0g7+udHD+tDLB+rYk0DdCSzbEkEtlb+WLhiuMXUuglf6pTNkgO5ZymAVoS2aUkkl/RN8E3pty6B42fxVKzaYCW7D01ksh+GAN9N9TTMImujyoCzE41kaYBWrI40kTGB/rNwLr7ONLS5kk4s5fXOTWF3tBoIpUBOhVnF5RENnP9yrVhkI/svHnFre0PSwFWByGRygCd2s/GsySyyIdAeuvuc+kEMQ3frZ+VAmQnayKVATq1vgmJuCMxOzX956Gwl0+fujKYvl0W9d2JmkhlgC75ESCJzPKRn7WouHrRotAlWx3ixpMmUh2gQ2PXKEkkGw9FO4rxUGqHdMlWh0SuoIlUB+iQv4v3E8kGe9GOXunJ9l2y1SH+xv+WyIMBOiMXqZ2I65KtDpEH/BEksvK7o9qJuC7Z6pDYb6h2n0iULt1H/USi9M1Wh0x9VrtPZE+eQ5218na4SeeBZ3Vqyx1iZn7GDbNWnQDd0LW47vTrSra8c9Lle+fTb9gP1VwQ/UlJeaDo7mPnC2IYxzW3KMZ1yGVa6hJ9Kna+RdkkJ16afd7U2vNlU9a06JKBlfon2eeHXW4aN7ZwJIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWNkNzVmZWQwMTk2NmYyNGUwMzc5YTUwMzY0NjczNzI3LS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-cd75fed01966f24e0379a50364673727 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:06 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.120' + X-B3-Traceid: + - 2949e8a078daefd5893c933b0ce1f988 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "59b627d7-7738-4ac0-b051-4cfcc39cb06c", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 19:02:06 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.045' + X-B3-Traceid: + - 5e5b2cbd79b920e3d51b62562b058896 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/59b627d7-7738-4ac0-b051-4cfcc39cb06c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 07 Oct 2024 19:02:06 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.053' + X-B3-Traceid: + - '000438f00875295a1a3b0100b32bf884' + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:06 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml new file mode 100644 index 0000000..71c38b1 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_find/finds_a_shop_image.yml @@ -0,0 +1,265 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.124' + X-B3-Traceid: + - eaa0da0a77b0ba2e678922f41a644afe + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728327725, + "jti" : "ehLS8L/42F6CJBOoyVeqXKJiWZA=" + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTgzN2E2ZGZiMjE2NDgxMjNmMTE4NDhhZmIxOGI0NmUwDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA5Nw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAABkAAAAZAEAwAAAHKRK/8AAAAbUExURQAAAP///x8fH7+/v9/f339/fz8/P5+fn19fX8TDkjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAPUSURBVHic7dnPT9swFMBxK9C0x5lmP45tVaEd6Q7bjg1iP45UGoJjizhwpNp2p9M28Wcv9ntOUjaWKEpWNH0/BxpX8Ytf7NhuMAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgP9DNApH12cX+bGJf5x9qxdgkh81DNCS2VwPPllrk1Mt9NKs9K5O/b0kHDUM0JKencvBlX13d54mI1+I0+Tixxd7XCPAIiTSNEBLVppIbN9nfwepXHqVLLO/37VVfxPbJBw0C9CWVIfWdCgfvllReiQf88r6+0NNpGmAlvSHK7nWWu5kZN0g7+udHD+tDLB+rYk0DdCSzbEkEtlb+WLhiuMXUuglf6pTNkgO5ZymAVoS2aUkkl/RN8E3pty6B42fxVKzaYCW7D01ksh+GAN9N9TTMImujyoCzE41kaYBWrI40kTGB/rNwLr7ONLS5kk4s5fXOTWF3tBoIpUBOhVnF5RENnP9yrVhkI/svHnFre0PSwFWByGRygCd2s/GsySyyIdAeuvuc+kEMQ3frZ+VAmQnayKVATq1vgmJuCMxOzX956Gwl0+fujKYvl0W9d2JmkhlgC75ESCJzPKRn7WouHrRotAlWx3ixpMmUh2gQ2PXKEkkGw9FO4rxUGqHdMlWh0SuoIlUB+iQv4v3E8kGe9GOXunJ9l2y1SH+xv+WyIMBOiMXqZ2I65KtDpEH/BEksvK7o9qJuC7Z6pDYb6h2n0iULt1H/USi9M1Wh0x9VrtPZE+eQ5218na4SeeBZ3Vqyx1iZn7GDbNWnQDd0LW47vTrSra8c9Lle+fTb9gP1VwQ/UlJeaDo7mPnC2IYxzW3KMZ1yGVa6hJ9Kna+RdkkJ16afd7U2vNlU9a06JKBlfon2eeHXW4aN7ZwJIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LTgzN2E2ZGZiMjE2NDgxMjNmMTE4NDhhZmIxOGI0NmUwLS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-837a6dfb21648123f11848afb18b46e0 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/80952e3a-4561-44e5-b62e-8c9b0237512d + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.136' + X-B3-Traceid: + - 5f6b99a61cae04f37fef367afb673a46 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "80952e3a-4561-44e5-b62e-8c9b0237512d", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - 4c869d42aa484663f42c8fdeb3c9e7ce + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "80952e3a-4561-44e5-b62e-8c9b0237512d", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/80952e3a-4561-44e5-b62e-8c9b0237512d + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.038' + X-B3-Traceid: + - 85eccf9257d41ae655b3c7405f57cf08 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml new file mode 100644 index 0000000..66388c6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Image/with_a_shop_image/_upload/uploads_an_image.yml @@ -0,0 +1,193 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 07 Oct 2024 19:02:04 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - a6e693b690fa848bc1cfd7a85a9594f7 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728327724, + "jti" : "0IogORUK/whqV/Hoz0rUJIbuBs4=" + } + recorded_at: Mon, 07 Oct 2024 19:02:04 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images?fileName=new-image.png&label=logo + body: + encoding: ASCII-8BIT + string: !binary |- + LS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWQ2NGRjMDJhZGYxOTBhZmI4OGRmMTM0MTkxZTY2NzkxDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImltYWdlIjsgZmlsZW5hbWU9ImltYWdlMS5wbmciDQpDb250ZW50LUxlbmd0aDogMTA5Nw0KQ29udGVudC1UeXBlOiBpbWFnZS9wbmcNCkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IGJpbmFyeQ0KDQqJUE5HDQoaCgAAAA1JSERSAAABkAAAAZAEAwAAAHKRK/8AAAAbUExURQAAAP///x8fH7+/v9/f339/fz8/P5+fn19fX8TDkjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAPUSURBVHic7dnPT9swFMBxK9C0x5lmP45tVaEd6Q7bjg1iP45UGoJjizhwpNp2p9M28Wcv9ntOUjaWKEpWNH0/BxpX8Ytf7NhuMAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgP9DNApH12cX+bGJf5x9qxdgkh81DNCS2VwPPllrk1Mt9NKs9K5O/b0kHDUM0JKencvBlX13d54mI1+I0+Tixxd7XCPAIiTSNEBLVppIbN9nfwepXHqVLLO/37VVfxPbJBw0C9CWVIfWdCgfvllReiQf88r6+0NNpGmAlvSHK7nWWu5kZN0g7+udHD+tDLB+rYk0DdCSzbEkEtlb+WLhiuMXUuglf6pTNkgO5ZymAVoS2aUkkl/RN8E3pty6B42fxVKzaYCW7D01ksh+GAN9N9TTMImujyoCzE41kaYBWrI40kTGB/rNwLr7ONLS5kk4s5fXOTWF3tBoIpUBOhVnF5RENnP9yrVhkI/svHnFre0PSwFWByGRygCd2s/GsySyyIdAeuvuc+kEMQ3frZ+VAmQnayKVATq1vgmJuCMxOzX956Gwl0+fujKYvl0W9d2JmkhlgC75ESCJzPKRn7WouHrRotAlWx3ixpMmUh2gQ2PXKEkkGw9FO4rxUGqHdMlWh0SuoIlUB+iQv4v3E8kGe9GOXunJ9l2y1SH+xv+WyIMBOiMXqZ2I65KtDpEH/BEksvK7o9qJuC7Z6pDYb6h2n0iULt1H/USi9M1Wh0x9VrtPZE+eQ5218na4SeeBZ3Vqyx1iZn7GDbNWnQDd0LW47vTrSra8c9Lle+fTb9gP1VwQ/UlJeaDo7mPnC2IYxzW3KMZ1yGVa6hJ9Kna+RdkkJ16afd7U2vNlU9a06JKBlfon2eeHXW4aN7ZwJIu8b1+iK7acNC8quDUkKrpkUKo/NHUCdCSaiM3xZFL+XeSGd/G76Kao4NeQUpdo/ZfJZDKqFaBjdX/qyqIelZ8S73H81DUhkep3B7qoT++vcPGjePlgQiJmIW9zYt+enr7NWRVzTthl/dYlmkhlgM5pIvty6Su54fK+MC41ehEe5vtdEhKpCtA5TSRKPxr3Jlju6zS5Ne617ig/7WqpB9HH7fohkaoAndNEso3U87PPdjjSVtmv5zP7qkb9kEjjAG0JiZjvbkG41cLA/VfgbZ36eSJNA7Tv8O7nKC9E13eX/zwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACP2C/ZfbbcqobJ/QAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLVJ1YnlNdWx0aXBhcnRQb3N0LWQ2NGRjMDJhZGYxOTBhZmI4OGRmMTM0MTkxZTY2NzkxLS0NCg== + headers: + Accept: + - application/json + Content-Type: + - multipart/form-data; boundary=-----------RubyMultipartPost-d64dc02adf190afb88df134191e66791 + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Content-Length: + - '1384' + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/images/0121a830-6643-4793-b174-e85ea905f518 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.293' + X-B3-Traceid: + - 84eef16d400978968d166ce4590ff8e0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "0121a830-6643-4793-b174-e85ea905f518", + "label" : "logo", + "width" : 400, + "height" : 400, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518" + }, + "image" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518" + }, + "data" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/core-storage/images/new-image.png?hash=54386a565cf2d7f563e8dec800be24434918438d{&width,height,upscale}", + "templated" : true + } + } + } + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/images/0121a830-6643-4793-b174-e85ea905f518 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 07 Oct 2024 19:02:05 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - b04208975f7ae95f6385c1f28b01e475 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 07 Oct 2024 19:02:05 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml new file mode 100644 index 0000000..4de5307 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml @@ -0,0 +1,158 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 09:42:19 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 3c831c0f06f35a83daaadc6bf1d2572e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727948539, + "jti" : "i9X4RgJLGRZpgy21AGIV7W4NzrM=" + } + recorded_at: Thu, 03 Oct 2024 09:42:19 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 09:42:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - a3c1855601b9a8f87e8164e97f8fb1c8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "languages" : [ { + "_id" : "dd170cd2-8b2d-4a8e-bfdb-16023eeca398", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:49.099Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/dd170cd2-8b2d-4a8e-bfdb-16023eeca398" + } + } + }, { + "_id" : "413732f8-44f7-4f4a-9981-20614262c0f1", + "locale" : "nb-NO", + "deletableAt" : "2024-10-02T09:54:49.107Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/413732f8-44f7-4f4a-9981-20614262c0f1" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages?page=0&size=20&sort=createdAt,asc" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Thu, 03 Oct 2024 09:42:19 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml new file mode 100644 index 0000000..fd07237 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:10:06 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.125' + X-B3-Traceid: + - ae7e7a9a7cd4926bbb51af05eedad4ae + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727964606, + "jti" : "VZdbLKLZ3DKJywgUWMdaG1szCPU=" + } + recorded_at: Thu, 03 Oct 2024 14:10:06 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:10:06 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - 951c00505367046cb463def0cacfd2f0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:10:06 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml new file mode 100644 index 0000000..f20c811 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml @@ -0,0 +1,186 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.103' + X-B3-Traceid: + - 9c5853c17768bd61ea33f1bf3e8d768c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727965449, + "jti" : "lzxLLtsyXFMbTxn86B/78ZMg7lo=" + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:10 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 14:24:10 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml new file mode 100644 index 0000000..73d5ca8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml @@ -0,0 +1,198 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.103' + X-B3-Traceid: + - 9c5853c17768bd61ea33f1bf3e8d768c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727965449, + "jti" : "lzxLLtsyXFMbTxn86B/78ZMg7lo=" + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:10 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:10 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Location/_all/returns_all_shop_locations.yml b/spec/vcr_cassettes/BeyondApi_Shop_Location/_all/returns_all_shop_locations.yml new file mode 100644 index 0000000..5b6b33c --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Location/_all/returns_all_shop_locations.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:18 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.211' + X-B3-Traceid: + - eefbcf59fcd29941d3044a86650abcb2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728571998, + "jti" : "EqWcFgvfMZ7j6HoHkvv+lsezTGI=" + } + recorded_at: Thu, 10 Oct 2024 14:53:18 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:18 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.087' + X-B3-Traceid: + - 61dc504d7a69fe05c4998f455275f405 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "locations" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations?page=0&size=20&sort=createdAt,asc" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Thu, 10 Oct 2024 14:53:18 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_create/creates_a_new_shop_location.yml b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_create/creates_a_new_shop_location.yml new file mode 100644 index 0000000..743055a --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_create/creates_a_new_shop_location.yml @@ -0,0 +1,222 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:18 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.120' + X-B3-Traceid: + - f387c0f33009487fa59ca22b547bad28 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728571998, + "jti" : "JdpG0j3tesmecsjHCH9GnyuPPsw=" + } + recorded_at: Thu, 10 Oct 2024 14:53:18 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations + body: + encoding: UTF-8 + string: '{"languageCode":"en","storeCode":"MLC-St-Ives","companyName":"My little + Cornershop - St.Ives","primaryPhone":"(800) 555-0102","address":{"postalCode":"90999","street":"Hudson + Way","houseNumber":"27","city":"St.Ives","country":"GB","dependentLocality":"","state":"Cornwall"},"googleStatus":"ACTIVE","googlePrimaryCategory":{"categoryId":"gcid:storefood","displayName":"Food"},"googleAdditionalCategories":[{"displayName":"Drinks","categoryId":"gcid:storedrinks"}],"regularHours":{"periods":[{"openDay":"MONDAY","openTime":"08:00","closeDay":"MONDAY","closeTime":"17:00"},{"openDay":"SATURDAY","openTime":"10:00","closeDay":"SATURDAY","closeTime":"16:00"}]},"latLng":{"latitude":53.5847424,"longitude":9.968901}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 10 Oct 2024 14:53:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/locations/b5ca0a65-b15b-44b6-93b5-99a86dfecba6 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - 53e5c924c5cec8dbd06d7c8154262166 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "b5ca0a65-b15b-44b6-93b5-99a86dfecba6", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "My little Cornershop - St.Ives", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/b5ca0a65-b15b-44b6-93b5-99a86dfecba6" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:19 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/b5ca0a65-b15b-44b6-93b5-99a86dfecba6 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 10 Oct 2024 14:53:19 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.056' + X-B3-Traceid: + - 0beabd9e843630d6e38e45f61804baa0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 10 Oct 2024 14:53:19 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_delete/deletes_a_shop_location.yml b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_delete/deletes_a_shop_location.yml new file mode 100644 index 0000000..308ea95 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_delete/deletes_a_shop_location.yml @@ -0,0 +1,274 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:21 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.131' + X-B3-Traceid: + - 9a937df50e5c4e91a56a9b278161012c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728572001, + "jti" : "d+nVa4xkMmsYZygYWfY4v+y2dJI=" + } + recorded_at: Thu, 10 Oct 2024 14:53:21 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations + body: + encoding: UTF-8 + string: '{"languageCode":"en","storeCode":"MLC-St-Ives","companyName":"My little + Cornershop - St.Ives","primaryPhone":"(800) 555-0102","address":{"postalCode":"90999","street":"Hudson + Way","houseNumber":"27","city":"St.Ives","country":"GB","dependentLocality":"","state":"Cornwall"},"googleStatus":"ACTIVE","googlePrimaryCategory":{"categoryId":"gcid:storefood","displayName":"Food"},"googleAdditionalCategories":[{"displayName":"Drinks","categoryId":"gcid:storedrinks"}],"regularHours":{"periods":[{"openDay":"MONDAY","openTime":"08:00","closeDay":"MONDAY","closeTime":"17:00"},{"openDay":"SATURDAY","openTime":"10:00","closeDay":"SATURDAY","closeTime":"16:00"}]},"latLng":{"latitude":53.5847424,"longitude":9.968901}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 10 Oct 2024 14:53:21 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/locations/20840fc4-aa39-4571-bd62-13d15f01f249 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - 02f94379b9a014ac81fefac8c25c82a9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "20840fc4-aa39-4571-bd62-13d15f01f249", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "My little Cornershop - St.Ives", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/20840fc4-aa39-4571-bd62-13d15f01f249" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:21 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/20840fc4-aa39-4571-bd62-13d15f01f249 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 10 Oct 2024 14:53:21 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.052' + X-B3-Traceid: + - f2af1fec575148c96fae7d920f8b5749 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 10 Oct 2024 14:53:21 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/20840fc4-aa39-4571-bd62-13d15f01f249 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Thu, 10 Oct 2024 14:53:21 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.015' + X-B3-Traceid: + - f496317e9c7d50d5f7aef92a7fc71001 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 10 Oct 2024 14:53:21 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_find/returns_a_shop_location.yml b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_find/returns_a_shop_location.yml new file mode 100644 index 0000000..72f0d03 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_find/returns_a_shop_location.yml @@ -0,0 +1,324 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:19 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.099' + X-B3-Traceid: + - 78645c4ac81e4ed07b2665a50f8f0dae + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728571999, + "jti" : "2zmmYhwZMMJH2I/DndPH0A8sYKk=" + } + recorded_at: Thu, 10 Oct 2024 14:53:19 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations + body: + encoding: UTF-8 + string: '{"languageCode":"en","storeCode":"MLC-St-Ives","companyName":"My little + Cornershop - St.Ives","primaryPhone":"(800) 555-0102","address":{"postalCode":"90999","street":"Hudson + Way","houseNumber":"27","city":"St.Ives","country":"GB","dependentLocality":"","state":"Cornwall"},"googleStatus":"ACTIVE","googlePrimaryCategory":{"categoryId":"gcid:storefood","displayName":"Food"},"googleAdditionalCategories":[{"displayName":"Drinks","categoryId":"gcid:storedrinks"}],"regularHours":{"periods":[{"openDay":"MONDAY","openTime":"08:00","closeDay":"MONDAY","closeTime":"17:00"},{"openDay":"SATURDAY","openTime":"10:00","closeDay":"SATURDAY","closeTime":"16:00"}]},"latLng":{"latitude":53.5847424,"longitude":9.968901}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 10 Oct 2024 14:53:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/locations/952797f5-b36d-4808-9c38-b4fd4e498190 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.045' + X-B3-Traceid: + - 88177eb05756b661bdb2f1cd99562961 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "952797f5-b36d-4808-9c38-b4fd4e498190", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "My little Cornershop - St.Ives", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/952797f5-b36d-4808-9c38-b4fd4e498190" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:19 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/952797f5-b36d-4808-9c38-b4fd4e498190 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - 1ad2d92a822cd8684ea86b3f0191bf85 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "952797f5-b36d-4808-9c38-b4fd4e498190", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "My little Cornershop - St.Ives", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/952797f5-b36d-4808-9c38-b4fd4e498190" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:19 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/952797f5-b36d-4808-9c38-b4fd4e498190 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 10 Oct 2024 14:53:20 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - 24c9814ac54e1f6927b5099cc07dee6b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 10 Oct 2024 14:53:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_update/updates_a_shop_location.yml b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_update/updates_a_shop_location.yml new file mode 100644 index 0000000..4cbcc68 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Location/with_location/_update/updates_a_shop_location.yml @@ -0,0 +1,326 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:20 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.104' + X-B3-Traceid: + - 1d26a32ed743bc965773c38dc508604e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1728572000, + "jti" : "fV/S1GqKoBkytwszksGTzzh/qFI=" + } + recorded_at: Thu, 10 Oct 2024 14:53:20 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations + body: + encoding: UTF-8 + string: '{"languageCode":"en","storeCode":"MLC-St-Ives","companyName":"My little + Cornershop - St.Ives","primaryPhone":"(800) 555-0102","address":{"postalCode":"90999","street":"Hudson + Way","houseNumber":"27","city":"St.Ives","country":"GB","dependentLocality":"","state":"Cornwall"},"googleStatus":"ACTIVE","googlePrimaryCategory":{"categoryId":"gcid:storefood","displayName":"Food"},"googleAdditionalCategories":[{"displayName":"Drinks","categoryId":"gcid:storedrinks"}],"regularHours":{"periods":[{"openDay":"MONDAY","openTime":"08:00","closeDay":"MONDAY","closeTime":"17:00"},{"openDay":"SATURDAY","openTime":"10:00","closeDay":"SATURDAY","closeTime":"16:00"}]},"latLng":{"latitude":53.5847424,"longitude":9.968901}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 10 Oct 2024 14:53:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/shop/locations/ca139c15-93d7-4abb-b315-c624e7f77ea8 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.085' + X-B3-Traceid: + - 884d6a5019102a351e66e0a04a8f76f8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ca139c15-93d7-4abb-b315-c624e7f77ea8", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "My little Cornershop - St.Ives", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/ca139c15-93d7-4abb-b315-c624e7f77ea8" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:20 GMT +- request: + method: put + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/ca139c15-93d7-4abb-b315-c624e7f77ea8 + body: + encoding: UTF-8 + string: '{"languageCode":"en","storeCode":"MLC-St-Ives","companyName":"Updated + Cornershop","primaryPhone":"(800) 555-0102","address":{"postalCode":"90999","street":"Hudson + Way","houseNumber":"27","city":"St.Ives","country":"GB","dependentLocality":"","state":"Cornwall"},"googleStatus":"ACTIVE","googlePrimaryCategory":{"categoryId":"gcid:storefood","displayName":"Food"},"googleAdditionalCategories":[{"displayName":"Drinks","categoryId":"gcid:storedrinks"}],"regularHours":{"periods":[{"openDay":"MONDAY","openTime":"08:00","closeDay":"MONDAY","closeTime":"17:00"},{"openDay":"SATURDAY","openTime":"10:00","closeDay":"SATURDAY","closeTime":"16:00"}]},"latLng":{"latitude":53.5847424,"longitude":9.968901}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 10 Oct 2024 14:53:20 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - b6769cba57e4732b78c2c5407b184c4a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "ca139c15-93d7-4abb-b315-c624e7f77ea8", + "storeCode" : "MLC-St-Ives", + "languageCode" : "en", + "address" : { + "street" : "Hudson Way", + "houseNumber" : "27", + "postalCode" : "90999", + "city" : "St.Ives", + "country" : "GB", + "dependentLocality" : "", + "state" : "Cornwall", + "displayAddressLines" : [ "27 Hudson Way", "ST.IVES", "90999", "UNITED KINGDOM" ] + }, + "companyName" : "Updated Cornershop", + "primaryPhone" : "(800) 555-0102", + "googleStatus" : "ACTIVE", + "googlePrimaryCategory" : { + "displayName" : "Food", + "categoryId" : "gcid:storefood" + }, + "googleAdditionalCategories" : [ { + "displayName" : "Drinks", + "categoryId" : "gcid:storedrinks" + } ], + "latLng" : { + "latitude" : 53.5847424, + "longitude" : 9.968901 + }, + "regularHours" : { + "periods" : [ { + "openDay" : "MONDAY", + "openTime" : "08:00", + "closeDay" : "MONDAY", + "closeTime" : "17:00" + }, { + "openDay" : "SATURDAY", + "openTime" : "10:00", + "closeDay" : "SATURDAY", + "closeTime" : "16:00" + } ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/locations/ca139c15-93d7-4abb-b315-c624e7f77ea8" + } + } + } + recorded_at: Thu, 10 Oct 2024 14:53:20 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/locations/ca139c15-93d7-4abb-b315-c624e7f77ea8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 10 Oct 2024 14:53:21 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.047' + X-B3-Traceid: + - 6b389ffff2b29cc702455515224f9c90 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 10 Oct 2024 14:53:21 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml b/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml new file mode 100644 index 0000000..3a71722 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Shop/_get/returns_the_shop_details.yml @@ -0,0 +1,160 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:36:16 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.171' + X-B3-Traceid: + - 5d0474f38fa3cd44d8d2db510cc40b8a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052976, + "jti" : "fP5GZ4flKaRAKWsK77zoPkasf58=" + } + recorded_at: Mon, 19 Aug 2024 07:36:16 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:36:17 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - 2ae749c42757058dbaa58127e4426c42 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "5227687a-aa6b-487c-9c2b-afccf1573cea", + "name" : "Team42 Beyond API", + "resellerName" : "epages", + "primaryHostname" : "team42-beyond-api.beyondshop.cloud", + "fallbackHostname" : "team42-beyond-api.beyondshop.cloud", + "tax" : { + "taxModel" : "GROSS", + "vatExempted" : false, + "country" : "GB", + "supportedTaxClasses" : [ "EXEMPT", "REDUCED", "REGULAR" ] + }, + "currencies" : [ "GBP" ], + "defaultCurrency" : "GBP", + "locales" : [ "en-GB" ], + "defaultLocale" : "en-GB", + "closedByMerchant" : true, + "emailConfirmed" : true, + "socialSharingEnabled" : true, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + }, + "shop" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop" + }, + "address" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/address" + }, + "images" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/images" + }, + "legal" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/legal" + }, + "attributes" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/shop/attributes" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:36:16 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml new file mode 100644 index 0000000..ef99947 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/_all/returns_all_script_tags.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.088' + X-B3-Traceid: + - d8bb94fce645e11df41f02cdf798c48c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051815, + "jti" : "tZ1d2LY1w2EHdOp6Fio2ID2v6sU=" + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.019' + X-B3-Traceid: + - 4bb5130872df2dc70bef5c5eabcb7790 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "script-tags" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags?page=0&size=20" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml new file mode 100644 index 0000000..0adb11d --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_create/creates_a_new_category.yml @@ -0,0 +1,182 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - 0c97be1daa45232d28dd92b0f670a097 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051815, + "jti" : "oSMzgxORYBuMaGTwU6WxFQhB3PI=" + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:55 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.074' + X-B3-Traceid: + - ca7443df2ac52d190d47ea8d7df1ffb4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "3bda8799-ed96-4f27-836a-4fb034e43a48", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/3bda8799-ed96-4f27-836a-4fb034e43a48 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.026' + X-B3-Traceid: + - d943e40a62bcba3951b1f008012de45d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:55 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml new file mode 100644 index 0000000..634ca55 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_delete/deletes_a_script_tag.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.097' + X-B3-Traceid: + - 2cd075d0bf0e39ff6109d213e139fb9e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055781, + "jti" : "C6UJPHY9f5Dc8FU43LVeiN2zoWw=" + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - d1f65daa2ab4973f56910dfe9abd53c6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "861516c1-32ce-4dfe-8bb7-f36d30194eed", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - a28101666148e32f48b4e2d4a98f4e39 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/861516c1-32ce-4dfe-8bb7-f36d30194eed + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:01 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.023' + X-B3-Traceid: + - 4da97a350edaea722e1135e1570c732d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "script-tag.not-found", + "details" : { }, + "message" : "script-tag with id 861516c1-32ce-4dfe-8bb7-f36d30194eed could not be found", + "traceId" : "4da97a350edaea722e1135e1570c732d" + } + recorded_at: Mon, 19 Aug 2024 08:23:01 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml new file mode 100644 index 0000000..a4e4441 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_destroy/deletes_a_script_tag.yml @@ -0,0 +1,242 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - a593d0cdd236de07616aef78bf6a6655 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051816, + "jti" : "FU5e5c1fVeoVADYx6gMOUbbaE9g=" + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.037' + X-B3-Traceid: + - 4b85311b0c4bc77c83cbd4b03eaf43cc + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c84ded08-d594-4124-a868-cf660c507e10", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.049' + X-B3-Traceid: + - 7d438309bcb3899f073002e6bcaec3d9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/c84ded08-d594-4124-a868-cf660c507e10 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 07:16:57 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.027' + X-B3-Traceid: + - a3989af594a1f550cdfc565446fe21b9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "script-tag.not-found", + "details" : { }, + "message" : "script-tag with id c84ded08-d594-4124-a868-cf660c507e10 could not be found", + "traceId" : "a3989af594a1f550cdfc565446fe21b9" + } + recorded_at: Mon, 19 Aug 2024 07:16:57 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml new file mode 100644 index 0000000..60b4c61 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Storefront_ScriptTag/with_script_tag/_find/returns_a_script_tag.yml @@ -0,0 +1,182 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.090' + X-B3-Traceid: + - 69f92027deeb0baa1b3cc91a4fc2b0a9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724051816, + "jti" : "fibGyoBMMp+/jt/tl0DI6Y3psV8=" + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags + body: + encoding: UTF-8 + string: '{"scriptUrl":"https://example.com/scripts/exampleScript.js"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.030' + X-B3-Traceid: + - d76f1dd31353f4c98c74c418a4fe7fc5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "2d427037-5968-46e6-b32a-a59f189ebfb2", + "categories" : [ ], + "scriptUrl" : "https://example.com/scripts/exampleScript.js", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/script-tags/2d427037-5968-46e6-b32a-a59f189ebfb2 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:16:56 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.057' + X-B3-Traceid: + - 26a4d23f761f124c1408ca0ea977412a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:16:56 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml new file mode 100644 index 0000000..394f975 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/_all/returns_all_webhook_subscriptions.yml @@ -0,0 +1,136 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.111' + X-B3-Traceid: + - e0b99fb5d7ea3fa4fee24a224568d657 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052312, + "jti" : "CtoBgVKfRCv3wpVQ9i1Wt0WOr3U=" + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - 4671d01950bc1fa1eb36536e344c3231 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "subscriptions" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_activate/activates_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_activate/activates_a_webhook_subscription.yml new file mode 100644 index 0000000..93a6346 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_activate/activates_a_webhook_subscription.yml @@ -0,0 +1,254 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.111' + X-B3-Traceid: + - e3d66d2aa31912e7b0b504fcb4cf21c1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727938728, + "jti" : "vitZ488XJwzufv9LHJgiyHRiAzM=" + } + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.069' + X-B3-Traceid: + - 2d1a762ad3d611a96e94a2123847b6f8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "735d9365-7795-496e-bfb7-7156433dd525", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525/activate + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.027' + X-B3-Traceid: + - 904d76b8aba432e0ff0c17a0624fbcf5 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "735d9365-7795-496e-bfb7-7156433dd525", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/735d9365-7795-496e-bfb7-7156433dd525 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.043' + X-B3-Traceid: + - 21e2dda7d41c1dd2bd6f82cc7279cfe9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml new file mode 100644 index 0000000..f004bef --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_create/creates_a_new_webhook_subscription.yml @@ -0,0 +1,186 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.096' + X-B3-Traceid: + - 29853db6da84b038e366c4c73a92e840 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052312, + "jti" : "dEZQvxoGOAVa9WMsx8d3qhjUrcI=" + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:12 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.055' + X-B3-Traceid: + - a543aff3022f92da255ecbc32ba6f474 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "2a3707d0-3cc1-462a-84c2-176c5e1cf689", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:12 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/2a3707d0-3cc1-462a-84c2-176c5e1cf689 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.038' + X-B3-Traceid: + - fd40a1d4fc79789287c66b0ad0cc1fa2 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_deactivate/deactivates_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_deactivate/deactivates_a_webhook_subscription.yml new file mode 100644 index 0000000..4c5a8c4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_deactivate/deactivates_a_webhook_subscription.yml @@ -0,0 +1,254 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.107' + X-B3-Traceid: + - 93421d636b7e092cc7a76bedb577e104 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727938728, + "jti" : "GRGUemmcTlUrNdm6vnUA2fS2B3E=" + } + recorded_at: Thu, 03 Oct 2024 06:58:47 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.055' + X-B3-Traceid: + - aa578b3abd60b6584917ef2ba3132052 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "5a8bba3b-5e7c-4f02-8876-d777af2d9659", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659/deactivate + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - 376b1c8a5c9d1069eaca08a061003094 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : false, + "_id" : "5a8bba3b-5e7c-4f02-8876-d777af2d9659", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659" + }, + "activate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659/activate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/5a8bba3b-5e7c-4f02-8876-d777af2d9659 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 03 Oct 2024 06:58:48 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - f1d312c7dae8eb40f6420031c734634e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:48 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml new file mode 100644 index 0000000..53cbeb6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete/deletes_a_webhook_subscription.yml @@ -0,0 +1,238 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.160' + X-B3-Traceid: + - 661b0474ff0beed08492404ba4b3246e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724055782, + "jti" : "etTNATIXyAYxSmeXKD6CSUrTCNs=" + } + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.054' + X-B3-Traceid: + - db202fddc69411adc9750a7a93eb1f36 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "ba3d5330-ed1d-440d-abce-7ad54c3f0d08", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.044' + X-B3-Traceid: + - d0c2be1d708e5ef0cd3eb8dadf70b2c1 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/ba3d5330-ed1d-440d-abce-7ad54c3f0d08 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 08:23:02 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.019' + X-B3-Traceid: + - 455eabf287b14c709350c96903b48836 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 08:23:02 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete_failure/deletes_a_webhook_failure.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete_failure/deletes_a_webhook_failure.yml new file mode 100644 index 0000000..84fa6e4 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_delete_failure/deletes_a_webhook_failure.yml @@ -0,0 +1,250 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:50 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.075' + X-B3-Traceid: + - 326eaf6eb08d2a384ab8f6f8401d9f0d + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727938730, + "jti" : "hd/XTyQyv33SG4JeSrywaAmJico=" + } + recorded_at: Thu, 03 Oct 2024 06:58:50 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 03 Oct 2024 06:58:50 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.052' + X-B3-Traceid: + - e063e94d034a0a2135b479c9f036c291 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "38d82a29-4ad6-49fa-83cd-70350517a472", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:50 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472/failures/123e4567-e89b-12d3-a456-426614174000 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 500 + message: Server Error + headers: + Date: + - Thu, 03 Oct 2024 06:58:50 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Vary: + - Access-Control-Request-Headers + - Access-Control-Request-Method + - Origin + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.018' + X-B3-Traceid: + - 259b55a05b6bfd44abd906464d51489a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "errorId" : "internal-error", + "details" : { }, + "message" : "No static resource webhook-subscriptions/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472/failures/123e4567-e89b-12d3-a456-426614174000.", + "traceId" : "259b55a05b6bfd44abd906464d51489a" + } + recorded_at: Thu, 03 Oct 2024 06:58:50 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/38d82a29-4ad6-49fa-83cd-70350517a472 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 03 Oct 2024 06:58:50 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.036' + X-B3-Traceid: + - 70c15805665504105f8478af5129ccf6 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:50 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml new file mode 100644 index 0000000..a76d87f --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_destroy/deletes_a_webhook_subscription.yml @@ -0,0 +1,238 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.101' + X-B3-Traceid: + - 4db8dbee6bd5eb98accdbc08e7882f9a + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052313, + "jti" : "2ArIrBGdwUsrtgORQ3UHj53FcCk=" + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.039' + X-B3-Traceid: + - a378220db8b2d3339b2fa689ffc28cc8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "a6cbd477-e250-4aaf-85cc-5dc899573a6c", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:14 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.035' + X-B3-Traceid: + - f42e017c7d27b95cff64de4d173ad537 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:14 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/a6cbd477-e250-4aaf-85cc-5dc899573a6c + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Mon, 19 Aug 2024 07:25:14 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.017' + X-B3-Traceid: + - e017a73d6b541d39e90ca41bf4fbca6c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:14 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_failures/lists_all_failed_deliveries_of_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_failures/lists_all_failed_deliveries_of_a_webhook_subscription.yml new file mode 100644 index 0000000..116dda6 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_failures/lists_all_failed_deliveries_of_a_webhook_subscription.yml @@ -0,0 +1,256 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.089' + X-B3-Traceid: + - 3dda588eafcbb357100ef4ef04af1bf8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727938729, + "jti" : "T/v4oieL2/5IZv6TqGvqp7aiXSM=" + } + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.034' + X-B3-Traceid: + - edff24a91abd9b6bb9d5de0f6e610385 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "57c659f9-3706-439f-8388-3b6fbb026c9b", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b/failures?page=0&size=100 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.022' + X-B3-Traceid: + - 8495ad4960eb203745452af09a0a4335 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "failures" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b/failures?page=0&size=100&sort=createdAt,desc" + } + }, + "page" : { + "size" : 100, + "totalElements" : 0, + "totalPages" : 0, + "number" : 0 + } + } + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/57c659f9-3706-439f-8388-3b6fbb026c9b + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.028' + X-B3-Traceid: + - 7cbaa1ac44a6dc8120b1c5f6bfc0ce13 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml new file mode 100644 index 0000000..67948af --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_find/returns_a_webhook_subscription.yml @@ -0,0 +1,254 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.084' + X-B3-Traceid: + - c962e7ebc9678a42f7470be9c81b683b + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1724052313, + "jti" : "puBdyxl6qlmDmf+P8r/jL4V1F8c=" + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.033' + X-B3-Traceid: + - f87514392ebcf7dec97dd79d461f0a0e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "50873c4d-97da-4cbb-b221-1b6da35dd1fd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.022' + X-B3-Traceid: + - d8a9409cf4a1a9da9ff09fc8669e2bc4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "order.created", "product.created" ], + "active" : true, + "_id" : "50873c4d-97da-4cbb-b221-1b6da35dd1fd", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd/deactivate" + } + } + } + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/50873c4d-97da-4cbb-b221-1b6da35dd1fd + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Mon, 19 Aug 2024 07:25:13 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.031' + X-B3-Traceid: + - bcf9b63acbf3b35ea7c6e4e7c89d2b8c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Mon, 19 Aug 2024 07:25:13 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_retry/retries_a_failed_webhook_delivery.yml b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_retry/retries_a_failed_webhook_delivery.yml new file mode 100644 index 0000000..2a8eea1 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Webhook_Subscription/with_webhook_subscription/_retry/retries_a_failed_webhook_delivery.yml @@ -0,0 +1,238 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.081' + X-B3-Traceid: + - 2c6d053ea44a5654591358694fc35f81 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727938729, + "jti" : "IsJ4kGGsEUTDD7kri+ON7+SLEe8=" + } + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions + body: + encoding: UTF-8 + string: '{"callbackUri":"http://example.com/test","eventTypes":["order.created","product.created"]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 201 + message: Created + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Location: + - https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/6ea2623c-4ef2-40fb-8f05-9683ba8d5e71 + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.043' + X-B3-Traceid: + - 4a6df15f0cc1641ee0dea4b4e52419f8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "callbackUri" : "http://example.com/test", + "eventTypes" : [ "product.created", "order.created" ], + "active" : true, + "_id" : "6ea2623c-4ef2-40fb-8f05-9683ba8d5e71", + "_links" : { + "self" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/6ea2623c-4ef2-40fb-8f05-9683ba8d5e71" + }, + "deactivate" : { + "href" : "https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/6ea2623c-4ef2-40fb-8f05-9683ba8d5e71/deactivate" + } + } + } + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/6ea2623c-4ef2-40fb-8f05-9683ba8d5e71/failures/987e6543-e21b-45d3-b123-654321098765/retry + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Thu, 03 Oct 2024 06:58:49 GMT + Content-Length: + - '0' + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.019' + X-B3-Traceid: + - fe923707345224b9199ee1185b7ff8a4 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:49 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/webhook-subscriptions/6ea2623c-4ef2-40fb-8f05-9683ba8d5e71 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 204 + message: No Content + headers: + Date: + - Thu, 03 Oct 2024 06:58:50 GMT + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - '0' + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.031' + X-B3-Traceid: + - 31be1c834ab966a4aa654059e5441133 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 06:58:50 GMT +recorded_with: VCR 6.2.0