Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Create InAppProducts returns 500 error #45

Open
dnaumenko opened this issue Jul 31, 2018 · 0 comments
Open

Create InAppProducts returns 500 error #45

dnaumenko opened this issue Jul 31, 2018 · 0 comments

Comments

@dnaumenko
Copy link

Hi

I've tried to create an InApp product, but publisher-api return only:
{ "code" : 500, "message" : null }

Here is my code:

val token = new TokenResponse()
token.setAccessToken("<put_valid_token>")
token.setExpiresInSeconds(3600L)
val creds = new Credential(BearerToken.queryParameterAccessMethod()).setFromTokenResponse(token)

val service = new AndroidPublisher.Builder(
GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance, creds).setApplicationName("test")
.build()

val listing = new InAppProductListing()
listing.setTitle("Title")
listing.setDescription("Desc")

val price = new Price
price.setCurrency("USD")
price.setPriceMicros("199000000")

val contentInApp = new InAppProduct()
contentInApp.setDefaultLanguage("en-US")
contentInApp.setStatus("active")
contentInApp.setListings(Map(
    "en-US" -> listing
).asJava)
contentInApp.setPurchaseType("managedUser")
contentInApp.setSku("b2b876c34f3145a6a7d41a0a76969929")
contentInApp.setDefaultPrice(price)
val result2 = service.inappproducts().insert("net.playq.dmitry.inapptest", contentInApp).execute()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant