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 proxy #255

Merged
merged 5 commits into from
Sep 8, 2023
Merged

Conversation

martijnvdbrug
Copy link
Member

@martijnvdbrug martijnvdbrug commented Sep 8, 2023

Description

  • Added a proxy function for retrieving created subscriptions in the current channel.
  • The function proxies incoming arguments to the Stripe client. See available parameters here: https://stripe.com/docs/api/subscriptions/list
  • Example usage:
import { StripeSubscriptionService } from `@pinelab/vendure-plugin-stripe-subscriptions`;

// There are multiple ways to onbtain an injector instance in your current context. See https://docs.vendure.io/typescript-api/common/injector/
injector.get(StripeSubscriptionService).getAllSubscriptions(ctx);

// Or, get a single subscription
injector.get(StripeSubscriptionService).getSubscription(ctx, 'sub_1No3b9225jfF0VNwOedpxA2l');
  • StripeClient can now be obtained with just a RequestContext, no order ID needed anymore.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains only a single feature. (Split into multiple PR's if needed)
  • I have reviewed my own PR, fixed all typo's and removed unused/commented code

⚡ Most of the time:

  • I have added or updated test cases for important functionality
  • I have updated the README if needed

📦 For publishable packages:

@martijnvdbrug martijnvdbrug marked this pull request as ready for review September 8, 2023 12:17
@martijnvdbrug martijnvdbrug merged commit 7d1e609 into main Sep 8, 2023
25 checks passed
@martijnvdbrug martijnvdbrug deleted the feat/stripe-subscription-proxy branch September 8, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant