Files
overleaf-cep/services/web/app/src/Features/Subscription/Errors.js
Liangjun Song b8da04078d Merge pull request #28851 from overleaf/ls-collect-business-details-in-stripe-elements
Collect business details in Stripe Elements

GitOrigin-RevId: 5a3affd1916b2ba659e007a7c25f64879899fd1a
2025-10-09 08:08:28 +00:00

79 lines
1.8 KiB
JavaScript

// @ts-check
const Errors = require('../Errors/Errors')
const OError = require('@overleaf/o-error')
class RecurlyTransactionError extends Errors.BackwardCompatibleError {
constructor(options) {
super({
message: 'Unknown transaction error',
...options,
})
}
}
class DuplicateAddOnError extends OError {}
class AddOnNotPresentError extends OError {}
class MissingBillingInfoError extends OError {}
class ManuallyCollectedError extends OError {}
class PendingChangeError extends OError {}
class InactiveError extends OError {}
class SubtotalLimitExceededError extends OError {}
class HasPastDueInvoiceError extends OError {}
class HasNoAdditionalLicenseWhenManuallyCollectedError extends OError {}
class InvalidTaxIdError extends OError {}
/**
* @typedef {Object} PaymentActionRequiredInfo
* @property {string} PaymentActionRequiredInfo.clientSecret
* @property {string} PaymentActionRequiredInfo.publicKey
*/
class PaymentActionRequiredError extends OError {
/**
* @param {PaymentActionRequiredInfo} info
*/
constructor(info) {
super('Payment action required', info)
}
}
/**
* @typedef {Object} PaymentFailedInfo
* @property {string} PaymentFailedInfo.subscriptionId
* @property {string} PaymentFailedInfo.reason
* @property {string} PaymentFailedInfo.adviceCode
*/
class PaymentFailedError extends OError {
/**
* @param {PaymentFailedInfo} info
*/
constructor(info) {
super('Failed to process payment', info)
}
}
module.exports = {
RecurlyTransactionError,
DuplicateAddOnError,
AddOnNotPresentError,
PaymentActionRequiredError,
PaymentFailedError,
MissingBillingInfoError,
ManuallyCollectedError,
PendingChangeError,
InactiveError,
SubtotalLimitExceededError,
HasPastDueInvoiceError,
HasNoAdditionalLicenseWhenManuallyCollectedError,
InvalidTaxIdError,
}