Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ description: |-
url: "{{base_url}}/{{api_prefix}}/{{namespace}}/checkouts/before"
method: GET
queryParams:
gateway: ""
customer: ""
cart: ""
service_quote: ""
cash: ""
pickup: ""
tip: ""
delivery_tip: ""
# `gateway` is the gateway CODE, not an id — "stripe", "cash", or whichever code the
# store has configured. CheckoutController resolves it with Storefront::findGateway().
gateway: "stripe"
customer: "{{customer_id}}"
cart: "{{cart_id}}"
service_quote: "{{service_quote_id}}"
pickup: "false"
scripts:
- type: afterResponse
code: |-
// Capture checkout as order and Get Checkout Status both address
// {{checkout_token}}; nothing set it.
var json_response = pm.response.json();

if (json_response && json_response.token) {
pm.environment.set("checkout_token", json_response.token);
}
language: text/javascript
order: 1000
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ description: |-
url: "{{base_url}}/{{api_prefix}}/{{namespace}}/service-quotes/from-cart"
method: GET
queryParams:
origin: ""
destination: ""
cart: ""
# origin and destination accept a place id, a store_location id, a vehicle id, a
# food_truck id, or a "lat,lng" pair. Coordinates are shown because that is what a
# storefront client usually has: the store's position and the customer's address.
origin: "1.3521,103.8198"
destination: "1.3644,103.9915"
cart: "{{cart_id}}"
scripts:
- type: afterResponse
code: |-
// Checkout/Before addresses {{service_quote_id}}; nothing set it.
var json_response = pm.response.json();

if (Array.isArray(json_response) && json_response.length) {
pm.environment.set("service_quote_id", json_response[0].id);
}
language: text/javascript
order: 1000
Loading