Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stripe-subscription): Leaner, more extensible subscriptions #260

Merged
merged 26 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
241ac6c
feat(stripe-subscription): wip n creating a flexible extensible inter…
martijnvdbrug Sep 21, 2023
eec3145
Merge branch 'main' into feat/stripe-subscription-cleanup
martijnvdbrug Sep 28, 2023
d63b701
feat(stripe-subscription): new graphql schema
martijnvdbrug Sep 28, 2023
3886e26
Merge branch 'feat/order-client-loading-states' into feat/stripe-subs…
martijnvdbrug Sep 28, 2023
fdbd35f
feat(stripe-subscription): minor improv
martijnvdbrug Sep 28, 2023
743f033
Merge branch 'main' into feat/stripe-subscription-cleanup
martijnvdbrug Sep 29, 2023
2cc81d7
feat(stripe-subscription): wip
martijnvdbrug Sep 30, 2023
2bd32e6
feat(stripe-subscription): wip
martijnvdbrug Sep 30, 2023
2d8920f
feat(stripe-subscription): strategy interface definition changed
martijnvdbrug Oct 1, 2023
49c66d0
feat(stripe-subscription): wip adding downpayment to the strategy int…
martijnvdbrug Oct 19, 2023
fe3825a
feat(stripe-subscription): multiple subs per orderline
martijnvdbrug Oct 26, 2023
19e96cd
fix(stripe-subscription): ready for real test with stripe webhook
martijnvdbrug Oct 30, 2023
fa1013b
fix(stripe-subscription): tiny improvement
martijnvdbrug Oct 31, 2023
5f02ce2
fix(stripe-subscription): added correct webhook events
martijnvdbrug Oct 31, 2023
b67de7a
fix(stripe-subscription): register events atuomatically
martijnvdbrug Oct 31, 2023
6c6bbbe
fix: wip
martijnvdbrug Nov 1, 2023
53b1025
fix(stripe-subscription): finalized docs
martijnvdbrug Nov 1, 2023
32c74b0
fix(stripe-subscription): added example downpayment strategy
martijnvdbrug Nov 1, 2023
6c131d8
fix(stripe-subscription): downpayment example
martijnvdbrug Nov 1, 2023
f189b81
v2.0.0-beta-1
martijnvdbrug Nov 1, 2023
2a85a89
v2.0.0-beta-2
martijnvdbrug Nov 1, 2023
de5fcc3
feat(stripe-subscription): added e2e tests
martijnvdbrug Nov 2, 2023
dde7580
feat(stripe-subscription): version and changelog update
martijnvdbrug Nov 2, 2023
ec41aa5
feat(stripe-subscription): dev-server perpare nad readme typo
martijnvdbrug Nov 2, 2023
93951a7
feat(stripe-subscription): imports broken
martijnvdbrug Nov 2, 2023
0054c5e
feat(stripe-subscription): small cleanup
martijnvdbrug Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/vendure-plugin-stripe-subscription/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.0.0 (2023-11-02)

- Major refactor: ([#260](https://github.com/Pinelab-studio/pinelab-vendure-plugins/pull/260))
- Scheduling has been taken out of this plugin.
- By default product variants are seen as monthly subscriptions
- Custom subscriptions can be defined by implementing the SubscriptionStrategy interface

# 1.4.0 (2023-09-08)

- Expose proxy function to retrieve all subscriptions for current channel ([#255](https://github.com/Pinelab-studio/pinelab-vendure-plugins/pull/255))
Expand Down
510 changes: 240 additions & 270 deletions packages/vendure-plugin-stripe-subscription/README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/vendure-plugin-stripe-subscription/codegen.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
schema: 'src/**/*.ts'
documents: 'src/ui/queries.ts'
schema: 'src/api/graphql-schema.ts'
generates:
./src/ui/generated/graphql.ts:
./src/api/generated/graphql.ts:
plugins:
- typescript
- typescript-operations
- typed-document-node
config:
enumsAsTypes: true
avoidOptionals: false
scalars:
DateTime: Date
Expand Down
2 changes: 1 addition & 1 deletion packages/vendure-plugin-stripe-subscription/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinelab/vendure-plugin-stripe-subscription",
"version": "1.4.0",
"version": "2.0.0",
"description": "Vendure plugin for selling subscriptions via Stripe",
"author": "Martijn van de Brug <[email protected]>",
"homepage": "https://pinelab-plugins.com/",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { gql } from 'graphql-tag';

/**
* Needed for gql codegen
*/
const _codegenAdditions = gql`
scalar DateTime
scalar JSON
`;

export const shopSchemaExtensions = gql`
enum StripeSubscriptionInterval {
week
month
year
}

type StripeSubscription {
name: String!
variantId: ID!
amountDueNow: Int!
priceIncludesTax: Boolean!
recurring: StripeSubscriptionRecurringPayment!
}

type StripeSubscriptionRecurringPayment {
amount: Int!
interval: StripeSubscriptionInterval!
intervalCount: Int!
startDate: DateTime!
endDate: DateTime
}

enum StripeSubscriptionIntentType {
PaymentIntent
SetupIntent
}

type StripeSubscriptionIntent {
clientSecret: String!
intentType: StripeSubscriptionIntentType!
}

extend type PaymentMethodQuote {
stripeSubscriptionPublishableKey: String
}

extend type Query {
previewStripeSubscriptions(
productVariantId: ID!
customInputs: JSON
): [StripeSubscription!]!
previewStripeSubscriptionsForProduct(
productId: ID!
customInputs: JSON
): [StripeSubscription!]!
}

extend type Mutation {
createStripeSubscriptionIntent: StripeSubscriptionIntent!
}
`;

This file was deleted.

Loading
Loading