-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #674 from bigcapitalhq/clean-up-payment-links-endp…
…oints feat: Clean up payment links endpoints
- Loading branch information
Showing
14 changed files
with
183 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/server/src/services/PaymentLinks/PaymentLinksApplication.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Inject, Service } from 'typedi'; | ||
import { GetInvoicePaymentLinkMetadata } from './GetInvoicePaymentLinkMetadata'; | ||
import { CreateInvoiceCheckoutSession } from './CreateInvoiceCheckoutSession'; | ||
import { StripeInvoiceCheckoutSessionPOJO } from '@/interfaces/StripePayment'; | ||
|
||
@Service() | ||
export class PaymentLinksApplication { | ||
@Inject() | ||
private getInvoicePaymentLinkMetadataService: GetInvoicePaymentLinkMetadata; | ||
|
||
@Inject() | ||
private createInvoiceCheckoutSessionService: CreateInvoiceCheckoutSession; | ||
|
||
/** | ||
* Retrieves the invoice payment link. | ||
* @param {string} paymentLinkId | ||
* @returns {} | ||
*/ | ||
public getInvoicePaymentLink(paymentLinkId: string) { | ||
return this.getInvoicePaymentLinkMetadataService.getInvoicePaymentLinkMeta( | ||
paymentLinkId | ||
); | ||
} | ||
|
||
/** | ||
* Create the invoice payment checkout session from the given payment link id. | ||
* @param {string} paymentLinkId - Payment link id. | ||
* @returns {Promise<StripeInvoiceCheckoutSessionPOJO>} | ||
*/ | ||
public createInvoicePaymentCheckoutSession( | ||
paymentLinkId: string | ||
): Promise<StripeInvoiceCheckoutSessionPOJO> { | ||
return this.createInvoiceCheckoutSessionService.createInvoiceCheckoutSession( | ||
paymentLinkId | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.