alexmorrisnz / moodle-paygw_stripe

https://moodle.org/plugins/paygw_stripe
10 stars 12 forks source link

Stripe `application_fee_amount` per-course support (Platform Fee): w/ Course Fee set per-educator #14

Open lsthompson opened 1 year ago

lsthompson commented 1 year ago

G'day from over the ditch!

Is there any chance that you'd consider (and could use our help) building in support for application fees? Which also means support for storing multiple Stripe acct_ identifiers, for each relevant transfer destination.

This is for the case of an online platform (Moodle) which charges a fee for service, which would be set at product-level. We should consider application_fee_amount, as this has the inner mechanics already worked out for this use-case.

// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
$stripe = new \Stripe\StripeClient('sk_test_NLSWiAT3rEo0Er1FeoqB0X1E');

$stripe->paymentIntents->create([
  'amount' => 300,
  'currency' => 'aud',
  'application_fee_amount' => 30,
  'transfer_data' => ['destination' => '{{CONNECTED_ACCOUNT_ID}}'],
]);

This would be configurable per-course and allows for the LMS operator to control the application/platform fee per-course, and from there the remaining funds (majority of them typically) goes to the designated Stripe account.

Cheers, Luke

alexmorrisnz commented 1 year ago

Hi @lsthompson

It is not a feature I've considered before, it's unlikely I'll look into this any time before 2024 as my personal time is focused elsewhere at the moment

The plugin (apart from sponsored features) is developed in my free time, paid work for this feature to guarantee it is implemented will need to be arranged through my employer @catalyst You can contact Dan dan@catalyst.net.nz if you are interested

Thanks

lsthompson commented 1 year ago

I've updated the OP now to reflect application_fee_amount likely being the most practical and relevant approach.