Closed anrddh closed 5 years ago
This is a good first part, but Stripe charges a different fee for credit card and bitcoin transactions. So the math needs to change depending on how the user pays for how much actually credit their account.
The new charge for Bitcoin is stored in the variable bitcoin_charge
, but I'm not sure how to make Stripe charge that amount for Bitcoin.
Acc to these docs (https://stripe.com/docs/bitcoin#using-stripejs), this is possible using a JavaScript library. Not sure if it's already being used elsewhere, or you'd like me to integrate it (I'd probably need some help if that, I'm not familiar with Django).
We currently just use Stripe checkout (https://stripe.com/docs/checkout) which is a simpler thing stripe built on top of stripe.js - I believe stripe has documentation on how to go from one to the other.
Betty is built on Pyramid ( https://trypyramid.com/ ) not Django, though I suspect the core ideas are similar.
I don't think any of the core betty folk have a ton of time to help out with software dev right now I'm afraid, but happy to keep giving pointers for you to move forward
On Wed, Feb 8, 2017 at 3:32 PM Aniruddh Agarwal notifications@github.com wrote:
The new charge for Bitcoin is stored in the variable bitcoin_charge, but I'm not sure how to make Stripe charge that amount for Bitcoin.
Acc to these docs (https://stripe.com/docs/bitcoin#using-stripejs), this is possible using a JavaScript library. Not sure if it's already being used elsewhere, or you'd like me to integrate it (I'd probably need some help if that, I'm not familiar with Django).
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/um-cseg/chez-betty/pull/301#issuecomment-278452531, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUt3trxTla4_Hfzi0RAQ155AejGghPCks5raiY_gaJpZM4L29r0 .
Moving from Stripe Checkout to Stripe.js will require building our own form. I'm looking for a workaround.
The easiest solution is to just make another button just for bitcoin. Lmk if that's what you want.
That seems like a fine solution.
Don't lose track of everything that'll need to change after the button too. It'll need to post to a different end point (i.e. not https://github.com/um-cseg/chez-betty/blob/44e052ca29f7c305549e76588b5d931150558d17/chezbetty/views_user.py#L196 ) and you'll need to make a variant of this https://github.com/um-cseg/chez-betty/blob/44e052ca29f7c305549e76588b5d931150558d17/chezbetty/utility.py#L326 that correctly validates the bitcoin fee, then a new transaction type https://github.com/um-cseg/chez-betty/blob/master/chezbetty/models/transaction.py#L666 -- I don't think the legacy BTCDeposit will work, probably too tied to the Coinbase API.
Once all that's in place, the next step is making sure all the analytics and cash reporting dashboards understand the new money pool.
210