Closed nilofer closed 4 years ago
Could use GitHub Sponsors or go through Paypal. Other options?
Stripe is also a widely use payment gateway, they're pretty popular. Both PayPal and Stripe are widely used. I've never used GitHub sponsors but I'll look into it to see which of the 3 is the most befitting option.
Regarding payments, I’d recommend that we use GitHub Sponsors existing flow (rather than Stripe or PayPal).
I assessed 3 options: 1) GitHub Sponsors 2) PayPal and 3) Stripe.
I chose GitHub sponsors primarily because it allows us to leverage GitHub’s existing legwork with payments which, from my experience, is not trivial. After reading through their docs, I discovered that GitHub sponsors actually sitting on top of Stripe Connect.
Additionally, they absorb/handle the processing fees and they don’t charge a fee to facilitate this. Their decision to absorb the fees is great and is also very, very rare! I feel this shows their commitment to making sure developers get paid.
Since the buyers are billed monthly (along w/ all of their other subscriptions), this leads me to believe that Developers won’t receive payment until the end of the month, when it’s all aggregated. Not sure how they’ll feel about this, might be a hit or a miss. Might be fine, but might be something we to suggest to GitHub to alter (in our hackathon video) specifically for GitHub Experts. Only after user research.
I’ve used PayPal (for multi-party payments) in my first startup and Stripe (for direct payments) in my second. Handling payments for a marketplace a.k.a. multiparty payments, can be more challenging especially when compared with direct payments because, e.g. you’re dealing with setting rules for how to money flows between 3 total parties (You, your sellers and the buyers) as well as other issues like who is responsible for settling disputes on chargebacks, etc.
https://stripe.com/connect Developer docs: https://stripe.com/docs/connect
https://www.paypal.com/us/webapps/mpp/partner-marketplaces Developer docs: https://developer.paypal.com/docs/platforms/
Action Item for @nwams :
@WilliamMortlMicrosoft will be pairing with @nwams on this work
Great discussion today Will!
@WilliamMortlMicrosoft Action Items
[ ] Explore whether GitHub exposes an API that shows if someone is already sponsoring you. If so, the badge can be showed somehow. Also there can be a Donate Time button shown on the payments screen that'll allow us to circumvent the rigor of demoing payments in great detail.
[x] Explore whether Stripe Connect API allows for Escrow payments (where payment is released upon completion of video chat). Decide whether to use Escrow (one-off) payments or Tiered Recurring Subscriptions.
We can change the subscription level per month: https://stripe.com/docs/billing/subscriptions/change
Also, I have code samples:
https://stripe.com/docs/payments#build-your-own https://github.com/stripe-samples
All APIs: https://stripe.com/docs/api
How to check on customer: https://stripe.com/docs/api/customers
This should be sufficient to check if a person sponsors someone
Might be the secret sauce: https://github.com/stripe-samples/subscription-use-cases/tree/master/usage-based-subscriptions
Here's the payment flow (I created 3 diagrams, attached):
Screen 1
Screen 2
Screen 3
What Stripe Service to Use. Use Stripe Connect’s Destination charges. For example, Destination charges are typically used in ride-hailing services like Lyft. Use case: Customers transact with your platform (GitHub) for services provided by your user (Expert).
Technical Implementation. Here’s how it works behind-the-scenes. GitHub will create a charge on GitHub’s platform’s account so the payment appears as a charge on your account. Then, GitHub determines whether some or all of those funds are transferred to the connected account. GitHub’s account balance will be debited for the cost of the Stripe fees, refunds, and chargebacks. Docs: https://stripe.com/docs/connect/collect-then-transfer-guide
Holding payments. Payments can be held in an escrow-like behavior and are released when video chat ends using transfer_groups. We will hold funds in GitHub balance before sending them to Experts accounts.
In order to get the sponsors for a particular Github user, you need to execute the following GraphQL query:
query {
user(login: "prophen") {
id
sponsorsListing {
id
fullDescription
}
sponsorshipsAsMaintainer(first:100) {
edges {
node {
tier {
id
__typename
}
sponsorEntity{
__typename
... on User {
name
url
}
}
privacyLevel
createdAt
}
}
}
}
}
This query gets the sponsors for Github user "prophen" and displays the following response (to change the query to another user, replace "prophen" with that person's Github user name):
{
"data": {
"user": {
"id": "MDQ6VXNlcjM5NDE4NTY=",
"sponsorsListing": {
"id": "MDE1OlNwb25zb3JzTGlzdGluZzEwNzQw",
"fullDescription": "My work is about creating opportunities for technologists like myself who are just getting started in their tech careers.\n\nI recognize from experience the extra effort it takes to get a great start when you are dealing with financial hardships and a number of non-negotiable adult responsibilities.\n\nWhen you sponsor me, you allow me the mental space to do my work to the best of my ability.\n\nThank you ❤️\n"
},
"sponsorshipsAsMaintainer": {
"edges": [
{
"node": {
"tier": null,
"sponsorEntity": {
"__typename": "User",
"name": "Thomas Reynolds",
"url": "https://github.com/tdreyno"
},
"privacyLevel": "PUBLIC",
"createdAt": "2020-07-25T23:33:20Z"
}
},
{
"node": {
"tier": null,
"sponsorEntity": {
"__typename": "User",
"name": "Ryan Florence",
"url": "https://github.com/ryanflorence"
},
"privacyLevel": "PUBLIC",
"createdAt": "2020-07-07T16:59:29Z"
}
},
{
"node": {
"tier": null,
"sponsorEntity": {
"__typename": "User",
"name": "Max Desiatov",
"url": "https://github.com/MaxDesiatov"
},
"privacyLevel": "PUBLIC",
"createdAt": "2020-06-28T01:15:55Z"
}
},
...
]
}
}
}
}
You can pare the query down to remove resulting data that you don't need.
The GraphQL endpoint for V4 of the Github API is:
https://api.github.com/graphql
rather than using curl to explore V4 of the GraphQL API, you can also use the easy to use query explorer:
https://developer.github.com/v4/explorer/
Of special note, V3 of the API is a conventional REST api but does not seem to export any functionality to query sponsorships.
Could use GitHub Sponsors or go through Paypal. Other options?