1.8.0 • Published 6 months ago

peertube-plugin-premium-users v1.8.0

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

PeerTube plugin premium users

About

This plugin will add a video field where uploaders can choose whether the video is a premium video or not. Premium videos will only be shown for paid users, other users will see a preselected default video. To become a premium user a user has to go to My account > Premium and click "Subscribe to become a premium user". He will then be redirected to Stripe and when the checkout is complete he's a premium user.

How to manually add premium users

  1. Login to Stripe dashboard.
  2. Go to Customers.
  3. Open the customer you want to add as premium.
  4. Click on add subscription.
  5. Select the product.
  6. At "Bill yearly/monthly starting", select the date where the billing should start.

Manually add premium user

Prerequisites

  • Stripe API key.
  • Stripe webhook listening for checkout.session.completed, customer.subscription.created, invoice.paid and invoice.payment_failed pointed to {PEERTUBE_URL}/plugins/premium-users/router/stripe-webhook.
  • Stripe product whom premium users will subscribe to.
  • Replacement video to be shown for non-premium users.

TODO:

  • ~Support for cancel subscriptions.~
  • ~Remove payments from DB and get from API instead.~
  • ~Create checkout from API instead of static URL.~
  • ~Support change payment method.~
  • ~Listen to webhook to know when subscription has ended.~
  • Verify paymentStatus is accurate upon GET /subscriptions
  • ~Change storage to Postgres~
  • ~Add Google Analytics support.~
  • Notify user about a failed payment.

Demo / testing

Prerequisites:

  • Copy demo/.env.stripe_example to demo/.env.stripe and fill in your Stripe API token for test environment.

  • cd demo

  • STRIPE_API_KEY=sk_test... npm start
  • open http://localhost:9000

Run e2e tests

  • npx playwright install --with-deps
  • npx playwright test

Development

Run GH actions locally

act -s STRIPE_API_KEY=sk_test_... --artifact-server-path /tmp/artifacts

1.8.0

6 months ago

1.7.0

9 months ago

1.6.3

9 months ago

1.6.2

10 months ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.2.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago