#Licklist Payment API Reference# *Created: 23rd Jan 2020* Please use: http://epiceditor.com/ to create html The api is used to create booking process including: product listing confirmation and order creation Product list ------------------------------ The list show all products grouped by categories URL: _GET /payment/carts/view.json Parameters: $_REQUEST['id'] - (required) venue id which will be used $_REQUEST['date'] - (required) date which need to be used to show product prices. format YYYY-MM-DD Response: json Save Cart ------------------------------ Store the product qty selection into a cart which later could be paid and converted to order URL: _POST /payment/carts/view.json Parameters: _POST['data[Cart][date]'] - the selected date in format YYYY-MM-DD _POST['data[Cart][currency_id]'] - id of the selected currency. This could be taken from the previous product list call _POST['data[Cart][CartsItem][{increment}][qty]'] - qty of the product _POST['data[Cart][CartsItem][{increment}][product_id]'] - id of the selected product. * {increment} for this could be used $product_id if it's not possible to increment the values Example: if we have 2 products with id 1234 and 2345 the single product could be posted as: _POST['data[Cart][CartsItem][1234][qty]'] = 1 _POST['data[Cart][CartsItem][1234][product_id]'] = 1234 _POST['data[Cart][CartsItem][2345][qty]'] = 2 _POST['data[Cart][CartsItem][2345][product_id]'] = 2345 Response: json The response will contain the 'step' attribute, which should flag what is the next step. Usually this is the confirmation (or payment step), but if not, then it could be 'guests', or 'tickets' which should load another screen where the user will enter the guest details. Also on that response there will be a 'session_id', which should be used in the further calls to identify the user session Confirmation ------------------------------ Display the selected products in the cart, as well as provide information how much will be the total and how much need to be paid at the moment (in case of deposit option) URL: /payment/carts/confirmation.json Parameters: _REQUEST['venue_id'] - id of the venue _REQUEST['session_id'] - identify the cart and then load the contents Response: json in CartsItem node will be listed the selected products total - will be the payment which need to be taken deposit_total - is the net payment which need to be taken. Should be used for display purposes fee - is the licklist fee (sometimes this could be taken from the venue) then total and deposit_total are the same actual_total - the total of the cart which need to be paid at the end remaining_payment - how much will remain after the initial payment Payment ------------------------------ This is the Stripe integration calls URL: /payment/orders/process_payment Parameters: _POST['data[cart_id]'] - id of the cart _POST['data[notes]'] - optional notes of the order _POST['data[reuse]'] - if the user has a card assigned, then this flag will indicate the card to be reused. The last digits of the card should be in the user's login data (if missing the card) need to be passed as 16digit number (via stripe) _POST['data[stripe_payment_method_id]'] - stripe payment method string If the payment intent is approved (see 3d secure payment) URL: /payment/orders/process_payment Parameters: _POST['data[stripe_payment_method_id]'] - from stripe e.g. pm_1G4B1kFGxROSjMgWqayuihHP _POST['data[stripe_payment_intent_id]'] - from stripe e.g. pi_1G4B1mFGxROSjMgWXaKft9Vo Or if the payment method is already used _POST['data[stripe_payment_id]'] - from stripe e.g. pm_1G4B7jFGxROSjMgWgXsx97sF consult stripe implementation how to work with this Response: json. It should contain success: true, to indicate the order has been created.