зеркало из https://github.com/mozilla/fxa.git
fix(payments-stripe): Cleanup instances that expect nullish values returned from client
This commit is contained in:
Родитель
264a140026
Коммит
a4099a03be
|
@ -6,10 +6,7 @@ import { Injectable } from '@nestjs/common';
|
|||
|
||||
import { StripeClient } from './stripe.client';
|
||||
import { StripePrice } from './stripe.client.types';
|
||||
import {
|
||||
PlanIntervalMultiplePlansError,
|
||||
PlanNotFoundError,
|
||||
} from './stripe.error';
|
||||
import { PlanIntervalMultiplePlansError } from './stripe.error';
|
||||
import { SubplatInterval } from './stripe.types';
|
||||
import { doesPriceMatchSubplatInterval } from './util/doesPriceMatchSubplatInterval';
|
||||
|
||||
|
@ -19,7 +16,6 @@ export class PriceManager {
|
|||
|
||||
async retrieve(priceId: string) {
|
||||
const price = await this.client.pricesRetrieve(priceId);
|
||||
if (!price) throw new PlanNotFoundError();
|
||||
return price;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { StripeClient } from './stripe.client';
|
||||
import { ProductNotFoundError } from './stripe.error';
|
||||
|
||||
@Injectable()
|
||||
export class ProductManager {
|
||||
|
@ -13,7 +12,6 @@ export class ProductManager {
|
|||
|
||||
async retrieve(productId: string) {
|
||||
const product = await this.client.productsRetrieve(productId);
|
||||
if (!product) throw new ProductNotFoundError();
|
||||
return product;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,18 +30,6 @@ export class PlanIntervalMultiplePlansError extends StripeError {
|
|||
}
|
||||
}
|
||||
|
||||
export class PlanNotFoundError extends StripeError {
|
||||
constructor() {
|
||||
super('Plan not found');
|
||||
}
|
||||
}
|
||||
|
||||
export class ProductNotFoundError extends StripeError {
|
||||
constructor() {
|
||||
super('Product not found');
|
||||
}
|
||||
}
|
||||
|
||||
export class PromotionCodeCouldNotBeAttachedError extends StripeError {
|
||||
customerId?: string;
|
||||
subscriptionId?: string;
|
||||
|
|
Загрузка…
Ссылка в новой задаче