Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.5.9
* Update: Unzer PHP SDK 4.0.1
* Entfernung von individuellem Plugin-php Requirement in composer.json

# 6.5.8
* Der Express-Checkout funktioniert unter Shopware 6.6 wieder zuverlässig, einschließlich PayPal und Apple Pay
* Beim Express-Checkout wird nun eine verständliche Fehlermeldung angezeigt, wenn die Erstellung der Zahlung fehlschlägt, anstatt den Kunden kommentarlos weiterzuleiten
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 6.5.9
* Update: Unzer PHP SDK 4.0.1
* Removed individual php requirement in composer.json

# 6.5.8
* Express checkout no longer fails in Shopware 6.6, including PayPal and Apple Pay
* Express checkout now shows a clear error message when payment creation fails, instead of silently redirecting
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "unzerdev/shopware6",
"description": "Unzer payment integration for Shopware 6",
"version": "6.5.8",
"version": "6.5.9",
"type": "shopware-platform-plugin",
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand All @@ -20,8 +20,7 @@
}
},
"require": {
"php": ">=8.2 || <=8.3",
"unzerdev/php-sdk": "~3.13.0",
"unzerdev/php-sdk": "~4.0.0",
"shopware/core": "~6.6.0",
"shopware/administration": "~6.6.0",
"shopware/storefront": "~6.6.0"
Expand Down
41 changes: 17 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public function hydrateObject(
throw new \RuntimeException(\sprintf('Could not determine the address for customer with number %s', $customer->getCustomerNumber()));
}

$billingAddress = $this->prepareAddress($billingAddress);
$shippingAddress = $this->prepareAddress($shippingAddress);

if (empty($billingAddress->getCompany()) || !\in_array($paymentMethodId, self::B2B_CUSTOMERS_ALLOWED, true)) {
$unzerCustomer = CustomerFactory::createCustomer(
$billingAddress->getFirstName(),
Expand Down Expand Up @@ -127,6 +130,8 @@ public function hydrateExistingCustomer(
throw new \RuntimeException(\sprintf('Could not determine the address for customer with number %s', $customer->getCustomerNumber()));
}

$billingAddress = $this->prepareAddress($billingAddress);

return $this->updateAdditionalDataToCustomer($unzerCustomer, $customer, $billingAddress, $orderTransaction);
}

Expand Down Expand Up @@ -306,4 +311,23 @@ private function updateShippingAddress(Customer $unzerCustomer, OrderAddressEnti

$unzerCustomer->setShippingAddress($unzerShippingAddress);
}
}

protected function prepareAddress(OrderAddressEntity|CustomerAddressEntity|null $address):OrderAddressEntity|CustomerAddressEntity|null{
if($address === null){
return null;
}

$address = clone $address;

$address->setFirstName(trim($address->getFirstName()));
$address->setLastName(trim($address->getLastName()));
$address->setStreet(trim($address->getStreet()));
$address->setZipcode(trim($address->getZipcode()));
$address->setCity(trim($address->getCity()));
if(!empty($address->getCompany())){
$address->setCompany(trim($address->getCompany()));
}

return $address;
}
}
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class ComposerStaticInitf95eb65f29edce7a2336b2687d62b002
{
public static $prefixLengthsPsr4 = array (
'U' =>
'U' =>
array (
'UnzerSDK\\examples\\' => 18,
'UnzerSDK\\' => 9,
Expand All @@ -16,15 +16,15 @@ class ComposerStaticInitf95eb65f29edce7a2336b2687d62b002
);

public static $prefixDirsPsr4 = array (
'UnzerSDK\\examples\\' =>
'UnzerSDK\\examples\\' =>
array (
0 => __DIR__ . '/..' . '/unzerdev/php-sdk/examples',
),
'UnzerSDK\\' =>
'UnzerSDK\\' =>
array (
0 => __DIR__ . '/..' . '/unzerdev/php-sdk/src',
),
'UnzerPayment6\\' =>
'UnzerPayment6\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
Expand Down
18 changes: 9 additions & 9 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
"packages": [
{
"name": "unzerdev/php-sdk",
"version": "3.13.1",
"version_normalized": "3.13.1.0",
"version": "4.0.1",
"version_normalized": "4.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/unzerdev/php-sdk.git",
"reference": "0a26d70b33185d52e49b06cb500a6e01bb6f1087"
"reference": "a9344b823fbf5374cd49e07ab6352d385578299e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/unzerdev/php-sdk/zipball/0a26d70b33185d52e49b06cb500a6e01bb6f1087",
"reference": "0a26d70b33185d52e49b06cb500a6e01bb6f1087",
"url": "https://api.github.com/repos/unzerdev/php-sdk/zipball/a9344b823fbf5374cd49e07ab6352d385578299e",
"reference": "a9344b823fbf5374cd49e07ab6352d385578299e",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "~7.4.0|~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0"
"php": "~8.1.0|~8.2.0|~8.3.0|~8.4.0|~8.5.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": ">6.5 <10.0"
"phpunit/phpunit": "^9.6"
},
"suggest": {
"ext-curl": "*"
},
"time": "2025-09-23T14:21:50+00:00",
"time": "2026-05-15T13:48:06+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -42,7 +42,7 @@
"description": "This is the php sdk to connect to the Unzer rest API.",
"support": {
"email": "support@unzer.com",
"source": "https://github.com/unzerdev/php-sdk/tree/3.13.1"
"source": "https://github.com/unzerdev/php-sdk/tree/4.0.1"
},
"install-path": "../unzerdev/php-sdk"
}
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'unzerdev/shopware6',
'pretty_version' => '6.99.2',
'version' => '6.99.2.0',
'pretty_version' => '6.5.8',
'version' => '6.5.8.0',
'reference' => null,
'type' => 'shopware-platform-plugin',
'install_path' => __DIR__ . '/../../',
Expand All @@ -17,17 +17,17 @@
),
),
'unzerdev/php-sdk' => array(
'pretty_version' => '3.13.1',
'version' => '3.13.1.0',
'reference' => '0a26d70b33185d52e49b06cb500a6e01bb6f1087',
'pretty_version' => '4.0.1',
'version' => '4.0.1.0',
'reference' => 'a9344b823fbf5374cd49e07ab6352d385578299e',
'type' => 'library',
'install_path' => __DIR__ . '/../unzerdev/php-sdk',
'aliases' => array(),
'dev_requirement' => false,
),
'unzerdev/shopware6' => array(
'pretty_version' => '6.99.2',
'version' => '6.99.2.0',
'pretty_version' => '6.5.8',
'version' => '6.5.8.0',
'reference' => null,
'type' => 'shopware-platform-plugin',
'install_path' => __DIR__ . '/../../',
Expand Down
9 changes: 4 additions & 5 deletions vendor/composer/platform_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

$issues = array();

if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
if (!(PHP_VERSION_ID >= 80100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}

if ($issues) {
Expand All @@ -19,8 +19,7 @@
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}
22 changes: 20 additions & 2 deletions vendor/unzerdev/php-sdk/.github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ on:
branches:
- 'main'
workflow_dispatch:
inputs:
php-version:
description: 'PHP version to run tests on'
required: false
default: '8.1'
type: string

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
name: integration tests
env:
UNZER_PAPI_TEST_PRIVATE_KEY_DEFAULT: ${{ secrets.PAPI_PRIVATE_KEY_DEFAULT }}
Expand All @@ -24,7 +33,8 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: ${{ inputs.php-version || '8.1' }}
ini-values: error_reporting=E_ALL, display_errors=On, display_startup_errors=On
- name: Setup Apple Pay test certificate
run: mkdir certs
- run: echo "$APPLE_PAY_MERCHANT_ID_CERT" > certs/merchant_id.pem
Expand All @@ -33,4 +43,12 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run integration tests
run: php ./vendor/bin/phpunit test/integration
run: php ./vendor/bin/phpunit --log-junit test-results/junit.xml test/integration
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'test-results/junit.xml'
check_name: 'Integration Test Report'
detailed_summary: true
fail_on_failure: true
16 changes: 14 additions & 2 deletions vendor/unzerdev/php-sdk/.github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
strategy:
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
php: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
name: PHP ${{ matrix.php }} unit tests
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL, display_errors=On, display_startup_errors=On
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run unit tests
run: php ./vendor/bin/phpunit test/unit
run: php ./vendor/bin/phpunit --log-junit test-results/junit-${{ matrix.php }}.xml test/unit
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: failure()
with:
report_paths: 'test-results/junit-${{ matrix.php }}.xml'
check_name: 'Unit Test Report (PHP ${{ matrix.php }})'
detailed_summary: true
fail_on_failure: true
Loading
Loading