{"action":"created","issue":{"url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/140","repository_url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin","labels_url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/140/comments","events_url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/140/events","html_url":"https://github.com/jamesmontemagno/InAppBillingPlugin/issues/140","id":316581350,"number":140,"title":"[Android] PurchaseAsync returns null when payload == \"\"","user":{"login":"THplusplus","id":5776037,"avatar_url":"https://avatars0.githubusercontent.com/u/5776037?v=4","gravatar_id":"","url":"https://api.github.com/users/THplusplus","html_url":"https://github.com/THplusplus","followers_url":"https://api.github.com/users/THplusplus/followers","following_url":"https://api.github.com/users/THplusplus/following{/other_user}","gists_url":"https://api.github.com/users/THplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/THplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/THplusplus/subscriptions","organizations_url":"https://api.github.com/users/THplusplus/orgs","repos_url":"https://api.github.com/users/THplusplus/repos","events_url":"https://api.github.com/users/THplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/THplusplus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-22T13:59:26Z","updated_at":"2018-04-24T16:08:07Z","closed_at":"2018-04-24T16:08:07Z","author_association":"NONE","body":"As payload parameter requires a non-null value I simply passed \"\", because I don't actually require the payload parameter.\r\nHowever, this results in PurchaseAsync returning null even after a successful purchase. Calling GetPurchasesAsync afterwards will correctly return the purchase.\r\nThe reason seems to be that the google api's response omits the developerPayload if it is empty, resulting in the plugin reading developerPayload as null. The plugin internally filters the returned purchases by sku and payload, and as null != \"\", the plugin won't be able to find the matching purchase, causing it to return null.\r\nIf I pass any other non-null value to payload, it works as expected.\r\n\r\nVersion Number of Plugin: 1.2.4\r\nDevice Tested On: Samsung Galaxy Nexus (Android 4.3)\r\nSimulator Tested On: -\r\nVersion of VS: VS Community 2017, 15.6.6\r\nVersion of Xamarin: Xamarin.Android.Support.* 26.0.2\r\n\r\n### Steps to reproduce the Behavior\r\n* call PurchaseAsync passing \"\" to the payload parameter\r\n* complete the purchase (tested in the test store using a test account)\r\n\r\n### Expected Behavior\r\nTask should complete with Result being a valid InAppBillingPurchase object OR raise an ArgumentException in case \"\" is supposed to be an invalid value for payload parameter.\r\n\r\n### Actual Behavior\r\nTask completes with Result == null.\r\n\r\n### Code snippet\r\nInAppBillingPurchase purchase = await CrossInAppBilling.Current.PurchaseAsync(productId, ItemType.InAppPurchase, \"\");"},"comment":{"url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/comments/383989440","html_url":"https://github.com/jamesmontemagno/InAppBillingPlugin/issues/140#issuecomment-383989440","issue_url":"https://api.github.com/repos/jamesmontemagno/InAppBillingPlugin/issues/140","id":383989440,"user":{"login":"jamesmontemagno","id":1676321,"avatar_url":"https://avatars0.githubusercontent.com/u/1676321?v=4","gravatar_id":"","url":"https://api.github.com/users/jamesmontemagno","html_url":"https://github.com/jamesmontemagno","followers_url":"https://api.github.com/users/jamesmontemagno/followers","following_url":"https://api.github.com/users/jamesmontemagno/following{/other_user}","gists_url":"https://api.github.com/users/jamesmontemagno/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesmontemagno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesmontemagno/subscriptions","organizations_url":"https://api.github.com/users/jamesmontemagno/orgs","repos_url":"https://api.github.com/users/jamesmontemagno/repos","events_url":"https://api.github.com/users/jamesmontemagno/events{/privacy}","received_events_url":"https://api.github.com/users/jamesmontemagno/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T16:08:07Z","updated_at":"2018-04-24T16:08:07Z","author_association":"OWNER","body":"You have to give it a payload"}}
{"actor":{"display_login":"jamesmontemagno"}}