Google Walletのサンプルファイルを使用するとエラーが発生します

StackOverflow https://stackoverflow.com//questions/22026574

  •  21-12-2019
  •  | 
  •  

質問

https://code.google.com/にあるサンプルコードを実装しましたP / IAP-PHP / マイテストサイト http://whatisthesite.com 。「購入」ボタンをクリックすると、曖昧なエラーメッセージが表示される可能性があるように:

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ではありません。プロトコルを定義するためのコード内のどこにもありません。あらゆるアドバイスが理解されるでしょう、ありがとう!

更新:

JS関数でインラインPHP変数を使用するには、サンプルの「こちらのdoc」構文の使用と関係があるものがあります。この構文を変更しました:

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>
.

しかし今さらにあいまいな誤差を与えます。

役に立ちましたか?
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top