From 1ae3a52de271156d9e167023ef83864a65766955 Mon Sep 17 00:00:00 2001 From: k4th Date: Tue, 1 Oct 2024 20:51:53 +0200 Subject: [PATCH 1/3] Add carts endpoints --- lib/beyond_api/services/checkout/cart.rb | 476 +++++++++++++++++++++++ 1 file changed, 476 insertions(+) create mode 100644 lib/beyond_api/services/checkout/cart.rb 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 From 9f117ee37e67475f1620845f9cef57096530b9d7 Mon Sep 17 00:00:00 2001 From: k4th Date: Tue, 1 Oct 2024 22:10:34 +0200 Subject: [PATCH 2/3] Add cart tests --- .../beyond_api/services/checkout/cart_spec.rb | 176 +++++++ ...s_the_current_payment_method_of_a_cart.yml | 482 ++++++++++++++++++ ..._the_current_pickup_option_of_the_cart.yml | 350 +++++++++++++ ...he_current_shipping_method_of_the_cart.yml | 356 +++++++++++++ ..._to_the_current_default_payment_method.yml | 454 +++++++++++++++++ ...to_the_current_default_shipping_method.yml | 454 +++++++++++++++++ .../sets_the_billing_address_of_the_cart.yml | 479 +++++++++++++++++ .../with_cart/_create/creates_a_new_cart.yml | 286 +++++++++++ .../initiates_the_creation_of_a_payment.yml | 346 +++++++++++++ ...on_of_a_payment_and_order_for_the_cart.yml | 348 +++++++++++++ .../with_cart/_delete/deletes_a_cart.yml | 336 ++++++++++++ .../removes_a_coupon_from_the_cart.yml | 346 +++++++++++++ .../_find/retrieves_the_details_of_a_cart.yml | 454 +++++++++++++++++ ...e_payment_methods_for_the_current_cart.yml | 482 ++++++++++++++++++ ...le_pickup_options_for_the_current_cart.yml | 350 +++++++++++++ .../_redeem_coupon/redeems_a_coupon.yml | 346 +++++++++++++ .../sets_the_shipping_address_of_the_cart.yml | 477 +++++++++++++++++ 17 files changed, 6522 insertions(+) create mode 100644 spec/beyond_api/services/checkout/cart_spec.rb create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_payment_method/sets_the_current_payment_method_of_a_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_pickup_option/sets_the_current_pickup_option_of_the_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_assign_current_shipping_method/sets_the_current_shipping_method_of_the_cart.yml create mode 100644 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 create mode 100644 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 create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_billing_address/sets_the_billing_address_of_the_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create/creates_a_new_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment/initiates_the_creation_of_a_payment.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_create_payment_and_order/initiates_the_creation_of_a_payment_and_order_for_the_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete/deletes_a_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_delete_coupon/removes_a_coupon_from_the_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_find/retrieves_the_details_of_a_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_payment_methods/lists_all_applicable_payment_methods_for_the_current_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_pickup_options/lists_all_applicable_pickup_options_for_the_current_cart.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_redeem_coupon/redeems_a_coupon.yml create mode 100644 spec/vcr_cassettes/BeyondApi_Checkout_Cart/with_cart/_shipping_address/sets_the_shipping_address_of_the_cart.yml 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..74c7003 --- /dev/null +++ b/spec/beyond_api/services/checkout/cart_spec.rb @@ -0,0 +1,176 @@ +# 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 = { + 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' + } + 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 = { + 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' + } + 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 = { + 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 + } + # 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/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 From 90be6da2ee8146681b465c247543723ae3505086 Mon Sep 17 00:00:00 2001 From: k4th Date: Wed, 2 Oct 2024 08:11:40 +0200 Subject: [PATCH 3/3] Use factories --- .../beyond_api/services/checkout/cart_spec.rb | 61 +------------------ spec/factories/address_data.rb | 30 +++++++++ spec/factories/payment_data.rb | 18 ++++++ 3 files changed, 51 insertions(+), 58 deletions(-) create mode 100644 spec/factories/address_data.rb create mode 100644 spec/factories/payment_data.rb diff --git a/spec/beyond_api/services/checkout/cart_spec.rb b/spec/beyond_api/services/checkout/cart_spec.rb index 74c7003..cccb127 100644 --- a/spec/beyond_api/services/checkout/cart_spec.rb +++ b/spec/beyond_api/services/checkout/cart_spec.rb @@ -25,30 +25,7 @@ describe '.billing_address' do it 'sets the billing address of the cart' do - body = { - 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' - } + 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]) @@ -57,30 +34,7 @@ describe '.shipping_address' do it 'sets the shipping address of the cart' do - body = { - 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' - } + 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]) @@ -115,16 +69,7 @@ describe '.create_payment_and_order' do it 'initiates the creation of a payment and order for the cart' do - 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 - } + 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 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/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