|
@@ -1,3 +1,5 @@
|
|
|
|
|
+// @ts-check
|
|
|
|
|
+
|
|
|
const Errors = require('../Errors/Errors')
|
|
const Errors = require('../Errors/Errors')
|
|
|
const OError = require('@overleaf/o-error')
|
|
const OError = require('@overleaf/o-error')
|
|
|
|
|
|
|
@@ -28,17 +30,41 @@ class HasPastDueInvoiceError extends OError {}
|
|
|
|
|
|
|
|
class HasNoAdditionalLicenseWhenManuallyCollectedError extends OError {}
|
|
class HasNoAdditionalLicenseWhenManuallyCollectedError extends OError {}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * @typedef {Object} PaymentActionRequiredInfo
|
|
|
|
|
+ * @property {string} PaymentActionRequiredInfo.clientSecret
|
|
|
|
|
+ * @property {string} PaymentActionRequiredInfo.publicKey
|
|
|
|
|
+ */
|
|
|
class PaymentActionRequiredError extends OError {
|
|
class PaymentActionRequiredError extends OError {
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param {PaymentActionRequiredInfo} info
|
|
|
|
|
+ */
|
|
|
constructor(info) {
|
|
constructor(info) {
|
|
|
super('Payment action required', 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 = {
|
|
module.exports = {
|
|
|
RecurlyTransactionError,
|
|
RecurlyTransactionError,
|
|
|
DuplicateAddOnError,
|
|
DuplicateAddOnError,
|
|
|
AddOnNotPresentError,
|
|
AddOnNotPresentError,
|
|
|
PaymentActionRequiredError,
|
|
PaymentActionRequiredError,
|
|
|
|
|
+ PaymentFailedError,
|
|
|
MissingBillingInfoError,
|
|
MissingBillingInfoError,
|
|
|
ManuallyCollectedError,
|
|
ManuallyCollectedError,
|
|
|
PendingChangeError,
|
|
PendingChangeError,
|