update subscription algorithm
This commit is contained in:
@@ -41,7 +41,7 @@ export async function handlePaypalWebhook(event: any) {
|
||||
|
||||
export async function initCharge(reservationId: string, companyId: string, body: {
|
||||
provider: 'AMANPAY' | 'PAYPAL'; type: 'CHARGE' | 'DEPOSIT'
|
||||
currency: 'MAD' | 'USD' | 'EUR'; successUrl: string; failureUrl: string
|
||||
currency: 'MAD'; successUrl: string; failureUrl: string
|
||||
}) {
|
||||
const reservation = await repo.findReservationOrThrow(reservationId, companyId)
|
||||
if (reservation.paymentStatus === 'PAID') throw new ConflictError('Reservation is already fully paid')
|
||||
|
||||
Reference in New Issue
Block a user