40 Replies
⏳ 잠시만 기다려주세요! 곧 답변드리겠습니다
오류 문의일 경우 아래 정보를 미리 전달해주시면, 빠른 답변에 도움이 됩니다.
- 주문번호(orderId) :
- 문의 내용 :
(img를 함께 첨부해주시면 도움이됩니다)
* 계약관련 내용은 1544-7772로 문의주세요.
* 주말/공휴일에는 답변이 늦을 수 있어요.
help me
Do you rendering the agreements?
what is the server dev language that you are using?
we will provide sample for your ref
php,wordpress
I'm very sorry, I don't understand what you mean. I'm testing the payment, but there is no feedback or jump when I click the button.
You can translate the error message with Google Translate
It says: Cannot find the element that has the selector given. Check selector again
I consulted the official staff of tosspayments and they told me to come here for help because they don't understand technical development. Please help me.
Yes, I did this, and it reported an error saying that the selector element was not found, but I clearly found the element, and I don't understand why. And this problem doesn't seem to be the main reason why it can't make payments.
I use other payment gateway platforms, they all have technical support, but this platform doesn't seem to have it. I am not proficient in technology, thank you!!
we also provide the technical support, but we actually having difficulty with supporting you.
Can you check, which selector did you passed on renderPaymentMethod function?
After that, share it here, and also check if there is the paymentwidget element that has the selector you passed
Is this the problem? I checked again and found that there is no such class name in the HTML, but I don't know what this class represents? What content does it get? And how can I adjust it to the correct one?
Sorry, it was my first day using this app and I was very unskilled and didn’t reply to your comment.
You have to pass the CSS Selector into renderPaymentMethods, it seems like that is the problem. Thanks
It specifies this ID
Please search Google and some public resources to how to handle HTML DOM elements on Javascript with QuerySelector. This will help you to solve it.
Simply, you just create <div> tag with id or class attribute. For example,
<div id="payment-methods"></div>
And, pass the CSS selector of that div, #payment-methods into renderPaymentMethods() function like this: .... = paymentWidget.renderPaymentMethods("#payment-methods")
Then refresh the page. Then, it should surprisingly loads payment widget into the div tag that you provided.please ensure you don't call renderPaymentMethods more than once in the page.
because it seems like you have 2 renderPaymentMethods function calls in the page.
If you already rendered the page like this,
You don't need to call it again, just use it
You know like a god what is wrong with me right now, because it still reports the error, and it seems to be what you said.
Yup, It seems like you calling renderPaymentMethods twice, in different js file or js function. It should not be happened.
Please ensure you don't call renderPaymentMethods twice, and share the paymentMethodWidget instance with other functions.
So,
This is the second position, it seems to just call the defined method.
Nope underneath
let price = ....
, you are calling renderPaymentMethods again! This where the error comes from.
Remove const paymentMethodsWidget = paymentWidget.renderPaymentMethods();
on that function.
And try again. It should refer this paymentMethodsWidget instance, and it is expected to be work.You are awesome! That error has gone away, only this one remains. I saw you mentioned this method function.
When this error comes?
Does it happen after you click the button, right?
Now it is. The previous bug is gone and I am so excited.
Yes!
Please put this function after
This script tag
I really suggest you to search some Google and MDN website because it is too basic error.
If you want to access a specific object inside a function, the function must be declared after the object is declared.
Now that I look at it, it looks like the function is declared before the execution of renderPaymentMethods. That won't work.
This payment.php file was sent to my colleague by tosspayments. It can run normally just by replacing the Key. These errors occurred when no content was modified, only the website was moved and the theme was changed.
Those two function is declared on the same file?
Yes
Can you just follow this? I think this will solve the issue
Integrate Payment Widgets | 토스페이먼츠 개발자센터
The Toss Payments Widget is a low code solution that only needs to be integrated once for all payment types and customization features.
This is also the document that you can refer it
After the error occurred, I re-downloaded the original payment.php file to overwrite it, replaced the company's Key, and the error still existed.
I think the payment.php file has the error
I will try it immediately!
.
.
❤️ 기술문의 경험이 어떠셨나요?!
간단히 코멘트 남겨주세요! 제품 발전에 큰 힘이 됩니다.