{"action":"created","issue":{"url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/175","repository_url":"https://api.github.com/repos/voltrue2/in-app-purchase","labels_url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/175/comments","events_url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/175/events","html_url":"https://github.com/voltrue2/in-app-purchase/issues/175","id":324096785,"number":175,"title":"[iOS]: Cancelled subscription being received as expired","user":{"login":"a-koka","id":16167317,"avatar_url":"https://avatars1.githubusercontent.com/u/16167317?v=4","gravatar_id":"","url":"https://api.github.com/users/a-koka","html_url":"https://github.com/a-koka","followers_url":"https://api.github.com/users/a-koka/followers","following_url":"https://api.github.com/users/a-koka/following{/other_user}","gists_url":"https://api.github.com/users/a-koka/gists{/gist_id}","starred_url":"https://api.github.com/users/a-koka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-koka/subscriptions","organizations_url":"https://api.github.com/users/a-koka/orgs","repos_url":"https://api.github.com/users/a-koka/repos","events_url":"https://api.github.com/users/a-koka/events{/privacy}","received_events_url":"https://api.github.com/users/a-koka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-17T16:26:43Z","updated_at":"2018-05-22T00:13:08Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"`iap.validate` is returning an error for an active but cancelled subscription. As you can see, this subscription was cancelled yesterday but it is still active for another 11 months. Below is the response from `iap.validate`. Somehow a cancelled reciept is being incorrectly reported as expired and thus `iap.getPurchaseData` doesn't return anything.\r\n\r\n```\r\n{\r\n  \"status\": 21006,\r\n  \"message\": \"This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.\",\r\n  \"auto_renew_status\": 0,\r\n  \"latest_expired_receipt_info\": {\r\n    \"original_purchase_date_pst\": \"2018-04-27 06:49:54 America/Los_Angeles\",\r\n    \"cancellation_date_ms\": \"1526490968000\",\r\n    \"quantity\": \"1\",\r\n    \"cancellation_reason\": \"0\",\r\n    \"unique_vendor_identifier\": \"1BEF4D18-49E6-4AB7-A5FD-D6CA7A87B2AB\",\r\n    \"bvrs\": \"1\",\r\n    \"expires_date_formatted\": \"2019-04-27 13:49:53 Etc/GMT\",\r\n    \"is_in_intro_offer_period\": \"false\",\r\n    \"purchase_date_ms\": \"1524836993000\",\r\n    \"expires_date_formatted_pst\": \"2019-04-27 06:49:53 America/Los_Angeles\",\r\n    \"is_trial_period\": \"false\",\r\n    \"item_id\": \"1280531126\",\r\n    \"unique_identifier\": \"04451921342e01bcde1fd00a7ae4a6552c62c242\",\r\n    \"original_transaction_id\": \"60000429490195\",\r\n    \"expires_date\": \"1556372993000\",\r\n    \"app_item_id\": \"1188877442\",\r\n    \"transaction_id\": \"60000429490195\",\r\n    \"web_order_line_item_id\": \"60000100858463\",\r\n    \"original_purchase_date\": \"2018-04-27 13:49:54 Etc/GMT\",\r\n    \"cancellation_date\": \"2018-05-16 17:16:08 Etc/GMT\",\r\n    \"product_id\": \"com.foo.bar\",\r\n    \"purchase_date\": \"2018-04-27 13:49:53 Etc/GMT\",\r\n    \"purchase_date_pst\": \"2018-04-27 06:49:53 America/Los_Angeles\",\r\n    \"cancellation_date_pst\": \"2018-05-16 10:16:08 America/Los_Angeles\",\r\n    \"bid\": \"com.foo.bar\",\r\n    \"original_purchase_date_ms\": \"1524836994000\"\r\n  },\r\n  \"cancellation_date\": \"2018-05-16 17:16:08 Etc/GMT\",\r\n  \"auto_renew_product_id\": \"com.foo.bar\",\r\n  \"receipt\": {\r\n    \"original_purchase_date_pst\": \"2018-04-27 06:49:54 America/Los_Angeles\",\r\n    \"quantity\": \"1\",\r\n    \"unique_vendor_identifier\": \"1BEF4D18-49E6-4AB7-A5FD-D6CA7A87B2AB\",\r\n    \"bvrs\": \"1\",\r\n    \"expires_date_formatted\": \"2019-04-27 13:49:53 Etc/GMT\",\r\n    \"is_in_intro_offer_period\": \"false\",\r\n    \"purchase_date_ms\": \"1524836993460\",\r\n    \"expires_date_formatted_pst\": \"2019-04-27 06:49:53 America/Los_Angeles\",\r\n    \"is_trial_period\": \"false\",\r\n    \"item_id\": \"1280531126\",\r\n    \"unique_identifier\": \"04451921342e01bcde1fd00a7ae4a6552c62c242\",\r\n    \"original_transaction_id\": \"60000429490195\",\r\n    \"expires_date\": \"1556372993460\",\r\n    \"app_item_id\": \"1188877442\",\r\n    \"transaction_id\": \"60000429490195\",\r\n    \"web_order_line_item_id\": \"60000100858463\",\r\n    \"version_external_identifier\": \"826524987\",\r\n    \"product_id\": \"com.foo.bar\",\r\n    \"purchase_date\": \"2018-04-27 13:49:53 Etc/GMT\",\r\n    \"original_purchase_date\": \"2018-04-27 13:49:54 Etc/GMT\",\r\n    \"purchase_date_pst\": \"2018-04-27 06:49:53 America/Los_Angeles\",\r\n    \"bid\": \"com.foo.bar\",\r\n    \"original_purchase_date_ms\": \"1524836994819\"\r\n  },\r\n  \"cancellation_reason\": \"0\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/comments/390822992","html_url":"https://github.com/voltrue2/in-app-purchase/issues/175#issuecomment-390822992","issue_url":"https://api.github.com/repos/voltrue2/in-app-purchase/issues/175","id":390822992,"user":{"login":"voltrue2","id":2267361,"avatar_url":"https://avatars0.githubusercontent.com/u/2267361?v=4","gravatar_id":"","url":"https://api.github.com/users/voltrue2","html_url":"https://github.com/voltrue2","followers_url":"https://api.github.com/users/voltrue2/followers","following_url":"https://api.github.com/users/voltrue2/following{/other_user}","gists_url":"https://api.github.com/users/voltrue2/gists{/gist_id}","starred_url":"https://api.github.com/users/voltrue2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voltrue2/subscriptions","organizations_url":"https://api.github.com/users/voltrue2/orgs","repos_url":"https://api.github.com/users/voltrue2/repos","events_url":"https://api.github.com/users/voltrue2/events{/privacy}","received_events_url":"https://api.github.com/users/voltrue2/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T00:13:08Z","updated_at":"2018-05-22T00:13:08Z","author_association":"OWNER","body":"      \n  \n\n Hello\n  \n\n  \nThanks for testing the fix. I’ll be publishing the new version very soon.\n  \n\n  \nCheers\n  \n\n  \n  \n\n  \n  \n>   \n> On May 21, 2018 at 23:51,  <Anshul Koka (mailto:notifications@github.com)>  wrote:\n>   \n>   \n>   \n>\n> I tested with a few different subscriptions and this is working as expected. Would you be able to push this fix live on npm sometime soon?\n>\n>   \n>\n> Thanks again!\n>\n>   \n>\n> —\n>  You are receiving this because you were mentioned.\n>  Reply to this email directly,   view it on GitHub (https://github.com/voltrue2/in-app-purchase/issues/175#issuecomment-390677782), or   mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4Zfbu4qhh2Dv7_BuPMkLc1_2vWJ4ks5t0tSHgaJpZM4UDY0G).\n>\n>       \n>   \n  \n  \n     "}}
{"actor":{"display_login":"voltrue2"}}