adonis-stripe
adonis-stripe copied to clipboard
AdonisJS 6
Adonis V6 got released on the 24th of january, it'd be great if you make this package compatible :)
There is a package migration guide
Is the repository is dead? No sign of any activity...
@IceCrew-Source Looks like it...
It's been a month now, I might have to make a fork and make it compatible myself
Unless there is another stripe package for adonis v6?
I've been quite busy lately. This is currently been worked on. Expect a new version to be tagged in the coming week.
Hey @ammezie, have you already gotten around to work on this? 🙌
@CodingDive I found out you don't really need this package, you can achieve the same thing by installing the official stripe package and making a provider and service in your adonisjs app
stripe_provider.ts
import env from '#start/env';
import type { ApplicationService } from '@adonisjs/core/types'
import Stripe from 'stripe';
declare module '@adonisjs/core/types' {
export interface ContainerBindings {
'stripe.manager': Stripe
}
}
export default class StripeProvider {
constructor(protected app: ApplicationService) {}
/**
* Register bindings to the container
*/
register() {
this.app.container.singleton('stripe.manager', () => {
return new Stripe(env.get('STRIPE_SECRET_KEY')!, {
apiVersion: '2024-04-10',
});
});
}
}
stripe_service.ts
import app from '@adonisjs/core/services/app';
const stripe = await app.container.make('stripe.manager');
export { stripe as default }
And then you can use it like normally, for example
import stripe from '#services/stripe_service';
//...
async foo()
{
const activeSubs = await stripe.subscriptions.list({
status: 'active'
});
return activeSubs;
}