카카오페이 결제 연동 흐름

내 웹 앱에 카카오페이 서비스를 구현하고 싶습니다. 반복 결제를 원합니다. 문서를 찾은 후 제공된 API 중 몇 가지에 대한 설명이 필요합니다. 첫 번째 API는 컬이 있는 결제 준비 API입니다. 다음과 같이
curl --location ‘https://open-api.kakaopay.com/online/v1/payment/ready
–header ‘Authorization: SECRET_KEY ${SECRET_KEY}’
–header ‘Content-Type: application/json’
–data ‘{
“cid”: “TCSEQUENCE”,
“partner_order_id”: “subscription_order_id_1”,
“partner_user_id”: “subscription_user_id_1”,
“item_name”: “음악정기결제”,
“quantity”: “1”,
“total_amount”: “9900”,
“vat_amount”: “900”,
“tax_free_amount”: “0”,
“approval_url”: “https://bizplan.work:8089”,
“fail_url”: “https://bizplan.work:8089”,
“cancel_url”: “https://bizplan.work:8089
}’
여기에서 가장 먼저 필요한 것은 이러한 Partner_order_id 및 Partner_user_id를 어디에서 설정할 수 있는지, 그리고 반복 결제를 설정하기 위해 앱에서 이 항목을 어디에서 설정할 수 있는지, 테스트 목적으로 어떻게 진행하고 결과를 얻을 수 있는지 확인하는 것입니다. 결제 흐름이 제대로 작동하고 있어요.
결제 준비 API를 누른 후 받은 응답은 다음과 같습니다.
{

"tid": "T73c2473058063933610",

"tms_result": false,

"created_at": "2024-11-19T14:38:59",

"next_redirect_pc_url": "https://online-payment.kakaopay.com/mockup/bridge/pc/pg/subscription/sequential-payment-issue/cf6e6b91574c9c343b847a52a2fe132694c14f9f4100418e13e4aa48b510d58a",

"next_redirect_mobile_url": "https://online-payment.kakaopay.com/mockup/bridge/mobile-web/pg/subscription/sequential-payment-issue/cf6e6b91574c9c343b847a52a2fe132694c14f9f4100418e13e4aa48b510d58a",

"next_redirect_app_url": "https://online-payment.kakaopay.com/mockup/bridge/mobile-app/pg/subscription/sequential-payment-issue/cf6e6b91574c9c343b847a52a2fe132694c14f9f4100418e13e4aa48b510d58a",

"android_app_scheme": "kakaotalk://kakaopay/pg?url=https://online-pay.kakao.com/pay/mockup/cf6e6b91574c9c343b847a52a2fe132694c14f9f4100418e13e4aa48b510d58a",

"ios_app_scheme": "kakaotalk://kakaopay/pg?url=https://online-pay.kakao.com/pay/mockup/cf6e6b91574c9c343b847a52a2fe132694c14f9f4100418e13e4aa48b510d58a"

}
그 후 문서에 따르면 내가 공격해야 할 다음 API는 다음과 같습니다.
curl --location ‘https://open-api.kakaopay.com/online/v1/payment/approve
–header ‘Authorization: SECRET_KEY ${SECRET_KEY}’
–header ‘Content-Type: application/json’
–data ‘{
“cid”: “TCSEQUENCE”,
“tid”: “T73b1f377f575eb05a3b”,
“partner_order_id”: “subscription_order_id_1”,
“partner_user_id”: “subscription_user_id_1”,
“pg_token”: “xxxxxxxxxxxxxxxxxxxx”
}’
이 pg_token에 대한 설명이 필요합니다. 그 후 반복 결제를 위해 이를 설정하고 애플리케이션에 연결하는 방법은 무엇입니까?

안녕하세요. 카카오페이입니다.
문의주신 partner_order_id와 partner_user_id는 가맹점에서 관리하는 정보입니다.
예를들어 테스트상품1의 대한 결제를 발생할때 가맹점에서는 해당 주문건의대한 관리를 해야하기때문에 주문서의 대한 정보를 저장해야하는데 저장하는 데이터중 주문번호가 존재할것이며 정기결제라면 회원의 대한 정보가 존재할겁니다.
partner_order_id의 경우 가맹점에서 관리하는 주문번호를 그대로 넘겨도되나 partner_user_id의 경우 개인정보가 될수 있기때문에 암호화된값을 사용하거나 고정값(ex kakaopay_user)과 같이 넘겨서 사용해주시기 바랍니다.
감사합니다.