Class: PCPServerSDK::Endpoints::OrderManagementCheckoutActionsApiClient
- Inherits:
-
BaseApiClient
- Object
- BaseApiClient
- PCPServerSDK::Endpoints::OrderManagementCheckoutActionsApiClient
- Defined in:
- lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb
Instance Method Summary collapse
-
#cancel_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::CancelResponse
Cancel an order.
-
#create_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::OrderResponse
Create an order.
-
#deliver_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::DeliverResponse
Deliver an order.
-
#initialize(config) ⇒ OrderManagementCheckoutActionsApiClient
constructor
A new instance of OrderManagementCheckoutActionsApiClient.
-
#return_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::ReturnResponse
Return an order.
Constructor Details
#initialize(config) ⇒ OrderManagementCheckoutActionsApiClient
Returns a new instance of OrderManagementCheckoutActionsApiClient.
13 14 15 |
# File 'lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb', line 13 def initialize(config) super(config) end |
Instance Method Details
#cancel_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::CancelResponse
Cancel an order
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb', line 86 def cancel_order(merchant_id, commerce_case_id, checkout_id, payload) validate_ids(merchant_id, commerce_case_id, checkout_id) url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/cancel") request_init = { method: 'POST', headers: { 'Content-Type' => 'application/json' }, body: JSON.generate(payload) } response = make_api_call(url.to_s, request_init) deserialize_json(response, PCPServerSDK::Models::CancelResponse) end |
#create_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::OrderResponse
Create an order
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb', line 23 def create_order(merchant_id, commerce_case_id, checkout_id, payload) validate_ids(merchant_id, commerce_case_id, checkout_id) url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/order") request_init = { method: 'POST', headers: { 'Content-Type' => 'application/json' }, body: JSON.generate(payload) } response = make_api_call(url.to_s, request_init) deserialize_json(response, PCPServerSDK::Models::OrderResponse) end |
#deliver_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::DeliverResponse
Deliver an order
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb', line 44 def deliver_order(merchant_id, commerce_case_id, checkout_id, payload) validate_ids(merchant_id, commerce_case_id, checkout_id) url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/deliver") request_init = { method: 'POST', headers: { 'Content-Type' => 'application/json' }, body: JSON.generate(payload) } response = make_api_call(url.to_s, request_init) deserialize_json(response, PCPServerSDK::Models::DeliverResponse) end |
#return_order(merchant_id, commerce_case_id, checkout_id, payload) ⇒ PCPServerSDK::Models::ReturnResponse
Return an order
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb', line 65 def return_order(merchant_id, commerce_case_id, checkout_id, payload) validate_ids(merchant_id, commerce_case_id, checkout_id) url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/return") request_init = { method: 'POST', headers: { 'Content-Type' => 'application/json' }, body: JSON.generate(payload) } response = make_api_call(url.to_s, request_init) deserialize_json(response, PCPServerSDK::Models::ReturnResponse) end |