Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

add wechat pay #108

Merged
merged 7 commits into from
Sep 21, 2016
Merged

add wechat pay #108

merged 7 commits into from
Sep 21, 2016

Conversation

simman
Copy link
Contributor

@simman simman commented Sep 17, 2016

add wechat pay

add wechat payment
add wechat payment
add wechat payment
add wechat payment
@yorkie yorkie added the payment label Sep 17, 2016
Copy link
Owner

@yorkie yorkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simman This is really awesome works, and thank you so much, most changes looks good to me except few nits, please fix them :)

console.log('Pay for failure!');
}
}
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the indention to 2 spaces please, thank you

#### `pay`

```
async useWeChat() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the wrapping function.

} else if (baseResp instanceof PayResp) {
PayResp resp = (PayResp) (baseResp);
map.putString("type", "PayReq.Resp");
map.putString("returnkey", resp.returnKey);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "returnKey"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the problem ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this line, it causes resp.returnKey to be undefined :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I have corrected.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have corrected? Did you push your code in live? I don't see any changes on this PR :(

*/
export function pay(data) {
return new Promise((resolve, reject) => {
WeChat.pay(data,() => {});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 2nd argument is not used correctly, propose:

return new Promise((resolve, reject) => {
  WeChat.pay(data, () => resolve());
}).then(() => {
  emitter.on('PayReq.Resp', ...);
});

But I'm not sure if there is something problems when listening "PayReq.Resp" after the callback get invoked :)

Remove the wrapping function. indention to 2 spaces
 callback throws
returnkey to returnKey
@simman
Copy link
Contributor Author

simman commented Sep 18, 2016

@yorkie , I Have already submitted.

Copy link
Owner

@yorkie yorkie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yorkie
Copy link
Owner

yorkie commented Sep 18, 2016

All changes looks good to me, and I will keep this still open for 48 hours, and will merge and release if there are no any objection :)

@yorkie yorkie merged commit a89e035 into yorkie:master Sep 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants