Untitled

토스페이먼츠 시리즈 (1) _ 도입

var clientKey = 'test_ck_d26DlbXAaV0mzlvkmvKrqY50Q9RB'
    var tossPayments = TossPayments(clientKey)
    var button = document.getElementById('payment-button') // 결제하기 버튼
    button.addEventListener('click', function () {
        tossPayments.requestPayment('카드', {
            amount: 35000,
            orderId: 'oidajfaoewf',
            orderName: "가나다라마바사",
            customerName: "홍길동",
            successUrl: '<http://localhost:8080/success>',
            failUrl: '<http://localhost:8080/fail>',
        })
    })

1. 토스 결제 시

1.1 누르기

Untitled

1.2 결제창 생성

Untitled

1.3 결제 실패시

Untitled

1.4 결제 성공시

Untitled