-
Notifications
You must be signed in to change notification settings - Fork 711
Conversation
add wechat payment
add wechat payment
add wechat payment
add wechat payment
There was a problem hiding this 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!'); | ||
} | ||
} | ||
``` |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "returnKey"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the problem ?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I have corrected.
There was a problem hiding this comment.
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,() => {}); |
There was a problem hiding this comment.
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
@yorkie , I Have already submitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 :) |
add wechat pay