diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cde6145..44b1096 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -329,13 +329,6 @@ build: when: manual extends: .login_to_registry script: - - sed -i "s|RELEASE_NAME|$RELEASE_NAME|" ./bin/docker/conf/nginx/proxy_helm.conf - - sed -i "s|URL_DOMAIN|${DOCKER_STACK}-${DOCKER_SERVICE}-${CI_COMMIT_REF_SLUG}.${URL_CD}|" ./bin/docker/conf/nginx/proxy_helm.conf - - /kaniko/executor - --cache=true - --context "dir://${CI_PROJECT_DIR}" - --dockerfile "./bin/docker/images/proxy/Dockerfile_helm" - --destination "${REGISTRY_CD}/${DOCKER_STACK}-${DOCKER_SERVICE}-proxy:${CI_COMMIT_REF_SLUG}" - /kaniko/executor --cache=true --context "dir://${CI_PROJECT_DIR}" @@ -350,7 +343,6 @@ build: deploy2recette: stage: deploy image: $REGISTRY_CI/gitlab-ci-base:deployment - needs: [] rules: - if: $ONLY_DEPLOY when: on_success diff --git a/CHANGELOG.md b/CHANGELOG.md index 3801e6b..d752b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Version 1.3.0 + +- **Add** : Add PayPal v2 + ## Version 1.2.0 - **Add** : Added new payment means diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6b1eb76..00c153b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ Contributions to the HiPay Enterprise module for Shopware 6 should be made via G If you would like to make a significant change, please open an issue to discuss it, in order to minimize duplication of effort. -## Development +### Install Installation with Docker for testing @@ -78,6 +78,34 @@ The login and password are the default: admin / shopware. You can test the module with your HiPay account configuration. +### Debug + +If you want to debug locally our CMS module, here are the steps : + +- Verify the value of `XDEBUG_REMOTE_HOST` in your `.env` file you have copied in last step. + - For Linux users, it should be `172.17.0.1` (value by default) + - For MacOS users, replace it by `host.docker.internal` +- Then, create a Xdebug launch according to your IDE (here is for VSCode) : + + ```json + { + "name": "Shopware", + "type": "php", + "request": "launch", + "hostname": "172.17.0.1", // Only for Linux users + "port": 9000, + "pathMappings": { + "/var/www/html/custom/plugins/HiPayPaymentPlugin/src": "${workspaceFolder}/src", + "/var/www/html/custom/plugins/HiPayPaymentPlugin/composer.json": "${workspaceFolder}/composer.json", + "/var/www/html/custom/plugins/HiPayPaymentPlugin/tests": "${workspaceFolder}/tests", + "/var/www/html": "${workspaceFolder}/web" + }, + "runtimeArgs": [ + "-dxdebug.idekey=VSCODE" + ] + } + ``` + ## Quality & Testing In order to play tests, install first dependencies: `composer install` diff --git a/bin/docker/images/shopware/Dockerfile b/bin/docker/images/shopware/Dockerfile index 280bc9d..6f911ca 100644 --- a/bin/docker/images/shopware/Dockerfile +++ b/bin/docker/images/shopware/Dockerfile @@ -6,35 +6,35 @@ LABEL maintainer="PI-Ecommerce" LABEL maintainer_email="pi-ecommerce@hipay.com" RUN echo '\ - CAPTURE_MODE=$CAPTURE_MODE \n\ - HIPAY_ENVIRONMENT=$HIPAY_ENVIRONMENT \n\ - OPERATION_MODE=$OPERATION_MODE \n\ - PRIVATE_LOGIN_PRODUCTION=$PRIVATE_LOGIN_PRODUCTION \n\ - PRIVATE_PASSWORD_PRODUCTION=$PRIVATE_PASSWORD_PRODUCTION \n\ - PUBLIC_LOGIN_PRODUCTION=$PUBLIC_LOGIN_PRODUCTION \n\ - PUBLIC_PASSWORD_PRODUCTION=$PUBLIC_PASSWORD_PRODUCTION \n\ - PASSPHRASE_PRODUCTION=$PASSPHRASE_PRODUCTION \n\ - HASH_PRODUCTION=$HASH_PRODUCTION \n\ - PRIVATE_LOGIN_STAGE=$PRIVATE_LOGIN_STAGE \n\ - PRIVATE_PASSWORD_STAGE=$PRIVATE_PASSWORD_STAGE \n\ - PUBLIC_LOGIN_STAGE=$PUBLIC_LOGIN_STAGE \n\ - PUBLIC_PASSWORD_STAGE=$PUBLIC_PASSWORD_STAGE \n\ - PASSPHRASE_STAGE=$PASSPHRASE_STAGE \n\ - HASH_STAGE=$HASH_STAGE \n\ - PRIVATE_APPLEPAY_LOGIN_PRODUCTION=$PRIVATE_APPLEPAY_LOGIN_PRODUCTION \n\ - PRIVATE_APPLEPAY_PASSWORD_PRODUCTION=$PRIVATE_APPLEPAY_PASSWORD_PRODUCTION \n\ - PUBLIC_APPLEPAY_LOGIN_PRODUCTION=$PUBLIC_APPLEPAY_LOGIN_PRODUCTION \n\ - PUBLIC_APPLEPAY_PASSWORD_PRODUCTION=$PUBLIC_APPLEPAY_PASSWORD_PRODUCTION \n\ - APPLEPAY_PASSPHRASE_PRODUCTION=$APPLEPAY_PASSPHRASE_PRODUCTION \n\ - HASH_PRODUCTION_APPLEPAY=$HASH_PRODUCTION_APPLEPAY \n\ - PRIVATE_APPLEPAY_LOGIN_STAGE=$PRIVATE_APPLEPAY_LOGIN_STAGE \n\ - PRIVATE_APPLEPAY_PASSWORD_STAGE=$PRIVATE_APPLEPAY_PASSWORD_STAGE \n\ - PUBLIC_APPLEPAY_LOGIN_STAGE=$PUBLIC_APPLEPAY_LOGIN_STAGE \n\ - PUBLIC_APPLEPAY_PASSWORD_STAGE=$PUBLIC_APPLEPAY_PASSWORD_STAGE \n\ - APPLEPAY_PASSPHRASE_STAGE=$APPLEPAY_PASSPHRASE_STAGE \n\ - HASH_STAGE_APPLEPAY=$HASH_STAGE_APPLEPAY \n\ - LOG_DEBUG=$LOG_DEBUG \ - ' >>.env +CAPTURE_MODE=$CAPTURE_MODE \n\ +HIPAY_ENVIRONMENT=$HIPAY_ENVIRONMENT \n\ +OPERATION_MODE=$OPERATION_MODE \n\ +PRIVATE_LOGIN_PRODUCTION=$PRIVATE_LOGIN_PRODUCTION \n\ +PRIVATE_PASSWORD_PRODUCTION=$PRIVATE_PASSWORD_PRODUCTION \n\ +PUBLIC_LOGIN_PRODUCTION=$PUBLIC_LOGIN_PRODUCTION \n\ +PUBLIC_PASSWORD_PRODUCTION=$PUBLIC_PASSWORD_PRODUCTION \n\ +PASSPHRASE_PRODUCTION=$PASSPHRASE_PRODUCTION \n\ +HASH_PRODUCTION=$HASH_PRODUCTION \n\ +PRIVATE_LOGIN_STAGE=$PRIVATE_LOGIN_STAGE \n\ +PRIVATE_PASSWORD_STAGE=$PRIVATE_PASSWORD_STAGE \n\ +PUBLIC_LOGIN_STAGE=$PUBLIC_LOGIN_STAGE \n\ +PUBLIC_PASSWORD_STAGE=$PUBLIC_PASSWORD_STAGE \n\ +PASSPHRASE_STAGE=$PASSPHRASE_STAGE \n\ +HASH_STAGE=$HASH_STAGE \n\ +PRIVATE_APPLEPAY_LOGIN_PRODUCTION=$PRIVATE_APPLEPAY_LOGIN_PRODUCTION \n\ +PRIVATE_APPLEPAY_PASSWORD_PRODUCTION=$PRIVATE_APPLEPAY_PASSWORD_PRODUCTION \n\ +PUBLIC_APPLEPAY_LOGIN_PRODUCTION=$PUBLIC_APPLEPAY_LOGIN_PRODUCTION \n\ +PUBLIC_APPLEPAY_PASSWORD_PRODUCTION=$PUBLIC_APPLEPAY_PASSWORD_PRODUCTION \n\ +APPLEPAY_PASSPHRASE_PRODUCTION=$APPLEPAY_PASSPHRASE_PRODUCTION \n\ +HASH_PRODUCTION_APPLEPAY=$HASH_PRODUCTION_APPLEPAY \n\ +PRIVATE_APPLEPAY_LOGIN_STAGE=$PRIVATE_APPLEPAY_LOGIN_STAGE \n\ +PRIVATE_APPLEPAY_PASSWORD_STAGE=$PRIVATE_APPLEPAY_PASSWORD_STAGE \n\ +PUBLIC_APPLEPAY_LOGIN_STAGE=$PUBLIC_APPLEPAY_LOGIN_STAGE \n\ +PUBLIC_APPLEPAY_PASSWORD_STAGE=$PUBLIC_APPLEPAY_PASSWORD_STAGE \n\ +APPLEPAY_PASSPHRASE_STAGE=$APPLEPAY_PASSPHRASE_STAGE \n\ +HASH_STAGE_APPLEPAY=$HASH_STAGE_APPLEPAY \n\ +LOG_DEBUG=$LOG_DEBUG \ +' >>.env COPY . /var/www/html/custom/plugins/HiPayPaymentPlugin/ diff --git a/composer.json b/composer.json index 57aac77..d67fedb 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "hipay/hipay-enterprise-shopware-6", "description": "HiPay enterprise plugin for Shopware 6", "license": "Apache-2.0", - "version": "1.2.0", + "version": "1.3.0", "authors": [ { "email": "support.tpp@hipay.com", diff --git a/src/Core/Checkout/Payment/Capture/OrderCaptureCollection.php b/src/Core/Checkout/Payment/Capture/OrderCaptureCollection.php index cf9a304..5635a16 100644 --- a/src/Core/Checkout/Payment/Capture/OrderCaptureCollection.php +++ b/src/Core/Checkout/Payment/Capture/OrderCaptureCollection.php @@ -45,7 +45,7 @@ public function calculCapturedAmountInProgress(): float return $capturedAmount; } - public function getCaptureByOperationId(string $operationId, string $status = null): ?OrderCaptureEntity + public function getCaptureByOperationId(string $operationId, ?string $status = null): ?OrderCaptureEntity { $result = array_filter($this->getElements(), function (OrderCaptureEntity $capture) use ($operationId, $status) { if ($status) { diff --git a/src/Core/Checkout/Payment/Refund/OrderRefundCollection.php b/src/Core/Checkout/Payment/Refund/OrderRefundCollection.php index 1c30ee7..280f5f6 100644 --- a/src/Core/Checkout/Payment/Refund/OrderRefundCollection.php +++ b/src/Core/Checkout/Payment/Refund/OrderRefundCollection.php @@ -45,7 +45,7 @@ public function calculRefundedAmountInProgress(): float return $refundedAmount; } - public function getRefundByOperationId(string $operationId, string $status = null): ?OrderRefundEntity + public function getRefundByOperationId(string $operationId, ?string $status = null): ?OrderRefundEntity { $result = array_filter($this->getElements(), function (OrderRefundEntity $refund) use ($operationId, $status) { if ($status) { diff --git a/src/PaymentMethod/AbstractPaymentMethod.php b/src/PaymentMethod/AbstractPaymentMethod.php index dc6f2c4..8213c7c 100644 --- a/src/PaymentMethod/AbstractPaymentMethod.php +++ b/src/PaymentMethod/AbstractPaymentMethod.php @@ -783,7 +783,7 @@ private function getOrderCustomers(string $customerId): OrderCustomerCollection * * @param int $format libphonenumber\PhoneNumberFormat\PhoneNumberFormat const */ - protected function formatPhoneNumber(?string $phoneNumber, string $isoCountry = null, int $format = PhoneNumberFormat::E164): ?string + protected function formatPhoneNumber(?string $phoneNumber, ?string $isoCountry = null, int $format = PhoneNumberFormat::E164): ?string { try { $phoneUtil = PhoneNumberUtil::getInstance(); diff --git a/src/PaymentMethod/Paypal.php b/src/PaymentMethod/Paypal.php index fe7bbd5..70c8156 100644 --- a/src/PaymentMethod/Paypal.php +++ b/src/PaymentMethod/Paypal.php @@ -3,6 +3,8 @@ namespace HiPay\Payment\PaymentMethod; use HiPay\Fullservice\Data\PaymentProduct; +use HiPay\Fullservice\Gateway\Request\Order\OrderRequest; +use Shopware\Core\Checkout\Payment\Cart\AsyncPaymentTransactionStruct; /** * Paypal payment Methods. @@ -18,12 +20,8 @@ class Paypal extends AbstractPaymentMethod /** {@inheritDoc} */ protected const PAYMENT_IMAGE = 'paypal.svg'; - /** {@inheritDoc} */ protected static PaymentProduct $paymentConfig; - /** - * {@inheritDoc} - */ public static function getName(string $lang): ?string { $names = [ @@ -34,9 +32,6 @@ public static function getName(string $lang): ?string return $names[$lang] ?? null; } - /** - * {@inheritDoc} - */ public static function getDescription(string $lang): ?string { $descriptions = [ @@ -46,4 +41,26 @@ public static function getDescription(string $lang): ?string return $descriptions[$lang] ?? null; } + + public static function addDefaultCustomFields(): array + { + return [ + 'merchantPayPalId' => '', + 'color' => 'gold', + 'shape' => 'pill', + 'label' => 'paypal', + 'height' => '40', + 'bnpl' => true, + ]; + } + + protected function hydrateHostedFields(OrderRequest $orderRequest, array $payload, AsyncPaymentTransactionStruct $transaction): OrderRequest + { + if ('paypal' === $orderRequest->payment_product && isset($payload['orderID'])) { + $providerData = ['paypal_id' => $payload['orderID']]; + $orderRequest->provider_data = (string) json_encode($providerData); + } + + return $orderRequest; + } } diff --git a/src/Resources/app/administration/src/main.js b/src/Resources/app/administration/src/main.js index 4afb184..fee3889 100644 --- a/src/Resources/app/administration/src/main.js +++ b/src/Resources/app/administration/src/main.js @@ -9,6 +9,7 @@ import './config/hipay-download-logs'; import './settings/hipay-settings-cards-selector'; import './settings/hipay-settings-multibanco'; import './settings/hipay-settings-applepay'; +import './settings/hipay-settings-paypal'; import './override/sw-data-grid'; import './override/sw-order-detail-base'; diff --git a/src/Resources/app/administration/src/override/sw-settings-payment-detail/sw-settings-payment-detail.html.twig b/src/Resources/app/administration/src/override/sw-settings-payment-detail/sw-settings-payment-detail.html.twig index 1e87de2..1a0545e 100644 --- a/src/Resources/app/administration/src/override/sw-settings-payment-detail/sw-settings-payment-detail.html.twig +++ b/src/Resources/app/administration/src/override/sw-settings-payment-detail/sw-settings-payment-detail.html.twig @@ -13,4 +13,8 @@ + {% endblock %} diff --git a/src/Resources/app/administration/src/settings/hipay-settings-paypal/hipay-settings-paypal.html.twig b/src/Resources/app/administration/src/settings/hipay-settings-paypal/hipay-settings-paypal.html.twig new file mode 100644 index 0000000..e4b160d --- /dev/null +++ b/src/Resources/app/administration/src/settings/hipay-settings-paypal/hipay-settings-paypal.html.twig @@ -0,0 +1,78 @@ + + + +
{{ $tc('hipay.settings.paypal.info')}}
+
+ + + + + + + + + + + + + + + + + + + + +
{{ $tc('hipay.settings.paypal.info_bnpl')}}
+
+ + +
diff --git a/src/Resources/app/administration/src/settings/hipay-settings-paypal/index.js b/src/Resources/app/administration/src/settings/hipay-settings-paypal/index.js new file mode 100644 index 0000000..bf1c2e8 --- /dev/null +++ b/src/Resources/app/administration/src/settings/hipay-settings-paypal/index.js @@ -0,0 +1,123 @@ +/** + * Component for hipay settings + * Cards selector + */ +import template from './hipay-settings-paypal.html.twig'; + +Shopware.Component.register('hipay-settings-paypal', { + template, + props: { + isLoading: { + type: Boolean, + required: true + }, + paymentMethod: { + type: Object, + required: true + } + }, + data() { + return { + isPayPalV2: this.paymentMethod.customFields.merchantPayPalId !== "", + colors: [ + { + label: this.$tc('hipay.settings.paypal.color.gold'), + value: "gold" + }, + { + label: this.$tc('hipay.settings.paypal.color.blue'), + value: "blue" + }, + { + label: this.$tc('hipay.settings.paypal.color.black'), + value: "black" + }, + { + label: this.$tc('hipay.settings.paypal.color.silver'), + value: "silver" + }, + { + label: this.$tc('hipay.settings.paypal.color.white'), + value: "white" + }], + shapes: [ + { + label: this.$tc('hipay.settings.paypal.shape.pill'), + value: "pill" + }, + { + label: this.$tc('hipay.settings.paypal.shape.rect'), + value: "rect" + }], + labels: [ + { + label: this.$tc('hipay.settings.paypal.label.paypal'), + value: "paypal" + }, + { + label: this.$tc('hipay.settings.paypal.label.pay'), + value: "pay" + }, + { + label: this.$tc('hipay.settings.paypal.label.subscribe'), + value: "subscribe" + }, + { + label: this.$tc('hipay.settings.paypal.label.checkout'), + value: "checkout" + }, + { + label: this.$tc('hipay.settings.paypal.label.buynow'), + value: "buynow" + }] + }; + }, + methods: { + updatePayPalStatus(newValue) { + this.isPayPalV2 = newValue !== "" ? true : false; + this.updateMerchantPayPalId(newValue); + }, + updateMerchantPayPalId(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, merchantPayPalId: newValue }; + } else { + this.paymentMethod.customFields.merchantPayPalId = newValue; + } + }, + updateColor(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, color: newValue }; + } else { + this.paymentMethod.customFields.color = newValue; + } + }, + updateShape(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, shape: newValue }; + } else { + this.paymentMethod.customFields.shape = newValue; + } + }, + updateLabel(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, label: newValue }; + } else { + this.paymentMethod.customFields.label = newValue; + } + }, + updateHeight(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, height: newValue }; + } else { + this.paymentMethod.customFields.height = newValue; + } + }, + updateBnpl(newValue) { + if (this.paymentMethod.customFields === null) { + this.paymentMethod.customFields = { ...this.paymentMethod.customFields, bnpl: newValue }; + } else { + this.paymentMethod.customFields.bnpl = newValue; + } + } + } +}); diff --git a/src/Resources/app/administration/src/snippet/de-DE.json b/src/Resources/app/administration/src/snippet/de-DE.json index f394663..7a9c88f 100644 --- a/src/Resources/app/administration/src/snippet/de-DE.json +++ b/src/Resources/app/administration/src/snippet/de-DE.json @@ -100,6 +100,37 @@ "creditcard": { "title": "Kreditkarten verfügbar", "choice": "Kreditkarte auswählen" + }, + "paypal": { + "title": "PayPal v2 Konfiguration", + "merchantPayPalId": "Händler PayPal ID", + "info": "Es ist notwendig, eine Händler PayPal ID anzugeben, um PayPal v2 nutzen zu können und den Button anzupassen.", + "bnpl_label": "'Jetzt kaufen, später bezahlen' Funktion aktivieren", + "info_bnpl": "Die Funktion 'Jetzt kaufen, später bezahlen' ist nur verfügbar, wenn die Währung des Geschäfts Euro ist und wenn der Warenkorbwert zwischen 30 und 2000 liegt.", + "color": { + "title": "Buttonfarbe", + "gold": "Gold", + "blue": "Blau", + "black": "Schwarz", + "silver": "Silber", + "white": "Weiß" + }, + "shape": { + "title": "Buttonform", + "pill": "Abgerundet", + "rect": "Rechteck" + }, + "label": { + "title": "Buttonbeschriftung", + "paypal": "PayPal", + "pay": "Bezahlen", + "subscribe": "Abonnieren", + "checkout": "Kasse", + "buynow": "Jetzt kaufen" + }, + "height": { + "title": "Buttonhöhe" + } } } } diff --git a/src/Resources/app/administration/src/snippet/en-GB.json b/src/Resources/app/administration/src/snippet/en-GB.json index 81cbbc5..75035a7 100644 --- a/src/Resources/app/administration/src/snippet/en-GB.json +++ b/src/Resources/app/administration/src/snippet/en-GB.json @@ -100,6 +100,37 @@ "creditcard": { "title": "Credit cards available", "choice": "Select credit card" + }, + "paypal": { + "title": "Configuration PayPal v2", + "merchantPayPalId": "Merchant PayPal ID", + "info": "It is necessary to indicate a Merchant Paypal ID in order to be able to use PayPal v2 and to customize the button.", + "bnpl_label": "Activate 'Buy now, pay later' feature", + "info_bnpl": "The 'Buy now, Pay later' feature is only available if the store currency is euros and if the basket amount is between 30 and 2000.", + "color": { + "title": "Button color", + "gold": "Gold", + "blue": "Blue", + "black": "Black", + "silver": "Silver", + "white": "White" + }, + "shape": { + "title": "Button shape", + "pill": "Rounded", + "rect": "Rectangle" + }, + "label": { + "title": "Button label", + "paypal": "PayPal", + "pay": "Pay", + "subscribe": "Subscribe", + "checkout": "Checkout", + "buynow": "Buy Now" + }, + "height": { + "title": "Button height" + } } } } diff --git a/src/Resources/app/storefront/dist/storefront/js/hi-pay-payment-plugin.js b/src/Resources/app/storefront/dist/storefront/js/hi-pay-payment-plugin.js index 4cb7c59..17e19ef 100644 --- a/src/Resources/app/storefront/dist/storefront/js/hi-pay-payment-plugin.js +++ b/src/Resources/app/storefront/dist/storefront/js/hi-pay-payment-plugin.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([["hi-pay-payment-plugin"],{CJug:function(e,t,n){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this._configHostedFields.fields[e].selector,o=document.querySelector("#"+r);t?o.classList.add(this.options.errorClass):o.classList.remove(this.options.errorClass);var i=document.querySelector("#"+this.options.errorPrefix+"-"+r);i&&(i.innerHTML=n)}},{key:"getPaymentName",value:function(){throw new Error('Method "getPaymentName" must be implemented')}},{key:"getConfigHostedFields",value:function(){throw new Error('Method "getConfigHostedFields" must be implemented')}}])&&u(n.prototype,r),o&&u(n,o),t}(r.a);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this._configHostedFields.fields[e].selector,o=document.querySelector("#"+r);t?o.classList.add(this.options.errorClass):o.classList.remove(this.options.errorClass);var i=document.querySelector("#"+this.options.errorPrefix+"-"+r);i&&(i.innerHTML=n)}},{key:"getPaymentName",value:function(){throw new Error('Method "getPaymentName" must be implemented')}},{key:"getConfigHostedFields",value:function(){throw new Error('Method "getConfigHostedFields" must be implemented')}}])&&s(n.prototype,r),o&&s(n,o),t}(r.a);function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;nSymbol Farbe + + + SDK Configuration + SDK-Konfiguration + + + sdkjsUrl + + + true + https://libs.hipay.com/js/sdkjs.js + + \ No newline at end of file diff --git a/src/Resources/public/administration/js/hi-pay-payment-plugin.js b/src/Resources/public/administration/js/hi-pay-payment-plugin.js index 3afe32f..06817bc 100644 --- a/src/Resources/public/administration/js/hi-pay-payment-plugin.js +++ b/src/Resources/public/administration/js/hi-pay-payment-plugin.js @@ -1 +1 @@ -!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/bundles/hipaypaymentplugin/",n(n.s="3YVu")}({"3YVu":function(e,t,n){"use strict";n.r(t);n("PfVt"),n("xlli");var a=n("yAkZ");n("IHpg");Shopware.Component.register("hipay-help-bloc",{template:'
\n
\n \n\n \n\n
\n \n

\n {{ $tc(\'hipay.config.help.version\') }} : {{ version }}\n

\n
\n
\n
\n',data:function(){return{version:a.version}}});Shopware.Component.register("hipay-help-info",{template:'\n
\n
\n',data:function(){return{text:this.$parent.bind.value}}});var i=Shopware,r=i.Component,o=i.Mixin;r.register("hipay-check-server-access",{template:'\n {{ $tc(\'hipay.config.checkAccess.button\') }}\n\n',inject:["hipayService"],mixins:[o.getByName("notification")],props:{value:{required:!1}},data:function(){return{isLoading:!1,success:!1}},methods:{completeSucess:function(){this.sucess=!1},validateConfig:function(){var e=this;this.isLoading=!0;var t=this.$tc("hipay.config.checkAccess.title");this.hipayService.validateConfig(this.getConfig()).then((function(n){if(!n.success)throw new Error(n.message);e.createNotificationSuccess({title:t,message:e.$tc("hipay.config.checkAccess.success")}),e.success=!0})).catch((function(n){e.createNotificationError({title:t,message:n.message||e.$tc("hipay.config.checkAccess.failure")})})).finally((function(){return e.isLoading=!1}))},getConfig:function(){for(var e=this.$parent;!e.hasOwnProperty("actualConfigData");)e=e.$parent;var t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t],{environment:this.$parent.bind.env,isApplePay:"true"===this.$parent.bind.isApplePay})}}});var s=Shopware,u=s.Component,l=s.Mixin;u.register("hipay-download-logs",{template:'\n {{ $tc(\'hipay.config.logs.download\') }}\n\n',inject:["hipayService"],mixins:[l.getByName("notification")],props:{value:{required:!1}},data:function(){return{isLoading:!1,success:!1}},methods:{completeSucess:function(){this.sucess=!1},downloadLogs:function(){var e=this;this.isLoading=!0;var t=this.$tc("hipay.config.logs.title");this.hipayService.getLogsArrayBuffer().then((function(e){var t=new Blob([e.data],{type:"application/octet-stream"}),n=window.URL.createObjectURL(t),a=document.createElement("a");a.href=n;var i=e.headers["content-disposition"].split('"');a.download=i[1],document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),window.URL.revokeObjectURL(n),document.body.removeChild(a)})).catch((function(n){e.createNotificationError({title:t,message:n.message||e.$tc("hipay.config.logs.failure")})})).finally((function(){return e.isLoading=!1}))}}});Shopware.Component.register("hipay-settings-cards-selector",{template:'\n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{availableCards:[{label:"Carte Bancaire",value:"cb"},{label:"VISA",value:"visa"},{label:"MasterCard",value:"mastercard"},{label:"Amercian Express",value:"american-express"},{label:"Bancontact / Mister Cash",value:"bcmc"},{label:"Maestro",value:"maestro"}]}},methods:{updateCardsValue:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields={cards:e}:this.paymentMethod.customFields.cards=e}}});function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t\n \n \n {{ limit.label }}\n \n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{availableLimits:[{label:"3 ".concat(this.$tc("hipay.config.days")),value:"3"},{label:"30 ".concat(this.$tc("hipay.config.days")),value:"30"},{label:"90 ".concat(this.$tc("hipay.config.days")),value:"90"}]}},methods:{updateLimitValue:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=p(p({},this.paymentMethod.customFields),{},{expiration_limit:e}):this.paymentMethod.customFields.expiration_limit=e}}});function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function y(e){for(var t=1;t\n\n \n \n\n \n \n {{ buttonType.label }}\n \n \n\n \n \n {{ buttonStyle.label }}\n \n \n\n \n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{buttonTypes:[{label:this.$tc("hipay.settings.applepay.buttonType.default"),value:"default"},{label:this.$tc("hipay.settings.applepay.buttonType.buy"),value:"buy"},{label:this.$tc("hipay.settings.applepay.buttonType.setup"),value:"set-up"},{label:this.$tc("hipay.settings.applepay.buttonType.donate"),value:"donate"},{label:this.$tc("hipay.settings.applepay.buttonType.checkout"),value:"check-out"},{label:this.$tc("hipay.settings.applepay.buttonType.processing"),value:"processing"},{label:this.$tc("hipay.settings.applepay.buttonType.book"),value:"book"},{label:this.$tc("hipay.settings.applepay.buttonType.subscribe"),value:"subscribe"}],buttonStyles:[{label:this.$tc("hipay.settings.applepay.buttonStyle.black"),value:"black"},{label:this.$tc("hipay.settings.applepay.buttonStyle.white"),value:"white"},{label:this.$tc("hipay.settings.applepay.buttonStyle.whiteOutline"),value:"white-outline"}]}},methods:{updateMerchantName:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{merchantName:e}):this.paymentMethod.customFields.merchantName=e},updateButtonType:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{buttonType:e}):this.paymentMethod.customFields.buttonType=e},updateButtonStyle:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{buttonStyle:e}):this.paymentMethod.customFields.buttonStyle=e},updateMerchantId:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{merchantId:e}):this.paymentMethod.customFields.merchantId=e}}});n("EJ7b");Shopware.Component.override("sw-data-grid",{template:'{% block sw_data_grid_bulk %}\n
\n {% parent %}\n
\n{% endblock %}\n\n{% block sw_data_grid_columns_render_value %}\n \n \n{% endblock %}\n\n\n',methods:{onValueChange:function(e,t){this.$emit("quantity-change",t,e)}}});n("fk7Z");function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function w(e){for(var t=1;t\n \n \n \n{% endblock %}\n\n\n{% block sw_order_detail_customer_comment_card %}\n {% parent %}\n \n \n \n{% endblock %}\n',inject:["hipayService"],computed:{orderCriteria:function(){var e=this.$super("orderCriteria");return e.addAssociation("hipayOrder"),e.addAssociation("hipayOrder.captures"),e.addAssociation("hipayOrder.refunds"),e.addAssociation("hipayOrder.statusFlows"),e},datasource:function(){var e=this;return this.order.extensions.hipayOrder.statusFlows.sort((function(e,t){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()})).map((function(t){return w(w({},t),{},{description:t.name?"".concat(t.name," (").concat(t.code,")"):t.code,createdAt:new Date(t.createdAt).toLocaleString(),amount:e.hipayService.getCurrencyFormater(e.order.currency.isoCode).format(t.amount)})}))},columns:function(){return[{property:"description",label:"Status"},{property:"createdAt",label:"Date"},{property:"message",label:"Message"},{property:"amount",label:"Amount"}]},getTitle:function(){return this.$t("hipay.transaction.title")+" #"+this.order.extensions.hipayOrder.transactionReference},isHipayPayment:function(){return this.transaction.paymentMethod.formattedHandlerIdentifier.startsWith("handler_hipay")}},watch:{order:function(){this.$root.$emit("order-loaded",this.order)}}});n("C0+k");function C(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n\n \n \n {{ $tc(\'hipay.action.capture\') }}\n \n \n {{ $tc(\'hipay.action.refund\') }}\n \n \n {{ $tc(\'hipay.action.cancel\') }}\n \n {% parent %}\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n \n\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n
\n\n \n \n{% endblock %}\n',inject:["hipayService"],data:function(){return{orderData:null,hipayOrderData:null,showOrderCapture:!1,showOrderRefund:!1,lastTransaction:null,lineItems:null,basketColumns:[{property:"label",label:this.$tc("hipay.basket.column.product"),multiLine:!0},{property:"quantity",label:this.$tc("hipay.basket.column.quantity")},{property:"totalPrice",label:this.$tc("hipay.basket.column.price")}],currency:null,captureAmount:null,refundAmount:null,manualCaptureAmount:null,manualRefundAmount:null,fullCapture:!0,fullRefund:!0,showOrderStateForCapture:!1,showOrderStateForRefund:!1,showOrderStateForCancel:!1,isLoadingRequest:!1}},computed:{showOnHipayMethod:function(){var e,t;return/hipay/.test(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t?void 0:t.formattedHandlerIdentifier)},canCancel:function(){var e,t;return["authorized"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canCapture:function(){var e,t;return["paid_partially","authorized"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canPartialCapture:function(){var e,t,n,a;return this.canCapture&&!1!==(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t||null===(n=t.extensions)||void 0===n||null===(a=n.hipayConfig)||void 0===a?void 0:a.allowPartialCapture)},canRefund:function(){var e,t;return["paid_partially","paid","refunded_partially"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canPartialRefund:function(){var e,t,n,a;return this.canRefund&&!1!==(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t||null===(n=t.extensions)||void 0===n||null===(a=n.hipayConfig)||void 0===a?void 0:a.allowPartialRefund)},orderBasket:function(){var e,t=C(this.lineItems);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.totalPrice=this.formatCurrency(n.unitPrice*n.currentQuantity),n.editable=this.canPartialCapture}}catch(e){t.e(e)}finally{t.f()}return this.lineItems},orderAmount:function(){return this.orderData.amountTotal},capturedAmount:function(){return this.hipayOrderData.capturedAmount},capturedAmountInProgress:function(){return this.hipayOrderData.capturedAmountInProgress},remainingCaptureAmount:function(){return Number((this.orderAmount-this.capturedAmountInProgress).toFixed(2))},refundedAmountInProgress:function(){return this.hipayOrderData.refundedAmountInProgress},remainingRefundAmount:function(){return Number((this.capturedAmount-this.refundedAmountInProgress).toFixed(2))},getCaptureAmount:function(){var e;return null!==(e=this.captureAmount)&&void 0!==e?e:this.manualCaptureAmount},getRefundAmount:function(){var e;return null!==(e=this.refundAmount)&&void 0!==e?e:this.manualRefundAmount},isInvalidFullCaptureAmount:function(){return this.remainingCaptureAmount<=0},isInvalidCaptureAmount:function(){return!this.getCaptureAmount||this.isInvalidFullCaptureAmount},isInvalidFullRefundAmount:function(){return this.remainingRefundAmount<=0},isInvalidRefundAmount:function(){return!this.getRefundAmount||this.isInvalidFullRefundAmount},captureAmountPlaceholder:function(){return this.captureAmount>this.remainingCaptureAmount?this.remainingCaptureAmount:this.captureAmount},refundAmountPlaceholder:function(){return this.refundAmount>this.remainingRefundAmount?this.remainingRefundAmount:this.refundAmount}},methods:{formatCurrency:function(e){return this.hipayService.getCurrencyFormater(this.currency).format(e)},openCapture:function(){this.showOrderCapture=!0},openRefund:function(){this.showOrderRefund=!0},openCancel:function(){this.showOrderStateForCancel=!0},createdComponent:function(){this.$super("createdComponent"),this.$root.$on("order-loaded",this.orderLoaded)},destroyedComponent:function(){this.$root.$off("order-loaded",this.orderLoaded),this.$super("destroyedComponent")},orderLoaded:function(e){var t;this.orderData=e,this.currency=e.currency.isoCode,this.lastTransaction=this.orderData.transactions.last(),this.hipayOrderData=null===(t=this.orderData.extensions)||void 0===t?void 0:t.hipayOrder;var n=JSON.parse(JSON.stringify(this.orderData.lineItems));for(var a in this.orderData.shippingCosts.totalPrice>0&&n.push({label:this.$tc("hipay.basket.column.shipping"),quantity:1,totalPrice:this.orderData.shippingCosts.totalPrice,unitPrice:this.orderData.shippingCosts.totalPrice,shipping:!0}),n)n[a].currentQuantity=n[a].quantity;this.lineItems=n},closeOrderCaptureModal:function(){for(var e in this.showOrderCapture=!1,this.captureAmount=null,this.manualCaptureAmount=null,this.lineItems)this.lineItems[e].currentQuantity=this.lineItems[e].quantity},closeOrderRefundModal:function(){for(var e in this.showOrderRefund=!1,this.refundAmount=null,this.manualRefundAmount=null,this.lineItems)this.lineItems[e].currentQuantity=this.lineItems[e].quantity},closeCancelModal:function(){this.showOrderStateForCancel=!1},onSelectProductForCapture:function(e){var t=0;for(var n in e)this.$refs.basket.isSelected(e[n].id)&&(t+=e[n].unitPrice*e[n].currentQuantity);this.captureAmount=t||null},onSelectProductForRefund:function(e){var t=0;for(var n in e)this.$refs.basket.isSelected(e[n].id)&&(t+=e[n].unitPrice*e[n].currentQuantity);this.refundAmount=t||null},selectAllProducts:function(){this.$refs.basket.selectAll(!0)},isProductSelectable:function(e){return e.good||e.shipping},onManualCaptureAmount:function(e){this.manualCaptureAmount=e},onManualRefundAmount:function(e){this.manualRefundAmount=e},onQuantityChangeForCapture:function(e,t){var n=this.lineItems.findIndex((function(e){return e.id===t.id}));n>=0&&(this.lineItems[n].currentQuantity=e),this.onSelectProductForCapture(this.lineItems)},onQuantityChangeForRefund:function(e,t){var n=this.lineItems.findIndex((function(e){return e.id===t.id}));n>=0&&(this.lineItems[n].currentQuantity=e),this.onSelectProductForRefund(this.lineItems)},captureOrder:function(){this.$refs.captureAmount.currentValue!==this.remainingCaptureAmount&&(this.fullCapture=!1),this.showOrderStateForCapture=!0},fullCaptureOrder:function(){this.showOrderStateForCapture=!0},refundOrder:function(){this.$refs.refundAmount.currentValue!==this.remainingRefundAmount&&(this.fullRefund=!1),this.showOrderStateForRefund=!0},fullRefundOrder:function(){this.showOrderStateForRefund=!0},closeOrderStateModal:function(){this.showOrderStateForCapture=!1,this.showOrderStateForRefund=!1},makeCancel:function(){var e=this;this.isLoadingRequest=!0,this.hipayService.cancelTransaction(this.hipayOrderData).then((function(t){if(!t.success)throw new Error(t.message);e.createNotificationSuccess({title:e.$tc("hipay.notification.cancel.title"),message:e.$tc("hipay.notification.cancel.success")})})).catch((function(){e.createNotificationError({title:e.$tc("hipay.notification.capture.title"),message:e.$tc("hipay.notification.capture.failure")})})).finally((function(){return e.isLoadingRequest=!1}))},makeCapture:function(){var e,t=this;this.isLoadingRequest=!0,this.hipayService.captureTransaction(this.hipayOrderData,this.fullCapture?this.remainingCaptureAmount:null!==(e=this.$refs.captureAmount.currentValue)&&void 0!==e?e:this.captureAmountPlaceholder).then((function(e){if(!e.success)throw new Error(e.message);t.createNotificationSuccess({title:t.$tc("hipay.notification.capture.title"),message:t.$tc("hipay.notification.capture.success")}),e.captures&&(t.hipayOrderData.captures=e.captures),e.captured_amount&&(t.hipayOrderData.capturedAmountInProgress=e.captured_amount),t.showOrderStateForCapture=!1,t.$nextTick((function(){t.showOrderCapture=!1}))})).catch((function(){t.createNotificationError({title:t.$tc("hipay.notification.capture.title"),message:t.$tc("hipay.notification.capture.failure")})})).finally((function(){return t.isLoadingRequest=!1}))},makeRefund:function(){var e,t=this;this.isLoadingRequest=!0,this.hipayService.refundTransaction(this.hipayOrderData,this.fullRefund?this.remainingRefundAmount:null!==(e=this.$refs.refundAmount.currentValue)&&void 0!==e?e:this.refundAmountPlaceholder).then((function(e){if(!e.success)throw new Error(e.message);t.createNotificationSuccess({title:t.$tc("hipay.notification.refund.title"),message:t.$tc("hipay.notification.refund.success")}),e.refunds&&(t.hipayOrderData.refunds=e.refunds),e.refunded_amount&&(t.hipayOrderData.refundedAmountInProgress=e.refunded_amount),t.showOrderStateForRefund=!1,t.$nextTick((function(){t.showOrderRefund=!1}))})).catch((function(){t.createNotificationError({title:t.$tc("hipay.notification.refund.title"),message:t.$tc("hipay.notification.refund.failure")})})).finally((function(){return t.isLoadingRequest=!1}))}}});Shopware.Component.override("sw-settings-payment-detail",{template:'{% block sw_settings_payment_detail_content_card %}\n {% parent %}\n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-state-history-card",{template:' {% block sw_order_state_history_card_transaction %}\n \n \n{% endblock %}',computed:{isHipayPayment:function(){return this.transaction.paymentMethod.formattedHandlerIdentifier.startsWith("handler_hipay")}}});var P=n("yLFk"),A=n("AK4m");Shopware.Locale.extend("en-GB",P),Shopware.Locale.extend("de-DE",A)},AK4m:function(e){e.exports=JSON.parse('{"hipay":{"config":{"days":"Tage","help":{"manual":"Online-Handbuch","github":"Meldung eines Fehler auf GitHub","version":"Versionsnummer"},"checkAccess":{"title":"HiPay Configuration","success":"API-Anmeldeinformationen testen: Die API-Anmeldeinformationen von HiPay sind gültig.","failure":"Test API Credentials : Die API Credentials von HiPay sind nicht gültig.","button":"API-Anmeldedaten testen"},"capture-help":"Automatich: Alle Transaktionen werden automatisch erfasst.
Manual: Alle Transaktionen werden manuell in Ihrem HiPay- oder PrestaShop-Backoffice erfasst.","operation-help":"Hostet Page: Der Kunde wird zu einer sicheren, von HiPay gehosteten Zahlungsseite weitergeleitet. Hosted Fields: Der Kunde gibt seine Bankdaten direkt auf der Website des Händlers ein, die Felder des Formulars werden jedoch von HiPay gehostet. Dieser Modus ist nur für Kreditkarten gültig.","title":{"privateKey":"Private Anmeldedaten","publicKey":"Öffentliche Anmeldedaten","notification":"Einstellungen für Benachrichtigungen"},"info":"Um Sie über Ereignisse im Zusammenhang mit Ihrem Zahlungssystem zu informieren, z. B. über eine neue Transaktion oder eine 3-D Secure-Transaktion, kann die HiPay Plattform Ihrer Anwendung eine Server-to-Server-Benachrichtigung senden. Loggen Sie sich bei HiPay Console ein, wählen Sie einen Account und klicken Sie Integration > Sicherheitseinstellungen um die geheime Passphrase abzurufen.","authenticationIndicator":"3-D Secure-Authentifizierung obligatorisch :
Zum Fortfahren ist eine Authentifizierung erforderlich (diese Authentifizierung kann entweder ein 3DSv2-Challenge-Flow oder ein reibungsloser 3DSv2-Flow sein, ohne dass eine Benutzereingabe erforderlich ist). Schlägt die Authentifizierung fehl, wird die Transaktion abgelehnt und der Kunde wird nicht belastet.

3-D Secure-Authentifizierung, falls verfügbar :
Wenn die Zahlungsmethode dies zulässt, wird ein Authentifizierungsprozess angefordert. Wenn die Authentifizierung jedoch fehlschlägt, wird die Transaktion nicht abgelehnt (nur für den Rest der Welt, da Transaktionen innerhalb der EURO-Zone PSD2 unterliegen und authentifiziert werden müssen).e. Falls von der Bank verlangt, führt der Kunde einen zusätzlichen Authentifizierungsschritt durch, damit die Belastung erfolgreich ist.","logs":{"title":"Logs Herunterladen","download":"Logs herunterladen","failure":"Herunterladen von Dateien fehlgeschlagen"}},"action":{"cancel":"Absagen","capture":"Erfassung","refund":"Erstattung","full_capture":"Vollständige Erfassung","full_refund":"Vollständige Erstattung"},"basket":{"column":{"product":"Produkt","quantity":"Menge","price":"Preis","shipping":"Versandkosten"}},"field":{"capture_amount":"Erfassungsbetrag","remaining_amount":"Restbetrag","order_amount":"Bestellbetrag","captured_amount":"Erfasster Betrag","refund_amount":"Rückerstattungsbetrag","refunded_amount":"Erstatteter Betrag"},"notification":{"capture":{"title":"Transaktionserfassung","success":"Transaktion erfolgreich erfasst","failure":"Fehler bei der Transaktionserfassung"},"refund":{"title":"Transaktionsrückerstattung","success":"Transaktion erfolgreich zurückerstattet","failure":"Fehler bei der Transaktionsrückerstattung"},"cancel":{"title":"Transaktion abbrechen","success":"Transaktion erfolgreich abgebrochen","failure":"Fehler beim Abbrechen der Transaktion"}},"transaction":{"title":"HiPay-Transaktionslebenszyklus"},"settings":{"applepay":{"title":"Konfiguration","merchantName":"Händlername","merchantId":"Händler-ID","buttonType":{"title":"Schaltflächentyp","default":"Standard","buy":"Kaufen","setup":"Einrichten","donate":"Spenden","checkout":"Auschecken","processing":"Verarbeitung","book":"Buchen","subscribe":"Abonnieren"},"buttonStyle":{"title":"Schaltflächenstil","black":"Schwarz","white":"Weiß","whiteOutline":"Weißer Umriss"}},"multibanco":{"title":"Zahlungsablauflimit"},"creditcard":{"title":"Kreditkarten verfügbar","choice":"Kreditkarte auswählen"}}}}')},"C0+k":function(e,t,n){var a=n("n6Dk");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("639cac67",a,!0,{})},C2Iv:function(e,t,n){},EJ7b:function(e,t,n){var a=n("UgRQ");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("73a153b8",a,!0,{})},IHpg:function(e,t,n){var a=n("RvIq");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("d17d5a74",a,!0,{})},PfVt:function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:"hipay";return a(this,l),(n=u.call(this,e,t,i)).headers=n.getBasicHeaders({}),n}return t=l,(n=[{key:"getCurrencyFormater",value:function(e){return new Intl.NumberFormat(localStorage.getItem("sw-admin-locale"),{style:"currency",currency:e})}},{key:"getLogsArrayBuffer",value:function(){var e=this.getBasicHeaders({});return this.httpClient({headers:e,method:"get",url:"/_action/".concat(this.getApiBasePath(),"/get-logs"),responseType:"arraybuffer"})}},{key:"validateConfig",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/checkAccess"),e,{headers:t}).then((function(e){return d.handleResponse(e)}))}},{key:"cancelTransaction",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/cancel"),{hipayOrder:JSON.stringify(e)},{headers:t}).then((function(e){return d.handleResponse(e)}))}},{key:"captureTransaction",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/capture"),{hipayOrder:JSON.stringify(e),amount:t},{headers:n}).then((function(e){return d.handleResponse(e)}))}},{key:"refundTransaction",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/refund"),{hipayOrder:JSON.stringify(e),amount:t},{headers:n}).then((function(e){return d.handleResponse(e)}))}}])&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),l}(d);c.addServiceProvider("hipayService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},RvIq:function(e,t,n){},SZ7m:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{var o=[];for(i=0;i',methods:{html:function(){var e=this.$attrs.name.slice(this.$attrs.name.lastIndexOf(".")+1);return"<"+e+">"+this.$tc(this.$parent.bind.value)+""}}})},yAkZ:function(e){e.exports=JSON.parse('{"name":"hipay/hipay-enterprise-shopware-6","description":"HiPay enterprise plugin for Shopware 6","license":"Apache-2.0","version":"1.2.0","authors":[{"email":"support.tpp@hipay.com","homepage":"https://www.hipay.com","name":"HiPay"}],"keywords":["HiPay","payment","php","shopware"],"type":"shopware-platform-plugin","extra":{"shopware-plugin-class":"HiPay\\\\Payment\\\\HiPayPaymentPlugin","plugin-icon":"src/Resources/config/hipay.png","author":"HiPay","label":{"en-GB":"HiPay Payment","de-DE":"HiPay Payment"},"description":{"en-GB":"Hipay enterprise module for Shopware","de-DE":"Hipay Enterprise-Modul für Shopware"},"manufacturerLink":{"en-GB":"#","de-DE":"#"},"supportLink":{"en-GB":"#","de-DE":"#"}},"autoload":{"psr-4":{"HiPay\\\\Payment\\\\":"src/"}},"autoload-dev":{"psr-4":{"HiPay\\\\Payment\\\\Tests\\\\":"tests/"}},"require":{"hipay/hipay-fullservice-sdk-php":"^2.14.1","giggsey/libphonenumber-for-php":"^8.13"},"require-dev":{"shopware/core":"6.4.*","shopware/storefront":"6.4.*","phpunit/php-code-coverage":"~9.2.14","phpunit/phpunit":"~9.5.17","symfony/phpunit-bridge":"~4.4 || ~5.2.3 || ~5.3.0 || ~5.4.0","infection/infection":"^0.26.6","phpstan/phpstan":"^1.8","friendsofphp/php-cs-fixer":"*"},"archive":{"exclude":["/bin","./\\\\.*","docker-compose.yaml","shopware.sh"]},"config":{"allow-plugins":{"infection/extension-installer":true}}}')},yLFk:function(e){e.exports=JSON.parse('{"hipay":{"config":{"days":"days","help":{"manual":"Online manual","github":"Report Errors on github","version":"Version number"},"checkAccess":{"title":"HiPay Configuration","success":"Test API credentials: The HiPay API credentials are valid.","failure":"Test API credentials: The HiPay API credentials are not valid.","button":"Test API credentials"},"title":{"privateKey":"Private credentials","publicKey":"Public credentials","notification":"Notification settings"},"capture-help":"Automatic: All transactions will be automatically captured.
Manual: All transactions will be captured manually in your HiPay or Shopware back office.","operation-help":"Hosted page: The customer is redirected to a secure payment page hosted by HiPay.
Hosted fields: The customer will fill in their banking information directly on the merchant\'s website but the form fields will be hosted by HiPay. This mode is only valid for credit cards","info":"To inform you about events related to your payment system, e.g. about a new transaction or a 3-D Secure transaction, the HiPay Enterprise platform can send your application a server-to-server notification. Login to Hipay Back Office, go to Integration > Security Settings module and get your HiPay merchant account passphrase.","authenticationIndicator":"3-D Secure authentication mandatory :
An authentication is required to proceed (This authentication can either be a 3DSv2 Challenge flow or a 3DSv2 frictionless flow, without any user input required). If the authentication fails, the transaction will be refused and the client will not be charged.

3-D Secure authentication if available :
If the Payment Method allows it, an authentication process is requested. However, if the authentication fails, the transaction will not be refused (only for rest of the world transactions, as transactions made inside the EURO zone are subject to PSD2 and must be authenticated).e. If required by the bank, the customer completes an additional authentication step for the charge to succeed.","logs":{"title":"Downloading logs","download":"Download logs","failure":"Fail to download logs"}},"action":{"cancel":"Cancel","capture":"Capture","refund":"Refund","full_capture":"Full Capture","full_refund":"Full Refund"},"basket":{"column":{"product":"Product","quantity":"Quantity","price":"Price","shipping":"Shipping costs"}},"field":{"capture_amount":"Capture amount","remaining_amount":"Remaining amount","order_amount":"Order amount","captured_amount":"Captured amount","refund_amount":"Refund amount","refunded_amount":"Refunded amount"},"notification":{"capture":{"title":"Transaction capture","success":"Transaction successfully captured","failure":"Error during transaction capture"},"refund":{"title":"Transaction refund","success":"Transaction successfully refunded","failure":"Error during transaction refund"},"cancel":{"title":"Cancel transaction","success":"Transaction canceled successfully","failure":"Error cancelling transaction"}},"transaction":{"title":"HiPay transaction lifecycle"},"settings":{"applepay":{"title":"Configuration","merchantName":"Merchant name","merchantId":"Merchant ID","buttonType":{"title":"Button type","default":"Default","buy":"Buy","setup":"Set-up","donate":"Donate","checkout":"Check-out","processing":"Processing","book":"Book","subscribe":"Subscribe"},"buttonStyle":{"title":"Button style","black":"Black","white":"White","whiteOutline":"White outline"}},"multibanco":{"title":"Payment expiration limit"},"creditcard":{"title":"Credit cards available","choice":"Select credit card"}}}}')}}); \ No newline at end of file +!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/bundles/hipaypaymentplugin/",n(n.s="3YVu")}({"3YVu":function(e,t,n){"use strict";n.r(t);n("PfVt"),n("xlli");var a=n("yAkZ");n("IHpg");Shopware.Component.register("hipay-help-bloc",{template:'
\n
\n \n\n \n\n
\n \n

\n {{ $tc(\'hipay.config.help.version\') }} : {{ version }}\n

\n
\n
\n
\n',data:function(){return{version:a.version}}});Shopware.Component.register("hipay-help-info",{template:'\n
\n
\n',data:function(){return{text:this.$parent.bind.value}}});var i=Shopware,r=i.Component,o=i.Mixin;r.register("hipay-check-server-access",{template:'\n {{ $tc(\'hipay.config.checkAccess.button\') }}\n\n',inject:["hipayService"],mixins:[o.getByName("notification")],props:{value:{required:!1}},data:function(){return{isLoading:!1,success:!1}},methods:{completeSucess:function(){this.sucess=!1},validateConfig:function(){var e=this;this.isLoading=!0;var t=this.$tc("hipay.config.checkAccess.title");this.hipayService.validateConfig(this.getConfig()).then((function(n){if(!n.success)throw new Error(n.message);e.createNotificationSuccess({title:t,message:e.$tc("hipay.config.checkAccess.success")}),e.success=!0})).catch((function(n){e.createNotificationError({title:t,message:n.message||e.$tc("hipay.config.checkAccess.failure")})})).finally((function(){return e.isLoading=!1}))},getConfig:function(){for(var e=this.$parent;!e.hasOwnProperty("actualConfigData");)e=e.$parent;var t=e.currentSalesChannelId,n=e.actualConfigData;return Object.assign({},n.null,n[t],{environment:this.$parent.bind.env,isApplePay:"true"===this.$parent.bind.isApplePay})}}});var s=Shopware,l=s.Component,u=s.Mixin;l.register("hipay-download-logs",{template:'\n {{ $tc(\'hipay.config.logs.download\') }}\n\n',inject:["hipayService"],mixins:[u.getByName("notification")],props:{value:{required:!1}},data:function(){return{isLoading:!1,success:!1}},methods:{completeSucess:function(){this.sucess=!1},downloadLogs:function(){var e=this;this.isLoading=!0;var t=this.$tc("hipay.config.logs.title");this.hipayService.getLogsArrayBuffer().then((function(e){var t=new Blob([e.data],{type:"application/octet-stream"}),n=window.URL.createObjectURL(t),a=document.createElement("a");a.href=n;var i=e.headers["content-disposition"].split('"');a.download=i[1],document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),window.URL.revokeObjectURL(n),document.body.removeChild(a)})).catch((function(n){e.createNotificationError({title:t,message:n.message||e.$tc("hipay.config.logs.failure")})})).finally((function(){return e.isLoading=!1}))}}});Shopware.Component.register("hipay-settings-cards-selector",{template:'\n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{availableCards:[{label:"Carte Bancaire",value:"cb"},{label:"VISA",value:"visa"},{label:"MasterCard",value:"mastercard"},{label:"Amercian Express",value:"american-express"},{label:"Bancontact / Mister Cash",value:"bcmc"},{label:"Maestro",value:"maestro"}]}},methods:{updateCardsValue:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields={cards:e}:this.paymentMethod.customFields.cards=e}}});function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t\n \n \n {{ limit.label }}\n \n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{availableLimits:[{label:"3 ".concat(this.$tc("hipay.config.days")),value:"3"},{label:"30 ".concat(this.$tc("hipay.config.days")),value:"30"},{label:"90 ".concat(this.$tc("hipay.config.days")),value:"90"}]}},methods:{updateLimitValue:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=p(p({},this.paymentMethod.customFields),{},{expiration_limit:e}):this.paymentMethod.customFields.expiration_limit=e}}});function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function y(e){for(var t=1;t\n\n \n \n\n \n \n {{ buttonType.label }}\n \n \n\n \n \n {{ buttonStyle.label }}\n \n \n\n \n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{buttonTypes:[{label:this.$tc("hipay.settings.applepay.buttonType.default"),value:"default"},{label:this.$tc("hipay.settings.applepay.buttonType.buy"),value:"buy"},{label:this.$tc("hipay.settings.applepay.buttonType.setup"),value:"set-up"},{label:this.$tc("hipay.settings.applepay.buttonType.donate"),value:"donate"},{label:this.$tc("hipay.settings.applepay.buttonType.checkout"),value:"check-out"},{label:this.$tc("hipay.settings.applepay.buttonType.processing"),value:"processing"},{label:this.$tc("hipay.settings.applepay.buttonType.book"),value:"book"},{label:this.$tc("hipay.settings.applepay.buttonType.subscribe"),value:"subscribe"}],buttonStyles:[{label:this.$tc("hipay.settings.applepay.buttonStyle.black"),value:"black"},{label:this.$tc("hipay.settings.applepay.buttonStyle.white"),value:"white"},{label:this.$tc("hipay.settings.applepay.buttonStyle.whiteOutline"),value:"white-outline"}]}},methods:{updateMerchantName:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{merchantName:e}):this.paymentMethod.customFields.merchantName=e},updateButtonType:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{buttonType:e}):this.paymentMethod.customFields.buttonType=e},updateButtonStyle:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{buttonStyle:e}):this.paymentMethod.customFields.buttonStyle=e},updateMerchantId:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=y(y({},this.paymentMethod.customFields),{},{merchantId:e}):this.paymentMethod.customFields.merchantId=e}}});function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function w(e){for(var t=1;t\n\n \n
{{ $tc(\'hipay.settings.paypal.info\')}}
\n
\n\n \n \n\n \n \n {{ color.label }}\n \n \n\n \n \n {{ shape.label }}\n \n \n\n \n \n {{ label.label }}\n \n \n\n \n \n\n \n
{{ $tc(\'hipay.settings.paypal.info_bnpl\')}}
\n
\n\n \n\n',props:{isLoading:{type:Boolean,required:!0},paymentMethod:{type:Object,required:!0}},data:function(){return{isPayPalV2:""!==this.paymentMethod.customFields.merchantPayPalId,colors:[{label:this.$tc("hipay.settings.paypal.color.gold"),value:"gold"},{label:this.$tc("hipay.settings.paypal.color.blue"),value:"blue"},{label:this.$tc("hipay.settings.paypal.color.black"),value:"black"},{label:this.$tc("hipay.settings.paypal.color.silver"),value:"silver"},{label:this.$tc("hipay.settings.paypal.color.white"),value:"white"}],shapes:[{label:this.$tc("hipay.settings.paypal.shape.pill"),value:"pill"},{label:this.$tc("hipay.settings.paypal.shape.rect"),value:"rect"}],labels:[{label:this.$tc("hipay.settings.paypal.label.paypal"),value:"paypal"},{label:this.$tc("hipay.settings.paypal.label.pay"),value:"pay"},{label:this.$tc("hipay.settings.paypal.label.subscribe"),value:"subscribe"},{label:this.$tc("hipay.settings.paypal.label.checkout"),value:"checkout"},{label:this.$tc("hipay.settings.paypal.label.buynow"),value:"buynow"}]}},methods:{updatePayPalStatus:function(e){this.isPayPalV2=""!==e,this.updateMerchantPayPalId(e)},updateMerchantPayPalId:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{merchantPayPalId:e}):this.paymentMethod.customFields.merchantPayPalId=e},updateColor:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{color:e}):this.paymentMethod.customFields.color=e},updateShape:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{shape:e}):this.paymentMethod.customFields.shape=e},updateLabel:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{label:e}):this.paymentMethod.customFields.label=e},updateHeight:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{height:e}):this.paymentMethod.customFields.height=e},updateBnpl:function(e){null===this.paymentMethod.customFields?this.paymentMethod.customFields=w(w({},this.paymentMethod.customFields),{},{bnpl:e}):this.paymentMethod.customFields.bnpl=e}}});n("EJ7b");Shopware.Component.override("sw-data-grid",{template:'{% block sw_data_grid_bulk %}\n
\n {% parent %}\n
\n{% endblock %}\n\n{% block sw_data_grid_columns_render_value %}\n \n \n{% endblock %}\n\n\n',methods:{onValueChange:function(e,t){this.$emit("quantity-change",t,e)}}});n("fk7Z");function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function C(e){for(var t=1;t\n \n \n \n{% endblock %}\n\n\n{% block sw_order_detail_customer_comment_card %}\n {% parent %}\n \n \n \n{% endblock %}\n',inject:["hipayService"],computed:{orderCriteria:function(){var e=this.$super("orderCriteria");return e.addAssociation("hipayOrder"),e.addAssociation("hipayOrder.captures"),e.addAssociation("hipayOrder.refunds"),e.addAssociation("hipayOrder.statusFlows"),e},datasource:function(){var e=this;return this.order.extensions.hipayOrder.statusFlows.sort((function(e,t){return new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()})).map((function(t){return C(C({},t),{},{description:t.name?"".concat(t.name," (").concat(t.code,")"):t.code,createdAt:new Date(t.createdAt).toLocaleString(),amount:e.hipayService.getCurrencyFormater(e.order.currency.isoCode).format(t.amount)})}))},columns:function(){return[{property:"description",label:"Status"},{property:"createdAt",label:"Date"},{property:"message",label:"Message"},{property:"amount",label:"Amount"}]},getTitle:function(){return this.$t("hipay.transaction.title")+" #"+this.order.extensions.hipayOrder.transactionReference},isHipayPayment:function(){return this.transaction.paymentMethod.formattedHandlerIdentifier.startsWith("handler_hipay")}},watch:{order:function(){this.$root.$emit("order-loaded",this.order)}}});n("C0+k");function k(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,r=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw r}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n\n \n \n {{ $tc(\'hipay.action.capture\') }}\n \n \n {{ $tc(\'hipay.action.refund\') }}\n \n \n {{ $tc(\'hipay.action.cancel\') }}\n \n {% parent %}\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n \n\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n
\n\n \n \n{% endblock %}\n',inject:["hipayService"],data:function(){return{orderData:null,hipayOrderData:null,showOrderCapture:!1,showOrderRefund:!1,lastTransaction:null,lineItems:null,basketColumns:[{property:"label",label:this.$tc("hipay.basket.column.product"),multiLine:!0},{property:"quantity",label:this.$tc("hipay.basket.column.quantity")},{property:"totalPrice",label:this.$tc("hipay.basket.column.price")}],currency:null,captureAmount:null,refundAmount:null,manualCaptureAmount:null,manualRefundAmount:null,fullCapture:!0,fullRefund:!0,showOrderStateForCapture:!1,showOrderStateForRefund:!1,showOrderStateForCancel:!1,isLoadingRequest:!1}},computed:{showOnHipayMethod:function(){var e,t;return/hipay/.test(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t?void 0:t.formattedHandlerIdentifier)},canCancel:function(){var e,t;return["authorized"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canCapture:function(){var e,t;return["paid_partially","authorized"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canPartialCapture:function(){var e,t,n,a;return this.canCapture&&!1!==(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t||null===(n=t.extensions)||void 0===n||null===(a=n.hipayConfig)||void 0===a?void 0:a.allowPartialCapture)},canRefund:function(){var e,t;return["paid_partially","paid","refunded_partially"].includes(null===(e=this.lastTransaction)||void 0===e||null===(t=e.stateMachineState)||void 0===t?void 0:t.technicalName)},canPartialRefund:function(){var e,t,n,a;return this.canRefund&&!1!==(null===(e=this.lastTransaction)||void 0===e||null===(t=e.paymentMethod)||void 0===t||null===(n=t.extensions)||void 0===n||null===(a=n.hipayConfig)||void 0===a?void 0:a.allowPartialRefund)},orderBasket:function(){var e,t=k(this.lineItems);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.totalPrice=this.formatCurrency(n.unitPrice*n.currentQuantity),n.editable=this.canPartialCapture}}catch(e){t.e(e)}finally{t.f()}return this.lineItems},orderAmount:function(){return this.orderData.amountTotal},capturedAmount:function(){return this.hipayOrderData.capturedAmount},capturedAmountInProgress:function(){return this.hipayOrderData.capturedAmountInProgress},remainingCaptureAmount:function(){return Number((this.orderAmount-this.capturedAmountInProgress).toFixed(2))},refundedAmountInProgress:function(){return this.hipayOrderData.refundedAmountInProgress},remainingRefundAmount:function(){return Number((this.capturedAmount-this.refundedAmountInProgress).toFixed(2))},getCaptureAmount:function(){var e;return null!==(e=this.captureAmount)&&void 0!==e?e:this.manualCaptureAmount},getRefundAmount:function(){var e;return null!==(e=this.refundAmount)&&void 0!==e?e:this.manualRefundAmount},isInvalidFullCaptureAmount:function(){return this.remainingCaptureAmount<=0},isInvalidCaptureAmount:function(){return!this.getCaptureAmount||this.isInvalidFullCaptureAmount},isInvalidFullRefundAmount:function(){return this.remainingRefundAmount<=0},isInvalidRefundAmount:function(){return!this.getRefundAmount||this.isInvalidFullRefundAmount},captureAmountPlaceholder:function(){return this.captureAmount>this.remainingCaptureAmount?this.remainingCaptureAmount:this.captureAmount},refundAmountPlaceholder:function(){return this.refundAmount>this.remainingRefundAmount?this.remainingRefundAmount:this.refundAmount}},methods:{formatCurrency:function(e){return this.hipayService.getCurrencyFormater(this.currency).format(e)},openCapture:function(){this.showOrderCapture=!0},openRefund:function(){this.showOrderRefund=!0},openCancel:function(){this.showOrderStateForCancel=!0},createdComponent:function(){this.$super("createdComponent"),this.$root.$on("order-loaded",this.orderLoaded)},destroyedComponent:function(){this.$root.$off("order-loaded",this.orderLoaded),this.$super("destroyedComponent")},orderLoaded:function(e){var t;this.orderData=e,this.currency=e.currency.isoCode,this.lastTransaction=this.orderData.transactions.last(),this.hipayOrderData=null===(t=this.orderData.extensions)||void 0===t?void 0:t.hipayOrder;var n=JSON.parse(JSON.stringify(this.orderData.lineItems));for(var a in this.orderData.shippingCosts.totalPrice>0&&n.push({label:this.$tc("hipay.basket.column.shipping"),quantity:1,totalPrice:this.orderData.shippingCosts.totalPrice,unitPrice:this.orderData.shippingCosts.totalPrice,shipping:!0}),n)n[a].currentQuantity=n[a].quantity;this.lineItems=n},closeOrderCaptureModal:function(){for(var e in this.showOrderCapture=!1,this.captureAmount=null,this.manualCaptureAmount=null,this.lineItems)this.lineItems[e].currentQuantity=this.lineItems[e].quantity},closeOrderRefundModal:function(){for(var e in this.showOrderRefund=!1,this.refundAmount=null,this.manualRefundAmount=null,this.lineItems)this.lineItems[e].currentQuantity=this.lineItems[e].quantity},closeCancelModal:function(){this.showOrderStateForCancel=!1},onSelectProductForCapture:function(e){var t=0;for(var n in e)this.$refs.basket.isSelected(e[n].id)&&(t+=e[n].unitPrice*e[n].currentQuantity);this.captureAmount=t||null},onSelectProductForRefund:function(e){var t=0;for(var n in e)this.$refs.basket.isSelected(e[n].id)&&(t+=e[n].unitPrice*e[n].currentQuantity);this.refundAmount=t||null},selectAllProducts:function(){this.$refs.basket.selectAll(!0)},isProductSelectable:function(e){return e.good||e.shipping},onManualCaptureAmount:function(e){this.manualCaptureAmount=e},onManualRefundAmount:function(e){this.manualRefundAmount=e},onQuantityChangeForCapture:function(e,t){var n=this.lineItems.findIndex((function(e){return e.id===t.id}));n>=0&&(this.lineItems[n].currentQuantity=e),this.onSelectProductForCapture(this.lineItems)},onQuantityChangeForRefund:function(e,t){var n=this.lineItems.findIndex((function(e){return e.id===t.id}));n>=0&&(this.lineItems[n].currentQuantity=e),this.onSelectProductForRefund(this.lineItems)},captureOrder:function(){this.$refs.captureAmount.currentValue!==this.remainingCaptureAmount&&(this.fullCapture=!1),this.showOrderStateForCapture=!0},fullCaptureOrder:function(){this.showOrderStateForCapture=!0},refundOrder:function(){this.$refs.refundAmount.currentValue!==this.remainingRefundAmount&&(this.fullRefund=!1),this.showOrderStateForRefund=!0},fullRefundOrder:function(){this.showOrderStateForRefund=!0},closeOrderStateModal:function(){this.showOrderStateForCapture=!1,this.showOrderStateForRefund=!1},makeCancel:function(){var e=this;this.isLoadingRequest=!0,this.hipayService.cancelTransaction(this.hipayOrderData).then((function(t){if(!t.success)throw new Error(t.message);e.createNotificationSuccess({title:e.$tc("hipay.notification.cancel.title"),message:e.$tc("hipay.notification.cancel.success")})})).catch((function(){e.createNotificationError({title:e.$tc("hipay.notification.capture.title"),message:e.$tc("hipay.notification.capture.failure")})})).finally((function(){return e.isLoadingRequest=!1}))},makeCapture:function(){var e,t=this;this.isLoadingRequest=!0,this.hipayService.captureTransaction(this.hipayOrderData,this.fullCapture?this.remainingCaptureAmount:null!==(e=this.$refs.captureAmount.currentValue)&&void 0!==e?e:this.captureAmountPlaceholder).then((function(e){if(!e.success)throw new Error(e.message);t.createNotificationSuccess({title:t.$tc("hipay.notification.capture.title"),message:t.$tc("hipay.notification.capture.success")}),e.captures&&(t.hipayOrderData.captures=e.captures),e.captured_amount&&(t.hipayOrderData.capturedAmountInProgress=e.captured_amount),t.showOrderStateForCapture=!1,t.$nextTick((function(){t.showOrderCapture=!1}))})).catch((function(){t.createNotificationError({title:t.$tc("hipay.notification.capture.title"),message:t.$tc("hipay.notification.capture.failure")})})).finally((function(){return t.isLoadingRequest=!1}))},makeRefund:function(){var e,t=this;this.isLoadingRequest=!0,this.hipayService.refundTransaction(this.hipayOrderData,this.fullRefund?this.remainingRefundAmount:null!==(e=this.$refs.refundAmount.currentValue)&&void 0!==e?e:this.refundAmountPlaceholder).then((function(e){if(!e.success)throw new Error(e.message);t.createNotificationSuccess({title:t.$tc("hipay.notification.refund.title"),message:t.$tc("hipay.notification.refund.success")}),e.refunds&&(t.hipayOrderData.refunds=e.refunds),e.refunded_amount&&(t.hipayOrderData.refundedAmountInProgress=e.refunded_amount),t.showOrderStateForRefund=!1,t.$nextTick((function(){t.showOrderRefund=!1}))})).catch((function(){t.createNotificationError({title:t.$tc("hipay.notification.refund.title"),message:t.$tc("hipay.notification.refund.failure")})})).finally((function(){return t.isLoadingRequest=!1}))}}});Shopware.Component.override("sw-settings-payment-detail",{template:'{% block sw_settings_payment_detail_content_card %}\n {% parent %}\n \n \n \n \n{% endblock %}\n'});Shopware.Component.override("sw-order-state-history-card",{template:' {% block sw_order_state_history_card_transaction %}\n \n \n{% endblock %}',computed:{isHipayPayment:function(){return this.transaction.paymentMethod.formattedHandlerIdentifier.startsWith("handler_hipay")}}});var _=n("yLFk"),$=n("AK4m");Shopware.Locale.extend("en-GB",_),Shopware.Locale.extend("de-DE",$)},AK4m:function(e){e.exports=JSON.parse('{"hipay":{"config":{"days":"Tage","help":{"manual":"Online-Handbuch","github":"Meldung eines Fehler auf GitHub","version":"Versionsnummer"},"checkAccess":{"title":"HiPay Configuration","success":"API-Anmeldeinformationen testen: Die API-Anmeldeinformationen von HiPay sind gültig.","failure":"Test API Credentials : Die API Credentials von HiPay sind nicht gültig.","button":"API-Anmeldedaten testen"},"capture-help":"Automatich: Alle Transaktionen werden automatisch erfasst.
Manual: Alle Transaktionen werden manuell in Ihrem HiPay- oder PrestaShop-Backoffice erfasst.","operation-help":"Hostet Page: Der Kunde wird zu einer sicheren, von HiPay gehosteten Zahlungsseite weitergeleitet. Hosted Fields: Der Kunde gibt seine Bankdaten direkt auf der Website des Händlers ein, die Felder des Formulars werden jedoch von HiPay gehostet. Dieser Modus ist nur für Kreditkarten gültig.","title":{"privateKey":"Private Anmeldedaten","publicKey":"Öffentliche Anmeldedaten","notification":"Einstellungen für Benachrichtigungen"},"info":"Um Sie über Ereignisse im Zusammenhang mit Ihrem Zahlungssystem zu informieren, z. B. über eine neue Transaktion oder eine 3-D Secure-Transaktion, kann die HiPay Plattform Ihrer Anwendung eine Server-to-Server-Benachrichtigung senden. Loggen Sie sich bei HiPay Console ein, wählen Sie einen Account und klicken Sie Integration > Sicherheitseinstellungen um die geheime Passphrase abzurufen.","authenticationIndicator":"3-D Secure-Authentifizierung obligatorisch :
Zum Fortfahren ist eine Authentifizierung erforderlich (diese Authentifizierung kann entweder ein 3DSv2-Challenge-Flow oder ein reibungsloser 3DSv2-Flow sein, ohne dass eine Benutzereingabe erforderlich ist). Schlägt die Authentifizierung fehl, wird die Transaktion abgelehnt und der Kunde wird nicht belastet.

3-D Secure-Authentifizierung, falls verfügbar :
Wenn die Zahlungsmethode dies zulässt, wird ein Authentifizierungsprozess angefordert. Wenn die Authentifizierung jedoch fehlschlägt, wird die Transaktion nicht abgelehnt (nur für den Rest der Welt, da Transaktionen innerhalb der EURO-Zone PSD2 unterliegen und authentifiziert werden müssen).e. Falls von der Bank verlangt, führt der Kunde einen zusätzlichen Authentifizierungsschritt durch, damit die Belastung erfolgreich ist.","logs":{"title":"Logs Herunterladen","download":"Logs herunterladen","failure":"Herunterladen von Dateien fehlgeschlagen"}},"action":{"cancel":"Absagen","capture":"Erfassung","refund":"Erstattung","full_capture":"Vollständige Erfassung","full_refund":"Vollständige Erstattung"},"basket":{"column":{"product":"Produkt","quantity":"Menge","price":"Preis","shipping":"Versandkosten"}},"field":{"capture_amount":"Erfassungsbetrag","remaining_amount":"Restbetrag","order_amount":"Bestellbetrag","captured_amount":"Erfasster Betrag","refund_amount":"Rückerstattungsbetrag","refunded_amount":"Erstatteter Betrag"},"notification":{"capture":{"title":"Transaktionserfassung","success":"Transaktion erfolgreich erfasst","failure":"Fehler bei der Transaktionserfassung"},"refund":{"title":"Transaktionsrückerstattung","success":"Transaktion erfolgreich zurückerstattet","failure":"Fehler bei der Transaktionsrückerstattung"},"cancel":{"title":"Transaktion abbrechen","success":"Transaktion erfolgreich abgebrochen","failure":"Fehler beim Abbrechen der Transaktion"}},"transaction":{"title":"HiPay-Transaktionslebenszyklus"},"settings":{"applepay":{"title":"Konfiguration","merchantName":"Händlername","merchantId":"Händler-ID","buttonType":{"title":"Schaltflächentyp","default":"Standard","buy":"Kaufen","setup":"Einrichten","donate":"Spenden","checkout":"Auschecken","processing":"Verarbeitung","book":"Buchen","subscribe":"Abonnieren"},"buttonStyle":{"title":"Schaltflächenstil","black":"Schwarz","white":"Weiß","whiteOutline":"Weißer Umriss"}},"multibanco":{"title":"Zahlungsablauflimit"},"creditcard":{"title":"Kreditkarten verfügbar","choice":"Kreditkarte auswählen"},"paypal":{"title":"PayPal v2 Konfiguration","merchantPayPalId":"Händler PayPal ID","info":"Es ist notwendig, eine Händler PayPal ID anzugeben, um PayPal v2 nutzen zu können und den Button anzupassen.","bnpl_label":"\'Jetzt kaufen, später bezahlen\' Funktion aktivieren","info_bnpl":"Die Funktion \'Jetzt kaufen, später bezahlen\' ist nur verfügbar, wenn die Währung des Geschäfts Euro ist und wenn der Warenkorbwert zwischen 30 und 2000 liegt.","color":{"title":"Buttonfarbe","gold":"Gold","blue":"Blau","black":"Schwarz","silver":"Silber","white":"Weiß"},"shape":{"title":"Buttonform","pill":"Abgerundet","rect":"Rechteck"},"label":{"title":"Buttonbeschriftung","paypal":"PayPal","pay":"Bezahlen","subscribe":"Abonnieren","checkout":"Kasse","buynow":"Jetzt kaufen"},"height":{"title":"Buttonhöhe"}}}}}')},"C0+k":function(e,t,n){var a=n("n6Dk");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("639cac67",a,!0,{})},C2Iv:function(e,t,n){},EJ7b:function(e,t,n){var a=n("UgRQ");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("73a153b8",a,!0,{})},IHpg:function(e,t,n){var a=n("RvIq");a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);(0,n("SZ7m").default)("d17d5a74",a,!0,{})},PfVt:function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:"hipay";return a(this,u),(n=l.call(this,e,t,i)).headers=n.getBasicHeaders({}),n}return t=u,(n=[{key:"getCurrencyFormater",value:function(e){return new Intl.NumberFormat(localStorage.getItem("sw-admin-locale"),{style:"currency",currency:e})}},{key:"getLogsArrayBuffer",value:function(){var e=this.getBasicHeaders({});return this.httpClient({headers:e,method:"get",url:"/_action/".concat(this.getApiBasePath(),"/get-logs"),responseType:"arraybuffer"})}},{key:"validateConfig",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/checkAccess"),e,{headers:t}).then((function(e){return d.handleResponse(e)}))}},{key:"cancelTransaction",value:function(e){var t=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/cancel"),{hipayOrder:JSON.stringify(e)},{headers:t}).then((function(e){return d.handleResponse(e)}))}},{key:"captureTransaction",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/capture"),{hipayOrder:JSON.stringify(e),amount:t},{headers:n}).then((function(e){return d.handleResponse(e)}))}},{key:"refundTransaction",value:function(e,t){var n=this.getBasicHeaders({});return this.httpClient.post("/_action/".concat(this.getApiBasePath(),"/refund"),{hipayOrder:JSON.stringify(e),amount:t},{headers:n}).then((function(e){return d.handleResponse(e)}))}}])&&i(t.prototype,n),s&&i(t,s),Object.defineProperty(t,"prototype",{writable:!1}),u}(d);c.addServiceProvider("hipayService",(function(e){var t=c.getContainer("init");return new p(t.httpClient,e.loginService)}))},RvIq:function(e,t,n){},SZ7m:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},i=0;in.parts.length&&(a.parts.length=n.parts.length)}else{var o=[];for(i=0;i',methods:{html:function(){var e=this.$attrs.name.slice(this.$attrs.name.lastIndexOf(".")+1);return"<"+e+">"+this.$tc(this.$parent.bind.value)+""}}})},yAkZ:function(e){e.exports=JSON.parse('{"name":"hipay/hipay-enterprise-shopware-6","description":"HiPay enterprise plugin for Shopware 6","license":"Apache-2.0","version":"1.3.0","authors":[{"email":"support.tpp@hipay.com","homepage":"https://www.hipay.com","name":"HiPay"}],"keywords":["HiPay","payment","php","shopware"],"type":"shopware-platform-plugin","extra":{"shopware-plugin-class":"HiPay\\\\Payment\\\\HiPayPaymentPlugin","plugin-icon":"src/Resources/config/hipay.png","author":"HiPay","label":{"en-GB":"HiPay Payment","de-DE":"HiPay Payment"},"description":{"en-GB":"Hipay enterprise module for Shopware","de-DE":"Hipay Enterprise-Modul für Shopware"},"manufacturerLink":{"en-GB":"#","de-DE":"#"},"supportLink":{"en-GB":"#","de-DE":"#"}},"autoload":{"psr-4":{"HiPay\\\\Payment\\\\":"src/"}},"autoload-dev":{"psr-4":{"HiPay\\\\Payment\\\\Tests\\\\":"tests/"}},"require":{"hipay/hipay-fullservice-sdk-php":"^2.14.1","giggsey/libphonenumber-for-php":"^8.13"},"require-dev":{"shopware/core":"6.4.*","shopware/storefront":"6.4.*","phpunit/php-code-coverage":"~9.2.14","phpunit/phpunit":"~9.5.17","symfony/phpunit-bridge":"~4.4 || ~5.2.3 || ~5.3.0 || ~5.4.0","infection/infection":"^0.26.6","phpstan/phpstan":"^1.8","friendsofphp/php-cs-fixer":"*"},"archive":{"exclude":["/bin","./\\\\.*","docker-compose.yaml","shopware.sh"]},"config":{"allow-plugins":{"infection/extension-installer":true}}}')},yLFk:function(e){e.exports=JSON.parse('{"hipay":{"config":{"days":"days","help":{"manual":"Online manual","github":"Report Errors on github","version":"Version number"},"checkAccess":{"title":"HiPay Configuration","success":"Test API credentials: The HiPay API credentials are valid.","failure":"Test API credentials: The HiPay API credentials are not valid.","button":"Test API credentials"},"title":{"privateKey":"Private credentials","publicKey":"Public credentials","notification":"Notification settings"},"capture-help":"Automatic: All transactions will be automatically captured.
Manual: All transactions will be captured manually in your HiPay or Shopware back office.","operation-help":"Hosted page: The customer is redirected to a secure payment page hosted by HiPay.
Hosted fields: The customer will fill in their banking information directly on the merchant\'s website but the form fields will be hosted by HiPay. This mode is only valid for credit cards","info":"To inform you about events related to your payment system, e.g. about a new transaction or a 3-D Secure transaction, the HiPay Enterprise platform can send your application a server-to-server notification. Login to Hipay Back Office, go to Integration > Security Settings module and get your HiPay merchant account passphrase.","authenticationIndicator":"3-D Secure authentication mandatory :
An authentication is required to proceed (This authentication can either be a 3DSv2 Challenge flow or a 3DSv2 frictionless flow, without any user input required). If the authentication fails, the transaction will be refused and the client will not be charged.

3-D Secure authentication if available :
If the Payment Method allows it, an authentication process is requested. However, if the authentication fails, the transaction will not be refused (only for rest of the world transactions, as transactions made inside the EURO zone are subject to PSD2 and must be authenticated).e. If required by the bank, the customer completes an additional authentication step for the charge to succeed.","logs":{"title":"Downloading logs","download":"Download logs","failure":"Fail to download logs"}},"action":{"cancel":"Cancel","capture":"Capture","refund":"Refund","full_capture":"Full Capture","full_refund":"Full Refund"},"basket":{"column":{"product":"Product","quantity":"Quantity","price":"Price","shipping":"Shipping costs"}},"field":{"capture_amount":"Capture amount","remaining_amount":"Remaining amount","order_amount":"Order amount","captured_amount":"Captured amount","refund_amount":"Refund amount","refunded_amount":"Refunded amount"},"notification":{"capture":{"title":"Transaction capture","success":"Transaction successfully captured","failure":"Error during transaction capture"},"refund":{"title":"Transaction refund","success":"Transaction successfully refunded","failure":"Error during transaction refund"},"cancel":{"title":"Cancel transaction","success":"Transaction canceled successfully","failure":"Error cancelling transaction"}},"transaction":{"title":"HiPay transaction lifecycle"},"settings":{"applepay":{"title":"Configuration","merchantName":"Merchant name","merchantId":"Merchant ID","buttonType":{"title":"Button type","default":"Default","buy":"Buy","setup":"Set-up","donate":"Donate","checkout":"Check-out","processing":"Processing","book":"Book","subscribe":"Subscribe"},"buttonStyle":{"title":"Button style","black":"Black","white":"White","whiteOutline":"White outline"}},"multibanco":{"title":"Payment expiration limit"},"creditcard":{"title":"Credit cards available","choice":"Select credit card"},"paypal":{"title":"Configuration PayPal v2","merchantPayPalId":"Merchant PayPal ID","info":"It is necessary to indicate a Merchant Paypal ID in order to be able to use PayPal v2 and to customize the button.","bnpl_label":"Activate \'Buy now, pay later\' feature","info_bnpl":"The \'Buy now, Pay later\' feature is only available if the store currency is euros and if the basket amount is between 30 and 2000.","color":{"title":"Button color","gold":"Gold","blue":"Blue","black":"Black","silver":"Silver","white":"White"},"shape":{"title":"Button shape","pill":"Rounded","rect":"Rectangle"},"label":{"title":"Button label","paypal":"PayPal","pay":"Pay","subscribe":"Subscribe","checkout":"Checkout","buynow":"Buy Now"},"height":{"title":"Button height"}}}}}')}}); \ No newline at end of file diff --git a/src/Resources/views/storefront/component/payment/hosted-fields/handler-hipay-paypal.html.twig b/src/Resources/views/storefront/component/payment/hosted-fields/handler-hipay-paypal.html.twig new file mode 100644 index 0000000..548e4e0 --- /dev/null +++ b/src/Resources/views/storefront/component/payment/hosted-fields/handler-hipay-paypal.html.twig @@ -0,0 +1,7 @@ +
+ {% block hipay_paypal_html %} +
+
+
+ {% endblock %} +
\ No newline at end of file diff --git a/src/Resources/views/storefront/component/payment/payment-method.html.twig b/src/Resources/views/storefront/component/payment/payment-method.html.twig index 7ccf60f..3534e33 100644 --- a/src/Resources/views/storefront/component/payment/payment-method.html.twig +++ b/src/Resources/views/storefront/component/payment/payment-method.html.twig @@ -22,15 +22,15 @@ and 'handler_hipay_' in payment.formattedHandlerIdentifier and activeRoute in ['frontend.account.edit-order.page', 'frontend.checkout.confirm.page'] %} + {% set environment = config('HiPayPaymentPlugin.config.environment') %} + {% set isPayPalV2 = payment.customFields.merchantPayPalId != "" %} + {% set componentName = payment.formattedHandlerIdentifier|replace({'_':'-'}) %} {% if config('HiPayPaymentPlugin.config.operationMode') == 'hostedFields' and payment.extensions.hipayConfig.haveHostedFields + or isPayPalV2 %} - - - {% set componentName = payment.formattedHandlerIdentifier|replace({'_':'-'}) %} - {% set environment = config('HiPayPaymentPlugin.config.environment') %} - + {% if componentName == 'handler-hipay-applepay'%} {% set hipayConfig = { username: config('HiPayPaymentPlugin.config.publicApplePayLogin' ~ environment), @@ -58,6 +58,24 @@ } } %} + {% elseif componentName == 'handler-hipay-paypal' %} + {% set hipayConfig = { + username: config('HiPayPaymentPlugin.config.publicLogin' ~ environment), + password: config('HiPayPaymentPlugin.config.publicPassword' ~ environment), + environment: environment|lower, + merchantPayPalId: payment.customFields.merchantPayPalId, + canPayLater: payment.customFields.bnpl, + amount: summary.price.rawTotal, + currency: page.header.activeCurrency.isoCode, + lang: page.header.activeLanguage.translationCode.code|slice(0, 2), + locale: page.header.activeLanguage.translationCode.code|replace({'-':'_'}), + styles: { + color: payment.customFields.color, + shape: payment.customFields.shape, + label: payment.customFields.label, + height: payment.customFields.height + } + }%} {% else %} {% set hipayConfig = { username: config('HiPayPaymentPlugin.config.publicLogin' ~ environment), @@ -90,7 +108,7 @@ {% endblock %} {% sw_include '@HiPayPaymentPlugin/storefront/component/payment/hosted-fields/' ~ componentName ~ '.html.twig' %} - {% elseif payment.formattedHandlerIdentifier != 'handler_hipay_multibanco' || config('HiPayPaymentPlugin.config.operationMode') != 'hostedFields' + {% elseif payment.formattedHandlerIdentifier != 'handler_hipay_multibanco' && not isPayPalV2 || config('HiPayPaymentPlugin.config.operationMode') != 'hostedFields' %}

{{ 'hipay.hosted-page.redirect-message'|trans }}

{% endif %} diff --git a/src/Service/NotificationService.php b/src/Service/NotificationService.php index ce3f68a..e765291 100644 --- a/src/Service/NotificationService.php +++ b/src/Service/NotificationService.php @@ -576,7 +576,7 @@ private function handleCapturedNotification(HipayNotificationEntity $notificatio /** * Add order Transaction capture. */ - private function saveCapture(string $status, ?OrderCaptureEntity $capture, float $amount = null, string $operationId = null, HipayOrderEntity $hipayOrder = null): void + private function saveCapture(string $status, ?OrderCaptureEntity $capture, ?float $amount = null, ?string $operationId = null, ?HipayOrderEntity $hipayOrder = null): void { $context = Context::createDefaultContext(); if (!$capture) { @@ -591,7 +591,7 @@ private function saveCapture(string $status, ?OrderCaptureEntity $capture, float /** * Add order Transaction refund. */ - private function saveRefund(string $status, ?OrderRefundEntity $refund, float $amount = null, string $operationId = null, HipayOrderEntity $hipayOrder = null): void + private function saveRefund(string $status, ?OrderRefundEntity $refund, ?float $amount = null, ?string $operationId = null, ?HipayOrderEntity $hipayOrder = null): void { $context = Context::createDefaultContext(); if (!$refund) { diff --git a/tests/Unit/PaymentMethod/PaypalTest.php b/tests/Unit/PaymentMethod/PaypalTest.php index a8ea774..728086c 100644 --- a/tests/Unit/PaymentMethod/PaypalTest.php +++ b/tests/Unit/PaymentMethod/PaypalTest.php @@ -35,7 +35,14 @@ public function testhydrateFields() public function testStatic() { $this->assertEquals( - [], + [ + 'merchantPayPalId' => '', + 'color' => 'gold', + 'shape' => 'pill', + 'label' => 'paypal', + 'height' => '40', + 'bnpl' => true, + ], Paypal::addDefaultCustomFields() );