neerosity
neerosity2y ago

I need help with payment integration

Hi, I am using nestjs for backend and react for frontend now, I want to create some link using backend which I can give as response to frontend and it will pay using that link after payment completes, I can fetch that record using wehook is it possible?
39 Replies
토스페이먼츠 BOT
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) : - 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요. * 주말/공휴일에는 답변이 늦을 수 있어요.
neerosity
neerosity2y ago
@Ayaan can you help here ?
Ayaan
Ayaan2y ago
Yes,
neerosity
neerosity2y ago
so, I have backend in which I want to create a payment link that I can send back to frontend and when user pay using that it should use webhook to update based on event type. is it possible ?
Ayaan
Ayaan2y ago
So, you want to make a link for making payment using the backend, right?
neerosity
neerosity2y ago
yes
Ayaan
Ayaan2y ago
Umm it is little bit unclear. The link of payment means a shopping mall page? like..
Ayaan
Ayaan2y ago
(korean image, sorry) like this, right?
No description
neerosity
neerosity2y ago
yes, something like I have a product , frontend will request for buying a product so backend will check that product in backend and create a payment link or checkout link that frontend can redirect and complete payment
Ayaan
Ayaan2y ago
I've got it. your "link" means checkout link right?
neerosity
neerosity2y ago
yes so, that I can control how much needs to pay based on product price in db.
Ayaan
Ayaan2y ago
and product owner has a business number, right? then actually you can to make a system
neerosity
neerosity2y ago
business number ?
Ayaan
Ayaan2y ago
it is possible In korea - we have a business number -
neerosity
neerosity2y ago
payment will be collected on dashboard of toss payments correct
Ayaan
Ayaan2y ago
Both works You can check it in dashboard
neerosity
neerosity2y ago
yes, but how I can create such link
Ayaan
Ayaan2y ago
We sent back to your backend server if payment happens
neerosity
neerosity2y ago
curl --request POST \
--url http://api.tosspayments.com/v1/payments \ --header 'Authorization: Basic dGVzdF9za19ZWjFhT3dYN0s4bUtXMEQ5TUVtVnlReHp2TlBHICsgOg==' \ --header 'Content-Type: application/json' \ --data '{"method":"카드","amount":15000,"orderId":"a4CWyWY5m89PNh7xJwhk1","orderName":"토스 티셔츠 외 2건","successUrl":"http://localhost:4242/success","failUrl":"http://localhost:4242/fail"}' I was tying this, but it throws timout error
Ayaan
Ayaan2y ago
I've got it. You don't need to use this API.
neerosity
neerosity2y ago
okay, then ?
Ayaan
Ayaan2y ago
결제위젯 연동하기 | 토스페이먼츠 개발자센터
토스페이먼츠 결제위젯 연동 가이드입니다. 내 상점의 주문서 페이지에 최적의 주문서 UI를 연동하세요. 결제 연동하기 가장 편리한 로우코드(Low-code) 솔루션입니다.
Ayaan
Ayaan2y ago
you can use in-browser translator
neerosity
neerosity2y ago
yes, but it means, I am creating checkout link on frontend ? sorry, I am not familiar with this. so, steps will be 1. creating checkout using html 2. user will proceed and do payment 3. on success url page I will get response along with paymentKey 4. then what is approve payment ?
Ayaan
Ayaan2y ago
1. Not creating, You import and calling SDK in HTML. then our SDK will redirect to your redirecturl then you should call to approve payment API
Ayaan
Ayaan2y ago
In addition, https://docs.tosspayments.com/guides/international/index this link is also help understand Korea payment system
International Merchants Guide | 토스페이먼츠 개발자센터
Understand the features and flow of Korean card payments and integrate TossPayments.
Ayaan
Ayaan2y ago
@neerosity
neerosity
neerosity2y ago
I can't use
curl --request POST \
--url https://api.tosspayments.com/v1/payments \
--header 'Authorization: Basic dGVzdF9za196WExrS0V5cE5BcdtbzUwblgzbG1lYXhZRzVSOg==' \
--header 'Content-Type: application/json' \
--data '{"method":"CARD","amount":15000,"orderId":"a4CWyWY5m89PNh7xJwhk1","orderName":"토스 티셔츠 외 2건","successUrl":"http://localhost:8080/success","failUrl":"http://localhost:8080/fail"}'
curl --request POST \
--url https://api.tosspayments.com/v1/payments \
--header 'Authorization: Basic dGVzdF9za196WExrS0V5cE5BcdtbzUwblgzbG1lYXhZRzVSOg==' \
--header 'Content-Type: application/json' \
--data '{"method":"CARD","amount":15000,"orderId":"a4CWyWY5m89PNh7xJwhk1","orderName":"토스 티셔츠 외 2건","successUrl":"http://localhost:8080/success","failUrl":"http://localhost:8080/fail"}'
something like this ? getting Failed to connect to api.tosspayments.com port 443 after 151011 ms: Couldn't connect to server
Ayaan
Ayaan2y ago
You must allow firewall for communicating our API
Ayaan
Ayaan2y ago
방화벽 설정 | 토스페이먼츠 개발자센터
토스페이먼츠 API를 안전하게 사용할 수 있는 방화벽 설정을 알아봅니다. 방화벽은 외부의 신뢰할 수 없는 네트워크가 내부 네트워크에 접근하지 못하도록 하는 보안 시스템입니다. 특정 포트나 IP에서 들어오는 요청을 필터링하거나, 사용자 인증 요청, 프록시, 주소변환기능(NAT) 등의 방법이 있습니다.
neerosity
neerosity2y ago
not working, even if I turned off firewall what card details i can enter for test payment
이실장
이실장2y ago
I dont get which step that you met the error
토스페이먼츠 BOT
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.
neerosity
neerosity2y ago
the checkout page shows everything in korean? can I change it to english ?
이실장
이실장2y ago
Can you share me in image that you want to provide in eng?
neerosity
neerosity2y ago
No description
Ayaan
Ayaan2y ago
신용/체크카드 - Credit/Debit Card 카드사 - Card Company * 네이버페이 - Naver Pay (Easy Pay) 카드 재선택 - Reselect card company option "네이버페이 결제에 카드와 포인트를 함께 사용할 수 없어요." - You cannot use card payment and point same time 카드 결제 - Card 포인트 결제 - Point 현금영수증 - Receipt for Tax refund 소득공제용(현금영수증카드) - For tax refund(or case of tax refund card) 발급번호를 입력해 주세요 - Please put the phone/card number that you want to take receive receipt 이메일(선택) - Email (Optional) 구매 내용에 동의하시면 다음 버튼을 눌러주세요. - If you agree the information in this page, please click "Next" button. 다음 - Next I have translated for just texts
이실장
이실장2y ago
We only provide in Kor. If you send
useInternationalOnly: true
useInternationalOnly: true
parameter, you can see in Eng. But you can only choose MASTER, VISA, JCB, UNION .
Ayaan
Ayaan2y ago
Just note: if you send this option, maybe your UI is fixed to old ui(xpay), not new ui