Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

購物車金流相關調整 #23

Merged
merged 7 commits into from
Jun 9, 2023

Conversation

ankazu
Copy link
Contributor

@ankazu ankazu commented Jun 8, 2023

cart 取得課程相關資料與總價計算,重複使用函式,另開新檔。
金流混淆參數增加 Name
order 新增 name 參數、商品詳細上限50字元。
createOrder 修改訂單參數、取得課程總價

@ankazu ankazu requested a review from paperhsiaooo June 8, 2023 13:59
Comment on lines 42 to 54
const calculateTotalPrice = (courseData) => {
let totalPrice = 0

courseData.forEach((course) => {
if (course.price < course.originPrice) {
totalPrice += course.price
} else {
totalPrice += course.originPrice
}
})

return totalPrice
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controller 內部通常都放跟路由後續有關動作的 js

  1. calculateTotalPrice 的 function 應放在 src 下的 js 或 utils 內,可能需找個適當的 js 放入

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增 calculate.js

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先前沒注意到 crypt.js 也應放在 src 下的 js 或者 utils 的資料夾下

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移至 utils 資料夾

@@ -8,71 +8,40 @@ const {
create_mpg_sha_encrypt,
create_mpg_aes_decrypt
} = require('./crypt')
const { getCourseData, calculateTotalPrice } = require('./cartOperations')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

路徑需跟著 cartOperations 位置改變而更動

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以調整

@paperhsiaooo
Copy link
Contributor

@ankazu 再麻煩修正了

Copy link
Contributor Author

@ankazu ankazu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

檔案搬遷

@ankazu ankazu requested a review from paperhsiaooo June 9, 2023 12:25
@paperhsiaooo
Copy link
Contributor

@ankazu ok,再麻煩合併了🙏

@ankazu ankazu merged commit d5bf126 into develop Jun 9, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants