{"action":"created","comment":{"url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/comments/73987563","id":73987563,"diff_hunk":"@@ -717,6 +720,216 @@ mobile | 手机号， （选填）\n **其他接口暂不支持测试模式**  \n \n \n+## 订阅支付  \n+\n+### 订阅支付详细设计请参考[BeeCloud订阅系统说明](https://github.com/beecloud/beecloud-rest-api/blob/master/subscription/%E8%AE%A2%E9%98%85%E7%B3%BB%E7%BB%9F%E8%AF%B4%E6%98%8E%E6%96%87%E6%A1%A3.md)\n+\n+### <a name=\"sendSMS\">短信验证码发送</a>  \n+成功发起短信验证码接口返回短信验证码id，输入手机会收到短信验证码。  \n+发起短信验证码发送接口异常情况将抛出BCException, 开发者需要捕获此异常进行相应失败操作 开发者可根据异常消息判断异常的具体信息，异常信息的格式为<mark>\"resultCode:xxx;resultMsg:xxx;errDetail:xxx(;responseCode:xxx)\"</mark>。  \n+```java\n+    try {\n+        String smsId = BCSubscriptionPay.sendSMS(\"13861331391\");\n+        out.println(smsId);//保留此smsId以便后续发起订阅使用\n+    } catch (BCException ex){\n+        out.print(ex.getMessage());\n+    }\n+```\n+\n+### <a name=\"startSubscription\">发起订阅</a>  \n+成功发起订阅接口将会返回带objectId的BCSubscription对象。\n+发起订阅接口异常情况将抛出BCException, 开发者需要捕获此异常进行相应失败操作 开发者可根据异常消息判断异常的具体信息，异常信息的格式为<mark>\"resultCode:xxx;resultMsg:xxx;errDetail:xxx(;responseCode:xxx)\"</mark>。\n+\n+```java\n+try {\n+    /**\n+     * 以下是通过银行5要素订阅的demo\n+     */\n+    BCSubscription subscription = new BCSubscription();\n+    subscription.setPlanId(\"4a009b37-c36a-49d3-b011-d13d43535b96\");\n+    subscription.setBuyerId(\"demo buyer id\");\n+    subscription.setSmsId(smsId);//验证码发送接口返回的smsId\n+    subscription.setSmsCode(\"code of your mobile received\");//收到的短信验证码\n+    subscription.setMobile(\"13661331392\");\n+    subscription.setBankName(\"交通银行\");\n+    subscription.setCardNo(\"6222630140019836463\");\n+    subscription.setIdName(\"冯小刚\");\n+    subscription.setIdNo(\"350503198606271013\");\n+    BCSubscription result = BCSubscriptionPay.startSubscription(subscription);\n+    out.println(result.getCardId());//保留待直接通过cardId发起订阅\n+    out.println(result.getValid());\n+    out.println(result.getStatus());\n+    out.println(result.getObject());//保留待取消订阅时使用\n+\n+    } catch (BCException ex){\n+        out.print(ex.getMessage());\n+    }\n+    \n+    /**\n+     * 以下是直接通过cardId订阅的demo\n+     */\n+    BCSubscription subscription = new BCSubscription();\n+    subscription.setCardId(\"第一次成功订阅后通过webhook获得\");\n+    subscription.setSmsId(smsId);//验证码发送接口返回的smsId\n+    subscription.setSmsCode(\"code of your mobile received\");//收到的短\n+    BCSubscription result = BCSubscriptionPay.startSubscription(subscription);\n+    out.print(result.getStatus());\n+    \n+ ```  \n+ <a name=\"subscriptionJump\"/>\n+代码中的参数对象BCSubscription封装字段含义如下：\n+\n+key | 说明\n+---- | -----\n+buyerId | 订阅的buyer ID，可以是用户email，也可以是商户系统中的用户ID， （必填） \n+planId | 对应的计划id\t， （必填） \n+smsId | 短信验证码id，通过短信验证接口获得，（必填）\n+smsCode | 短信验证码， （必填）\n+cardId | 第一次订阅成功的情况下，webhook会返回，之后订阅可以直接使用cardId代替以下5个参数\t， 即（{bank_name、card_no、id_name、id_no、mobile}和{cardId} 二选一）（必填） ","path":"README.md","position":118,"original_position":119,"commit_id":"914fe1cbecd92fd204451d4085b9cc40825e2e60","original_commit_id":"914fe1cbecd92fd204451d4085b9cc40825e2e60","user":{"login":"figo10203","id":12635964,"avatar_url":"https://avatars.githubusercontent.com/u/12635964?v=3","gravatar_id":"","url":"https://api.github.com/users/figo10203","html_url":"https://github.com/figo10203","followers_url":"https://api.github.com/users/figo10203/followers","following_url":"https://api.github.com/users/figo10203/following{/other_user}","gists_url":"https://api.github.com/users/figo10203/gists{/gist_id}","starred_url":"https://api.github.com/users/figo10203/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/figo10203/subscriptions","organizations_url":"https://api.github.com/users/figo10203/orgs","repos_url":"https://api.github.com/users/figo10203/repos","events_url":"https://api.github.com/users/figo10203/events{/privacy}","received_events_url":"https://api.github.com/users/figo10203/received_events","type":"User","site_admin":false},"body":"已改","created_at":"2016-08-09T01:55:50Z","updated_at":"2016-08-09T01:55:50Z","html_url":"https://github.com/beecloud/beecloud-java/pull/62#discussion_r73987563","pull_request_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/comments/73987563"},"html":{"href":"https://github.com/beecloud/beecloud-java/pull/62#discussion_r73987563"},"pull_request":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62","id":80401997,"html_url":"https://github.com/beecloud/beecloud-java/pull/62","diff_url":"https://github.com/beecloud/beecloud-java/pull/62.diff","patch_url":"https://github.com/beecloud/beecloud-java/pull/62.patch","issue_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/62","number":62,"state":"open","locked":false,"title":"Feature subscription","user":{"login":"figo10203","id":12635964,"avatar_url":"https://avatars.githubusercontent.com/u/12635964?v=3","gravatar_id":"","url":"https://api.github.com/users/figo10203","html_url":"https://github.com/figo10203","followers_url":"https://api.github.com/users/figo10203/followers","following_url":"https://api.github.com/users/figo10203/following{/other_user}","gists_url":"https://api.github.com/users/figo10203/gists{/gist_id}","starred_url":"https://api.github.com/users/figo10203/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/figo10203/subscriptions","organizations_url":"https://api.github.com/users/figo10203/orgs","repos_url":"https://api.github.com/users/figo10203/repos","events_url":"https://api.github.com/users/figo10203/events{/privacy}","received_events_url":"https://api.github.com/users/figo10203/received_events","type":"User","site_admin":false},"body":"pull request","created_at":"2016-08-08T06:53:51Z","updated_at":"2016-08-09T01:55:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6bc70d031fb2e16de6a1479d79ea5cf6cac9a01d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62/commits","review_comments_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62/comments","review_comment_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/62/comments","statuses_url":"https://api.github.com/repos/beecloud/beecloud-java/statuses/914fe1cbecd92fd204451d4085b9cc40825e2e60","head":{"label":"beecloud:feature_subscription","ref":"feature_subscription","sha":"914fe1cbecd92fd204451d4085b9cc40825e2e60","user":{"login":"beecloud","id":7818606,"avatar_url":"https://avatars.githubusercontent.com/u/7818606?v=3","gravatar_id":"","url":"https://api.github.com/users/beecloud","html_url":"https://github.com/beecloud","followers_url":"https://api.github.com/users/beecloud/followers","following_url":"https://api.github.com/users/beecloud/following{/other_user}","gists_url":"https://api.github.com/users/beecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/beecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beecloud/subscriptions","organizations_url":"https://api.github.com/users/beecloud/orgs","repos_url":"https://api.github.com/users/beecloud/repos","events_url":"https://api.github.com/users/beecloud/events{/privacy}","received_events_url":"https://api.github.com/users/beecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":38604511,"name":"beecloud-java","full_name":"beecloud/beecloud-java","owner":{"login":"beecloud","id":7818606,"avatar_url":"https://avatars.githubusercontent.com/u/7818606?v=3","gravatar_id":"","url":"https://api.github.com/users/beecloud","html_url":"https://github.com/beecloud","followers_url":"https://api.github.com/users/beecloud/followers","following_url":"https://api.github.com/users/beecloud/following{/other_user}","gists_url":"https://api.github.com/users/beecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/beecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beecloud/subscriptions","organizations_url":"https://api.github.com/users/beecloud/orgs","repos_url":"https://api.github.com/users/beecloud/repos","events_url":"https://api.github.com/users/beecloud/events{/privacy}","received_events_url":"https://api.github.com/users/beecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/beecloud/beecloud-java","description":"BeeCloud Java SDK (Open Source)","fork":false,"url":"https://api.github.com/repos/beecloud/beecloud-java","forks_url":"https://api.github.com/repos/beecloud/beecloud-java/forks","keys_url":"https://api.github.com/repos/beecloud/beecloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beecloud/beecloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beecloud/beecloud-java/teams","hooks_url":"https://api.github.com/repos/beecloud/beecloud-java/hooks","issue_events_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/beecloud/beecloud-java/events","assignees_url":"https://api.github.com/repos/beecloud/beecloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/beecloud/beecloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/beecloud/beecloud-java/tags","blobs_url":"https://api.github.com/repos/beecloud/beecloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beecloud/beecloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beecloud/beecloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/beecloud/beecloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beecloud/beecloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/beecloud/beecloud-java/languages","stargazers_url":"https://api.github.com/repos/beecloud/beecloud-java/stargazers","contributors_url":"https://api.github.com/repos/beecloud/beecloud-java/contributors","subscribers_url":"https://api.github.com/repos/beecloud/beecloud-java/subscribers","subscription_url":"https://api.github.com/repos/beecloud/beecloud-java/subscription","commits_url":"https://api.github.com/repos/beecloud/beecloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/beecloud/beecloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/beecloud/beecloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/beecloud/beecloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/beecloud/beecloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beecloud/beecloud-java/merges","archive_url":"https://api.github.com/repos/beecloud/beecloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beecloud/beecloud-java/downloads","issues_url":"https://api.github.com/repos/beecloud/beecloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/beecloud/beecloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/beecloud/beecloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beecloud/beecloud-java/labels{/name}","releases_url":"https://api.github.com/repos/beecloud/beecloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/beecloud/beecloud-java/deployments","created_at":"2015-07-06T07:38:59Z","updated_at":"2016-07-19T12:07:23Z","pushed_at":"2016-08-08T06:58:47Z","git_url":"git://github.com/beecloud/beecloud-java.git","ssh_url":"git@github.com:beecloud/beecloud-java.git","clone_url":"https://github.com/beecloud/beecloud-java.git","svn_url":"https://github.com/beecloud/beecloud-java","homepage":"http://beecloud.cn","size":69203,"stargazers_count":28,"watchers_count":28,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":1,"forks":26,"open_issues":1,"watchers":28,"default_branch":"master"}},"base":{"label":"beecloud:dev","ref":"dev","sha":"6a72cca8a6fd8a62b5c04a9970c5eb144751e688","user":{"login":"beecloud","id":7818606,"avatar_url":"https://avatars.githubusercontent.com/u/7818606?v=3","gravatar_id":"","url":"https://api.github.com/users/beecloud","html_url":"https://github.com/beecloud","followers_url":"https://api.github.com/users/beecloud/followers","following_url":"https://api.github.com/users/beecloud/following{/other_user}","gists_url":"https://api.github.com/users/beecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/beecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beecloud/subscriptions","organizations_url":"https://api.github.com/users/beecloud/orgs","repos_url":"https://api.github.com/users/beecloud/repos","events_url":"https://api.github.com/users/beecloud/events{/privacy}","received_events_url":"https://api.github.com/users/beecloud/received_events","type":"Organization","site_admin":false},"repo":{"id":38604511,"name":"beecloud-java","full_name":"beecloud/beecloud-java","owner":{"login":"beecloud","id":7818606,"avatar_url":"https://avatars.githubusercontent.com/u/7818606?v=3","gravatar_id":"","url":"https://api.github.com/users/beecloud","html_url":"https://github.com/beecloud","followers_url":"https://api.github.com/users/beecloud/followers","following_url":"https://api.github.com/users/beecloud/following{/other_user}","gists_url":"https://api.github.com/users/beecloud/gists{/gist_id}","starred_url":"https://api.github.com/users/beecloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beecloud/subscriptions","organizations_url":"https://api.github.com/users/beecloud/orgs","repos_url":"https://api.github.com/users/beecloud/repos","events_url":"https://api.github.com/users/beecloud/events{/privacy}","received_events_url":"https://api.github.com/users/beecloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/beecloud/beecloud-java","description":"BeeCloud Java SDK (Open Source)","fork":false,"url":"https://api.github.com/repos/beecloud/beecloud-java","forks_url":"https://api.github.com/repos/beecloud/beecloud-java/forks","keys_url":"https://api.github.com/repos/beecloud/beecloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beecloud/beecloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beecloud/beecloud-java/teams","hooks_url":"https://api.github.com/repos/beecloud/beecloud-java/hooks","issue_events_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/beecloud/beecloud-java/events","assignees_url":"https://api.github.com/repos/beecloud/beecloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/beecloud/beecloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/beecloud/beecloud-java/tags","blobs_url":"https://api.github.com/repos/beecloud/beecloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beecloud/beecloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beecloud/beecloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/beecloud/beecloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beecloud/beecloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/beecloud/beecloud-java/languages","stargazers_url":"https://api.github.com/repos/beecloud/beecloud-java/stargazers","contributors_url":"https://api.github.com/repos/beecloud/beecloud-java/contributors","subscribers_url":"https://api.github.com/repos/beecloud/beecloud-java/subscribers","subscription_url":"https://api.github.com/repos/beecloud/beecloud-java/subscription","commits_url":"https://api.github.com/repos/beecloud/beecloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/beecloud/beecloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/beecloud/beecloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/beecloud/beecloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/beecloud/beecloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/beecloud/beecloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beecloud/beecloud-java/merges","archive_url":"https://api.github.com/repos/beecloud/beecloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beecloud/beecloud-java/downloads","issues_url":"https://api.github.com/repos/beecloud/beecloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/beecloud/beecloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/beecloud/beecloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/beecloud/beecloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beecloud/beecloud-java/labels{/name}","releases_url":"https://api.github.com/repos/beecloud/beecloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/beecloud/beecloud-java/deployments","created_at":"2015-07-06T07:38:59Z","updated_at":"2016-07-19T12:07:23Z","pushed_at":"2016-08-08T06:58:47Z","git_url":"git://github.com/beecloud/beecloud-java.git","ssh_url":"git@github.com:beecloud/beecloud-java.git","clone_url":"https://github.com/beecloud/beecloud-java.git","svn_url":"https://github.com/beecloud/beecloud-java","homepage":"http://beecloud.cn","size":69203,"stargazers_count":28,"watchers_count":28,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":1,"forks":26,"open_issues":1,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62"},"html":{"href":"https://github.com/beecloud/beecloud-java/pull/62"},"issue":{"href":"https://api.github.com/repos/beecloud/beecloud-java/issues/62"},"comments":{"href":"https://api.github.com/repos/beecloud/beecloud-java/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/beecloud/beecloud-java/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/beecloud/beecloud-java/statuses/914fe1cbecd92fd204451d4085b9cc40825e2e60"}}}}
{"actor":{"display_login":"figo10203"}}