diff --git a/src/app/core/facades/checkout.facade.ts b/src/app/core/facades/checkout.facade.ts index b5effb84ef2..ce42ac61012 100644 --- a/src/app/core/facades/checkout.facade.ts +++ b/src/app/core/facades/checkout.facade.ts @@ -36,6 +36,7 @@ import { updateBasketAddress, updateBasketItems, updateBasketShippingMethod, + updateConcardisCvcLastUpdated, } from 'ish-core/store/customer/basket'; import { getOrdersError, getSelectedOrder } from 'ish-core/store/customer/orders'; import { getLoggedInUser } from 'ish-core/store/customer/user'; @@ -172,4 +173,8 @@ export class CheckoutFacade { removePromotionCodeFromBasket(code: string) { this.store.dispatch(removePromotionCodeFromBasket({ code })); } + + updateConcardisCvcLastUpdated(paymentInstrument: PaymentInstrument) { + this.store.dispatch(updateConcardisCvcLastUpdated({ paymentInstrument })); + } } diff --git a/src/app/core/services/payment/payment.service.spec.ts b/src/app/core/services/payment/payment.service.spec.ts index ed5d8d89ed6..382496e3b2d 100644 --- a/src/app/core/services/payment/payment.service.spec.ts +++ b/src/app/core/services/payment/payment.service.spec.ts @@ -67,6 +67,26 @@ describe('Payment Service', () => { ], }; + const creditCardPaymentInstrument = { + id: 'UZUKgzzAppcAAAFzK9FDCMcG', + parameters: [ + { + name: 'paymentInstrumentId', + value: '****************************', + }, + { + name: 'cvcLastUpdated', + value: '2020-04-30T13:41:45Z', + }, + { + name: 'token', + value: 'payment_instrument_123', + }, + ], + paymentMethod: 'Concardis_CreditCard', + urn: 'urn:payment-instrument:basket:_3oKgzzAfGgAAAFzuFpDCMcE:UZUKgzzAppcAAAFzK9FDCMcG', + }; + beforeEach(() => { apiService = mock(ApiService); appFacade = mock(AppFacade); @@ -193,6 +213,22 @@ describe('Payment Service', () => { done(); }); }); + + it("should update payment instrument from basket when 'updateBasketPaymentInstrument' is called", done => { + when(apiService.patch(anyString(), anything(), anything())).thenReturn(of({})); + paymentService + .updateConcardisCvcLastUpdated(BasketMockData.getBasket(), creditCardPaymentInstrument) + .subscribe(() => { + verify( + apiService.patch( + `baskets/${BasketMockData.getBasket().id}/payment-instruments/${creditCardPaymentInstrument.id}`, + anything(), + anything() + ) + ).once(); + done(); + }); + }); }); describe('user payment service', () => { @@ -251,5 +287,20 @@ describe('Payment Service', () => { done(); }); }); + + it("should update payment instrument from customer when 'updateBasketPaymentInstrument' is called", done => { + const userCreditCardPaymentInstrument: PaymentInstrument = { + ...creditCardPaymentInstrument, + urn: 'urn:payment-instrument:user:fIQKAE8B4tYAAAFu7tuO4P6T:ug8KAE8B1dcAAAFvNQqSJBQg', + }; + + when(apiService.put(anyString(), anything())).thenReturn(of({})); + paymentService + .updateConcardisCvcLastUpdated(BasketMockData.getBasket(), userCreditCardPaymentInstrument) + .subscribe(() => { + verify(apiService.put(`customers/-/payments/${userCreditCardPaymentInstrument.id}`, anything())).once(); + done(); + }); + }); }); }); diff --git a/src/app/core/services/payment/payment.service.ts b/src/app/core/services/payment/payment.service.ts index d368cb97626..1f750c88961 100644 --- a/src/app/core/services/payment/payment.service.ts +++ b/src/app/core/services/payment/payment.service.ts @@ -325,4 +325,53 @@ export class PaymentService { ) ); } + + /** + * Update CvcLastUpdated in concardis credit card (user/basket) payment instrument. + * @param basket The basket. + * @param paymentInstrument The payment instrument, that is to be updated + */ + updateConcardisCvcLastUpdated(basket: Basket, paymentInstrument: PaymentInstrument): Observable { + if (!basket) { + return throwError('updateConcardisCvcLastUpdated() called without basket'); + } + if (!paymentInstrument) { + return throwError('updateConcardisCvcLastUpdated() called without paymentInstrument'); + } + + if (paymentInstrument.urn?.includes('basket')) { + // update basket payment instrument + const body: { + parameters?: { + name: string; + value: string; + }[]; + } = { + parameters: paymentInstrument.parameters + .filter(attr => attr.name === 'cvcLastUpdated') + .map(attr => ({ name: attr.name, value: attr.value })), + }; + + return this.apiService + .patch(`baskets/${basket.id}/payment-instruments/${paymentInstrument.id}`, body, { + headers: this.basketHeaders, + }) + .pipe(map(({ data }) => data)); + } else { + // update user payment instrument + const body: { + name: string; + parameters?: { + key: string; + property: string; + }[]; + } = { + name: paymentInstrument.paymentMethod, + parameters: paymentInstrument.parameters.map(attr => ({ key: attr.name, property: attr.value })), + }; + + // TODO: Replace this PUT request with PATCH request once it is fixed in ICM + return this.apiService.put(`customers/-/payments/${paymentInstrument.id}`, body).pipe(mapTo(paymentInstrument)); + } + } } diff --git a/src/app/core/store/customer/basket/basket-payment.effects.ts b/src/app/core/store/customer/basket/basket-payment.effects.ts index 454be1f727c..2da9e884694 100644 --- a/src/app/core/store/customer/basket/basket-payment.effects.ts +++ b/src/app/core/store/customer/basket/basket-payment.effects.ts @@ -25,6 +25,9 @@ import { updateBasketPayment, updateBasketPaymentFail, updateBasketPaymentSuccess, + updateConcardisCvcLastUpdated, + updateConcardisCvcLastUpdatedFail, + updateConcardisCvcLastUpdatedSuccess, } from './basket.actions'; import { getCurrentBasket, getCurrentBasketId } from './basket.selectors'; @@ -163,4 +166,20 @@ export class BasketPaymentEffects { mapTo(loadBasketEligiblePaymentMethods()) ) ); + /** + * Update CvcLastUpdated for Concardis Credit Card. + */ + updateConcardisCvcLastUpdated$ = createEffect(() => + this.actions$.pipe( + ofType(updateConcardisCvcLastUpdated), + mapToPayloadProperty('paymentInstrument'), + withLatestFrom(this.store.pipe(select(getCurrentBasket))), + concatMap(([paymentInstrument, basket]) => + this.paymentService.updateConcardisCvcLastUpdated(basket, paymentInstrument).pipe( + map(pi => updateConcardisCvcLastUpdatedSuccess({ paymentInstrument: pi })), + mapErrorToAction(updateConcardisCvcLastUpdatedFail) + ) + ) + ) + ); } diff --git a/src/app/core/store/customer/basket/basket.actions.ts b/src/app/core/store/customer/basket/basket.actions.ts index eb9c6a3b7c1..7d4d5e3b1e9 100644 --- a/src/app/core/store/customer/basket/basket.actions.ts +++ b/src/app/core/store/customer/basket/basket.actions.ts @@ -204,3 +204,18 @@ export const deleteBasketPaymentFail = createAction('[Basket API] Delete Basket export const deleteBasketPaymentSuccess = createAction('[Basket API] Delete Basket Payment Success'); export const resetBasketErrors = createAction('[Basket Internal] Reset Basket and Basket Promotion Errors'); + +export const updateConcardisCvcLastUpdated = createAction( + '[Basket] Update CvcLastUpdated for Concardis Credit Card ', + payload<{ paymentInstrument: PaymentInstrument }>() +); + +export const updateConcardisCvcLastUpdatedFail = createAction( + '[Basket API] Update CvcLastUpdated for Concardis Credit Card Fail', + httpError() +); + +export const updateConcardisCvcLastUpdatedSuccess = createAction( + '[Basket API] Update CvcLastUpdated for Concardis Credit Card Success', + payload<{ paymentInstrument: PaymentInstrument }>() +); diff --git a/src/app/core/store/customer/basket/basket.reducer.ts b/src/app/core/store/customer/basket/basket.reducer.ts index a0558b16a64..f77b2ac2cb7 100644 --- a/src/app/core/store/customer/basket/basket.reducer.ts +++ b/src/app/core/store/customer/basket/basket.reducer.ts @@ -58,6 +58,9 @@ import { updateBasketPaymentFail, updateBasketPaymentSuccess, updateBasketShippingMethod, + updateConcardisCvcLastUpdated, + updateConcardisCvcLastUpdatedFail, + updateConcardisCvcLastUpdatedSuccess, } from './basket.actions'; export interface BasketState { @@ -109,7 +112,8 @@ export const basketReducer = createReducer( setBasketPayment, createBasketPayment, updateBasketPayment, - deleteBasketPayment + deleteBasketPayment, + updateConcardisCvcLastUpdated ), setErrorOn( mergeBasketFail, @@ -125,7 +129,8 @@ export const basketReducer = createReducer( setBasketPaymentFail, createBasketPaymentFail, updateBasketPaymentFail, - deleteBasketPaymentFail + deleteBasketPaymentFail, + updateConcardisCvcLastUpdatedFail ), on(addPromotionCodeToBasketFail, (state: BasketState, action) => { const { error } = action.payload; @@ -212,5 +217,18 @@ export const basketReducer = createReducer( info: undefined, promotionError: undefined, validationResults: initialValidationResults, + })), + + on(updateConcardisCvcLastUpdatedSuccess, (state: BasketState, action) => ({ + ...state, + basket: { + ...state.basket, + payment: { + ...state.basket.payment, + paymentInstrument: action.payload.paymentInstrument, + }, + }, + loading: false, + error: undefined, })) ); diff --git a/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.html b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.html new file mode 100644 index 00000000000..9e9d6b910a5 --- /dev/null +++ b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.html @@ -0,0 +1,20 @@ + +
+
+
{{ 'account.payment.sepa_mandate_Reference' | translate }}
+
{{ mandateReference }}
+
+
+
{{ mandateText }}
+
+
+
{{ 'account.payment.sepa_accepted_on' | translate }}
+
{{ mandateCreatedDateTime | ishDate }}
+
+
+
diff --git a/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.spec.ts b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.spec.ts new file mode 100644 index 00000000000..b875110cdba --- /dev/null +++ b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.spec.ts @@ -0,0 +1,67 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { TranslateModule } from '@ngx-translate/core'; +import { MockComponent, MockPipe } from 'ng-mocks'; + +import { DatePipe } from 'ish-core/pipes/date.pipe'; +import { ModalDialogLinkComponent } from 'ish-shared/components/common/modal-dialog-link/modal-dialog-link.component'; + +import { AccountPaymentConcardisDirectdebitComponent } from './account-payment-concardis-directdebit.component'; + +describe('Account Payment Concardis Directdebit Component', () => { + let component: AccountPaymentConcardisDirectdebitComponent; + let fixture: ComponentFixture; + let element: HTMLElement; + + const mandateTextValue = 'mandate_text'; + const mandateCreatedDateTimeValue = '1597644563000'; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TranslateModule.forRoot()], + declarations: [ + AccountPaymentConcardisDirectdebitComponent, + MockComponent(ModalDialogLinkComponent), + MockPipe(DatePipe), + ], + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountPaymentConcardisDirectdebitComponent); + component = fixture.componentInstance; + element = fixture.nativeElement; + + component.paymentInstrument = { + id: '4321', + paymentMethod: 'Concardis_DirectDebit', + parameters: [ + { + name: 'mandateReference', + value: 'mandate_reference', + }, + { + name: 'mandateText', + value: mandateTextValue, + }, + { + name: 'mandateCreatedDateTime', + value: mandateCreatedDateTimeValue, + }, + ], + }; + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + expect(element).toBeTruthy(); + expect(() => fixture.detectChanges()).not.toThrow(); + }); + + it('should show sepa mandate text on executing showSepaMandateText()', () => { + fixture.detectChanges(); + component.showSepaMandateText(); + expect(element.querySelector('[data-testing-id="mandate-text"]')).toBeTruthy(); + expect(component.mandateText).toEqual(mandateTextValue); + expect(component.mandateCreatedDateTime.toString()).toEqual(mandateCreatedDateTimeValue); + }); +}); diff --git a/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.ts b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.ts new file mode 100644 index 00000000000..84f6dd5d157 --- /dev/null +++ b/src/app/pages/account-payment/account-payment-concardis-directdebit/account-payment-concardis-directdebit.component.ts @@ -0,0 +1,30 @@ +import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; + +import { PaymentInstrument } from 'ish-core/models/payment-instrument/payment-instrument.model'; + +@Component({ + selector: 'ish-account-payment-concardis-directdebit', + templateUrl: './account-payment-concardis-directdebit.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class AccountPaymentConcardisDirectdebitComponent { + @Input() paymentInstrument: PaymentInstrument; + + mandateReference: string; + mandateText: string; + mandateCreatedDateTime: number; + + /** + * Show SEPA mandate information + */ + showSepaMandateText() { + this.mandateReference = this.paymentInstrument.parameters + .find(param => param.name === 'mandateReference') + .value.toString(); + this.mandateText = this.paymentInstrument.parameters.find(param => param.name === 'mandateText').value.toString(); + const mandateCreatedDatetimeStr = this.paymentInstrument.parameters + .find(param => param.name === 'mandateCreatedDateTime') + .value.toString(); + this.mandateCreatedDateTime = Number(mandateCreatedDatetimeStr) || 0; + } +} diff --git a/src/app/pages/account-payment/account-payment-page.module.ts b/src/app/pages/account-payment/account-payment-page.module.ts index 1bd70f953ed..8521874765c 100644 --- a/src/app/pages/account-payment/account-payment-page.module.ts +++ b/src/app/pages/account-payment/account-payment-page.module.ts @@ -3,6 +3,7 @@ import { RouterModule, Routes } from '@angular/router'; import { SharedModule } from 'ish-shared/shared.module'; +import { AccountPaymentConcardisDirectdebitComponent } from './account-payment-concardis-directdebit/account-payment-concardis-directdebit.component'; import { AccountPaymentPageComponent } from './account-payment-page.component'; import { AccountPaymentComponent } from './account-payment/account-payment.component'; @@ -15,6 +16,6 @@ const routes: Routes = [ @NgModule({ imports: [RouterModule.forChild(routes), SharedModule], - declarations: [AccountPaymentComponent, AccountPaymentPageComponent], + declarations: [AccountPaymentComponent, AccountPaymentConcardisDirectdebitComponent, AccountPaymentPageComponent], }) export class AccountPaymentPageModule {} diff --git a/src/app/pages/account-payment/account-payment/account-payment.component.html b/src/app/pages/account-payment/account-payment/account-payment.component.html index 909bfb98bed..e968174b26f 100644 --- a/src/app/pages/account-payment/account-payment/account-payment.component.html +++ b/src/app/pages/account-payment/account-payment/account-payment.component.html @@ -46,6 +46,8 @@

{{ pi.accountIdentifier }}

- {{ 'account.payment.preferred.link' | translate }} + {{ 'account.payment.preferred.link' | translate }}
+ diff --git a/src/app/pages/account-payment/account-payment/account-payment.component.spec.ts b/src/app/pages/account-payment/account-payment/account-payment.component.spec.ts index f1eb5cbc96a..f76abf67e2d 100644 --- a/src/app/pages/account-payment/account-payment/account-payment.component.spec.ts +++ b/src/app/pages/account-payment/account-payment/account-payment.component.spec.ts @@ -8,6 +8,8 @@ import { makeHttpError } from 'ish-core/utils/dev/api-service-utils'; import { BasketMockData } from 'ish-core/utils/dev/basket-mock-data'; import { ErrorMessageComponent } from 'ish-shared/components/common/error-message/error-message.component'; +import { AccountPaymentConcardisDirectdebitComponent } from '../account-payment-concardis-directdebit/account-payment-concardis-directdebit.component'; + import { AccountPaymentComponent } from './account-payment.component'; describe('Account Payment Component', () => { @@ -18,7 +20,12 @@ describe('Account Payment Component', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [TranslateModule.forRoot()], - declarations: [AccountPaymentComponent, MockComponent(ErrorMessageComponent), MockComponent(FaIconComponent)], + declarations: [ + AccountPaymentComponent, + MockComponent(AccountPaymentConcardisDirectdebitComponent), + MockComponent(ErrorMessageComponent), + MockComponent(FaIconComponent), + ], }).compileComponents(); }); diff --git a/src/app/pages/checkout-payment/checkout-payment-page.module.ts b/src/app/pages/checkout-payment/checkout-payment-page.module.ts index c1b50fbb354..e2077589a00 100644 --- a/src/app/pages/checkout-payment/checkout-payment-page.module.ts +++ b/src/app/pages/checkout-payment/checkout-payment-page.module.ts @@ -4,6 +4,7 @@ import { SharedModule } from 'ish-shared/shared.module'; import { CheckoutPaymentPageComponent } from './checkout-payment-page.component'; import { CheckoutPaymentComponent } from './checkout-payment/checkout-payment.component'; +import { PaymentConcardisCreditcardCvcDetailComponent } from './payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component'; import { PaymentConcardisCreditcardComponent } from './payment-concardis-creditcard/payment-concardis-creditcard.component'; import { PaymentConcardisDirectdebitComponent } from './payment-concardis-directdebit/payment-concardis-directdebit.component'; import { PaymentConcardisComponent } from './payment-concardis/payment-concardis.component'; @@ -15,6 +16,7 @@ import { PaymentConcardisComponent } from './payment-concardis/payment-concardis CheckoutPaymentPageComponent, PaymentConcardisComponent, PaymentConcardisCreditcardComponent, + PaymentConcardisCreditcardCvcDetailComponent, PaymentConcardisDirectdebitComponent, ], }) diff --git a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.html b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.html index aafc8574b3d..b4386025032 100644 --- a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.html +++ b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.html @@ -77,7 +77,7 @@

{{ 'checkout.payment.method.select.heading' | translate }}

[attr.data-testing-id]="'payment-parameter-form-' + paymentMethod.id" >
  • -
  • -
  • {{ 'checkout.payment.addPayment.link' | translate }} @@ -177,7 +189,13 @@

    {{ 'checkout.order_details.heading' | translate }}

    -
    diff --git a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.spec.ts b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.spec.ts index 44b42db9933..11452f5c701 100644 --- a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.spec.ts +++ b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.spec.ts @@ -21,6 +21,7 @@ import { ErrorMessageComponent } from 'ish-shared/components/common/error-messag import { ModalDialogLinkComponent } from 'ish-shared/components/common/modal-dialog-link/modal-dialog-link.component'; import { CheckboxComponent } from 'ish-shared/forms/components/checkbox/checkbox.component'; +import { PaymentConcardisCreditcardCvcDetailComponent } from '../payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component'; import { PaymentConcardisCreditcardComponent } from '../payment-concardis-creditcard/payment-concardis-creditcard.component'; import { PaymentConcardisDirectdebitComponent } from '../payment-concardis-directdebit/payment-concardis-directdebit.component'; @@ -52,6 +53,7 @@ describe('Checkout Payment Component', () => { MockComponent(ModalDialogLinkComponent), MockComponent(NgbCollapse), MockComponent(PaymentConcardisCreditcardComponent), + MockComponent(PaymentConcardisCreditcardCvcDetailComponent), MockComponent(PaymentConcardisDirectdebitComponent), MockDirective(ServerHtmlDirective), MockPipe(PricePipe), @@ -175,6 +177,7 @@ describe('Checkout Payment Component', () => { describe('parameter forms', () => { it('should open and close payment form if open/cancel form is triggered', () => { + component.basket.payment = undefined; expect(component.formIsOpen(-1)).toBeTruthy(); component.openPaymentParameterForm(2); expect(component.formIsOpen(2)).toBeTruthy(); @@ -184,6 +187,7 @@ describe('Checkout Payment Component', () => { }); it('should throw createPaymentInstrument event when the user submits a valid parameter form and saving is not allowed', done => { + component.basket.payment = undefined; component.ngOnChanges(paymentMethodChange); component.openPaymentParameterForm(1); @@ -201,6 +205,7 @@ describe('Checkout Payment Component', () => { }); it('should throw createUserPaymentInstrument event when the user submits a valid parameter form and saving is allowed', done => { + component.basket.payment = undefined; component.ngOnChanges(paymentMethodChange); component.openPaymentParameterForm(3); @@ -218,6 +223,7 @@ describe('Checkout Payment Component', () => { }); it('should disable submit button when the user submits an invalid parameter form', () => { + component.basket.payment = undefined; component.openPaymentParameterForm(1); fixture.detectChanges(); @@ -228,6 +234,7 @@ describe('Checkout Payment Component', () => { }); it('should render standard parameter form for standard parametrized form', () => { + component.basket.payment = undefined; component.openPaymentParameterForm(1); component.ngOnChanges(paymentMethodChange); diff --git a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts index 916c6971494..80180c18e46 100644 --- a/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts +++ b/src/app/pages/checkout-payment/checkout-payment/checkout-payment.component.ts @@ -29,7 +29,7 @@ import { markAsDirtyRecursive } from 'ish-shared/forms/utils/form-utils'; @Component({ selector: 'ish-checkout-payment', templateUrl: './checkout-payment.component.html', - changeDetection: ChangeDetectionStrategy.OnPush, + changeDetection: ChangeDetectionStrategy.Default, }) export class CheckoutPaymentComponent implements OnInit, OnChanges, OnDestroy { @Input() basket: Basket; @@ -157,7 +157,6 @@ export class CheckoutPaymentComponent implements OnInit, OnChanges, OnDestroy { openPaymentParameterForm(index: number) { this.formSubmitted = false; this.openFormIndex = index; - // enable / disable the appropriate parameter form controls Object.keys(this.parameterForm.controls).forEach(key => { this.filteredPaymentMethods[index].parameters.find(param => param.key === key) diff --git a/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.html b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.html new file mode 100644 index 00000000000..9c2ba7291ab --- /dev/null +++ b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.html @@ -0,0 +1,21 @@ +
    +
    + +
    + +
    + +
    +
    diff --git a/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.spec.ts b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.spec.ts new file mode 100644 index 00000000000..8663d73164c --- /dev/null +++ b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.spec.ts @@ -0,0 +1,94 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; +import { TranslateModule } from '@ngx-translate/core'; +import { MockComponent } from 'ng-mocks'; +import { instance, mock } from 'ts-mockito'; + +import { CheckoutFacade } from 'ish-core/facades/checkout.facade'; +import { PaymentInstrument } from 'ish-core/models/payment-instrument/payment-instrument.model'; +import { PaymentMethod } from 'ish-core/models/payment-method/payment-method.model'; +import { InputComponent } from 'ish-shared/forms/components/input/input.component'; + +import { PaymentConcardisCreditcardCvcDetailComponent } from './payment-concardis-creditcard-cvc-detail.component'; + +describe('Payment Concardis Creditcard Cvc Detail Component', () => { + let component: PaymentConcardisCreditcardCvcDetailComponent; + let fixture: ComponentFixture; + let element: HTMLElement; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [MockComponent(InputComponent), PaymentConcardisCreditcardCvcDetailComponent], + imports: [ReactiveFormsModule, TranslateModule.forRoot()], + providers: [{ provide: CheckoutFacade, useFactory: () => instance(mock(CheckoutFacade)) }], + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PaymentConcardisCreditcardCvcDetailComponent); + component = fixture.componentInstance; + element = fixture.nativeElement; + + component.paymentMethod = { + id: 'Concardis_CreditCard', + saveAllowed: false, + serviceId: 'Concardis_CreditCard', + } as PaymentMethod; + + component.paymentInstrument = { + accountIdentifier: 'VISA 4000007XXXX00031 10/23', + id: 'UZUKgzzAppcAAAFzK9FDCMcG', + numberOfPayments: 0, + parameters: [ + { + name: 'paymentInstrumentId', + value: '****************************', + }, + { + name: 'cardType', + value: 'VISA', + }, + { + name: 'cvcLastUpdated', + value: '2020-04-30T13:41:45Z', + }, + { + name: 'token', + value: 'payment_instrument_123', + }, + ], + paymentMethod: 'Concardis_CreditCard', + urn: 'urn:payment-instrument:basket:_3oKgzzAfGgAAAFzuFpDCMcE:UZUKgzzAppcAAAFzK9FDCMcG', + } as PaymentInstrument; + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + expect(element).toBeTruthy(); + expect(() => fixture.detectChanges()).not.toThrow(); + expect(component.cvcDetailForm.get('cvcDetail')).toBeTruthy(); + }); + + it('should return true when cvc is expired', () => { + expect(component.isCvcExpired()).toBeTruthy(); + }); + + it('should return false when cvc is valid', () => { + component.validityTimeInMinutes = '20'; + component.paymentInstrument.parameters.find( + attribute => attribute.name === 'cvcLastUpdated' + ).value = new Date().toISOString(); + expect(component.isCvcExpired()).toBeFalsy(); + }); + + it('should show an error if submit call back returns with an error', () => { + const errorMessage = 'field is required'; + + fixture.detectChanges(); + component.submitCallback({ + message: { properties: [{ key: 'verification', code: 123, message: errorMessage, messageKey: '' }] }, + }); + + expect(component.errorMessage.cvc.message).toEqual(errorMessage); + }); +}); diff --git a/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.ts b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.ts new file mode 100644 index 00000000000..3b9a37ada9f --- /dev/null +++ b/src/app/pages/checkout-payment/payment-concardis-creditcard-cvc-detail/payment-concardis-creditcard-cvc-detail.component.ts @@ -0,0 +1,160 @@ +import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { takeUntil } from 'rxjs/operators'; + +import { CheckoutFacade } from 'ish-core/facades/checkout.facade'; +import { PaymentInstrument } from 'ish-core/models/payment-instrument/payment-instrument.model'; +import { ScriptLoaderService } from 'ish-core/utils/script-loader/script-loader.service'; +import { markAsDirtyRecursive } from 'ish-shared/forms/utils/form-utils'; + +import { PaymentConcardisComponent } from '../payment-concardis/payment-concardis.component'; + +// allows access to concardis js functionality +// tslint:disable-next-line:no-any +declare var PayEngine: any; + +@Component({ + selector: 'ish-payment-concardis-creditcard-cvc-detail', + templateUrl: './payment-concardis-creditcard-cvc-detail.component.html', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +// tslint:disable-next-line: rxjs-prefer-angular-takeuntil +export class PaymentConcardisCreditcardCvcDetailComponent extends PaymentConcardisComponent implements OnInit { + @Input() paymentInstrument: PaymentInstrument; + + validityTimeInMinutes: string; + cvcDetailForm: FormGroup; + + constructor( + protected scriptLoader: ScriptLoaderService, + protected cd: ChangeDetectorRef, + private checkoutFacade: CheckoutFacade + ) { + super(scriptLoader, cd); + this.cvcDetailForm = new FormGroup({ + cvcDetail: new FormControl(undefined, [Validators.required]), + }); + } + + /** + * load concardis script if component is visible + */ + loadScript() { + // load script only once if component becomes visible + if (!this.scriptLoaded) { + const merchantId = this.getParamValue( + 'ConcardisPaymentService.MerchantID', + 'checkout.credit_card.merchantId.error.notFound' + ); + // if config params are missing - don't load script + if (!merchantId) { + return; + } + + this.scriptLoaded = true; + this.scriptLoader + .load(this.getPayEngineURL()) + .pipe(takeUntil(this.destroy$)) + .subscribe( + () => { + PayEngine.setPublishableKey(merchantId); + }, + error => { + this.scriptLoaded = false; + this.errorMessage.general.message = error; + this.cd.detectChanges(); + } + ); + } + this.validityTimeInMinutes = this.getParamValue( + 'intershop.payment.Concardis_CreditCard.cvcmaxage', + 'checkout.credit_card.validityTime.error.notFound' + ); + } + + isCvcExpired() { + let isExpired = true; + // if cvc last updated timestamp is less than maximum validity in minutes then return false + if (this.paymentInstrument.parameters) { + const cvcLastUpdatedAttr = + this.paymentInstrument.parameters && + this.paymentInstrument.parameters.find(attribute => attribute.name === 'cvcLastUpdated'); + + if (cvcLastUpdatedAttr) { + const cvcLastUpdatedValue = cvcLastUpdatedAttr.value ? cvcLastUpdatedAttr.value.toString() : undefined; + if (cvcLastUpdatedValue) { + const cvcDate = new Date(cvcLastUpdatedValue); + const diffAsMinutes = (Date.now() - cvcDate.getTime()) / (1000 * 60); + if (diffAsMinutes <= parseInt(this.validityTimeInMinutes, 10)) { + isExpired = false; + } + } + } + } + return isExpired; + } + + /** + * call back function to submit data + */ + submitCallback(error) { + if (error) { + // map error messages + if (typeof error.message !== 'string' && error.message.properties) { + this.errorMessage.cvc = + error.message.properties && error.message.properties.find(prop => prop.key === 'verification'); + if (this.errorMessage.cvc && this.errorMessage.cvc.code) { + this.errorMessage.cvc.messageKey = this.getErrorMessage( + this.errorMessage.cvc.code, + 'credit_card', + 'cvc', + this.errorMessage.cvc.message + ); + this.cvcDetailForm.get('cvcDetail').setErrors({ + customError: this.errorMessage.cvc.messageKey, + }); + } + } + } else { + // update cvcLastUpdated to current timestamp + const param = + this.paymentInstrument.parameters && + this.paymentInstrument.parameters.map(attr => ({ name: attr.name, value: attr.value })); + if (param.find(attribute => attribute.name === 'cvcLastUpdated')) { + param.find(attribute => attribute.name === 'cvcLastUpdated').value = new Date().toISOString(); + } else { + param.push({ name: 'cvcLastUpdated', value: new Date().toISOString() }); + } + // TODO: Replacing encoded paymentInstrumentId with Token for put request + param.find(attribute => attribute.name === 'paymentInstrumentId').value = this.paymentInstrument.parameters.find( + attribute => attribute.name === 'token' + ).value; + const pi: PaymentInstrument = { + id: this.paymentInstrument.id, + urn: this.paymentInstrument.urn, + accountIdentifier: this.paymentInstrument.accountIdentifier, + parameters: param, + paymentMethod: this.paymentInstrument.paymentMethod, + }; + + this.checkoutFacade.updateConcardisCvcLastUpdated(pi); + } + } + + renewCVCDetails() { + if (this.paymentInstrument.parameters?.find(attribute => attribute.name === 'token')) { + const tokenAttr = this.paymentInstrument.parameters.find(attribute => attribute.name === 'token'); + + const tokenValue = tokenAttr.value ? tokenAttr.value.toString() : undefined; + if (tokenValue) { + const cvcValue = this.cvcDetailForm.get('cvcDetail').value; + if (cvcValue) { + PayEngine.verifyPaymentInstrument(tokenValue, cvcValue, err => this.submitCallback(err)); + } else { + this.cvcDetailForm.get('cvcDetail').setErrors({ required: true }); + markAsDirtyRecursive(this.cvcDetailForm); + } + } + } + } +} diff --git a/src/app/pages/checkout-payment/payment-concardis-creditcard/payment-concardis-creditcard.component.ts b/src/app/pages/checkout-payment/payment-concardis-creditcard/payment-concardis-creditcard.component.ts index 5b8d145bd12..5c44943ed7e 100644 --- a/src/app/pages/checkout-payment/payment-concardis-creditcard/payment-concardis-creditcard.component.ts +++ b/src/app/pages/checkout-payment/payment-concardis-creditcard/payment-concardis-creditcard.component.ts @@ -175,6 +175,8 @@ export class PaymentConcardisCreditcardComponent extends PaymentConcardisCompone { name: 'maskedCardNumber', value: result.attributes.cardNumber }, { name: 'cardType', value: result.attributes.brand }, { name: 'expirationDate', value: `${result.attributes.expiryMonth}/${result.attributes.expiryYear}` }, + { name: 'cvcLastUpdated', value: new Date().toISOString() }, + { name: 'token', value: result.paymentInstrumentId }, ], saveAllowed: this.paymentMethod.saveAllowed && this.parameterForm.get('saveForLater').value, }); diff --git a/src/assets/i18n/de_DE.json b/src/assets/i18n/de_DE.json index b6523cff3b2..4d8eed8cb2b 100644 --- a/src/assets/i18n/de_DE.json +++ b/src/assets/i18n/de_DE.json @@ -288,6 +288,10 @@ "account.payment.payment_deleted.message": "Ihr Zahlungsmittel wurde gelöscht.", "account.payment.preferred.link": "Als bevorzugtes Zahlungsmittel speichern", "account.payment.preferred_method": "Bevorzugtes Zahlungsmittel", + "account.payment.sepa_accepted_on": "Akzeptiert am", + "account.payment.sepa_mandate_Reference": "Mandatsreferenz", + "account.payment.view_sepa_mandate.link": "SEPA-Mandat anzeigen", + "account.payment.view_sepa_mandate_text.link": "SEPA-Lastschriftmandat", "account.productnotification.login.disabled_user.error": "Ihr Benutzerkonto ist deaktiviert.", "account.productnotification.login.email.error.required": "Bitte geben Sie eine E-Mail-Adresse an.", "account.productnotification.login.email_password.error.invalid": "Ihre E-Mail-Kennwort-Kombination ist nicht korrekt. Bitte versuchen Sie es erneut.", @@ -529,6 +533,7 @@ "basket.promotioncode.not_found.error": "Der Aktionscode wurde nicht gefunden.", "basket.validation.general.error": "Ihr Warenkorb ist nicht mehr gültig. Bitte korrigieren Sie die unten angegebenen Fehler.", "captcha.incorrect": "Die Sicherheitsprüfung ist fehlgeschlagen. Korrigieren Sie den unten angegebenen Fehler.", + "checkout.account.confirm.button.label": "Best\u00E4tigen", "checkout.account.email.already_exist.error": "Die angegebene E-Mail-Adresse wird bereits verwendet.", "checkout.account.email.invalid.error": "Die E-Mail-Adresse ist ungültig.", "checkout.account.email.registered.heading": "Benutzerkonto", @@ -600,6 +605,7 @@ "checkout.credit_card.user.firstname.missing.error": "Bitte geben Sie den Vornamen des Karteninhabers an.", "checkout.credit_card.user.lastname.missing.error": "Bitte geben Sie den Nachnamen des Karteninhabers an.", "checkout.credit_card.user.name.missing.error": "Bitte geben Sie den Namen des Karteninhabers an.", + "checkout.credit_card.validityTime.error.notFound": "Die maximale G\u00FCltigkeitsdauer der Kartenpr\u00FCfnummer wurde nicht gefunden.", "checkout.detail.text": "Details", "checkout.error.AuthorizationCancelled": "Ihre Bezahlung wurde abgebrochen. Wählen Sie eine andere Zahlungsart aus.", "checkout.error.AuthorizationFailed": "Ihre Zahlung konnte nicht autorisiert werden. Wählen Sie eine andere Zahlungsart aus.", @@ -810,9 +816,6 @@ "helpdesk.user.name.missing.error": "Bitte geben Sie Ihren Namen an.", "helpdesk.user.phone_number.missing.error": "Bitte geben Sie Ihre Telefonnummer an", "helpdesk.user_service.message": "Um unseren Benutzerservice per Telefon zu kontaktieren, wählen Sie 0-800-xxx-xxxx.", - "inplace_edit.cancel": "Abbrechen", - "inplace_edit.click_to_edit": "Klicken zum Editieren", - "inplace_edit.save": "Speichern", "modal.heading.remove.order.template": "Produkt aus Bestellvorlage entfernen", "newsletter.email.invalid.error": "Bitte geben Sie eine gültige E-Mail-Adresse an", "order.number.label": "Bestellnummer:", @@ -906,9 +909,13 @@ "quote.add_product_to_quote.button.add_to_quote.label": "In die Preisanfrage", "quote.already_in_basket.error": "Das Preisangebot befindet sich bereits im Warenkorb.", "quote.delete.message": "Ihr Preisangebot wurde gelöscht.", + "quote.edit.already_accepted.text": "Das Preisangebot kann nicht akzeptiert werden, da es bereits akzeptiert wurde.", + "quote.edit.already_refused.text": "Das Preisangebot kann nicht akzeptiert werden, da es bereits abgelehnt wurde.", + "quote.edit.already_submitted.text": "Das Preisangebot kann nicht gesendet werden, da es bereits gesendet wurde.", "quote.edit.back_to_quotes.link": "Zurück zu Preisangeboten", "quote.edit.button.add_quote_to_cart.label": "Preisangebot in Warenkorb legen", "quote.edit.button.create_new_from_quote.label": "Neue Preisanfrage aus Preisangebot anlegen", + "quote.edit.button.save.label": "Preisanfrage speichern", "quote.edit.button.submit.label": "Preisanfrage senden", "quote.edit.reject.button.reject.label": "Preisangebot ablehnen", "quote.edit.responded.quote_details.text": "Preisangebot-Details", @@ -920,9 +927,9 @@ "quote.edit.submitted.your_quote_request.text": "Ihre Preisanfrage wurde gesendet.
    Den Status ihrer
    Preisangebote können Sie im Bereich Mein Konto einsehen.", "quote.edit.submitted.your_quote_request_has_been_submitted.text": "Ihre Preisanfrage wurde am {{0}} gesendet. Sie werden per E-Mail über ein Angebot informiert.", "quote.edit.unsubmitted.comment.label": "Kommentar:", - "quote.edit.unsubmitted.enter_an_optional_name.text": "Klicken Sie hier, um einen Namen hinzuzufügen", + "quote.edit.unsubmitted.enter_an_optional_name.text": "Geben Sie hier einen Namen für die Preisanfrage ein (optional)", "quote.edit.unsubmitted.name.label": "Name:", - "quote.edit.unsubmitted.provide_comment.text": "Klicken Sie hier, um einen Kommentar hinzuzufügen", + "quote.edit.unsubmitted.provide_comment.text": "Fügen Sie ihrer Preisanfrage einen Kommentar hinzu.", "quote.edit.unsubmitted.quote_no.label": "Preisangebotsnr.:", "quote.edit.unsubmitted.quote_request_details.text": "Details der Preisanfrage", "quote.edit.unsubmitted.seller_comment.label": "Kommentar des Anbieters:", @@ -949,7 +956,7 @@ "quote.list.table.expiration_date": "Ablaufdatum", "quote.list.table.line_items": "Artikel", "quote.list.table.name": "Name", - "quote.list.table.quote_no": "Preisangebotsnr.", + "quote.list.table.quote_no": "Preisangebotsnr.:", "quote.list.table.status": "Status", "quote.not_found.error": "Das Preisangebot konnte nicht gefunden werden.", "quote.quote_details.link": "Preisangebot-Details", diff --git a/src/assets/i18n/en_US.json b/src/assets/i18n/en_US.json index d44042133b2..42b6bc14a4a 100644 --- a/src/assets/i18n/en_US.json +++ b/src/assets/i18n/en_US.json @@ -288,6 +288,10 @@ "account.payment.payment_deleted.message": "Your payment instrument has been deleted.", "account.payment.preferred.link": "Save as Preferred Payment Instrument", "account.payment.preferred_method": "Preferred Payment Instrument", + "account.payment.sepa_accepted_on": "Accepted on", + "account.payment.sepa_mandate_Reference": "Mandate Reference", + "account.payment.view_sepa_mandate.link": "View SEPA mandate", + "account.payment.view_sepa_mandate_text.link": "SEPA Direct Debit Mandate", "account.productnotification.login.disabled_user.error": "Your account is disabled.", "account.productnotification.login.email.error.required": "Please enter an e-mail address.", "account.productnotification.login.email_password.error.invalid": "Your E-mail/Password combination is incorrect. Please try again.", @@ -531,6 +535,7 @@ "basket.promotioncode.not_found.error": "The promotion code could not be found.", "basket.validation.general.error": "Your shopping cart is not valid anymore. Please correct the errors indicated below.", "captcha.incorrect": "The security verification failed. Please correct the error indicated below.", + "checkout.account.confirm.button.label": "Confirm", "checkout.account.email.already_exist.error": "A user with that e-mail address already exists.", "checkout.account.email.invalid.error": "The e-mail address is not valid.", "checkout.account.email.registered.heading": "Account", @@ -602,6 +607,7 @@ "checkout.credit_card.user.firstname.missing.error": "Please enter a cardholder first name", "checkout.credit_card.user.lastname.missing.error": "Please enter a cardholder last name", "checkout.credit_card.user.name.missing.error": "Please enter a cardholder name.", + "checkout.credit_card.validityTime.error.notFound": "max validity time For CVC not found.", "checkout.detail.text": "Details", "checkout.error.AuthorizationCancelled": "Your payment was canceled. Please select another payment method.", "checkout.error.AuthorizationFailed": "Your payment could not be authorized. Please select another payment method.", diff --git a/src/assets/i18n/fr_FR.json b/src/assets/i18n/fr_FR.json index 390ec7606cf..99ee3fe5a39 100644 --- a/src/assets/i18n/fr_FR.json +++ b/src/assets/i18n/fr_FR.json @@ -288,6 +288,10 @@ "account.payment.payment_deleted.message": "Votre instrument de paiement a été supprimé.", "account.payment.preferred.link": "Enregistrer comme instrument de paiement par défaut", "account.payment.preferred_method": "Instrument de paiement par défaut", + "account.payment.sepa_accepted_on": "Accept\u00E9 le", + "account.payment.sepa_mandate_Reference": "R\u00E9f\u00E9rence du mandat", + "account.payment.view_sepa_mandate.link": "Voir le mandat SEPA", + "account.payment.view_sepa_mandate_text.link": "Mandat de pr\u00E9l\u00E8vement SEPA", "account.productnotification.login.disabled_user.error": "Votre compte est désactivé.", "account.productnotification.login.email.error.required": "Veuillez entrer une adresse courriel.", "account.productnotification.login.email_password.error.invalid": "Votre combinaison Courriel/Mot de passe est incorrecte. Veuillez réessayer.", @@ -531,6 +535,7 @@ "basket.promotioncode.not_found.error": "Le code promotionnel n’a pas pu être trouvé.", "basket.validation.general.error": "Votre panier n’est plus valide. Veuillez corriger les erreurs signalées ci-dessous.", "captcha.incorrect": "Échec de la vérification de sécurité. Veuillez corriger l’erreur signalée ci-dessous.", + "checkout.account.confirm.button.label": "Confirmer", "checkout.account.email.already_exist.error": "Un utilisateur avec cette adresse courriel existe déjà.", "checkout.account.email.invalid.error": "L’adresse courriel n’est pas valide.", "checkout.account.email.registered.heading": "Compte", @@ -602,6 +607,7 @@ "checkout.credit_card.user.firstname.missing.error": "Veuillez entrer un prénom du titulaire de la carte", "checkout.credit_card.user.lastname.missing.error": "Veuillez entrer un nom de famille du titulaire de la carte", "checkout.credit_card.user.name.missing.error": "Veuillez entrer un nom du titulaire de la carte.", + "checkout.credit_card.validityTime.error.notFound": "La dur\u00E9e de validit\u00E9 maximale du CVC n\u2019a pas \u00E9t\u00E9 trouv\u00E9e.", "checkout.detail.text": "Détails", "checkout.error.AuthorizationCancelled": "Votre paiement a été annulé. Veuillez sélectionner un autre mode de paiement.", "checkout.error.AuthorizationFailed": "Votre paiement n’a pas pu être autorisé. Veuillez sélectionner un autre mode de paiement.", @@ -812,9 +818,6 @@ "helpdesk.user.name.missing.error": "Veuillez entrer votre nom", "helpdesk.user.phone_number.missing.error": "Veuillez entrer votre numéro de téléphone", "helpdesk.user_service.message": "Pour contacter notre service utilisateurs par téléphone, veuillez appeler 1-0800-xxx-xxxx.", - "inplace_edit.cancel": "Annuler", - "inplace_edit.click_to_edit": "Cliquez pour modifier", - "inplace_edit.save": "Enregistrer", "modal.heading.remove.order.template": "Supprimer le produit du modèle de commande", "newsletter.email.invalid.error": "Veuillez entrer une adresse courriel valide.", "order.number.label": "Numéro de commande :", @@ -908,9 +911,13 @@ "quote.add_product_to_quote.button.add_to_quote.label": "Ajouter à la demande de devis", "quote.already_in_basket.error": "Le devis se trouve déjà dans le panier.", "quote.delete.message": "Votre devis a été supprimé.", + "quote.edit.already_accepted.text": "Impossible d’accepter ce devis car il a déjà été accepté.", + "quote.edit.already_refused.text": "Impossible d’accepter ce devis car il est déjà refusé.", + "quote.edit.already_submitted.text": "Impossible d’envoyer ce devis car il a déjà été envoyé.", "quote.edit.back_to_quotes.link": "Retour aux devis", "quote.edit.button.add_quote_to_cart.label": "Ajouter le devis au panier", "quote.edit.button.create_new_from_quote.label": "Créer une nouvelle demande à partir du devis", + "quote.edit.button.save.label": "Enregistrer la demande de devis", "quote.edit.button.submit.label": "Envoyer la demande de devis", "quote.edit.reject.button.reject.label": "Rejeter le devis", "quote.edit.responded.quote_details.text": "Détails du devis", @@ -922,9 +929,9 @@ "quote.edit.submitted.your_quote_request.text": "Votre demande de devis a été soumise.
    Vous pouvez consulter l’état de vos devis dans la section Mon compte.", "quote.edit.submitted.your_quote_request_has_been_submitted.text": "Votre demande de devis a été soumise à {{0}}. Vous serez informé sur votre demande de devis par courriel.", "quote.edit.unsubmitted.comment.label": "Commentaire :", - "quote.edit.unsubmitted.enter_an_optional_name.text": "Cliquez pour ajouter un nom", + "quote.edit.unsubmitted.enter_an_optional_name.text": "Entrez un nom de demande de devis optionnel ici...", "quote.edit.unsubmitted.name.label": "Nom :", - "quote.edit.unsubmitted.provide_comment.text": "Cliquez pour ajouter un commentaire", + "quote.edit.unsubmitted.provide_comment.text": "Entrez un commentaire pour votre demande de devis", "quote.edit.unsubmitted.quote_no.label": "N° devis :", "quote.edit.unsubmitted.quote_request_details.text": "Détails de la demande de devis", "quote.edit.unsubmitted.seller_comment.label": "Commentaire du vendeur :",