Created
April 8, 2019 06:23
-
-
Save jermsam/19e5a0573e183c37927ae4903d988535 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Below is the explanation that would accompany that diagram... (hope it answers all preceding questions) | |
| ... 1st and foremost, I am planning to use both subscriptions and one time checkout .... | |
| My implementation: | |
| 1. I am storing info about students in my database (i do not intend to put money on students bank accounts and so they are not direct stripe customers). The information I am storing for students include the goal (the total amount they want to collect-our threshold if you may call it) and the collection (of how much money has been donated to that specific student's campaign) as such, no card information is required from students. | |
| 2. then we have donors (which could include any one on earth) ... I am not storing any of their information yet in the database according to my current implementation. As such, they do not have to log in (they can donate anonymously). All they do is go to the students profile and find a donate button to click on. When they do, a checkout form pops up to collect the donors card information (in a sense that would make them my stripe customers but remember they are not customers in my implementation currently) in addition to the amount they are donating. | |
| 3. I have info about financial advisers in my database (these are stripe customers and as such i am storing customerId and subscriptionId as part of the fields in their DB table). These subscribe to any available plan on the platform (stripe cuts off its money) and rest is kept on my stripe account (to the section I called card for company money)*** | |
| My payment flow: | |
| 1. Let's consider StudentA getting a donation from an anonymous donor of $100 ... this donor checks out as explained in section above, assuming the details pass basic validation,Checkout sends the payment details directly to Stripe from the student's profile Stripe returns a token to Checkout. Checkout takes the returned token and submits it to server for my implementation which charges the card. Once the donors card is charged, donor is notified and goes his way, but, after stripe gets off its transaction fee, the rest of the collected money goes to my stripe account (to the section I called card for student donations)***, the student collection (described in preceding section) is then incremented by the amount that goes to my stripe account (let say that is $98 by now). | |
| *** now here is the major confusion *** | |
| 2. I have student subscription plans in my implementation that depend on whether or not a student has a financial adviser. (Both of which have a usage_type=licensed). From diagram, these are called Subscription 1 (represented by orange curve) and Subscription 2 (represented by green card) respectively. At the end of the billing cycle, I expect stripe to get the total number of donations on students without financial advisers ( n & m respectively in diagram)* the subscription amount for that plan ($4 and $2 respectively in diagram) and send it from the section I called card for student donations*** to the section I called card for company money*** and then respectively send webhooks for invoice.payment_succeeded that will affect the student collection as illustrated in the diagram above such that if StudentA does not have a FA and received only the $100 the entire month, their collection increment becomes $98-$4*1=$94... and $98-$2*1=$96 if he has a Financial adviser. Another student that got 10 donations amounting to $100 that month ends up with $98-$4*10=$58 or $98-$2*10=$78 collection increment respectively depending on whether they have a financial adviser respectively. | |
| The part I have not implemented or even plan to do manually for the start | |
| 3. Once any student's total collection reaches their goal (the threshold) then their FA can transfer the money to desired account if they have one or I do that if they dont. | |
| Hope this makes sense. Kindly let me know whether you still need clarification please. Looking forward to hear from you soon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment