mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 23:20:47 +02:00
Merge pull request #27093 from overleaf/ls-support-3ds-in-group-plan-update-flows
Support 3DS verification in group plan update flows GitOrigin-RevId: 3206f612e5699f39ac44864daf6610da2956e6ca
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
SubtotalLimitExceededError,
|
||||
HasPastDueInvoiceError,
|
||||
HasNoAdditionalLicenseWhenManuallyCollectedError,
|
||||
PaymentActionRequiredError,
|
||||
} from './Errors.js'
|
||||
|
||||
/**
|
||||
@@ -273,6 +274,14 @@ async function createAddSeatsSubscriptionChange(req, res) {
|
||||
})
|
||||
}
|
||||
|
||||
if (error instanceof PaymentActionRequiredError) {
|
||||
return res.status(402).json({
|
||||
message: 'Payment action required',
|
||||
clientSecret: error.info.clientSecret,
|
||||
publicKey: error.info.publicKey,
|
||||
})
|
||||
}
|
||||
|
||||
logger.err(
|
||||
{ error },
|
||||
'error trying to create "add seats" subscription change'
|
||||
@@ -369,6 +378,13 @@ async function upgradeSubscription(req, res) {
|
||||
await SubscriptionGroupHandler.promises.upgradeGroupPlan(userId)
|
||||
return res.sendStatus(200)
|
||||
} catch (error) {
|
||||
if (error instanceof PaymentActionRequiredError) {
|
||||
return res.status(402).json({
|
||||
message: 'Payment action required',
|
||||
clientSecret: error.info.clientSecret,
|
||||
publicKey: error.info.publicKey,
|
||||
})
|
||||
}
|
||||
logger.err({ error }, 'error trying to upgrade subscription')
|
||||
return res.sendStatus(500)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user