김아무개
TPToss payments 개발자 커뮤니티
•Created by 김아무개 on 2/5/2025 in #❓┃연동개발-문의
네이티브 iOS 연동 문의
아 확인했습니다 감사합니다!! ㅠㅠ
13 replies
TPToss payments 개발자 커뮤니티
•Created by 김아무개 on 2/5/2025 in #❓┃연동개발-문의
네이티브 iOS 연동 문의
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<!-- SDK 추가 -->
<script src="https://js.tosspayments.com/v2/standard"></script>
</head>
<body>
<!-- 카드 등록하기 버튼 -->
<button class="button" style="margin-top: 30px" onclick="requestBillingAuth()">카드 등록하기</button>
<script>
// ------ SDK 초기화 ------
// @docs https://docs.tosspayments.com/sdk/v2/js#토스페이먼츠-초기화
const clientKey = "가이드에 있는 클라 키";
const customerKey = "1vNa0JQXg2Het73og8f1j";
const tossPayments = TossPayments(clientKey);
// 회원 결제
// @docs https://docs.tosspayments.com/sdk/v2/js#tosspaymentspayment
const payment = tossPayments.payment({ customerKey });
// ------ '카드 등록하기' 버튼 누르면 결제창 띄우기 ------ // @docs https://docs.tosspayments.com/sdk/v2/js#paymentrequestpayment async function requestBillingAuth() { await payment.requestBillingAuth({ method: "CARD", // 자동결제(빌링)는 카드만 지원합니다 successUrl: window.location.origin + "/success", // 요청이 성공하면 리다이렉트되는 URL failUrl: window.location.origin + "/fail", // 요청이 실패하면 리다이렉트되는 URL customerEmail: "customer123@gmail.com", customerName: "김토스", }); } </script> </body> </html> 가이드에 있는 내용 html string 그대로 호출하고 있습니다
// ------ '카드 등록하기' 버튼 누르면 결제창 띄우기 ------ // @docs https://docs.tosspayments.com/sdk/v2/js#paymentrequestpayment async function requestBillingAuth() { await payment.requestBillingAuth({ method: "CARD", // 자동결제(빌링)는 카드만 지원합니다 successUrl: window.location.origin + "/success", // 요청이 성공하면 리다이렉트되는 URL failUrl: window.location.origin + "/fail", // 요청이 실패하면 리다이렉트되는 URL customerEmail: "customer123@gmail.com", customerName: "김토스", }); } </script> </body> </html> 가이드에 있는 내용 html string 그대로 호출하고 있습니다
13 replies
TPToss payments 개발자 커뮤니티
•Created by 김아무개 on 2/5/2025 in #❓┃연동개발-문의
네이티브 iOS 연동 문의
네 에러는 없습니다. 추가로 말씀드리면 v1, v2 둘 다 웹뷰로 연동 테스트 하였을때 v1만 화면 표시가 되고 있습니다
13 replies