https://code.google.com/p/iap-php/에있는 샘플 코드 http://whatisthesite.com을 구현했습니다.Google 월렛의 샘플 파일을 사용하면 오류가 발생합니다.
There is an error in the setup for your purchase. Please contact the merchant with this error message: Expected 3 components in jwt: $jwtToken
콘솔이 제공 :
Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://whatisthesite.com" from accessing a frame with origin "https://sandbox.google.com". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
markdown-here.js:33
findFocusedElem markdown-here.js:33
intervalCheck
데모 사이트 http://iap-php.appspot.com/이 아닌 HTTPS입니다 : 당신은 "구매"버튼을 클릭하면 모호한 오류 메시지가 볼 수 있습니다로도입니다 프로토콜을 정의하기 위해 코드의 어느 곳에서나 사용할 수 있습니다. 모든 조언을 주시면 감사하겠습니다.
UPDATE :
그것은 JS 기능에 인라인 PHP 변수를 사용하는 "다음 문서"구문의 샘플의 사용과 함께 할 수있는 뭔가가. 이것에
echo <<< INDEX <button id='runDemoButton' value='buy' class='buy-button' onclick='DemoButton("$jwtToken");'><b>Purchase</b></button> INDEX;
:이 구문 변경
<button id='runDemoButton' value='buy' class='buy-button' onclick='DemoButton("<?php echo $jwtToken;?>");'><b>Purchase</b></button>
을하지만 지금은 훨씬 더 모호한 오류를 제공합니다. 귀하의 경우에는
https://developers.google.com/wallet/digital/docs/jsreference#failurehandler
오류 코드입니다 : 예 : "구매 설정에 오류가 있습니다"와 같은
_sandbox_ account (secret/id)를 사용하고 있습니까? – EdSF
그게 문제가되었습니다! 샌드 박스 ID와 프로덕션 ID. 내 머리에서 벗어나서 고맙습니다. @EdSF – BenRacicot