Project

General

Profile

Actions

New Function #71

closed

[API] Order (change)

Added by Deca Park about 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
07/08/2023
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

[API] POST /api/online_order, POST /api/store_order

1.Spec

  • Order sheet of #32 (20230708)

2.RequestBody
  1) product_code_list / order_count_list : REMOVE
  2) order_products (array) (NEW)
       - product_code
       - price
       - discount_amount
       - sale_price
       - order_count

3.Process
  1) INSERT st_order_product
    a) prodcut_code / price / discount_amount / sale_price (NEW column)
      - set by order_products of RequestBody


Files

admin_smart_order_1.png (65.2 KB) admin_smart_order_1.png Deca Park, 07/11/2023 04:11 PM
PaymentRequest.java (420 Bytes) PaymentRequest.java Deca Park, 07/18/2023 12:35 PM
OrderController.java (43.3 KB) OrderController.java Deca Park, 07/18/2023 12:35 PM
Actions #1

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Deca Park about 1 year ago

  • Description updated (diff)
Actions #3

Updated by bryant bryant about 1 year ago

  • Status changed from New to Resolved
  • Assignee changed from Toby Pham to Deca Park
Actions #4

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant

[API] POST /api/online_order, POST /api/store_order

1.RequestBody (refer to new attached spec)
  1) payment_method : REMOVE
    - DELETE st_order.payment_method -> set st_order.payment_method by payment_info.payment_method
  2) data type (fix)
    - use_point / use_money / coupon_amount / payment_amount : String -> Integer
    - order_products > price / discount_amount / sale_price / order_count : String -> Integer
  3) new fields
    - payment_info > payment_key / payment_method / payment_amount (required)
                                 pg_secret / va_due_date (not required)

    a) [PROCESS]
      INSERT st_order_payment (NEW)
      a-1) order_no : set by created order_no
      a-2) payment_key / payment_method / payment_amount
        - set by param value
      a-3) pg_secret / va_due_date
        - if payment_method = 'PV02', set value (if else, skip)
      a-4) payment_status
        - if payment_method = 'PV02', set 'PS20'
        - else, set 'PS10'
      a-5) reg_date / reg_user_no

Actions #5

Updated by bryant bryant about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #6

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant

[ADMIN] 온라인몰 관리 > 주문/배송 관리 > 직접 추가 (/onlineOrder/add)
[ADMIN] 스마트 오더 관리 > 주문 관리 > 직접 추가 (/storeOrder/add)

1.Logic (fix)
   1) INSERT st_order_product
      - price / sale_price : set by st_product info
      - discount_amount : set by st_product info 
        + if st_product.discount_type = 'rate', set amount after calculating discount amount
        + if st_product.discount_type = 'amount', set by discount_amount
      - product_amount = sale_price * order_count

Actions #7

Updated by Deca Park about 1 year ago

1.POST /api/claim
  1) change URL
    - '/api/claim' -> '/api/online_claim'
  2) change comment
    a) API comment: '온라인몰 클레임 신청'
    b) RequestParam field comment
      claim_reason_type : "클레임사유유형코드 (Code: CR)

2.스마트오더 주문 취소 (store order cancel)
  - POST /api/store_order_cancel (NEW)

Actions #8

Updated by Deca Park about 1 year ago

[ADMIN] 스마트 오더 관리 > 주문 관리 (/storeOrder) > 상세 (Modify) page

1.field (refer to attach image)
  1) 주문자 취소 사유 : {cancel_reason_type} (NEW)
    - add next to 주문 상태 field
    - if smart_order_status = 'SS05' (주문자취소), enable the selectbox (if not, disable it)
    - if 저장(save) button clicks, UPDATE this field too
    a) selectbox options: 선택(select), SD codes

Actions #9

Updated by bryant bryant about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #10

Updated by Deca Park about 1 year ago

[API] POST /api/online_order, POST /api/store_order

1.Spec

  • Order sheet on #32 - 20230717

2.RequestBody
  1) payment_info object : REMOVE
  2) payment_amount / payment_method / va_due_date : MOVE to fields
  3) apply Integer into amount fields (refer to API spec)
    - currently, String was applied to all fields

3.Response
  1) order_no : set by created order_no

4.Process
  1) INSERT DB (st_order_payment) (Change)
    - order_no / payment_method / payment_amount
    - va_due_date : NOT required (if payment_method = 'PV02', value is set)
    - payment_status = 'PS01'
    - reg_date / reg_user_seq

Actions #11

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant
Actions #12

Updated by bryant bryant about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #13

Updated by Deca Park about 1 year ago

[API] PG 결제 컨펌 (confirm PG payment)

1.URL / Spec

  • URL: POST /api/pay_confirm
  • Spec: Order sheet on #32 - 20230717

2.API definition

  1) document: https://docs.tosspayments.com/reference#%EA%B2%B0%EC%A0%9C-%EC%8A%B9%EC%9D%B8
  2) refer to attached java source (OrderController.payment())

  2) Header

  • base64("{pg secretKey}:"// append ":" text
  • {pg secretKey} : "test_sk_zXLkKEypNArWmo50nX3lmeaxYG5R" (define as property)
  • set 'Authorization: Basic {base64 encode value}'

  3) ReqeustBody

  • paymentKey / orderId / amount

3.Logic
  1) if PG pay confirm API is success
    a) if payment_method = 'PV02', set payment_status = 'PS20'
       else, set payment_status = 'PS10'
    b) pg_error_code / pg_error_msg : don't set empty string (set NULL)

Actions #14

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant
Actions #16

Updated by bryant bryant about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #17

Updated by Deca Park about 1 year ago

[message process]

1.common.error.idNotExist 
  - set variable by user id value (currently, it's set by "id") (apply into other sources)
2.order.error.notExist
  - set variable by order_no value 
3.order.error.notSameAmount
  - set 1st varible by order_no value 
  - set 2nd variable by st_order_payment.payment_amount value
  - set 3th variable by amount parameter value

Actions #18

Updated by Deca Park about 1 year ago

0.Spec

  • Order sheet on #32 - 20230726

1.[API] 주문정보 (GET /api/order)

  1) Response
    a) mall_phone : set by st_mall.mall_phone
    b) payment_method / payment_method_name / payment_status / payment_status_name : set by st_order_payment data

2.[API] 주문 리스트 (GET /api/order_list)

  1) Logic
    a) add condition on SELECT 
      - st_order_payment.payment_status NOT IN ('PS01','PS02')
  2) Response
    a) payment_method / payment_method_name / payment_status / payment_status_name : set by st_order_payment data

3.[API] 스마트오더 진행중인 주문 리스트 (store ongoing order list) (NEW)

  1) URL: GET /api/store_ongoing_order_list
  2) Logic
    a) add condition on SELECT 
      - st_order_payment.payment_status NOT IN ('PS01','PS02')
  3) Response
    a) payment_method / payment_method_name / payment_status / payment_status_name : set by st_order_payment data

4.{API] PG 결제 실패 주문 삭제  (delete order with PG fail) (NEW)

  1) URL: DELETE /api/pg_fail_order

Actions #19

Updated by Deca Park about 1 year ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Deca Park to bryant bryant
Actions #20

Updated by Deca Park about 1 year ago

 [API] 스마트오더 진행중인 주문 리스트 (store ongoing order list) - Test Isuse

1.Parameter
    - REMOVE mall_type bcz only store order list is displayed

2.Response
  - REMOVE products.product_review_yn (it's not response field)

Actions #21

Updated by Deca Park about 1 year ago

[API] POST /api/online_order, POST /api/store_order (Change)

0.Spec : Order sheet on #32 - 20230727

1.RequestBody
  1) paramter (Add)
    - refund_bank_code / refund_account_number / refund_holder_name
2.Logic
  1) INSERT DB (st_order_payment)
    - set refund_bank_code / refund_account_number / refund_holder_name (Add columns)

Actions #22

Updated by bryant bryant about 1 year ago

  • Status changed from Feedback to Resolved
  • Assignee changed from bryant bryant to Deca Park
Actions #23

Updated by Deca Park 8 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF