{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/comments/132191075","pull_request_review_id":55244435,"id":132191075,"diff_hunk":"@@ -61,12 +79,59 @@ public PayCart cartFromUnity(\n                 .build();\n     }\n \n-    private void addAndroidPayFragment(String unityDelegateObjectName, PayCart cart, String countryCode) {\n-        UnityAndroidPayFragment payFragment =\n-                UnityAndroidPayFragment.newInstance(unityDelegateObjectName, cart, countryCode);\n+    private void addPayFragment(PayCart cart, String countryCode, String publicKey, boolean testing) {\n+        if (payFragment != null) {\n+            removePayFragment();\n+        }\n+\n+        payFragment = UnityAndroidPayFragment.builder()\n+            .setPayCart(cart)\n+            .setCountryCode(countryCode)\n+            .setEnvironment(testing ?\n+                WalletConstants.ENVIRONMENT_TEST : WalletConstants.ENVIRONMENT_PRODUCTION)\n+            .setPublicKey(publicKey)\n+            .build();\n+        payFragment.setSessionCallbacks(this);\n+\n         UnityPlayer.currentActivity.getFragmentManager()\n-                .beginTransaction()\n-                .add(payFragment, \"payFragment\")\n-                .commit();\n+            .beginTransaction()\n+            .add(payFragment, \"payFragment\")\n+            .commit();\n+    }\n+\n+    private void removePayFragment() {\n+        UnityPlayer.currentActivity.getFragmentManager()\n+            .beginTransaction()\n+            .remove(payFragment)\n+            .commit();\n+    }\n+\n+    public void onUpdateShippingAddress(MailingAddressInput address, MessageCenter.MessageCallbacks messageCallbacks) {\n+        UnityMessage msg = UnityMessage.fromAndroid(address.toJsonString());\n+        MessageCenter.UnityMessageReceiver receiver = new MessageCenter.UnityMessageReceiver(\n+            unityDelegateObjectName,\n+            MessageCenter.Method.ON_UPDATE_SHIPPING_ADDRESS\n+        );\n+        MessageCenter.sendMessageTo(msg, receiver, messageCallbacks);\n+    }\n+\n+    public void onError(String error) {\n+        removePayFragment();\n+        UnityMessage msg = UnityMessage.fromAndroid(error);\n+        MessageCenter.UnityMessageReceiver receiver = new MessageCenter.UnityMessageReceiver(\n+            unityDelegateObjectName,\n+            MessageCenter.Method.ON_ERROR\n+        );\n+        MessageCenter.sendMessageTo(msg, receiver);\n+    }\n+\n+    public void onCancel() {","path":"android/shopify_buy_plugin/src/main/java/com/shopify/unity/buy/AndroidPayCheckoutSession.java","position":127,"original_position":127,"commit_id":"636a073b08aad68123ddb34f79404501814db0e7","original_commit_id":"636a073b08aad68123ddb34f79404501814db0e7","user":{"login":"sav007","id":902816,"avatar_url":"https://avatars2.githubusercontent.com/u/902816?v=4","gravatar_id":"","url":"https://api.github.com/users/sav007","html_url":"https://github.com/sav007","followers_url":"https://api.github.com/users/sav007/followers","following_url":"https://api.github.com/users/sav007/following{/other_user}","gists_url":"https://api.github.com/users/sav007/gists{/gist_id}","starred_url":"https://api.github.com/users/sav007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sav007/subscriptions","organizations_url":"https://api.github.com/users/sav007/orgs","repos_url":"https://api.github.com/users/sav007/repos","events_url":"https://api.github.com/users/sav007/events{/privacy}","received_events_url":"https://api.github.com/users/sav007/received_events","type":"User","site_admin":false},"body":"is `public` here is intentional? ","created_at":"2017-08-09T13:58:47Z","updated_at":"2017-08-09T13:58:47Z","html_url":"https://github.com/Shopify/unity-buy-sdk/pull/250#discussion_r132191075","pull_request_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250","_links":{"self":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/comments/132191075"},"html":{"href":"https://github.com/Shopify/unity-buy-sdk/pull/250#discussion_r132191075"},"pull_request":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250","id":133961961,"html_url":"https://github.com/Shopify/unity-buy-sdk/pull/250","diff_url":"https://github.com/Shopify/unity-buy-sdk/pull/250.diff","patch_url":"https://github.com/Shopify/unity-buy-sdk/pull/250.patch","issue_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/250","number":250,"state":"open","locked":false,"title":"[Android Pay] Launches wallet chooser UI when checking out using Native Pay from Unity","user":{"login":"sleroux","id":434322,"avatar_url":"https://avatars0.githubusercontent.com/u/434322?v=4","gravatar_id":"","url":"https://api.github.com/users/sleroux","html_url":"https://github.com/sleroux","followers_url":"https://api.github.com/users/sleroux/followers","following_url":"https://api.github.com/users/sleroux/following{/other_user}","gists_url":"https://api.github.com/users/sleroux/gists{/gist_id}","starred_url":"https://api.github.com/users/sleroux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sleroux/subscriptions","organizations_url":"https://api.github.com/users/sleroux/orgs","repos_url":"https://api.github.com/users/sleroux/repos","events_url":"https://api.github.com/users/sleroux/events{/privacy}","received_events_url":"https://api.github.com/users/sleroux/received_events","type":"User","site_admin":false},"body":"* Adds Google API client and wallet listeners to UnityAndroidPayFragment to launch a masked wallet request.","created_at":"2017-08-03T14:39:48Z","updated_at":"2017-08-09T13:58:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f6867c1872371035a11e4a9365b60ea9820c2bc","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250/commits","review_comments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250/comments","review_comment_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/250/comments","statuses_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/statuses/636a073b08aad68123ddb34f79404501814db0e7","head":{"label":"Shopify:sleroux/masked-request","ref":"sleroux/masked-request","sha":"636a073b08aad68123ddb34f79404501814db0e7","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":75216845,"name":"unity-buy-sdk","full_name":"Shopify/unity-buy-sdk","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/unity-buy-sdk","description":"The Unity Buy SDK allows Unity developers to query and sell products from Shopify directly in Unity.","fork":false,"url":"https://api.github.com/repos/Shopify/unity-buy-sdk","forks_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/forks","keys_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/teams","hooks_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/hooks","issue_events_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/events","assignees_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/tags","blobs_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/languages","stargazers_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/stargazers","contributors_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/contributors","subscribers_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/subscribers","subscription_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/subscription","commits_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/merges","archive_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/downloads","issues_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/deployments","created_at":"2016-11-30T18:51:35Z","updated_at":"2017-05-29T19:07:58Z","pushed_at":"2017-08-08T20:52:41Z","git_url":"git://github.com/Shopify/unity-buy-sdk.git","ssh_url":"git@github.com:Shopify/unity-buy-sdk.git","clone_url":"https://github.com/Shopify/unity-buy-sdk.git","svn_url":"https://github.com/Shopify/unity-buy-sdk","homepage":"https://help.shopify.com/api/sdks/custom-storefront/unity-buy-sdk","size":23761,"stargazers_count":12,"watchers_count":12,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":12,"default_branch":"master"}},"base":{"label":"Shopify:beta","ref":"beta","sha":"9302970a1720ad9652b17881ad28bdfa1b260c45","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":75216845,"name":"unity-buy-sdk","full_name":"Shopify/unity-buy-sdk","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars1.githubusercontent.com/u/8085?v=4","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/unity-buy-sdk","description":"The Unity Buy SDK allows Unity developers to query and sell products from Shopify directly in Unity.","fork":false,"url":"https://api.github.com/repos/Shopify/unity-buy-sdk","forks_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/forks","keys_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/teams","hooks_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/hooks","issue_events_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/events","assignees_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/tags","blobs_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/languages","stargazers_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/stargazers","contributors_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/contributors","subscribers_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/subscribers","subscription_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/subscription","commits_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/merges","archive_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/downloads","issues_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/unity-buy-sdk/deployments","created_at":"2016-11-30T18:51:35Z","updated_at":"2017-05-29T19:07:58Z","pushed_at":"2017-08-08T20:52:41Z","git_url":"git://github.com/Shopify/unity-buy-sdk.git","ssh_url":"git@github.com:Shopify/unity-buy-sdk.git","clone_url":"https://github.com/Shopify/unity-buy-sdk.git","svn_url":"https://github.com/Shopify/unity-buy-sdk","homepage":"https://help.shopify.com/api/sdks/custom-storefront/unity-buy-sdk","size":23761,"stargazers_count":12,"watchers_count":12,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":18,"forks":1,"open_issues":18,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250"},"html":{"href":"https://github.com/Shopify/unity-buy-sdk/pull/250"},"issue":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/250"},"comments":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/issues/250/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/pulls/250/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/unity-buy-sdk/statuses/636a073b08aad68123ddb34f79404501814db0e7"}}}}
{"actor":{"display_login":"sav007"}}