Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Complete web purchase from message (bug 1101995)#49

Merged
kumar303 merged 1 commit into
mozilla:masterfrom
kumar303:pay-finish
Dec 17, 2014
Merged

Complete web purchase from message (bug 1101995)#49
kumar303 merged 1 commit into
mozilla:masterfrom
kumar303:pay-finish

Conversation

@kumar303
Copy link
Copy Markdown
Contributor

@muffinresearch r?

I've only tested with a dummy html page but it should work with your patch!

Comment thread lib/fxpay/utils.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will work the same as location e.g. you could also use just a.origin when available or fallback to the a.protocol + '//' + a.host as that should be enough to deal with the port.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought that too but the unit test proved otherwise. It's weirdly inconsistent though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I didn't know origin was available there. Cool, thanks. Updated.

@kumar303
Copy link
Copy Markdown
Contributor Author

@muffinresearch after mozilla/spartacus#177 landed, I tested on dev and it works! ^5

Let me know when you've finished an r on it.

Comment thread tests/test-web-purchase.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Extra space before ;

@muffinresearch
Copy link
Copy Markdown
Contributor

r+wc

Comment thread lib/fxpay/pay.js
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this ship has probably sailed and this is personal preference, but I don't much like the exports.foo = function whatever style. It makes for long lines, plus when you want to refer to the func defined elsewhere you have to refer to it off of exports.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My original reasoning for it was so one doesn't have to repeat the function name down below in the returned dictionary. However, I've noticed it's always helpful to use a named function so one has to repeat the name anyway. Thus, I could come around to always using named functions and exporting them at the bottom. Whichever style we go with, it just needs to be consistent throughout.

@kumar303 kumar303 force-pushed the pay-finish branch 4 times, most recently from bbeca43 to 3a7493b Compare December 17, 2014 17:28
Comment thread lib/fxpay/utils.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe return a.origin || a.protocol + '//' + a.host; ?

kumar303 added a commit that referenced this pull request Dec 17, 2014
Complete web purchase from message (bug 1101995)
@kumar303 kumar303 merged commit 7de0499 into mozilla:master Dec 17, 2014
@kumar303 kumar303 deleted the pay-finish branch December 17, 2014 21:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants