From ba6d59b944e96234c9aa418fb36050fab49cf66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Hrdina?= Date: Tue, 5 Sep 2023 14:01:06 +0000 Subject: [PATCH] feat: fixes #9 --- src/Core/Util/Payload/TransactionPayload.php | 12 ++++++------ .../storefront/dist/storefront/js/wallee-payment.js | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 src/Resources/app/storefront/dist/storefront/js/wallee-payment.js diff --git a/src/Core/Util/Payload/TransactionPayload.php b/src/Core/Util/Payload/TransactionPayload.php index ff078b1..a68b737 100644 --- a/src/Core/Util/Payload/TransactionPayload.php +++ b/src/Core/Util/Payload/TransactionPayload.php @@ -176,7 +176,7 @@ public function get(): TransactionCreate if (!empty($companyDepartment = $customer->getDefaultBillingAddress()->getDepartment())) { $transactionData['meta_data']['billingCompanyDepartment'] = $companyDepartment; } - + if (!empty($companyDepartment = $customer->getDefaultShippingAddress()->getDepartment())) { $transactionData['meta_data']['shippingCompanyDepartment'] = $companyDepartment; } @@ -399,7 +399,7 @@ protected function getProductAttributes(OrderLineItemEntity $shopLineItem): ?arr $label = $option['group']; $lineItemAttributeCreate = (new LineItemAttributeCreate()) ->setLabel($this->fixLength($label, 512)) - ->setValue($this->fixLength($option['option'], 512)); + ->setValue($this->fixLength((string)$option['option'], 512)); if ($lineItemAttributeCreate->valid()) { $key = $this->fixLength('option_' . md5($label), 40); @@ -544,7 +544,7 @@ protected function getAddressPayload(CustomerEntity $customer, CustomerAddressEn } $organization_name = !empty($organization_name) ? $this->fixLength($organization_name, 100) : null; - + $salesTaxNumber = null; if ($returnSalesTaxNumber) { // salesTaxNumber @@ -590,7 +590,7 @@ protected function getAddressPayload(CustomerEntity $customer, CustomerAddressEn 'street' => $customerAddressEntity->getStreet() ? $this->fixLength($customerAddressEntity->getStreet(), 300) : null, 'birthday' => $birthday ]; - + if ($returnSalesTaxNumber) { $addressData['sales_tax_number'] = $salesTaxNumber; } @@ -607,11 +607,11 @@ protected function getAddressPayload(CustomerEntity $customer, CustomerAddressEn ->setPostalState($addressData['postal_state']) ->setSalutation($addressData['salutation']) ->setStreet($addressData['street']); - + if ($returnSalesTaxNumber) { $addressPayload->setSalesTaxNumber($addressData['sales_tax_number']); } - + if (!empty($addressData['birthday'])) { $addressPayload->setDateOfBirth($addressData['birthday']); } diff --git a/src/Resources/app/storefront/dist/storefront/js/wallee-payment.js b/src/Resources/app/storefront/dist/storefront/js/wallee-payment.js new file mode 100644 index 0000000..63acda6 --- /dev/null +++ b/src/Resources/app/storefront/dist/storefront/js/wallee-payment.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["wallee-payment"],{5201:(e,t,a)=>{var n,r,i,l=a(6285),m=a(8254);class o extends l.Z{init(){this._client=new m.Z(window.accessKey)}}n=o,i={payment_method_tabs:"ul.wallee-payment-panel li",payment_method_iframe_prefix:"iframe_payment_method_",payment_method_iframe_class:".wallee-payment-iframe",payment_method_handler_name:"wallee_payment_handler",payment_method_handler_prefix:"wallee_handler_",payment_method_handler_status:'input[name="wallee_payment_handler_validation_status"]',payment_form:"confirmOrderForm"},(r=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(r="options"))in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i;const _=o;window.PluginManager.register("WalleeCheckoutPlugin",_,"[data-wallee-checkout-plugin]")}},e=>{e.O(0,["vendor-node","vendor-shared"],(()=>{return t=5201,e(e.s=t);var t}));e.O()}]); \ No newline at end of file