Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/dtrsd 17982 #3451

Merged
merged 3 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@
valid="$ctrl.contractsValidated"
submit-text="{{:: 'domain_configuration_enable_web_hosting_activate' | translate }}"
on-cancel="$ctrl.goBack()"
prevent-next
>
<ovh-contracts-summary
name="agreeContracts"
items="$ctrl.checkout.contracts"
model="$ctrl.contractsValidated"
required
>
</ovh-contracts-summary>
</oui-step-form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import template from './domain-enable-web-hosting.html';
export default {
bindings: {
addOption: '<',
defaultPaymentMethod: '<',
domainName: '<',
getCheckout: '<',
goBack: '<',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ const commonResolves = {
WucOrderCartService.createNewCart(user.ovhSubsidiary).then((cart) =>
WucOrderCartService.assignCart(cart.cartId).then(() => cart),
),
defaultPaymentMethod: /* @ngInject */ (ovhPaymentMethod) =>
ovhPaymentMethod.getDefaultPaymentMethod(),
addOption: /* @ngInject */ (cart, domainName, WebhostingEnableService) => (
item,
offer,
Expand All @@ -20,13 +18,9 @@ const commonResolves = {

getCheckout: /* @ngInject */ (cart, WucOrderCartService) => () =>
WucOrderCartService.getCheckoutInformations(cart.cartId),
order: /* @ngInject */ (
cart,
defaultPaymentMethod,
WucOrderCartService,
) => () =>
order: /* @ngInject */ (cart, WucOrderCartService) => () =>
WucOrderCartService.checkoutCart(cart.cartId, {
autoPayWithPreferredPaymentMethod: !!defaultPaymentMethod,
autoPayWithPreferredPaymentMethod: true,
waiveRetractationPeriod: true,
}),
goBack: /* @ngInject */ (goToDashboard) => goToDashboard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import template from './activate.html';

export default {
bindings: {
autoPayWithPreferredPaymentMethod: '<',
goBack: '<',
serviceName: '<',
serviceOption: '<',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import filter from 'lodash/filter';
import get from 'lodash/get';

import {
pricingConstants,
} from '@ovh-ux/manager-product-offers';
import { pricingConstants } from '@ovh-ux/manager-product-offers';

export default class DomainDnsZoneActivateController {
/* @ngInject */
Expand Down Expand Up @@ -62,13 +60,15 @@ export default class DomainDnsZoneActivateController {
'app.domain.product.zoneactivate',
),
)
.finally(() => (this.checkoutLoading = false));
.finally(() => {
this.checkoutLoading = false;
});
}
}

checkout() {
this.checkoutOrderCart(
this.autoPayWithPreferredPaymentMethod,
!!this.defaultPaymentMethod,
this.cartId,
this.price.value === 0,
);
Expand All @@ -77,7 +77,7 @@ export default class DomainDnsZoneActivateController {
checkoutOrderCart(autoPayWithPreferredPaymentMethod, cartId, isOptionFree) {
this.checkoutLoading = true;
this.DomainDnsZoneActivateService.checkoutOrderCart(
autoPayWithPreferredPaymentMethod,
isOptionFree || autoPayWithPreferredPaymentMethod,
cartId,
)
.then((order) => {
Expand Down Expand Up @@ -117,7 +117,7 @@ export default class DomainDnsZoneActivateController {
this.serviceOption,
price,
).then((finalCart) => {
return { ...finalCart, cartId: cart.cartId }
return { ...finalCart, cartId: cart.cartId };
}),
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const commonResolves = {
autoPayWithPreferredPaymentMethod: /* @ngInject */ (ovhPaymentMethod) =>
ovhPaymentMethod.hasDefaultPaymentMethod(),

serviceName: /* @ngInject */ ($transition$) =>
$transition$.params().productId,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default /* @ngInject */ ($stateProvider) => {
) => async (autoPayWithPreferredPaymentMethod, cartId) => {
try {
const order = await HostingCdnOrderService.checkoutOrderCart(
autoPayWithPreferredPaymentMethod,
isOptionFree || autoPayWithPreferredPaymentMethod,
cartId,
);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { FIDELITY_ACCOUNT } from './order-cart.constants';

/**
* Cart order management service, based on API /order/cart
* It is, for the moment, aimed to handle order of product, or existing product
Expand Down Expand Up @@ -213,19 +211,6 @@ export default class OrderCartService {
},
).$promise;

if (order.prices.withTax.value === 0) {
await this.OvhApiMe.Order()
.v6()
.payRegisteredPaymentMean(
{
orderId: order.orderId,
},
{
paymentMean: FIDELITY_ACCOUNT,
},
).$promise;
}

return order;
}

Expand Down