결제취소 요청 시 401 UNAUTHORIZED_KEY 에러가 떨어집니다.

. 데 401 .
릿는 test_sk_jkYG57Eba3GxQLvaaZzVpWDOxmA1 .
.

final response = await http.post(
Uri.parse(
'https://api.tosspayments.com/v1/payments/$paymentKey/cancel'),
headers: <String, String>{
//'Basic ${릿+: 를 base64}'
'Authorization':
'Basic dGVzdF9za19qa1lHNTdFYmEzR3hRTHZhYVp6VnBXRE94bUExICsgOg==',
'Content-Type': 'application/json',
},
body: jsonEncode(<dynamic, dynamic>{
'cancelReason': 'dropdownValue',
// 'cancelAmount': cancelAmount,
// 'refundableAmount': cancelAmount,
}),
);
Was this page helpful?