Class: BeyondApi::CheckoutSettings
- Includes:
- Utils
- Defined in:
- lib/beyond_api/resources/checkout_settings.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all ⇒ OpenStruct
A
GET
request is used to retrieve the checkout settings. -
#update(body) ⇒ OpenStruct
A
PUT
request is used to update the checkout settings.
Methods included from Utils
#file_content_type, #handle_all_request, #handle_error, #handle_response, #sanitize_key, #sanitize_response, #to_object_struct
Methods inherited from Base
Constructor Details
This class inherits a constructor from BeyondApi::Base
Instance Method Details
#all ⇒ OpenStruct
A GET
request is used to retrieve the checkout settings.
$ curl 'https://api-shop.beyondshop.cloud/api/checkout-settings' -i -X GET \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>'
23 24 25 26 27 |
# File 'lib/beyond_api/resources/checkout_settings.rb', line 23 def all response, status = BeyondApi::Request.get(@session, "/checkout-settings") handle_response(response, status) end |
#update(body) ⇒ OpenStruct
A PUT
request is used to update the checkout settings.
$ curl 'https://api-shop.beyondshop.cloud/api/checkout-settings' -i -X PUT \
-H 'Content-Type: application/json' \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>' \
-d '{
"minimumOrderValue" : {
"currency" : "EUR",
"amount" : 50
},
"mustAcceptTermsAndConditions" : true
}'
57 58 59 60 61 |
# File 'lib/beyond_api/resources/checkout_settings.rb', line 57 def update(body) response, status = BeyondApi::Request.put(@session, "/checkout-settings", body) handle_response(response, status) end |