Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payments #52

Merged
merged 40 commits into from
Apr 29, 2020
Merged

Payments #52

merged 40 commits into from
Apr 29, 2020

Conversation

jones-sam
Copy link
Collaborator

Overview

I have implemented a payment system using stripe. Users can now bid and accept payments for tasks.

Configuration

You must run bundle, migrate the db, as well as seed. You also have to set up all the Stripe environment variables, check the README.

Details

  • Connected Stripe
  • Added payment model
  • Added bid to help
  • Added money_rails gem
  • And much more!

A user can:

  • bid on a task if they have a payment method setup
  • sign up for a stripe connect account to accept payments from other users
  • make a payment to a user who has applied to their task using a credit card
  • view their stripe account details (expected payouts, account info, etc)

I still need to test a bit more, as well as adding more pundit rules, and there is a parameter "state" that I pass to the stripe api, and right now it is not secure.

I will open this as a draft for now, but it is pretty much done. I also added a bunch of TODO's for stuff I think needs done 😉👌

Screenshots

image

image

image

image

image

@gabrielecanepa gabrielecanepa marked this pull request as ready for review April 27, 2020 15:07
@gabrielecanepa gabrielecanepa added the changes requested Don't merge yet, some changes are needed label Apr 27, 2020
@gabrielecanepa
Copy link
Contributor

Payments

@todo
Copy link

todo bot commented Apr 28, 2020

set up a transfer if the user already has a stripe account (this will be easier, since you won't have to enter your info)

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/controllers/tasks_controller.rb#L64-L69


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

Check to see what happens if user doesn't have an avatar

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/controllers/tasks_controller.rb#L71-L76


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

Once we implement a chat feature we should redirect there instead of directly to the payment

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/controllers/tasks_controller.rb#L90-L95


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

@todo
Copy link

todo bot commented Apr 28, 2020

Style the "Choose File" button %>

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/views/devise/registrations/edit.html.erb#L17-L21


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

We might also want to have this somewhere in the dashboard %>

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/views/devise/registrations/edit.html.erb#L43-L48


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

This is just a basic view, feel free to completely change it %>

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/views/payments/show.html.erb#L1-L6


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

@todo
Copy link

todo bot commented Apr 28, 2020

add more stripe_user[] fields to url, to fill out location https://stripe.com/docs/connect/oauth-reference#prefill-fields %>

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/views/shared/_task_modal.html.erb#L96-L101


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

This bid input needs to be deisgned better, and I was also having some issues with the bid appearing as 0 when it was not supposed to be %>

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/app/views/shared/_task_modal.html.erb#L105-L110


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

Add notifications to let the other party know when a transation goes through

https://github.com/localhelp/findlocal.help/blob/e037081e893ed11d5ef039ae6f01bcccc4cbdb9d/config/initializers/stripe.rb#L15


This comment was generated by todo based on a TODO comment in e037081 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

set up a transfer if the user already has a stripe account (this will be easier, since you won't have to enter your info)

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/controllers/tasks_controller.rb#L64-L69


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

Check to see what happens if user doesn't have an avatar

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/controllers/tasks_controller.rb#L71-L76


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

can this be secured further?

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/policies/payment_policy.rb#L13-L17


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

Style the "Choose File" button %>

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/views/devise/registrations/edit.html.erb#L17-L21


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

We might also want to have this somewhere in the dashboard %>

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/views/devise/registrations/edit.html.erb#L43-L48


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

This is just a basic view, feel free to completely change it %>

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/views/payments/show.html.erb#L1-L6


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

add more stripe_user[] fields to url, to fill out location https://stripe.com/docs/connect/oauth-reference#prefill-fields %>

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/views/shared/_task_modal.html.erb#L95-L100


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 28, 2020

This bid input needs to be deisgned better, and I was also having some issues with the bid appearing as 0 when it was not supposed to be %>

https://github.com/localhelp/findlocal.help/blob/b857c572b30f8ddf3e4575b23036a4b4b6d108dc/app/views/shared/_task_modal.html.erb#L104-L109


This comment was generated by todo based on a TODO comment in b857c57 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

We might also want to have this somewhere in the dashboard %>

https://github.com/localhelp/findlocal.help/blob/8d895695f4a57f1b55c5425c5080fdf6ed9520a8/app/views/devise/registrations/edit.html.erb#L43-L48


This comment was generated by todo based on a TODO comment in 8d89569 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This is just a basic view, feel free to completely change it %>

https://github.com/localhelp/findlocal.help/blob/8d895695f4a57f1b55c5425c5080fdf6ed9520a8/app/views/payments/show.html.erb#L1-L6


This comment was generated by todo based on a TODO comment in 8d89569 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

add more stripe_user[] fields to url, to fill out location https://stripe.com/docs/connect/oauth-reference#prefill-fields %>

https://github.com/localhelp/findlocal.help/blob/8d895695f4a57f1b55c5425c5080fdf6ed9520a8/app/views/shared/_task_modal.html.erb#L95-L100


This comment was generated by todo based on a TODO comment in 8d89569 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This bid input needs to be deisgned better, and I was also having some issues with the bid appearing as 0 when it was not supposed to be %>

https://github.com/localhelp/findlocal.help/blob/8d895695f4a57f1b55c5425c5080fdf6ed9520a8/app/views/shared/_task_modal.html.erb#L104-L109


This comment was generated by todo based on a TODO comment in 8d89569 in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

set up a transfer if the user already has a stripe account (this will be easier, since you won't have to enter your info)

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/controllers/tasks_controller.rb#L64-L69


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

Check to see what happens if user doesn't have an avatar

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/controllers/tasks_controller.rb#L71-L76


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

Style the "Choose File" button %>

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/views/devise/registrations/edit.html.erb#L17-L21


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

We might also want to have this somewhere in the dashboard %>

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/views/devise/registrations/edit.html.erb#L43-L48


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This is just a basic view, feel free to completely change it %>

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/views/payments/show.html.erb#L1-L6


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

add more stripe_user[] fields to url, to fill out location https://stripe.com/docs/connect/oauth-reference#prefill-fields %>

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/views/shared/_task_modal.html.erb#L95-L100


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This bid input needs to be deisgned better, and I was also having some issues with the bid appearing as 0 when it was not supposed to be %>

https://github.com/localhelp/findlocal.help/blob/8adba0be54cccd396321341ba89991208b19bed8/app/views/shared/_task_modal.html.erb#L104-L109


This comment was generated by todo based on a TODO comment in 8adba0b in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

set up a transfer if the user already has a stripe account (this will be easier, since you won't have to enter your info)

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/controllers/tasks_controller.rb#L66-L71


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

Style the "Choose File" button %>

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/views/devise/registrations/edit.html.erb#L17-L21


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

We might also want to have this somewhere in the dashboard %>

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/views/devise/registrations/edit.html.erb#L43-L48


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This is just a basic view, feel free to completely change it %>

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/views/payments/show.html.erb#L1-L6


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

add more stripe_user[] fields to url, to fill out location https://stripe.com/docs/connect/oauth-reference#prefill-fields %>

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/views/shared/_task_modal.html.erb#L95-L100


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

@todo
Copy link

todo bot commented Apr 29, 2020

This bid input needs to be deisgned better, and I was also having some issues with the bid appearing as 0 when it was not supposed to be %>

https://github.com/localhelp/findlocal.help/blob/c3a434e08d60b5288700609bbff745c7d3b4193a/app/views/shared/_task_modal.html.erb#L104-L109


This comment was generated by todo based on a TODO comment in c3a434e in #52. cc @localhelp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Don't merge yet, some changes are needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants