{"action":"created","issue":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/123","labels_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/123/labels{/name}","comments_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/123/comments","events_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/123/events","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/123","id":54040932,"number":123,"title":"store.refresh breaks after first purchase","user":{"login":"CodeHunger","id":1182900,"avatar_url":"https://avatars.githubusercontent.com/u/1182900?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeHunger","html_url":"https://github.com/CodeHunger","followers_url":"https://api.github.com/users/CodeHunger/followers","following_url":"https://api.github.com/users/CodeHunger/following{/other_user}","gists_url":"https://api.github.com/users/CodeHunger/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeHunger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeHunger/subscriptions","organizations_url":"https://api.github.com/users/CodeHunger/orgs","repos_url":"https://api.github.com/users/CodeHunger/repos","events_url":"https://api.github.com/users/CodeHunger/events{/privacy}","received_events_url":"https://api.github.com/users/CodeHunger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-12T10:57:57Z","updated_at":"2015-02-06T17:03:00Z","closed_at":null,"body":"I've puchased an consumable with my android device.\r\nSadly it the app crashes after the purchase.\r\n\r\nWhen reloading the app and thus calling store.refresh() i get the following error log.\r\n\r\n```\r\nE/IABUtil/Security(28815): Base64 decoding failed.\r\nE/AndroidRuntime(28815): FATAL EXCEPTION: Thread-1914\r\nE/AndroidRuntime(28815): Process: com.CordovaApp, PID: 28815\r\nE/AndroidRuntime(28815): java.lang.IllegalArgumentException: com.smartmobilesoftware.util.on: Bad Base64 input character at 0: 36(decimal)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Security.generatePublicKey(Security.java:70)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Security.verifyPurchase(Security.java:47)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.IabHelper.queryPurchases(IabHelper.java:864)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.IabHelper.queryInventory(IabHelper.java:562)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.IabHelper.queryInventory(IabHelper.java:540)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.IabHelper$2.run(IabHelper.java:635)\r\nE/AndroidRuntime(28815):  at java.lang.Thread.run(Thread.java:841)\r\nE/AndroidRuntime(28815): Caused by: com.smartmobilesoftware.util.Base64DecoderException: Bad Base64 input ecimal)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Base64.decode(Base64.java:518)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Base64.decode(Base64.java:446)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Base64.decode(Base64.java:392)\r\nE/AndroidRuntime(28815):  at com.smartmobilesoftware.util.Security.generatePublicKey(Security.java:60)\r\nE/AndroidRuntime(28815):  ... 6 more\r\nE/WindowManager(28815): android.view.WindowLeaked: Activity com.CordovaApp.CordovaApp has leaked window com.icy.impl.PhoneWindow$DecorView{4287f528 V.E..... R....... 0,0-1048,576} that was originally added here\r\nE/WindowManager(28815):   at android.view.ViewRootImpl.<init>(ViewRootImpl.java:346)\r\nE/WindowManager(28815):   at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)\r\nE/WindowManager(28815):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)\r\nE/WindowManager(28815):   at android.app.Dialog.show(Dialog.java:286)\r\nE/WindowManager(28815):   at android.app.AlertDialog$Builder.show(AlertDialog.java:951)\r\nE/WindowManager(28815):   at org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:126)\r\nE/WindowManager(28815):   at com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(tAdapter.java:612)\r\nE/WindowManager(28815):   at com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(ge.java:72)\r\nE/WindowManager(28815):   at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)\r\nE/WindowManager(28815):   at com.android.org.chromium.base.SystemMessageHandler.handleMessage(.java:24)\r\nE/WindowManager(28815):   at android.os.Handler.dispatchMessage(Handler.java:102)\r\nE/WindowManager(28815):   at android.os.Looper.loop(Looper.java:136)\r\nE/WindowManager(28815):   at android.app.ActivityThread.main(ActivityThread.java:5001)\r\nE/WindowManager(28815):   at java.lang.reflect.Method.invokeNative(Native Method)\r\nE/WindowManager(28815):   at java.lang.reflect.Method.invoke(Method.java:515)\r\nE/WindowManager(28815):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\r\nE/WindowManager(28815):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\r\nE/WindowManager(28815):   at dalvik.system.NativeStart.main(Native Method)\r\nE/Icing(28195): Unexpected state encountered in RFC822\r\n```\r\n\r\nDoes anyone have any idea what i'm doing wrong?"},"comment":{"url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/comments/73272087","html_url":"https://github.com/j3k0/cordova-plugin-purchase/issues/123#issuecomment-73272087","issue_url":"https://api.github.com/repos/j3k0/cordova-plugin-purchase/issues/123","id":73272087,"user":{"login":"flexed","id":1859867,"avatar_url":"https://avatars.githubusercontent.com/u/1859867?v=3","gravatar_id":"","url":"https://api.github.com/users/flexed","html_url":"https://github.com/flexed","followers_url":"https://api.github.com/users/flexed/followers","following_url":"https://api.github.com/users/flexed/following{/other_user}","gists_url":"https://api.github.com/users/flexed/gists{/gist_id}","starred_url":"https://api.github.com/users/flexed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flexed/subscriptions","organizations_url":"https://api.github.com/users/flexed/orgs","repos_url":"https://api.github.com/users/flexed/repos","events_url":"https://api.github.com/users/flexed/events{/privacy}","received_events_url":"https://api.github.com/users/flexed/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T17:03:00Z","updated_at":"2015-02-06T17:03:00Z","body":"For what it's worth, I had the same problem and it seems to be fixed. I deleted `<string name=\"billing_key_param\">$BILLING_KEY</string>` from my billing_key_param.xml file and it seems to work. I then went into the android.json file and deleted the relevant line for the plugin so that that line would not be readded when I run `cordova prepare` Same with the plugin.xml file. So far, so good.\r\n\r\n```\r\n% more platforms/android/res/values/billing_key_param.xml\r\n<?xml version='1.0' encoding='utf-8'?>\r\n<resources>\r\n    <string name=\"billing_key_param\">MIIB.. {MY_OWN_KEY}</string>\r\n</resources>\r\n```"}}