gratipay / grtp.co

Gratipay Widgets + API
https://grtp.co/
MIT License
26 stars 19 forks source link

add a Team receiving widget #138

Closed mattbk closed 8 years ago

mattbk commented 8 years ago

Lots to do. Starting with a clean/working duplication of v1 to v2, then will start chipping away.

https://github.com/gratipay/grtp.co/issues/103#issuecomment-215474340:

So we should build a v2 widget that is cloned and then modified from the v1 widget. This new version will handle giving in the same way, but will handle taking (for ~users) and receiving (for teams).

A different PR:

mattbk commented 8 years ago

133 changes are incorporated.

mattbk commented 8 years ago

Now, to the fun part.

I think a better approach will be to let data-gratipay-username continue to only mean ~user username, and write new widget code for Teams. https://github.com/gratipay/grtp.co/pull/112#issuecomment-207889689

An example, using default-widget.html:

<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>

<body>
    <script src="/lib/v2.js" data-gratipay-username="rummik" async></script>
</body>

Where it says data-gratipay-username= I should be able to put data-gratipay-teamslug= (TBD), and then pick it up in v2.js and go from there.

mattbk commented 8 years ago

Forgot to test before committing.

mattbk commented 8 years ago

I think it's ready for review. Very simple and stripped down. Does not modify anything from v1.

Example using default-widget.html:

<!doctype html>
<script>grtpAPI = '/lib/v2/'</script>
<script>gratipayURI = '/test/gratipay.com/'</script>

<body>
    <script src="/lib/v2.js" data-gratipay-teamslug="gratipay" async></script>
</body>

screen shot 2016-06-25 at 11 45 37 am

chadwhitacre commented 8 years ago
Punchlist
chadwhitacre commented 8 years ago

Here's a diff between v1 and v2 in cc11356419e32d96b4b4db95ea61e954c36ea3d0:

https://gist.github.com/whit537/2411be1bb1037d4e6cfb15310f25715f

mattbk commented 8 years ago

Comments sound good so far, can't test until tonight at earliest.

Here's a diff between v1 and v2 in cc11356:

Should I be using this information for something?

chadwhitacre commented 8 years ago

Should I be using this information for something?

Nope. That's just FYI at this point—mostly for me and @kaguillera as we review this. :)

Comments sound good, can't test until tonight at earliest.

More comments coming (probably). I will update the punchlist and let you know when I'm done reviewing. :)

chadwhitacre commented 8 years ago

Alright, @mattbk. I'm ready to merge this if you are. Even if we end up going a different direction on #103 with more of a Gumroad-style button, this work is basically done and is an improvement over having nothing for 2.0 widgets.

mattbk commented 8 years ago

:+1: