Search code examples
playn

PaymentsDemo in playn-samples fails with "iss is missing"


In the PaymentsDemo included with PlayN, I get the following error:

iss is missing. Please add its value in the web.xml.

The error message comes as a callback response to failureHandler from inappPayments.encodeJWT. As far as I can tell, no source files or XML files explain what iss is, or how to add it to web.xml.

Any suggestions?


Solution

  • iss is the sellerIdentifier you get when creating a Google Wallet account. For bootstrapping you can use a sandbox account, or use Google's sandbox merchant (that page also shows how to create a sandbox customer). Do that by modifying the servlet tag in web.xml to the following:

    <servlet>
        <servlet-name>EncodeJWTServiceImpl</servlet-name>
        <servlet-class>playn.payments.server.JWTEncodedServiceImp</servlet-class>
        <init-param>
            <param-name>aud</param-name>
            <param-value>Google</param-value>
        </init-param>
        <init-param>
            <param-name>typ</param-name>
            <param-value>google/payments/inapp/item/v1</param-value>
        </init-param> 
        <init-param>
            <param-name>iss</param-name>
            <param-value>14204953094352168571</param-value>
        </init-param> 
        <init-param>
            <param-name>secret</param-name>
            <param-value>PWGknVgi6zt_BU1qrO1hXg</param-value>
        </init-param> 
    </servlet>
    

    The aud and typ parameters should always be like above. Change iss and secret to match your account details.