mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat: Stripe payment checkout session
This commit is contained in:
@@ -4,6 +4,8 @@ import { CreateStripeAccountService } from '@/api/controllers/StripeIntegration/
|
||||
import { CreateStripeAccountDTO } from '@/api/controllers/StripeIntegration/types';
|
||||
import { SaleInvoiceStripePaymentLink } from './SaleInvoiceStripePaymentLink';
|
||||
import { DeleteStripePaymentLinkInvoice } from './DeleteStripePaymentLinkInvoice';
|
||||
import { CreateInvoiceCheckoutSession } from './CreateInvoiceCheckoutSession';
|
||||
import { StripeInvoiceCheckoutSessionPOJO } from '@/interfaces/StripePayment';
|
||||
|
||||
export class StripePaymentApplication {
|
||||
@Inject()
|
||||
@@ -15,6 +17,9 @@ export class StripePaymentApplication {
|
||||
@Inject()
|
||||
private deleteStripePaymentLinkInvoice: DeleteStripePaymentLinkInvoice;
|
||||
|
||||
@Inject()
|
||||
private createSaleInvoiceCheckoutSessionService: CreateInvoiceCheckoutSession;
|
||||
|
||||
/**
|
||||
* Creates a new Stripe account for Bigcapital.
|
||||
* @param {number} tenantId
|
||||
@@ -49,6 +54,22 @@ export class StripePaymentApplication {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the Stripe checkout session from the given sale invoice.
|
||||
* @param {number} tenantId
|
||||
* @param {string} paymentLinkId
|
||||
* @returns {Promise<StripeInvoiceCheckoutSessionPOJO>}
|
||||
*/
|
||||
public createSaleInvoiceCheckoutSession(
|
||||
tenantId: number,
|
||||
paymentLinkId: number
|
||||
): Promise<StripeInvoiceCheckoutSessionPOJO> {
|
||||
return this.createSaleInvoiceCheckoutSessionService.createInvoiceCheckoutSession(
|
||||
tenantId,
|
||||
paymentLinkId
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the Stripe payment link associated with the given sale invoice.
|
||||
* @param {number} tenantId - Tenant id.
|
||||
|
||||
Reference in New Issue
Block a user