brandpay.requestPayment

<script setup lang="ts">
import { loadTossPayments } from "@tosspayments/tosspayments-sdk"
const tossPayments = await loadTossPayments(tossBrandPayClientKey);
const brandpay = tossPayments.brandpay({
  customerKey: mbId.value,
  redirectUrl: window.location.origin + "/bridge/toss/brand-pay-auth", // 흐름상 auth가 맞음
});

onMounted(() => {
  brandpay.requestPayment({
    amount: {
      currency: 'KRW',
      value: req_price,
    },
    orderId: od_id,
    orderName: product_name,
    successUrl: window.location.origin + '/bridge/toss/brand-pay-success',
    failUrl: window.location.origin + '/bridge/toss/brand-pay-fail',
    customerEmail: email.value,
    customerName: name.value,
    // methodId: , // 결제수단의 ID - [https://docs.tosspayments.com/reference/brandpay#secretkey로-결제수단-조회]의 카드 정보
  })
})
</script>

redirectUrl, successUrl, failUrl 당 url.

. . , .
image.png
Was this page helpful?