From 080284b6fdd1944d174cd9ff50cf3eb511acef1e Mon Sep 17 00:00:00 2001 From: Edgaras Date: Wed, 17 Jan 2024 14:21:49 +0200 Subject: [PATCH] Release 1.0.19 --- README.md | 2 +- Services/PostFinanceCheckoutTransactionService.php | 14 +++++++++++++- docs/en/documentation.html | 2 +- info.xml | 2 +- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 8 ++++---- vendor/composer/autoload_static.php | 8 ++++---- vendor/composer/installed.php | 4 ++-- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 2fb448f..b2d3d1c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ account dashboard. ## Documentation -[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/jtl-5/1.0.18/docs/en/documentation.html) +[Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/jtl-5/1.0.19/docs/en/documentation.html) ## License diff --git a/Services/PostFinanceCheckoutTransactionService.php b/Services/PostFinanceCheckoutTransactionService.php index 116ccb8..18e959a 100644 --- a/Services/PostFinanceCheckoutTransactionService.php +++ b/Services/PostFinanceCheckoutTransactionService.php @@ -17,6 +17,7 @@ use stdClass; use PostFinanceCheckout\Sdk\ApiClient; use PostFinanceCheckout\Sdk\Model\{AddressCreate, + Gender, LineItemCreate, LineItemType, Transaction, @@ -143,7 +144,6 @@ public function confirmTransaction(Transaction $transaction): void ]); $pendingTransaction->setMerchantReference($orderNr); - $this->apiClient->getTransactionService() ->confirm($this->spaceId, $pendingTransaction); @@ -533,6 +533,12 @@ private function createBillingAddress(): AddressCreate $billingAddress->setPhoneNumber($customer->cMobil); $billingAddress->setSalutation($customer->cTitel); + $gender = $_SESSION['orderData']?->oKunde?->cAnrede ?? null; + if ($gender !== null) { + $billingAddress->setGender($gender === 'm' ? Gender::MALE : Gender::FEMALE); + $billingAddress->setSalutation($gender === 'm' ? 'Mr' : 'Ms'); + } + return $billingAddress; } @@ -556,6 +562,12 @@ private function createShippingAddress(): AddressCreate $shippingAddress->setPhoneNumber($customer->cMobil); $shippingAddress->setSalutation($customer->cTitel); + $gender = $_SESSION['orderData']?->oKunde?->cAnrede ?? null; + if ($gender !== null) { + $shippingAddress->setGender($gender === 'm' ? Gender::MALE : Gender::FEMALE); + $shippingAddress->setSalutation($gender === 'm' ? 'Mr' : 'Ms'); + } + return $shippingAddress; } } diff --git a/docs/en/documentation.html b/docs/en/documentation.html index 3bedd8c..43e7fa5 100644 --- a/docs/en/documentation.html +++ b/docs/en/documentation.html @@ -22,7 +22,7 @@

Documentation

  • - + Source
  • diff --git a/info.xml b/info.xml index a9ae25e..ee14a9e 100644 --- a/info.xml +++ b/info.xml @@ -9,7 +9,7 @@ logo.jpg jtl_postfinancecheckout 2023-05-29 - 1.0.18 + 1.0.19 diff --git a/vendor/autoload.php b/vendor/autoload.php index ba565d0..1d55823 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitb19b981bc254fb8ee325a2de1b4ba3e2::getLoader(); +return ComposerAutoloaderInit39b485e377e8f7811713b1fbf9c612ac::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 8336fba..f0cede1 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitb19b981bc254fb8ee325a2de1b4ba3e2 +class ComposerAutoloaderInit39b485e377e8f7811713b1fbf9c612ac { private static $loader; @@ -24,12 +24,12 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInitb19b981bc254fb8ee325a2de1b4ba3e2', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit39b485e377e8f7811713b1fbf9c612ac', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitb19b981bc254fb8ee325a2de1b4ba3e2', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit39b485e377e8f7811713b1fbf9c612ac', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit39b485e377e8f7811713b1fbf9c612ac::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 91ea5ee..ab6deec 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2 +class ComposerStaticInit39b485e377e8f7811713b1fbf9c612ac { public static $prefixLengthsPsr4 = array ( 'W' => @@ -35,9 +35,9 @@ class ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitb19b981bc254fb8ee325a2de1b4ba3e2::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit39b485e377e8f7811713b1fbf9c612ac::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit39b485e377e8f7811713b1fbf9c612ac::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit39b485e377e8f7811713b1fbf9c612ac::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 01fa510..2ce81ce 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '480d57c9e991b9cb79e69c14625a681a17509333', + 'reference' => 'db06ed79c3f185677bba7b74be6816d7935a67d2', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '480d57c9e991b9cb79e69c14625a681a17509333', + 'reference' => 'db06ed79c3f185677bba7b74be6816d7935a67d2', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),