woo 有 error log 可以找問題點
2022-10-19T04:49:52+00:00 INFO [request][order_id:2826] http request url : https://api-pay.line.me/v3/payments/request
2022-10-19T04:49:52+00:00 INFO [request][order_id:2826] execute request_args: Array
(
[httpversion] => 1.1
[timeout] => 20
[headers] => Array
(
[content-type] => application/json; charset=UTF-8
[X-LINE-ChannelId] => 123456789
[X-LINE-Authorization-Nonce] => 123456789
[X-LINE-Authorization] => abcdefg
)
[method] => POST
[body] => {"orderId":2826,"amount":"380","currency":"TWD","packages":[{"id":"WC-ITEMS||2826","name":"WC_ITEMS","amount":"380","products":[{"id":1740,"name":"xxx","quantity":1,"price":"380.00","imageUrl":"xxx"}]}],"redirectUrls":{"confirmUrl":"https:\/\/xxx.com\/wc-api\/linepay_payment?request_type=confirm&order_id=2826","confirmUrlType":"CLIENT","cancelUrl":"https:\/\/xxx.com\/wc-api\/linepay_payment?request_type=cancel&order_id=2826"},"options":{"payment":{"payType":"NORMAL","capture":true},"extra":{"branchName":""}}}
)
2022-10-19T04:49:53+00:00 INFO [execute] http response code: 200, response body: stdClass Object
(
[returnCode] => 1124
[returnMessage] => Error in Amount info.
)
.
錯誤代號 1124
官方文件寫說是 Amount info error (scale) ...
我翻了一下程式碼 ... 呵呵 ... 還真的有 scale ...

看起來程式碼是在找小數點
但台幣是沒有小數點的
.
直接把 woo 的 number of decimals 改成 0 就好了
.

.
woo line pay get_amount_precision amount precision