keytool -genkey -alias linepay -keyalg RSA -keystore keystore.jks \
-validity 3650 -storetype JKS \
-dname "CN=Lance Li, OU=Lance, O=Lance, L=Taipei, ST=Taiwan, C=TW" \
-keypass keypass1234 -storepass storepass1234
- Encrypt key and keystore passwd
java src/main/java/com/lance/util/AES.java keypass1234 java src/main/java/com/lance/util/AES.java storepass1234
- Put the text to .txt respective file under credential directory
- Create sandbox account to get channel id and channel secret key
- Put channel id and channel secret key to application.yaml
./mvnw spring-boot:run
- Create request
- Post https://localhost:8443/line-pay/request
- Body
{ "amount": 40, "currency": "TWD", "orderId": "test_lance_10", "packages": [ { "id": "1", "amount": 40, "name": "TECH SHOP", "products": [ { "id": "product_1", "name": "USB 1T", "quantity": 1, "price": 40 } ] } ], "redirectUrls": { "confirmUrl": "https://lance.requestcatcher.com/", "cancelUrl": "https://lance.requestcatcher.com/" } }
- Pay the request by the response body paymentUrl
- Confirm request
- Post https://localhost:8443/line-pay/confirm
- Body
{ "amount": 40, "currency": "TWD", "transactionId": "2022082500725250810" }
- Refund request
- Post https://localhost:8443/line-pay/refund
- Body
{ "amount": 5, "transactionId": "2022082500725250810" }
- Get request detail