diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c417099 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,70 @@ +# Changelog - Payplug Payments Module + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [4.0.0](https://github.com/payplug/payplug-magento2/releases/tag/4.0.0) - 2024-XX-XX + +> **NOTE** +> This new version goes directly from 1.27.4 to 4.0.0 to make a clean slate and avoid maintaining two logics as was done on previous versions (one in 1.27.X and the other one in 3.5.X). + +### Features + +- Optimize Oney payment load and script + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.27.4...4.0.0)** + +### Added + +- Add CHANGELOG.md [#211](https://github.com/payplug/payplug-magento2/pull/211) +- Add declare strict types along with real returns and php 8.0 [#209](https://github.com/payplug/payplug-magento2/pull/209) +- Add missing xml version declarations [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Add secure-magenta.dalenys.com in CSP whitelist [#212](https://github.com/payplug/payplug-magento2/pull/212) +- Add strict returns and fix typos for CheckPayment class [#209](https://github.com/payplug/payplug-magento2/pull/209) +- Add the real exceptions throw to function declaration [#209](https://github.com/payplug/payplug-magento2/pull/209) + +### Changed + +- Factorize payment simulation Ajax calls [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Get popin payment option navigation back [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Optimize Oney popin script show/hide [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Update and refacto Oney view handler script [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Update oney popin script constructor [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Update order status [#209](https://github.com/payplug/payplug-magento2/pull/209) +- Update payment standard method script indentation and declaration [#209](https://github.com/payplug/payplug-magento2/pull/209) +- Update Payplug Integrated Payments library call aliasing [#208](https://github.com/payplug/payplug-magento2/pull/208) + +### Removed + +- Remove Oney script head tag call [#208](https://github.com/payplug/payplug-magento2/pull/208) +- Remove residual comment - Update order status [#209](https://github.com/payplug/payplug-magento2/pull/209) + +## [1.27.4](https://github.com/payplug/payplug-magento2/releases/tag/1.27.4) - 2024-05-02 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.27.3...1.27.4)** + +## [1.27.3](https://github.com/payplug/payplug-magento2/releases/tag/1.27.3) - 2024-03-28 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.27.2...1.27.3)** + +## [1.27.2](https://github.com/payplug/payplug-magento2/releases/tag/1.27.2) - 2023-10-26 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.27.1...1.27.2)** + +## [1.27.1](https://github.com/payplug/payplug-magento2/releases/tag/1.27.1) - 2023-10-10 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.27.0...1.27.1)** + +## [1.27.0](https://github.com/payplug/payplug-magento2/releases/tag/1.27.0) - 2023-09-21 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.26.0...1.27.0)** + +## [1.26.0](https://github.com/payplug/payplug-magento2/releases/tag/1.26.0) - 2023-09-06 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.25.0...1.26.0)** + +## [1.25.0](https://github.com/payplug/payplug-magento2/releases/tag/1.25.0) - 2023-07-10 + +**[view diff](https://github.com/payplug/payplug-magento2/compare/1.24.1...1.25.0)** \ No newline at end of file diff --git a/Controller/Payment/CheckPayment.php b/Controller/Payment/CheckPayment.php index 01a6d1a..3c872ec 100644 --- a/Controller/Payment/CheckPayment.php +++ b/Controller/Payment/CheckPayment.php @@ -1,5 +1,6 @@ orderRepository = $orderRepository; - } - /** * Handle return from PayPlug payment page - * - * @return mixed */ - public function execute() + public function execute(): Redirect|ResultInterface { $resultRedirect = $this->resultRedirectFactory->create(); @@ -61,13 +36,12 @@ public function execute() $payment = $this->payplugHelper->getOrderPayment($lastIncrementId)->retrieve(); - - if (!$payment->is_paid) { + if (!$payment->is_paid && !$this->isOneyPending($payment)) { $this->payplugHelper->cancelOrderAndInvoice($order); $failureMessage = $this->_request->getParam( 'failure_message', - __('The transaction was aborted and your card has not been charged') + (string)__('The transaction was aborted and your card has not been charged') ); if (!empty($failureMessage)) { @@ -113,4 +87,19 @@ public function execute() return $resultRedirect->setPath($redirectUrlSuccess); } } + + /** + * Return true if we are paying with oney and the payment isn't rejected but waiting for approval + */ + public function isOneyPending(?Payment $payment): bool + { + if ($payment && isset($payment->payment_method)) { + $paymentMethod = $payment->payment_method; + if ($payment->is_paid === false && isset($paymentMethod['is_pending']) && isset($paymentMethod['type'])) { + return (str_contains($paymentMethod['type'], 'oney') && $paymentMethod['is_pending'] === true); + } + } + + return false; + } } diff --git a/Helper/Data.php b/Helper/Data.php index 3d3a241..b278edb 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -309,7 +309,7 @@ public function updateOrderStatus(Order $order, bool $save = true): void if ($field !== null) { $orderStatus = $order->getPayment()->getMethodInstance()->getConfigData($field, $order->getStoreId()); if (!empty($orderStatus) && $orderStatus !== $order->getStatus()) { - $order->addStatusToHistory($orderStatus, __('Custom Payplug Payments status')); + $order->addStatusToHistory($orderStatus, (string)__('Custom Payplug Payments status')); if ($save) { $this->orderRepository->save($order); } @@ -335,7 +335,7 @@ public function updateOrder(Order $order, array $data = []): Order $createdAt = new \DateTime($orderProcessing->getCreatedAt()); if ($createdAt > new \DateTime("now - 1 min")) { // Order is currently being processed - throw new OrderAlreadyProcessingException(__('Order is currently being processed.')); + throw new OrderAlreadyProcessingException((string)__('Order is currently being processed.')); } // Order has been set as processing for more than a minute // Delete and recreate a new flag @@ -527,7 +527,7 @@ public function forceOrderCancel(Order $order): void if ($order->getState() !== Order::STATE_CANCELED) { // Order is no longer in review and hasn't been canceled // It means that the payment was validated - throw new LocalizedException(__('The order has been updated without being canceled ' . + throw new LocalizedException((string)__('The order has been updated without being canceled ' . 'because its payment has been validated.')); } @@ -567,7 +567,7 @@ public function cancelOrderPayment(Order $order): bool // Payment is already aborted, keep processing to cancel order return true; } - throw new LocalizedException(__('An error occurred. Please try again.')); + throw new LocalizedException((string)__('An error occurred. Please try again.')); } } @@ -668,7 +668,7 @@ public function sendNewPaymentLink(Order $order, array $paymentLinkData): Order $createdAt = new \DateTime($orderProcessing->getCreatedAt()); if ($createdAt > new \DateTime("now - 1 min")) { // Order is currently being processed - throw new OrderAlreadyProcessingException(__('Order is currently being processed.')); + throw new OrderAlreadyProcessingException((string)__('Order is currently being processed.')); } // Order has been set as processing for more than a minute // Delete and recreate a new flag diff --git a/README.md b/README.md index ca91d32..b1a3477 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Payplug Payments Module -## Installation +## Installation ### Installation via Magento Back Office diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index 6e6a9db..470dd19 100644 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -1,23 +1,35 @@ - - + + - api.payplug.com - applepay.cdn-apple.com - https://cdn.payplug.com/js/integrated-payment/ + applepay.cdn-apple.com + api-qa.payplug.com + cdn-qa.payplug.com + https://cdn-qa.payplug.com + https://secure-magenta.dalenys.com - + - api.payplug.com - secure.payplug.com + https://secure-magenta.dalenys.com + + + + + api-qa.payplug.com + secure-qa.payplug.com + *.payplug.com + + applepay.cdn-apple.com + + + - applepay.cdn-apple.com + https://secure-magenta.dalenys.com diff --git a/view/frontend/web/css/source/_module.less b/view/frontend/web/css/source/_module.less index a219d41..edaa6a8 100644 --- a/view/frontend/web/css/source/_module.less +++ b/view/frontend/web/css/source/_module.less @@ -1,1210 +1,16 @@ - // // Variables // _____________________________________________ +@import 'module/_variables.less'; -@oney-color1: #fff; -@oney-color2: #fbfbfb; -@oney-color3: #f6f6f6; -@oney-color4: rgba(178, 178, 178, .1); -@oney-color5: #e5e5e5; -@oney-color6: #dce0e8; -@oney-color7: #b2b2b2; -@oney-color8: #8a8a8a; -@oney-color9: #777; -@oney-color10: #333; -@oney-color11: #2f2930; -@oney-color12: rgba(128, 188, 0, .1); -@oney-color13: rgba(126, 189, 0, .15); -@oney-color14: #7ebd00; -@oney-color15: #81bc00; -@payplug-error: #fc5656; - -.payplug-payments-cards { - list-style: none; - - .card-last4 { - font-weight: bold; - } -} -.bancontact-checkout-error, -.apple-pay-checkout-error, -.amex-checkout-error { - color: @payplug-error; - margin-bottom: 15px; -} -.payplug-ppro-method.ppro-unavailable { - .payment-method-title label, - .ppro-checkout-error { - color: @oney-color7; - &[data-error-type="mode-test"] { - color: @payplug-error; - } - } - img { - opacity: 50%; - } -} -.oney-product { - margin-bottom: 15px; -} -.oney-checkout-error { - color: @oney-color7; -} -.oney-checkout-error.active { - margin-bottom: 15px; -} -.oney-logo-checkout { - max-width: 150px; - [data-oney-container='payplug_payments_oney_without_fees'] & { - max-width: 170px; - } -} -.oney { - // Oney logo - &Logo { - background: 50% no-repeat; - background-size: 100%; - - &-3x { - background-image: url('Payplug_Payments::images/oney/3x.svg'); - [data-oney-container='payplug_payments_oney_without_fees'] & { - background-image: url('Payplug_Payments::images/oney_without_fees/3x.svg'); - .oney-it& { - background-image: url('Payplug_Payments::images/oney_without_fees/3x-it.svg'); - height: 50px; - } - } - } - &-4x { - background-image: url('Payplug_Payments::images/oney/4x.svg'); - [data-oney-container='payplug_payments_oney_without_fees'] & { - background-image: url('Payplug_Payments::images/oney_without_fees/4x.svg'); - .oney-it& { - background-image: url('Payplug_Payments::images/oney_without_fees/4x-it.svg'); - height: 50px; - } - } - } - &-x3x4 { - background-image: url('Payplug_Payments::images/oney/3x4x.svg'); - .oney-without-fees & { - background-image: url('Payplug_Payments::images/oney_without_fees/3x4x.svg'); - margin-right: 5px; - .oney-it& { - background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-it.svg'); - } - } - } - &-tooltip { - background-image: url('Payplug_Payments::images/oney/tooltip.svg'); - } - } - - // Oney CTA - &Cta { - display: block; - position: relative; - z-index: 3; - - &_button { - align-items: center; - background: none; - border: none !important; - box-shadow: none !important; - color: @oney-color14; - display: flex; - font-size: 13px; - font-weight: 400; - justify-content: center; - margin: 0; - padding: 3px; - text-transform: uppercase; - transition: color .4s; - width: auto; - - &:hover { - background: none !important; - border: none; - color: @oney-color14; - } - - &:focus, - &:active { - background: none !important; - border: none; - box-shadow: none; - color: @oney-color14; - outline: 0; - } - - &-disabled { - color: @oney-color7; - - &:hover, - &:focus, - &:active { - color: @oney-color7; - } - } - - span { - font: inherit; - white-space: nowrap; - } - } - - img { - display: block; - height: auto; - max-width: 100%; - } - - &_logo { - background-size: 110%; - height: 23px; - margin: 0 0 0 .25em; - width: 106px; - .oney-without-fees & { - background-size: 100%; - width: 170px; - } - - .oneyCta_button-disabled & { - background-image: url('Payplug_Payments::images/oney/3x4x-alt.svg'); - .oney-without-fees & { - background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt.svg'); - margin-right: 5px; - .oney-it& { - background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt-it.svg'); - } - } - } - } - - &_tooltip { - height: 14px; - width: 14px; - - .oneyCta_button-disabled & { - background-image: url('Payplug_Payments::images/oney/tooltip-alt.svg'); - } - } - - &_row { - .table tfoot tr& { - background: none; - } - - td { - &:first-child { - background: none; - border-bottom: 1px solid @oney-color1; - border-left: 1px solid @oney-color1; - } - } - } - - &_field { - background: @oney-color12; - height: 46px; - padding: 0 8px !important; - text-align: right; - } - - &_wrapper { - display: flex !important; - justify-content: flex-end; - } - } - - // Oney popin - &Popin { - background: @oney-color1; - box-sizing: border-box; - display: none; - font-size: 13px; - font-weight: 400; - opacity: 1; - padding: 15px; - position: absolute; - right: calc(100% + 10px); - text-align: left; - top: 0; - transform: translateY(-15%); - transition: opacity .4s; - width: 350px; - - &:after { - background: @oney-color1; - border: 2px solid @oney-color14; - border-bottom: none; - border-left: none; - content: ''; - height: 24px; - position: absolute; - right: -2px; - top: 19.5%; - transform: translate(50%, -50%) rotate(45deg); - width: 24px; - } - .loading& { - height: 100px; - top: -50%; - &:after { - top: 50%; - } - } - - &-open { - border: 2px solid @oney-color14; - display: block; - } - - &-show { - opacity: 1; - } - - &-error { - padding: 8px; - top: 50%; - transform: translateY(-50%); - - &:after { - border: 2px solid @oney-color7; - border-bottom: none; - border-left: none; - top: 50%; - } - .oneyPopin-open& { - border: 2px solid @oney-color7; - } - .loading& { - top: 50%; - } - } - - &_title { - background: url('Payplug_Payments::images/oney/logo.svg') -11px 0 no-repeat; - background-size: auto 36px; - color: @oney-color14; - display: block; - font-size: 18px; - line-height: 20px; - margin: 0 0 18px; - padding: 36px 0 0; - text-transform: uppercase; - - .underline { - text-decoration: underline; - } - strong { - display: block; - } - .oney-without-fees.oney-it & { - background: url('Payplug_Payments::images/oney_without_fees/logo-it.svg') 0 0 no-repeat; - } - } - - &_navigation { - display: flex; - flex-direction: column; - list-style: none; - margin: 0; - padding-left: 0; - width: 100%; - - li { - border: 1px solid @oney-color5; - margin-bottom: 0; - transition: all .4s; - - &:first-child { - border-radius: 2px 2px 0 0; - } - - &:last-child { - border-radius: 0 0 2px 2px; - } - - & + li { - margin: -1px 0 0; - } - - button { - background: transparent; - border: none; - color: @oney-color7; - height: 32px; - outline: 0; - padding: 0 16px; - text-align: left; - width: 100%; - } - - &:hover, - &.selected { - border: 1px solid @oney-color14; - z-index: 2; - - button { - color: @oney-color9; - } - } - - &.selected { - background: @oney-color13; - } - } - } - - &_option { - border-bottom: 1px solid @oney-color14; - display: none; - font-size: 12px; - line-height: 17px; - margin: 0 0 8px; - padding: 4px; - position: relative; - width: 100%; - - &-show { - box-sizing: border-box; - display: block; - } - - ul, p { - margin: 0; - padding-left: 0; - } - - p { - padding: 4px 0; - } - - p, - li { - display: flex; - flex-wrap: wrap; - justify-content: space-between; - line-height: 17px; - margin-bottom: 0; - width: 100%; - - &:first-child, - &:last-child { - padding: 4px 0; - } - } - - &[data-type='3x'] { - ul { - li { - &:last-child { - padding: 21px 0 4px; - } - } - } - } - small { - font-size: 80%; - font-weight: 400; - } - } - - &_legal { - color: @oney-color8; - display: block; - font-size: 10px; - line-height: 13px; - margin: 8px 0 0; - - a { - color: @oney-color14; - } - .legal-it { - display: none; - .oney-it & { - display: block; - font-weight: bold; - text-decoration: underline; - } - } - } - - &_close { - background: none; - border: none; - display: block; - height: 24px; - line-height: 24px; - overflow: hidden; - padding: 0; - position: absolute; - right: 15px; - text-indent: 24px; - top: 15px; - width: 24px; - - &:focus { - outline: 0; - } - - &:before, - &:after { - background: @oney-color14; - content: ''; - display: block; - height: 2px; - left: 50%; - position: absolute; - top: 50%; - width: 100%; - } - - &:before { - transform: translate(-50%, -50%) rotate(45deg); - } - - &:after { - transform: translate(-50%, -50%) rotate(-45deg); - } - } - - &_error { - font-size: 14px; - font-style: italic; - font-weight: 400; - margin: 0; - } - } -} -.oney { - &Payment { - max-height: 90px; - overflow: hidden; - - &-disabled { - max-height: none; - } - - &-open { - max-height: 10000vh; - } - - &_trigger { - align-items: center; - background: none; - border: none; - color: @oney-color10; - display: flex; - font-size: 17px; - font-weight: bold; - height: 88px; - letter-spacing: -1px; - padding: 0 15px; - position: relative; - text-align: left; - width: 100%; - - .oneyPayment-disabled & { - color: @oney-color7; - cursor: default; - - &:hover { - background: @oney-color2; - } - } - - &:hover { - background: @oney-color3; - - .oneyPayment-open & { - background: @oney-color2; - } - } - - &:focus { - outline: 0; - } - - &:after { - align-items: center; - color: @oney-color9; - content: '\f054'; - display: flex; - font-size: 25px; - height: 30px; - justify-content: center; - position: absolute; - right: 7px; - top: 50%; - width: 30px; - - .oneyPayment-disabled & { - display: none; - } - } - } - - &_label { - display: flex; - flex-direction: column; - line-height: 1.3em; - } - - &_error { - font-size: 14px; - font-style: italic; - font-weight: 400; - } - - &_logo { - background-size: 110%; - display: block; - height: 45px; - margin: 0 15px 0 0; - max-width: 100%; - width: 165px; - - .oneyPayment-disabled & { - background-image: url('Payplug_Payments::images/oney/3x4x-alt.svg'); - .oney-without-fees & { - background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt.svg'); - } - } - } - - &_cta { - display: flex; - justify-content: center; - margin: 0 0 30px; - width: 100%; - } - - &_button { - background: @oney-color15; - border: none; - color: @oney-color1; - font-size: 15px; - height: 50px; - width: 254px; - - &-disabled { - background: @oney-color7; - } - } - .more-info { - color: @oney-color14; - display: block; - font-size: 13px; - margin: 0 auto 15px; - padding: 0; - position: relative; - text-align: center; - width: 100px; - } - } - - // Oney payment option - &Option { - align-items: center; - border: 1px solid @oney-color6; - box-sizing: border-box; - cursor: pointer; - display: flex; - flex-direction: column; - margin: 0 8px 30px; - padding: 30px; - position: relative; - width: calc(~'50% - 16px'); - - &:after { - background: @oney-color15; - bottom: -14px; - box-shadow: 0px -5px 10px 5px @oney-color1 inset; - content: ''; - display: block; - height: 13px; - left: 0; - opacity: 0; - position: absolute; - right: 0; - } - - &:hover { - border-color: @oney-color15; - - &:after { - opacity: 1; - } - } - - &-selected { - background: fade(@oney-color15, 15); - border-color: @oney-color15; - - &:after { - opacity: 1; - } - } - - &_wrapper { - display: flex; - flex-wrap: wrap; - justify-content: center; - padding: 0 8px; - position: relative; - - &-loading { - justify-content: center; - padding: 16px; - - & + .oneyPayment_cta { - display: none; - } - } - } - - &_logo { - display: block; - height: 35px; - max-width: 100%; - width: 135px; - } - - &_title { - align-items: center; - box-sizing: border-box; - color: @oney-color11; - display: flex; - flex-direction: column; - font-size: 13px; - font-weight: 500; - height: 90px; - justify-content: center; - padding: 0 0 35px; - .oney-it[data-oney-container='payplug_payments_oney_without_fees'] & { - height: 110px; - } - } - - &_prices { - display: flex; - flex-direction: column; - height: 100%; - justify-content: space-between; - width: 100%; - - // Oney Detail - ul { - color: @oney-color11; - display: flex; - flex-direction: column; - font-size: 15px; - font-weight: 600; - height: 100%; - margin: 0; - padding-left: 0; - width: 100%; - - li { - border-bottom: 1px solid @oney-color6; - display: flex; - flex-wrap: wrap; - justify-content: space-between; - line-height: 21px; - padding: 0 0 16px; - - & + li { - padding: 16px 0; - } - - &:last-child { - border: none; - margin: auto 0 0; - padding: 16px 0 0; - } - - span { - display: flex; - font-weight: 600; - max-width: 50%; - - &:first-child { - font-weight: 500; - } - } - small { - display: block; - width: 100%; - } - } - } - } - - &_legend { - color: @oney-color11; - font-weight: 400; - margin: auto 0 0; - text-align: center; - } - - &_radio { - height: 0; - left: 0; - overflow: hidden; - position: absolute; - top: 0; - width: 0; - } - } -} -// Rewrite margins definition -// to bypass rule .onestepcheckout-index-index .page-main .aw-onestep-main .payment-method-content * {margin: 0;} -.onestepcheckout-index-index .page-main .aw-onestep-main .payment-method-content { - .oney { - &Payment { - &_logo { - margin: 0 15px 0 0; - } - &_cta { - margin: 0 0 30px; - } - } - // Oney payment option - &Option { - margin: 0 8px 30px; - &_prices { - // Oney Detail - ul { - margin: 0; - li { - &:last-child { - margin: auto 0 0; - } - } - } - } - &_legend { - margin: auto 0 0; - } - } - } - .payplug-payments-cards { - li { - margin-bottom: 1rem; - } - } -} -.onestepcheckout-index-index .page-main .checkout-container { - .payplug-payments-cards { - padding-left: 0; - img { - display: inline; - } - } -} -.prepaid-card-mention { - display: none; - &.visible { - display: inline-block; - } -} -.label-oney { - align-items: center; - display: inline-flex; -} -.payplug-method-title { - align-items: center; - display: flex; -} - -@media (min-width: 768px) { - .oney-product { - width: 50%; - } -} -@media (max-width: 767px) { - .oney { - &Cta { - & { - align-items: flex-start; - display: flex; - flex-direction: column; - width: 100%; - } - .cart-summary & { - box-sizing: border-box; - padding-left: 15px; - padding-right: 15px; - } - &_button { - height: 32px; - position: relative; - } - &_field { - background: transparent; - height: auto; - } - } - &Popin { - background: transparent; - display: block; - max-height: 0; - overflow: hidden; - padding: 0 15px; - position: relative; - right: auto; - transform: none; - transition: max-height .4s, border .4s, padding .4s; - width: 100%; - - &:after { - display: none; - } - .loading& { - border: none; - height: 0; - padding: 0; - } - &-open { - max-height: 555px; - } - &-error { - background: @oney-color4; - padding: 0 8px; - top: 0; - transform: none; - width: 100%; - - .oneyPopin-open& { - background: @oney-color4; - padding: 8px; - } - .loading& { - border: none; - height: 0; - padding: 0; - } - } - &_title { - margin: 15px 0 24px; - } - &_legal { - padding: 0 0 15px; - } - &_close { - display: none; - } - } - &Payment { - &-open { - margin-bottom: 15px; - } - &_trigger { - align-items: flex-start; - flex-direction: column; - justify-content: center; - - .oneyPayment-disabled & { - height: auto; - padding: 8px 15px; - } - } - .more-info { - margin-top: 10px; - } - } - &Option { - background: none; - border: none; - margin: 0; - padding: 0; - position: static; - width: 100%; - - &:after { - display: none; - } - &-selected { - background: none; - border: none; - } - &_wrapper { - padding: 89px 0 0; - position: relative; - .oney-it[data-oney-container='payplug_payments_oney_without_fees'] & { - padding: 109px 0 0; - } - - &-loading { - padding: 16px; - } - } - &_logo { - height: 30px; - width: 100px; - [data-oney-container='payplug_payments_oney_without_fees'] & { - width: 150px; - } - } - &_title { - background: transparent; - border: 1px solid @oney-color6; - border-bottom: 5px solid transparent; - left: 0; - padding: 0; - position: absolute; - top: 0; - width: 50%; - - .oneyOption:nth-child(2) & { - border-left: none; - left: 50%; - } - - .oneyOption-selected & { - border-bottom: 5px solid @oney-color15; - } - } - &_prices { - border: 1px solid @oney-color6; - box-sizing: border-box; - display: none; - height: auto; - padding: 30px 16px; +// +// Checkout +// _____________________________________________ - .oneyOption-selected & { - display: block; - } - ul { - li { - padding: 8px 0; - } - } - } - } - &Logo { - &-3x, - &-4x { - [data-oney-container='payplug_payments_oney_without_fees'] & { - .oney-it& { - height: 55px; - } - } - } - } - } - .onestepcheckout-index-index .page-main .aw-onestep-main .payment-method-content { - .oney { - &Payment { - &-open { - margin-bottom: 15px; - } - } - &Option { - margin: 0; - } - } - } -} -.payplug-apple-pay-method, -.payplug-amex-method, -.payplug-ppro-method { - .payment-method-title { - &, & label { - align-items: center; - display: inline-flex; - width: 100%; - } - } -} -.payplug-apple-pay-method, -.payplug-ppro-method { - .payment-method-title { - input[type='radio'], img { - margin-right: 10px; - } - } -} -.payplug-amex-method { - .payment-method-title { - img { - height: 50px; - } - } -} -.payment-method-title { - img { - [data-ppro-container="payplug_payments_satispay"] & { - width: 100px; - } - [data-ppro-container="payplug_payments_sofort"] & { - width: 80px; - } - [data-ppro-container="payplug_payments_giropay"] & { - width: 110px; - } - [data-ppro-container="payplug_payments_ideal"] & { - width: 50px; - } - [data-ppro-container="payplug_payments_mybank"] & { - width: 70px; - } - } -} +@import 'module/_checkout.less'; -@form-integrated-width: 300px; -@form-integrated-exp-cvv-gap: 10px; -.form-integrated { - width: @form-integrated-width; - margin-bottom: 30px; - .integrated-container.after-cards & { - margin-left: 40px; - } - .schemes-container { - align-items: center; - display: flex; - justify-content: space-between; - margin-bottom: 10px; - margin-top: 20px; - .card-title { - color: #555D64; - font-size: 14px; - font-weight: 700; - text-transform: uppercase; - } - .schemes { - .scheme { - cursor: pointer; - input { - display: none; - + span { - display: inline-block; - width: 33px; - height: 21px; - background-repeat: no-repeat; - background-size: contain; - } - &[value="visa"] { - + span { - background-image: url('Payplug_Payments::images/icons/visa-dark.svg'); - } - &:checked + span { - background-image: url('Payplug_Payments::images/icons/visa.svg'); - } - } - &[value="mastercard"] { - + span { - background-image: url('Payplug_Payments::images/icons/mastercard-dark.svg'); - } - &:checked + span { - background-image: url('Payplug_Payments::images/icons/mastercard.svg'); - } - } - &[value="cb"] { - + span { - background-image: url('Payplug_Payments::images/icons/cb-dark.svg'); - } - &:checked + span { - background-image: url('Payplug_Payments::images/icons/cb.svg'); - } - } - } - } - } - } - .input-container { - border: 1px solid @oney-color6; - height: 40px; - padding: 0 16px 0 50px; - position: relative; - width: calc(@form-integrated-width - 16px - 50px); - &:before { - content: ""; - position: absolute; - top: 20%; - left: 16px; - width: 24px; - height: 24px; - background: #95999e 50% no-repeat; - background-size: 100% auto; - } - + .error-container { - .invalid-field, .empty-field { - color: #E91932; - display: none; - } - } - &.error-invalid, &.error-empty { - border: 1px solid #E91932; - } - &.error-invalid + .error-container .invalid-field, - &.error-empty + .error-container .empty-field { - display: block; - } - } - .cardholder-input-container:before { - mask-image: url('Payplug_Payments::images/icons/account.svg'); - -webkit-mask-image: url('Payplug_Payments::images/icons/account.svg'); - } - .pan-input-container:before { - mask-image: url('Payplug_Payments::images/icons/card.svg'); - -webkit-mask-image: url('Payplug_Payments::images/icons/card.svg'); - } - .exp-input-container:before { - mask-image: url('Payplug_Payments::images/icons/calendar.svg'); - -webkit-mask-image: url('Payplug_Payments::images/icons/calendar.svg'); - } - .cvv-input-container:before { - mask-image: url('Payplug_Payments::images/icons/lock.svg'); - -webkit-mask-image: url('Payplug_Payments::images/icons/lock.svg'); - } - .exp-cvv-container { - display: flex; - gap: @form-integrated-exp-cvv-gap; - justify-content: space-between; - margin-top: 10px; - > div { - width: calc(@form-integrated-width / 2 - @form-integrated-exp-cvv-gap); - .input-container { - width: calc(@form-integrated-width / 2 - @form-integrated-exp-cvv-gap - 16px - 50px); - } - } - } - .transaction-secured, .policy { - font-size: 14px; - line-height: 21px; - margin-top: 20px; - } - .transaction-secured { - color: #212225; - display: flex; - justify-content: center; - align-items: center; - gap: 10px; - img { - height: 16px; - } - } - .policy { - text-align: center; - a { - display: block; - color: #909192; - text-decoration: underline; - } - } - .save-card-container { - margin-top: 10px; - } - .message { - margin-top: 20px; - } -} -@media (max-width: 767px) { - .form-integrated { - margin: 0 auto 30px; - } -} +// Payments +@import 'module/payments/_amex.less'; +@import 'module/payments/_oney.less'; +@import 'module/payments/_ppro.less'; +@import 'module/payments/_standard.less'; diff --git a/view/frontend/web/css/source/module/_checkout.less b/view/frontend/web/css/source/module/_checkout.less new file mode 100644 index 0000000..ef0def1 --- /dev/null +++ b/view/frontend/web/css/source/module/_checkout.less @@ -0,0 +1,70 @@ +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .payplug-method-title { + display: flex; + align-items: center; + + img { + [data-ppro-container='payplug_payments_satispay'] & { + width: 100px; + } + + [data-ppro-container='payplug_payments_sofort'] & { + width: 80px; + } + + [data-ppro-container='payplug_payments_giropay'] & { + width: 110px; + } + + [data-ppro-container='payplug_payments_ideal'] & { + width: 50px; + } + + [data-ppro-container='payplug_payments_mybank'] & { + width: 70px; + } + } + } + + .bancontact-checkout-error, + .apple-pay-checkout-error, + .amex-checkout-error { + margin-bottom: 15px; + color: @payplug-error; + } + + .prepaid-card-mention { + display: none; + + &.visible { + display: inline-block; + } + } + + .payplug-apple-pay-method, + .payplug-amex-method, + .payplug-ppro-method { + .payment-method-title { + &, + & label { + display: inline-flex; + align-items: center; + width: 100%; + } + } + } + + .payplug-apple-pay-method, + .payplug-ppro-method { + .payment-method-title { + input[type='radio'], + img { + margin-right: 10px; + } + } + } +} diff --git a/view/frontend/web/css/source/module/_variables.less b/view/frontend/web/css/source/module/_variables.less new file mode 100644 index 0000000..23d2573 --- /dev/null +++ b/view/frontend/web/css/source/module/_variables.less @@ -0,0 +1,25 @@ +// +// Variables +// _____________________________________________ + +// Colors +@oney-color1: #fff; +@oney-color2: #fbfbfb; +@oney-color3: #f6f6f6; +@oney-color4: rgba(178, 178, 178, .1); +@oney-color5: #e5e5e5; +@oney-color6: #dce0e8; +@oney-color7: #b2b2b2; +@oney-color8: #8a8a8a; +@oney-color9: #777; +@oney-color10: #333; +@oney-color11: #2f2930; +@oney-color12: rgba(128, 188, 0, .1); +@oney-color13: rgba(126, 189, 0, .15); +@oney-color14: #7ebd00; +@oney-color15: #81bc00; +@payplug-error: #fc5656; + +// Form +@form-integrated-width: 300px; +@form-integrated-exp-cvv-gap: 10px; diff --git a/view/frontend/web/css/source/module/payments/_amex.less b/view/frontend/web/css/source/module/payments/_amex.less new file mode 100644 index 0000000..bd6ac15 --- /dev/null +++ b/view/frontend/web/css/source/module/payments/_amex.less @@ -0,0 +1,13 @@ +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .payplug-amex-method { + .payment-method-title { + img { + height: 50px; + } + } + } +} \ No newline at end of file diff --git a/view/frontend/web/css/source/module/payments/_oney.less b/view/frontend/web/css/source/module/payments/_oney.less new file mode 100644 index 0000000..72bcd81 --- /dev/null +++ b/view/frontend/web/css/source/module/payments/_oney.less @@ -0,0 +1,1028 @@ +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .oney { + // + // Popin banner (product and cart view) + // _____________________________________________ + + &-product { + *, + ::before, + ::after { + box-sizing: border-box; + } + + margin-bottom: 15px; + } + + &Logo { + background: 50% no-repeat; + background-size: 100%; + + &-3x { + background-image: url('Payplug_Payments::images/oney/3x.svg'); + + [data-oney-container='payplug_payments_oney_without_fees'] & { + background-image: url('Payplug_Payments::images/oney_without_fees/3x.svg'); + + .oney-it& { + background-image: url('Payplug_Payments::images/oney_without_fees/3x-it.svg'); + height: 50px; + } + } + } + + &-4x { + background-image: url('Payplug_Payments::images/oney/4x.svg'); + + [data-oney-container='payplug_payments_oney_without_fees'] & { + background-image: url('Payplug_Payments::images/oney_without_fees/4x.svg'); + + .oney-it& { + background-image: url('Payplug_Payments::images/oney_without_fees/4x-it.svg'); + height: 50px; + } + } + } + + &-x3x4 { + background-image: url('Payplug_Payments::images/oney/3x4x.svg'); + + .oney-without-fees & { + background-image: url('Payplug_Payments::images/oney_without_fees/3x4x.svg'); + margin-right: 5px; + + .oney-it& { + background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-it.svg'); + } + } + } + + &-tooltip { + background-image: url('Payplug_Payments::images/oney/tooltip.svg'); + } + } + + &Cta { + position: relative; + display: flex; + align-items: flex-start; + flex-direction: column; + width: 100%; + z-index: 3; + + .cart-summary & { + padding-left: 15px; + padding-right: 15px; + } + + &_button { + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: auto; + height: 32px; + margin: 0; + padding: 3px; + font-size: 13px; + font-weight: 400; + color: @oney-color14; + text-transform: uppercase; + transition: color .4s; + border: none !important; + background-color: transparent; + box-shadow: none !important; + + &:hover { + border: none; + color: @oney-color14; + background-color: transparent !important; + } + + &:focus, + &:active { + color: @oney-color14; + outline: 0; + border: none; + box-shadow: none; + background-color: transparent !important; + } + + &-disabled { + color: @oney-color7; + + &:hover, + &:focus, + &:active { + color: @oney-color7; + } + } + + span { + font: inherit; + white-space: nowrap; + } + } + + img { + display: block; + height: auto; + max-width: 100%; + } + + &_logo { + width: 106px; + height: 23px; + background-size: 110%; + margin: 0 0 0 .25em; + + .oney-without-fees & { + background-size: 100%; + width: 170px; + } + + .oneyCta_button-disabled & { + background-image: url('Payplug_Payments::images/oney/3x4x-alt.svg'); + + .oney-without-fees & { + background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt.svg'); + margin-right: 5px; + + .oney-it& { + background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt-it.svg'); + } + } + } + } + + &_tooltip { + height: 14px; + width: 14px; + + .oneyCta_button-disabled & { + background-image: url('Payplug_Payments::images/oney/tooltip-alt.svg'); + } + } + + &_row { + .table tfoot tr& { + background-color: transparent; + } + + td { + &:first-child { + border-bottom: 1px solid @oney-color1; + border-left: 1px solid @oney-color1; + background-color: transparent; + } + } + } + + &_field { + padding: 0 8px !important; + text-align: right; + } + + &_wrapper { + display: flex !important; + justify-content: flex-end; + } + } + + &Popin { + max-height: 0; + opacity: 1; + padding: 0 15px; + font-size: 13px; + font-weight: 400; + text-align: left; + overflow: hidden; + transition: max-height .4s, border .4s, padding .4s; + + .loading& { + top: -50%; + height: 0; + padding: 0; + + &::after { + top: 50%; + } + } + + &-open { + display: block !important; + max-height: 555px; + border: 2px solid @oney-color14; + } + + &-show { + opacity: 1; + } + + &-error { + width: 100%; + padding: 8 8px; + background-color: @oney-color4; + + .loading& { + top: 50%; + height: 0; + padding: 0; + } + + .oneyPopin-open& { + padding: 8px; + border: 2px solid @oney-color7; + background-color: @oney-color4; + } + } + + &_title { + display: block; + margin: 15px 0 24px; + padding: 36px 0 0; + color: @oney-color14; + font-size: 18px; + line-height: 20px; + text-transform: uppercase; + background: url('Payplug_Payments::images/oney/logo.svg') -11px 0 no-repeat; + background-size: auto 36px; + + .underline { + text-decoration: underline; + } + + strong { + display: block; + } + + .oney-without-fees.oney-it & { + background: url('Payplug_Payments::images/oney_without_fees/logo-it.svg') 0 0 no-repeat; + } + } + + &_navigation { + display: flex; + flex-direction: column; + width: 100%; + margin: 0; + padding-left: 0; + list-style: none; + + li { + margin-bottom: 0; + border: 1px solid @oney-color5; + transition: all .4s; + + &:first-child { + border-radius: 2px 2px 0 0; + } + + &:last-child { + border-radius: 0 0 2px 2px; + } + + & + li { + margin: -1px 0 0; + } + + button { + width: 100%; + height: 32px; + padding: 0 16px; + color: @oney-color7; + text-align: left; + outline: 0; + border: none; + background-color: transparent; + } + + &:hover, + &.selected { + z-index: 2; + border: 1px solid @oney-color14; + + button { + color: @oney-color9; + } + } + + &.selected { + background-color: @oney-color13; + } + } + } + + &_option { + display: none; + position: relative; + width: 100%; + margin: 0 0 8px; + padding: 4px; + font-size: 12px; + line-height: 17px; + border-bottom: 1px solid @oney-color14; + + &-show { + display: block; + } + + ul, p { + margin: 0; + padding-left: 0; + } + + p { + padding: 4px 0; + } + + p, + li { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + width: 100%; + line-height: 17px; + margin-bottom: 0; + + &:first-child, + &:last-child { + padding: 4px 0; + } + } + + &[data-type='3x'] { + ul { + li { + &:last-child { + padding: 21px 0 4px; + } + } + } + } + small { + font-size: 80%; + font-weight: 400; + } + } + + &_legal { + display: block; + margin: 8px 0 0; + padding: 0 0 15px; + color: @oney-color8; + font-size: 10px; + line-height: 13px; + + a { + color: @oney-color14; + } + + .legal-it { + display: none; + + .oney-it & { + display: block; + font-weight: bold; + text-decoration: underline; + } + } + } + + &_close { + position: absolute; + top: 15px; + right: 15px; + display: none; + height: 24px; + width: 24px; + padding: 0; + line-height: 24px; + overflow: hidden; + text-indent: 24px; + border: none; + + &:focus { + outline: 0; + } + + &, + &:hover { + background-color: transparent; + border: 0 none; + } + + &::before, + &::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + display: block; + height: 2px; + width: 100%; + background-color: @oney-color14; + } + + &::before { + transform: translate(-50%, -50%) rotate(45deg); + } + + &::after { + transform: translate(-50%, -50%) rotate(-45deg); + } + } + + &_error { + font-size: 14px; + font-style: italic; + font-weight: 400; + margin: 0; + } + } + + // + // Checkout + // _____________________________________________ + + &Payment { + *, + ::before, + ::after { + box-sizing: border-box; + } + + max-height: 90px; + overflow: hidden; + + &-disabled { + max-height: none; + } + + &-open { + max-height: 10000vh; + margin-bottom: 15px; + } + + &_trigger { + position: relative; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 100%; + padding: 0 15px; + color: @oney-color10; + font-size: 17px; + font-weight: bold; + letter-spacing: -1px; + text-align: left; + background: none; + border: none; + + .oneyPayment-disabled & { + padding: 8px 15px; + color: @oney-color7; + cursor: default; + + &:hover { + background: @oney-color2; + } + } + + &:hover { + background: @oney-color3; + + .oneyPayment-open & { + background: @oney-color2; + } + } + + &:focus { + outline: 0; + } + + &:after { + align-items: center; + color: @oney-color9; + content: '\f054'; + display: flex; + font-size: 25px; + height: 30px; + justify-content: center; + position: absolute; + right: 7px; + top: 50%; + width: 30px; + + .oneyPayment-disabled & { + display: none; + } + } + } + + &_label { + display: flex; + flex-direction: column; + line-height: 1.3em; + } + + &_error { + font-size: 14px; + font-style: italic; + font-weight: 400; + } + + &_logo { + background-size: 110%; + display: block; + height: 45px; + margin: 0 15px 0 0; + max-width: 100%; + width: 165px; + + .oneyPayment-disabled & { + background-image: url('Payplug_Payments::images/oney/3x4x-alt.svg'); + .oney-without-fees & { + background-image: url('Payplug_Payments::images/oney_without_fees/3x4x-alt.svg'); + } + } + } + + &_cta { + display: flex; + justify-content: center; + margin: 0 0 30px; + width: 100%; + } + + &_button { + background: @oney-color15; + border: none; + color: @oney-color1; + font-size: 15px; + height: 50px; + width: 254px; + + &-disabled { + background: @oney-color7; + } + } + + .more-info { + color: @oney-color14; + display: block; + font-size: 13px; + margin-top: 10px; + padding: 0; + position: relative; + text-align: center; + width: 100px; + } + } + + &Option { + cursor: pointer; + + &_wrapper { + position: relative; + padding: 90px 0 0; + + .oney-it[data-oney-container='payplug_payments_oney_without_fees'] & { + padding: 109px 0 0; + } + + &-loading { + padding: 16px; + } + } + + &_logo { + display: block; + height: 30px; + width: 100px; + margin: 5px auto 0; + + [data-oney-container='payplug_payments_oney_without_fees'] & { + width: 150px; + } + } + + &_title { + position: absolute; + left: 0; + top: 0; + width: 50%; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + height: 90px; + color: @oney-color11; + font-size: 13px; + font-weight: 500; + border: 1px solid @oney-color6; + border-bottom: 5px solid transparent; + + .oneyOption:nth-child(2) & { + left: 50%; + border-left: 0 none; + } + + .oneyOption-selected & { + border-bottom: 5px solid @oney-color15; + } + } + + &_radio { + .lib-visually-hidden(); + } + + &_prices { + display: flex; + flex-direction: column; + justify-content: space-between; + height: 100%; + width: 100%; + padding: 30px 16px; + border: 1px solid @oney-color6; + + // Oney Detail + ul { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + margin: 0; + padding-left: 0; + font-size: 15px; + font-weight: 600; + color: @oney-color11; + + li { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + padding: 0 0 16px; + line-height: 21px; + border-bottom: 1px solid @oney-color6; + + & + li { + padding: 16px 0; + } + + &:last-child { + border: none; + margin: auto 0 0; + padding: 16px 0 0; + } + + span { + display: flex; + font-weight: 600; + max-width: 50%; + + &:first-child { + font-weight: 500; + } + } + small { + display: block; + width: 100%; + } + } + } + } + + &:not(&-selected) { + .oneyOption_prices { + display: none; + } + } + + &_legend { + color: @oney-color11; + font-weight: 400; + margin: auto 0 0; + text-align: center; + } + } + + &Logo { + &-3x, + &-4x { + [data-oney-container='payplug_payments_oney_without_fees'] & { + .oney-it& { + height: 55px; + } + } + } + } + + &-logo-checkout { + max-width: 150px; + + [data-oney-container='payplug_payments_oney_without_fees'] & { + max-width: 170px; + } + } + + &-checkout-error { + color: @oney-color7; + + &.active { + margin-bottom: 15px; + } + } + + // + // One step checkout + // _____________________________________________ + + // Rewrite margins definition + // to bypass rule .onestepcheckout-index-index .page-main .aw-onestep-main .payment-method-content * {margin: 0;} + .onestepcheckout-index-index { + .page-main { + .aw-onestep-main { + .payment-method-content { + .oney { + &Payment { + &-open { + margin-bottom: 15px; + } + + &_logo { + margin: 0 15px 0 0; + } + + &_cta { + margin: 0 0 30px; + } + } + + &Option { + &_prices { + // Oney Detail + ul { + margin: 0; + li { + &:last-child { + margin: auto 0 0; + } + } + } + } + &_legend { + margin: auto 0 0; + } + } + } + } + } + } + } + } + + .label-oney { + display: inline-flex; + align-items: center; + } +} + +// +// Desktop +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { + .oney { + + // + // Popin banner (product and cart view) + // _____________________________________________ + + &-product { + width: 50%; + } + + &Cta { + flex-direction: row; + + .cart-summary & { + padding-left: 0; + padding-right: 0; + } + + &_button { + height: auto; + } + + &_field { + height: 46px; + background-color: @oney-color12; + } + } + + &Popin { + display: none; + position: absolute; + top: -5px; + right: calc(~"100% + 30px"); + width: 350px; + max-height: none; + padding: 15px; + overflow: visible; + transform: translateY(-15%); + background-color: @oney-color1; + + &::after { + content: ""; + position: absolute; + right: -2px; + top: 19.5%; + width: 24px; + height: 24px; + border: 2px solid @oney-color14; + border-bottom: none; + border-left: none; + transform: translate(50%, -50%) rotate(45deg); + transition: opacity .4s; + background-color: @oney-color1; + } + + .loading& { + height: 100px; + } + + &-open { + max-height: none; + } + + &-error { + top: 50%; + padding: 8px; + transform: translateY(-50%); + + // Arrow + &::after { + top: 50%; + border: 2px solid @oney-color7; + border-bottom: none; + border-left: none; + background-color: @oney-color1; + } + + .loading& { + height: 100px; + } + + .oneyPopin-open& { + background-color: @oney-color1; + } + } + + &_title { + margin: 0 0 18px; + } + + &_legal { + padding: 0; + } + + &_close { + display: block; + } + } + + // + // Checkout + // _____________________________________________ + + &Payment { + &_trigger { + flex-direction: row; + justify-content: flex-start; + align-items: normal; + + .oneyPayment-disabled & { + height: 88px; + padding: 0; + } + } + + .more-info { + margin: 0 auto 15px; + } + } + + &Option { + position: relative; + display: flex; + align-items: center; + flex-direction: column; + width: calc(~'50% - 16px'); + margin: 0 8px 30px; + padding: 30px; + border: 1px solid @oney-color6; + + // Fake background color + &::after { + content: ""; + position: absolute; + right: 0; + left: 0; + bottom: -14px; + display: block; + height: 13px; + opacity: 0; + box-shadow: 0px -5px 10px 5px @oney-color1 inset; + background-color: @oney-color15; + } + + &:hover { + border-color: @oney-color15; + + &:after { + opacity: 1; + } + } + + &-selected { + background-color: fade(@oney-color15, 15); + border-color: @oney-color15; + + &:after { + opacity: 1; + } + } + + &_wrapper { + display: flex; + flex-wrap: wrap; + justify-content: center; + padding: 0; + + &-loading { + justify-content: center; + padding: 16px; + } + } + + &_logo { + height: 35px; + max-width: 100%; + width: 135px; + } + + &_title { + position: static; + left: auto !important; + top: auto; + width: 100%; + padding: 0 0 35px; + border: 0 none; + + .oneyOption-selected & { + border-bottom: 0 none; + } + + .oney-it[data-oney-container='payplug_payments_oney_without_fees'] & { + height: 110px; + } + } + + &_prices { + display: flex !important; + padding: 0; + border: 0 none; + } + } + + // + // One step checkout + // _____________________________________________ + + .onestepcheckout-index-index { + .page-main { + .aw-onestep-main { + .payment-method-content { + .oney { + &Payment { + &-open { + margin-bottom: 0; + } + } + + &Option { + margin: 0 8px 30px; + } + } + } + } + } + } + } +} diff --git a/view/frontend/web/css/source/module/payments/_ppro.less b/view/frontend/web/css/source/module/payments/_ppro.less new file mode 100644 index 0000000..1653d2e --- /dev/null +++ b/view/frontend/web/css/source/module/payments/_ppro.less @@ -0,0 +1,20 @@ +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .payplug-ppro-method.ppro-unavailable { + .payment-method-title label, + .ppro-checkout-error { + color: @oney-color7; + + &[data-error-type="mode-test"] { + color: @payplug-error; + } + } + + img { + opacity: 50%; + } + } +} \ No newline at end of file diff --git a/view/frontend/web/css/source/module/payments/_standard.less b/view/frontend/web/css/source/module/payments/_standard.less new file mode 100644 index 0000000..a8ddc5a --- /dev/null +++ b/view/frontend/web/css/source/module/payments/_standard.less @@ -0,0 +1,230 @@ +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .payplug-payments-cards { + list-style: none; + + .card-last4 { + font-weight: bold; + } + } + + .form-integrated { + width: @form-integrated-width; + margin: 0 auto 30px; + + .integrated-container.after-cards & { + margin-left: 40px; + } + + .schemes-container { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; + margin-top: 20px; + + .card-title { + color: #555D64; + font-size: 14px; + font-weight: 700; + text-transform: uppercase; + } + + .schemes { + .scheme { + cursor: pointer; + + input { + display: none; + + + span { + display: inline-block; + width: 33px; + height: 21px; + background-repeat: no-repeat; + background-size: contain; + } + + &[value="visa"] { + + span { + background-image: url('Payplug_Payments::images/icons/visa-dark.svg'); + } + + &:checked + span { + background-image: url('Payplug_Payments::images/icons/visa.svg'); + } + } + + &[value="mastercard"] { + + span { + background-image: url('Payplug_Payments::images/icons/mastercard-dark.svg'); + } + + &:checked + span { + background-image: url('Payplug_Payments::images/icons/mastercard.svg'); + } + } + + &[value="cb"] { + + span { + background-image: url('Payplug_Payments::images/icons/cb-dark.svg'); + } + + &:checked + span { + background-image: url('Payplug_Payments::images/icons/cb.svg'); + } + } + } + } + } + } + + .input-container { + position: relative; + height: 40px; + width: calc(@form-integrated-width - 16px - 50px); + padding: 0 16px 0 50px; + border: 1px solid @oney-color6; + + &::before { + content: ""; + position: absolute; + top: 20%; + left: 16px; + width: 24px; + height: 24px; + background: #95999e 50% no-repeat; + background-size: 100% auto; + } + + + .error-container { + .invalid-field, + .empty-field { + display: none; + color: #E91932; + } + } + + &.error-invalid, + &.error-empty { + border: 1px solid #E91932; + + & + .error-container { + .invalid-field, + .empty-field { + display: block; + } + } + } + } + + .cardholder-input-container::before { + mask-image: url('Payplug_Payments::images/icons/account.svg'); + -webkit-mask-image: url('Payplug_Payments::images/icons/account.svg'); + } + + .pan-input-container::before { + mask-image: url('Payplug_Payments::images/icons/card.svg'); + -webkit-mask-image: url('Payplug_Payments::images/icons/card.svg'); + } + + .exp-input-container::before { + mask-image: url('Payplug_Payments::images/icons/calendar.svg'); + -webkit-mask-image: url('Payplug_Payments::images/icons/calendar.svg'); + } + + .cvv-input-container::before { + mask-image: url('Payplug_Payments::images/icons/lock.svg'); + -webkit-mask-image: url('Payplug_Payments::images/icons/lock.svg'); + } + + .exp-cvv-container { + display: flex; + gap: @form-integrated-exp-cvv-gap; + justify-content: space-between; + margin-top: 10px; + + > div { + width: calc(@form-integrated-width / 2 - @form-integrated-exp-cvv-gap); + + .input-container { + width: calc(@form-integrated-width / 2 - @form-integrated-exp-cvv-gap - 16px - 50px); + } + } + } + + .transaction-secured, + .policy { + font-size: 14px; + line-height: 21px; + margin-top: 20px; + } + + .transaction-secured { + display: flex; + justify-content: center; + align-items: center; + gap: 10px; + color: #212225; + + img { + height: 16px; + } + } + + .policy { + text-align: center; + + a { + display: block; + color: #909192; + text-decoration: underline; + } + } + + .save-card-container { + margin-top: 10px; + } + + .message { + margin-top: 20px; + } + } + + // Rewrite margins definition + // to bypass rule .onestepcheckout-index-index .page-main .aw-onestep-main .payment-method-content * {margin: 0;} + .onestepcheckout-index-index { + .page-main { + .aw-onestep-main .payment-method-content { + .payplug-payments-cards { + li { + margin-bottom: 1rem; + } + } + } + + .checkout-container { + .payplug-payments-cards { + padding-left: 0; + + img { + display: inline; + } + } + } + } + } +} + +// +// Desktop +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { + .form-integrated { + margin: 0 0 30px; + } +} diff --git a/view/frontend/web/js/view/payment/method-renderer/payplug_payments_standard-method.js b/view/frontend/web/js/view/payment/method-renderer/payplug_payments_standard-method.js index 734e007..4e2672a 100644 --- a/view/frontend/web/js/view/payment/method-renderer/payplug_payments_standard-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/payplug_payments_standard-method.js @@ -26,6 +26,8 @@ define([ ) { 'use strict'; + const PAYPLUG_DOMAIN = "https://secure-qa.payplug.com"; + return Component.extend({ defaults: { template: 'Payplug_Payments/payment/payplug_payments_standard', @@ -125,6 +127,7 @@ define([ $('[name="save_card"]').is(':checked'); self.integratedApi.pay(response.payment_id, selectedScheme, {save_card: saveCard}); self.integratedApi.onCompleted(function (event) { + $.ajax({ url: url.build('payplug_payments/payment/checkPayment'), type: "GET",