Domanda

Ho implementato il codice di esempio trovato su https://code.google.com/P / IAP-PHP / sul mio sito di test http://whatisthesite.com .Come potresti essere in grado di vedere che c'è un messaggio di errore vago una volta cliccato il pulsante "Acquisto":

There is an error in the setup for your purchase. Please contact the merchant with this error message: Expected 3 components in jwt: $jwtToken
.

La console dà:

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
.

Il sito demo http://iap-php.appspot.com/ non è https:Né c'è ovunque nel codice per definire il protocollo.Qualsiasi consiglio sarebbe apprezzato, grazie!

Aggiornamento:

ha qualcosa a che fare con l'uso del campione di sintassi "qui doc" per utilizzare le variabili PHP in linea nelle funzioni JS.Modificato questa sintassi:

echo <<< INDEX <button id='runDemoButton' value='buy' class='buy-button' onclick='DemoButton("$jwtToken");'><b>Purchase</b></button> INDEX;
.

A questo:

<button id='runDemoButton' value='buy' class='buy-button' onclick='DemoButton("<?php echo $jwtToken;?>");'><b>Purchase</b></button>
.

Ma ora dà un errore ancora più vago.

È stato utile?

Soluzione

Errori di dialogo come "Esiste un errore nell'installazione per il tuo acquisto" ha un codice di errore corrispondente restituito al gestore di guasto del lato client:

https://developers.google.com/wallet/digital/docs/JSREFERENCE # Failure Mandhandler

Nel caso in cui il codice di errore è Merchant_Error che indica un JWT gravemente formattato.Questo potrebbe essere dovuto all'utilizzo della chiave del venditore errata o del segreto per firmare il JWT.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top