Enzo Yoon
TPToss payments 개발자 커뮤니티
•Created by Enzo Yoon on 5/23/2023 in #❓┃연동개발-문의
결제 관련 이슈가 있어서 공유 드립니다.
안녕하세요 결제 SDK를 활용하여 서비스를 개발하는 중에 에러가 있습니다.
결제가 완료되었다는 완료 모달까지 확인 되는 데 실제로 계좌에서 돈이 빠져나가지 않습니다.
확인 한번 요청 드립니다. 필요한 것 있음 말씀 주셔요
This is guide: https://docs.tosspayments.com/reference/js-sdk
This is the code applied:
const onClickPaymentWithTosspay = () => {
var clientKey = CLIENT_KEY_LIVE;
var orderId =
order_id_${new Date().getTime()}
;
let currentAmout = data.freightCost + data.vat;
setloadingBrandpay(true);
loadTossPayments(clientKey).then((tossPayments: any) => {
tossPayments
.requestPayment("카드", {
// 결제 정보 파라미터
amount: currentAmout,
orderId: orderId,
orderName: orderId,
})
.then(function (data: any) {
// 결제 요청 성공 처리
console.log("payment completed:", data);
callbackPayment({
success: true,
});
setloadingBrandpay(false);
})
.catch(function (error: any) {
console.log("payment error:", error);
if (error.code === "USER_CANCEL") {
// 결제 고객이 결제창을 닫았을 때 에러 처리
} else if (error.code === "INVALID_CARD_COMPANY") {
// 유효하지 않은 카드 코드에 대한 에러 처리
}
dispatch(
openDialog({
type: "info",
//@ts-ignore
content: error?.message || "결제 문제",
})
);
setloadingBrandpay(false);
});
});
};37 replies
TPToss payments 개발자 커뮤니티
•Created by Enzo Yoon on 2/23/2023 in #🌎┃global-support
inquiring about the brand pay error.

35 replies