Project

General

Profile

修改功能 #423

Update UPS Oauth 2.0

Added by Junyi Zhang over 1 year ago. Updated about 1 year ago.

Status:
已关闭
Priority:
普通
Assignee:
Target version:
IT: Easytryck (Sweden) - v3.0
Start date:
09/18/2024
Due date:
09/30/2024
% Done:

100%

Estimated time:
8.00 h

Description

Task Details
  1. Update Qauth 2.0 to replace accesskey way to connect with UPS
Input
  • Email from UPS
Output
  • Report and Solution

Others


Files

#2

Updated by Junyi Zhang over 1 year ago

  • Start date changed from 02/18/2024 to 09/18/2024
#3

Updated by Junyi Zhang over 1 year ago

  • Status changed from 新建 to 进行中
  • % Done changed from 0 to 30

Output(2024/09/19 - 2024/09/20)

  1. Update Oauth 2.0 to replace accesskey way to connect with UPS
    1. About update to Restful (https://developer.ups.com/oauth-developer-guide?loc=en_US)
      - I decide to update UPS to restful API to replace the current way(XML).
      - Even UPS supports the current way(soap/XML) to connect OAUTH2.0 by the steppingstone model, but the steppingstone model will also be shut down in the future.
      - The future UPS will have a transition about Resful, so we update it now instead of in the future.
    2. Update to Restful
      1. Use UPS OAuth Client Credentials API to generate a token (Reference: https://developer.ups.com/api/reference?loc=zh_CN#tag/OAuth-Client-Credentials)
        - Our project belongs to the client credentials type since we only use our ups account for tracking.
      2. Use restful API's tracking function to replace the current XML way. https://developer.ups.com/api/reference?loc=zh_CN#tag/Tracking
        1. About the value of some ambiguous parameters that did not explained in API document:
          (Reference: https://github.com/UPS-API/api-documentation/issues/15)
          - transId: Unique transaction id, I use uniqid(rand(), true) to generate a unique id.
          - transactionSrc: REDBLUE-OTS
      3. Overrider UPS display function in order.js since the old(soap/XML) data structure won't fit the new(restful) structure
        1. Add a new file: order.override.js (ui/desktop/js/order.override.js), and make it load later than order.js.
        2. UPS data format:
          - Old: Use js code to format data(location, date .etc)
          - New: Use PHP to format data, js just display with the formatted data.
    3. Change scope:
      - protected/views/layouts/desktop.php
      - protected/actions/track/QueryAction.php
      - protected/tracking.ini
      - protected/components/TrackingUPS.php
      - (new)ui/desktop/js/order.tracking.ups.js
  2. About UPS:
    1. URL: https://developer.ups.com/apps/Redblue-OTS?loc=en_US
    2. Settings:
      Old: 
      ups_username   = v533v8api
      ups_password   = ups.12345678
      ups_access_key = ADCD9DF0A2900AD5
      ups_test_mode  = false
      
      New:
      ups_test_mode  = false
      ups_api_test_url = https://wwwcie.ups.com
      ups_api_production_url = https://onlinetools.ups.com
      ups_account_number = v533v8
      ups_client_id = krDQOkgoTJGEzGl943X0gppaM6T8UcrnsaPjLLw3t69dg2MY
      ups_client_secret = Yqf6BjEyZfL9fAAKVRCMZvrYA3O7Z81y7Cpc6CA9DnHkAbp4L1hCx6M6pcGgU5gW
      ups_grant_type = client_credentials  // Our project belongs to the client credentials type since we only use our ups account for tracking
      
#4

Updated by Junyi Zhang about 1 year ago

  • % Done changed from 30 to 90
#5

Updated by Junyi Zhang about 1 year ago

  • Subject changed from Update UPS Qauth 2.0 to Update UPS Oauth 2.0
#6

Updated by Junyi Zhang about 1 year ago

  • Status changed from 进行中 to 已关闭
  • % Done changed from 90 to 100
#7

Updated by Xihua Fan about 1 year ago

  • Target version set to v3.0

Also available in: Atom PDF