Skip to content

Commit

Permalink
Merge pull request #260 from Pinelab-studio/feat/stripe-subscription-…
Browse files Browse the repository at this point in the history
…cleanup

feat(stripe-subscription): Leaner, more extensible subscriptions
  • Loading branch information
martijnvdbrug authored Nov 2, 2023
2 parents dc89db3 + 0054c5e commit 2641e32
Show file tree
Hide file tree
Showing 46 changed files with 2,703 additions and 4,508 deletions.
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!
}
`;
182 changes: 0 additions & 182 deletions packages/vendure-plugin-stripe-subscription/src/api/graphql-schemas.ts

This file was deleted.

Loading

0 comments on commit 2641e32

Please sign in to comment.