{"action":"created","comment":{"url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/comments/62686443","id":62686443,"diff_hunk":"@@ -0,0 +1,141 @@\n+//\n+//  BUYPaymentProvider.h\n+//  Mobile Buy SDK\n+//\n+//  Created by Shopify.\n+//  Copyright (c) 2015 Shopify Inc. All rights reserved.\n+//\n+//  Permission is hereby granted, free of charge, to any person obtaining a copy\n+//  of this software and associated documentation files (the \"Software\"), to deal\n+//  in the Software without restriction, including without limitation the rights\n+//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+//  copies of the Software, and to permit persons to whom the Software is\n+//  furnished to do so, subject to the following conditions:\n+//\n+//  The above copyright notice and this permission notice shall be included in\n+//  all copies or substantial portions of the Software.\n+//\n+//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+//  THE SOFTWARE.\n+//\n+\n+@import UIKit;\n+\n+#import \"BUYClient.h\"\n+\n+@class BUYCheckout;\n+@protocol BUYPaymentProvider;\n+\n+extern NSString *const BUYPaymentProviderWillStartCheckoutNotificationKey;\n+extern NSString *const BUYPaymentProviderDidDismissCheckoutNotificationKey;\n+extern NSString *const BUYPaymentProviderDidFailToUpdateCheckoutNotificationKey;\n+extern NSString *const BUYPaymentProviderDidFailCheckoutNotificationKey;\n+extern NSString *const BUYPaymentProviderDidCompleteCheckoutNotificationKey;\n+\n+@protocol BUYPaymentProviderDelegate <NSObject>\n+\n+@required\n+\n+/**\n+ *  Called when a view controller needs to be presented\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ *  @param controller the `UIViewController` to be presented\n+ */\n+- (void)paymentProvider:(id <BUYPaymentProvider>)provider wantsControllerPresented:(UIViewController *)controller;\n+\n+/**\n+ *  Called when the view controller\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ */\n+- (void)paymentProviderWantsControllerDismissed:(id <BUYPaymentProvider>)provider;\n+\n+@optional\n+\n+/**\n+ *  Called when the checkout process has started\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ */\n+- (void)paymentProviderWillStartCheckout:(id <BUYPaymentProvider>)provider;\n+\n+/**\n+ *  Called when the checkout has been dismissed\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ */\n+- (void)paymentProviderDidDismissCheckout:(id <BUYPaymentProvider>)provider;\n+\n+/**\n+ *  Called when a checkout failed to update\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ *  @param error    the optional `NSError`\n+ */\n+- (void)paymentProvider:(id <BUYPaymentProvider>)provider didFailToUpdateCheckoutWithError:(NSError *)error;\n+\n+/**\n+ *  Called when the checkout failed\n+ *\n+ *  @param provider   the `BUYPaymentProvider`\n+ *  @param error    the optional `NSError`\n+ */\n+- (void)paymentProvider:(id <BUYPaymentProvider>)provider didFailCheckoutWithError:(NSError *)error;","path":"Mobile Buy SDK/Mobile Buy SDK/Payment Providers/BUYPaymentProvider.h","position":89,"original_position":89,"commit_id":"3258128a4b3ade0e04a56fb4d5f9e72f770a8189","original_commit_id":"3258128a4b3ade0e04a56fb4d5f9e72f770a8189","user":{"login":"davidmuzi","id":1058176,"avatar_url":"https://avatars.githubusercontent.com/u/1058176?v=3","gravatar_id":"","url":"https://api.github.com/users/davidmuzi","html_url":"https://github.com/davidmuzi","followers_url":"https://api.github.com/users/davidmuzi/followers","following_url":"https://api.github.com/users/davidmuzi/following{/other_user}","gists_url":"https://api.github.com/users/davidmuzi/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmuzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmuzi/subscriptions","organizations_url":"https://api.github.com/users/davidmuzi/orgs","repos_url":"https://api.github.com/users/davidmuzi/repos","events_url":"https://api.github.com/users/davidmuzi/events{/privacy}","received_events_url":"https://api.github.com/users/davidmuzi/received_events","type":"User","site_admin":false},"body":"Can we collapse the error methods since the NEError can convey the actual error condition?","created_at":"2016-05-10T14:52:23Z","updated_at":"2016-05-10T14:52:23Z","html_url":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153#discussion_r62686443","pull_request_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/comments/62686443"},"html":{"href":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153#discussion_r62686443"},"pull_request":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153","id":69503685,"html_url":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153","diff_url":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153.diff","patch_url":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153.patch","issue_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/153","number":153,"state":"open","locked":false,"title":"Add payment providers","user":{"login":"bgulanowski","id":186680,"avatar_url":"https://avatars.githubusercontent.com/u/186680?v=3","gravatar_id":"","url":"https://api.github.com/users/bgulanowski","html_url":"https://github.com/bgulanowski","followers_url":"https://api.github.com/users/bgulanowski/followers","following_url":"https://api.github.com/users/bgulanowski/following{/other_user}","gists_url":"https://api.github.com/users/bgulanowski/gists{/gist_id}","starred_url":"https://api.github.com/users/bgulanowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgulanowski/subscriptions","organizations_url":"https://api.github.com/users/bgulanowski/orgs","repos_url":"https://api.github.com/users/bgulanowski/repos","events_url":"https://api.github.com/users/bgulanowski/events{/privacy}","received_events_url":"https://api.github.com/users/bgulanowski/received_events","type":"User","site_admin":false},"body":"# Why?\r\n\r\nWe want to consolidate payment logic and ensure consistency between different payment types.\r\n\r\n# How?\r\n\r\nIntroduce a payment controller which manages many payment providers, each of which designed to interact with a payment interface that provides the necessary payment workflow or data to complete a checkout.\r\n\r\n@dbart01 @davidmuzi ","created_at":"2016-05-10T13:14:50Z","updated_at":"2016-05-10T14:52:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3a12a7d3d80f770d94baee25c15546d5d8c7e65","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153/commits","review_comments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153/comments","review_comment_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/153/comments","statuses_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/statuses/3258128a4b3ade0e04a56fb4d5f9e72f770a8189","head":{"label":"Shopify:task/payment-providers","ref":"task/payment-providers","sha":"3258128a4b3ade0e04a56fb4d5f9e72f770a8189","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","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":36382861,"name":"mobile-buy-sdk-ios","full_name":"Shopify/mobile-buy-sdk-ios","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","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/mobile-buy-sdk-ios","description":"Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.","fork":false,"url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios","forks_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/forks","keys_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/teams","hooks_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/hooks","issue_events_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/events","assignees_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/tags","blobs_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/languages","stargazers_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/stargazers","contributors_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/contributors","subscribers_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/subscribers","subscription_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/subscription","commits_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/merges","archive_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/downloads","issues_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/deployments","created_at":"2015-05-27T17:12:56Z","updated_at":"2016-05-04T00:21:30Z","pushed_at":"2016-05-10T13:36:45Z","git_url":"git://github.com/Shopify/mobile-buy-sdk-ios.git","ssh_url":"git@github.com:Shopify/mobile-buy-sdk-ios.git","clone_url":"https://github.com/Shopify/mobile-buy-sdk-ios.git","svn_url":"https://github.com/Shopify/mobile-buy-sdk-ios","homepage":"","size":3832,"stargazers_count":53,"watchers_count":53,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":15,"forks":20,"open_issues":15,"watchers":53,"default_branch":"master"}},"base":{"label":"Shopify:integration/sdk-2.0","ref":"integration/sdk-2.0","sha":"9d8671c87f9d883205947faee028a151c16ca670","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","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":36382861,"name":"mobile-buy-sdk-ios","full_name":"Shopify/mobile-buy-sdk-ios","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","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/mobile-buy-sdk-ios","description":"Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.","fork":false,"url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios","forks_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/forks","keys_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/teams","hooks_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/hooks","issue_events_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/events","assignees_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/tags","blobs_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/languages","stargazers_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/stargazers","contributors_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/contributors","subscribers_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/subscribers","subscription_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/subscription","commits_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/merges","archive_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/downloads","issues_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/releases{/id}","deployments_url":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/deployments","created_at":"2015-05-27T17:12:56Z","updated_at":"2016-05-04T00:21:30Z","pushed_at":"2016-05-10T13:36:45Z","git_url":"git://github.com/Shopify/mobile-buy-sdk-ios.git","ssh_url":"git@github.com:Shopify/mobile-buy-sdk-ios.git","clone_url":"https://github.com/Shopify/mobile-buy-sdk-ios.git","svn_url":"https://github.com/Shopify/mobile-buy-sdk-ios","homepage":"","size":3832,"stargazers_count":53,"watchers_count":53,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":15,"forks":20,"open_issues":15,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153"},"html":{"href":"https://github.com/Shopify/mobile-buy-sdk-ios/pull/153"},"issue":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/153"},"comments":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/mobile-buy-sdk-ios/statuses/3258128a4b3ade0e04a56fb4d5f9e72f770a8189"}}}}