修改功能 #423
Update UPS Oauth 2.0
Added by Junyi Zhang over 1 year ago. Updated about 1 year ago.
Start date:
09/18/2024
Due date:
09/30/2024
% Done:
100%
Estimated time:
8.00 h
Description
Task Details
- Update Qauth 2.0 to replace accesskey way to connect with UPS
- Email from UPS
- Report and Solution
Others
Files
| 如何获取OAuth API 证书?.docx (529 KB) 如何获取OAuth API 证书?.docx | Junyi Zhang, 09/18/2024 04:21 PM |
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)
- Update Oauth 2.0 to replace accesskey way to connect with UPS
- 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. - Update to Restful
- 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. - Use restful API's tracking function to replace the current XML way. https://developer.ups.com/api/reference?loc=zh_CN#tag/Tracking
- 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
- About the value of some ambiguous parameters that did not explained in API document:
- Overrider UPS display function in order.js since the old(soap/XML) data structure won't fit the new(restful) structure
- Add a new file: order.override.js (ui/desktop/js/order.override.js), and make it load later than order.js.
- 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.
- Use UPS OAuth Client Credentials API to generate a token (Reference: https://developer.ups.com/api/reference?loc=zh_CN#tag/OAuth-Client-Credentials)
- 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
- About update to Restful (https://developer.ups.com/oauth-developer-guide?loc=en_US)
- About UPS:
- URL: https://developer.ups.com/apps/Redblue-OTS?loc=en_US
- 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
Updated by Junyi Zhang about 1 year ago
- Subject changed from Update UPS Qauth 2.0 to Update UPS Oauth 2.0
Updated by Junyi Zhang about 1 year ago
- Status changed from 进行中 to 已关闭
- % Done changed from 90 to 100