зеркало из https://github.com/mozilla/fxa.git
Merge pull request #17575 from mozilla/fix-nextjsactions-validation
fix(payments): failed validation does not reject
This commit is contained in:
Коммит
ed7019cd86
|
@ -34,7 +34,7 @@ export class NextJSActionsService {
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async getCart(args: GetCartActionArgs) {
|
async getCart(args: GetCartActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
const cart = await this.cartService.getCart(args.cartId);
|
const cart = await this.cartService.getCart(args.cartId);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateCart(args: UpdateCartActionArgs) {
|
async updateCart(args: UpdateCartActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
await this.cartService.updateCart(
|
await this.cartService.updateCart(
|
||||||
args.cartId,
|
args.cartId,
|
||||||
|
@ -52,7 +52,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async restartCart(args: RestartCartActionArgs) {
|
async restartCart(args: RestartCartActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
const cart = await this.cartService.restartCart(args.cartId);
|
const cart = await this.cartService.restartCart(args.cartId);
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setupCart(args: SetupCartActionArgs) {
|
async setupCart(args: SetupCartActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
const cart = await this.cartService.setupCart({
|
const cart = await this.cartService.setupCart({
|
||||||
...args,
|
...args,
|
||||||
|
@ -70,7 +70,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async finalizeCartWithError(args: FinalizeCartWithErrorArgs) {
|
async finalizeCartWithError(args: FinalizeCartWithErrorArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
await this.cartService.finalizeCartWithError(
|
await this.cartService.finalizeCartWithError(
|
||||||
args.cartId,
|
args.cartId,
|
||||||
|
@ -79,7 +79,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getPayPalCheckoutToken(args: GetPayPalCheckoutTokenArgs) {
|
async getPayPalCheckoutToken(args: GetPayPalCheckoutTokenArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
const token = await this.checkoutTokenManager.get(args.currencyCode);
|
const token = await this.checkoutTokenManager.get(args.currencyCode);
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkoutCartWithPaypal(args: CheckoutCartWithPaypalActionArgs) {
|
async checkoutCartWithPaypal(args: CheckoutCartWithPaypalActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
await this.cartService.checkoutCartWithPaypal(
|
await this.cartService.checkoutCartWithPaypal(
|
||||||
args.cartId,
|
args.cartId,
|
||||||
|
@ -98,7 +98,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkoutCartWithStripe(args: CheckoutCartWithStripeActionArgs) {
|
async checkoutCartWithStripe(args: CheckoutCartWithStripeActionArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
await this.cartService.checkoutCartWithStripe(
|
await this.cartService.checkoutCartWithStripe(
|
||||||
args.cartId,
|
args.cartId,
|
||||||
|
@ -109,7 +109,7 @@ export class NextJSActionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchCMSData(args: FetchCMSDataArgs) {
|
async fetchCMSData(args: FetchCMSDataArgs) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
const offering = await this.productConfigurationManager.fetchCMSData(
|
const offering = await this.productConfigurationManager.fetchCMSData(
|
||||||
args.offeringId,
|
args.offeringId,
|
||||||
|
@ -123,7 +123,7 @@ export class NextJSActionsService {
|
||||||
* @@todo: Emit event using Emittery. To be added as part of FXA-10087
|
* @@todo: Emit event using Emittery. To be added as part of FXA-10087
|
||||||
*/
|
*/
|
||||||
async recordGleanEvent(args: RecordGleanEvent) {
|
async recordGleanEvent(args: RecordGleanEvent) {
|
||||||
new Validator().validateOrReject(args);
|
await new Validator().validateOrReject(args);
|
||||||
|
|
||||||
// Temporary ignore until Emittery logic is added
|
// Temporary ignore until Emittery logic is added
|
||||||
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
|
Загрузка…
Ссылка в новой задаче