From 06048ebe0c67164a4b942cb77e2bdf5d7de9a45e Mon Sep 17 00:00:00 2001 From: Florent Letendre Date: Wed, 13 Sep 2023 13:30:31 -0400 Subject: [PATCH] refactor: change header from deprecated Content-language to Accept-Language (#17830) CXSPA-4688 --- .../opf/base/occ/adapters/occ-opf.adapter.ts | 12 ++++++------ .../opf/checkout/occ/adapters/occ-opf.adapter.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/integration-libs/opf/base/occ/adapters/occ-opf.adapter.ts b/integration-libs/opf/base/occ/adapters/occ-opf.adapter.ts index 1612b32032d..4a7fd013811 100644 --- a/integration-libs/opf/base/occ/adapters/occ-opf.adapter.ts +++ b/integration-libs/opf/base/occ/adapters/occ-opf.adapter.ts @@ -7,24 +7,24 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { - backOff, ConverterService, + backOff, isJaloError, normalizeHttpError, } from '@spartacus/core'; import { - OpfEndpointsService, - OpfPaymentAdapter, OPF_PAYMENT_SUBMIT_COMPLETE_NORMALIZER, OPF_PAYMENT_SUBMIT_NORMALIZER, OPF_PAYMENT_VERIFICATION_NORMALIZER, + OpfEndpointsService, + OpfPaymentAdapter, } from '@spartacus/opf/base/core'; import { + OPF_CC_OTP_KEY, + OPF_CC_PUBLIC_KEY, OpfConfig, OpfPaymentVerificationPayload, OpfPaymentVerificationResponse, - OPF_CC_OTP_KEY, - OPF_CC_PUBLIC_KEY, SubmitCompleteRequest, SubmitCompleteResponse, SubmitRequest, @@ -46,7 +46,7 @@ export class OccOpfPaymentAdapter implements OpfPaymentAdapter { header: { [name: string]: string } = { accept: 'application/json', 'Content-Type': 'application/json', - 'Content-Language': 'en-us', + 'Accept-Language': 'en-us', }; verifyPayment( diff --git a/integration-libs/opf/checkout/occ/adapters/occ-opf.adapter.ts b/integration-libs/opf/checkout/occ/adapters/occ-opf.adapter.ts index dce23e0879d..4f99e95d86f 100644 --- a/integration-libs/opf/checkout/occ/adapters/occ-opf.adapter.ts +++ b/integration-libs/opf/checkout/occ/adapters/occ-opf.adapter.ts @@ -75,7 +75,7 @@ export class OccOpfAdapter implements OpfAdapter { paymentConfig: PaymentInitiationConfig ): Observable { const headers = new HttpHeaders({ - 'Content-Language': 'en-us', + 'Accept-Language': 'en-us', }) .set(OPF_CC_PUBLIC_KEY, this.config.opf?.commerceCloudPublicKey || '') .set(OPF_CC_OTP_KEY, paymentConfig?.otpKey || '');