Skip to content

Commit

Permalink
Merge pull request #265 from OXID-eSales/b-6.3.x-installement-keys-UN…
Browse files Browse the repository at this point in the history
…ZER-348

B 6.3.x installement keys unzer 348
  • Loading branch information
mariolorenz authored May 23, 2024
2 parents dba241f + 75643b8 commit edf4194
Show file tree
Hide file tree
Showing 27 changed files with 685 additions and 552 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.2.0] - unreleased - 2024-??-??

### NEW
- new Paymentmethod Unzer installment (Paylater)
- If customers - for whatever reason - interrupt the order in the checkout, the order is still saved using a temporary order and Unzer's webhook
- New Paymentmethod Unzer installment (Paylater)
- If a customer interrupt the order in the checkout for any reason, the order is still saved using a temporary order and Unzer's webhook [oxid6]

### FIXED
- refactor of the correct use of the appropriate credentials depending on the payment method used
- [0007553](https://bugs.oxid-esales.com/view.php?id=7553) revert this task because, it is possible to have different billing and delivery addresses for invoice purchases (Paylater)
- [0007586](https://bugs.oxid-esales.com/view.php?id=7586) - Fix: Unable to finish the checkout process using the Apple Pay as the payment method
- [0007638](https://bugs.oxid-esales.com/view.php?id=7638) - Fix: Sometimes duplicate order-positions in Backend, and dublicate ordermails ...
Expand Down
13 changes: 12 additions & 1 deletion Tests/Codeception/_data/dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ REPLACE INTO `oxuser` SET
OXCOUNTRYID = 'a7c40f631fc920687.20179984',
OXBIRTHDATE = '1980-11-22',
OXCREATE = '2021-02-05 14:42:42',
OXREGISTER = '2021-02-05 14:42:42';
OXREGISTER = '2021-02-05 14:42:42';


REPLACE INTO `oxcounters` SET
OXIDENT = 'oxOrder',
OXCOUNT = 747,
OXTIMESTAMP = '2024-05-13 12:04:58';

REPLACE INTO `oxcounters` SET
OXIDENT = 'oxUnzerOrder',
OXCOUNT = 420,
OXTIMESTAMP = '2024-05-13 12:04:58';
5 changes: 3 additions & 2 deletions Tests/PhpStan/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
parameters:
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
bootstrapFiles:
- phpstan-bootstrap.php
level: max
scanFiles:
- ../../vendor/oxid-esales/oxideshop-ce/source/oxfunctions.php
- ../../vendor/oxid-esales/oxideshop-ce/source/overridablefunctions.php
- ../../vendor/oxid-esales/oxideshop-ce/source/overridablefunctions.php
ignoreErrors:
- identifier: missingType.iterableValue
4 changes: 2 additions & 2 deletions Tests/Unit/PaymentExtensions/UnzerPaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testDefaultExecute(): void
$unzerServiceMock->method('prepareOrderRedirectUrl')->willReturn('someRedirectUrl');
$unzerServiceMock->method('getUnzerCustomer')->with($userModel)->willReturn($customer = new Customer());
$unzerServiceMock->method('getShopMetadata')->willReturn($metadata = new Metadata());
$unzerServiceMock->method('generateUnzerOrderId')->willReturn(1234567890);
$unzerServiceMock->method('generateUnzerOrderId')->willReturn('1234567890');
$unzerServiceMock->method('getUnzerBasket')->willReturn($unzerBasket);

$chargeResult = $this->createPartialMock(Charge::class, []);
Expand Down Expand Up @@ -78,7 +78,7 @@ public function testDefaultExecute(): void
'EUR',
'someRedirectUrl',
$customer,
1234567890,
'1234567890',
$metadata,
$unzerBasket
)
Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/Service/ModuleSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getSettingsDataProvider(): array
['sandbox-UnzerPublicKey', Module::MODULE_ID, 'sandboxPublicKey'],
['production-UnzerPublicKey', Module::MODULE_ID, 'productionPublicKey'],
],
'settingMethod' => 'getShopPublicKey',
'settingMethod' => 'getStandardPublicKey',
'settingValue' => 'sandboxPublicKey'
],
[
Expand All @@ -95,7 +95,7 @@ public function getSettingsDataProvider(): array
['sandbox-UnzerPublicKey', Module::MODULE_ID, 'sandboxPublicKey'],
['production-UnzerPublicKey', Module::MODULE_ID, 'productionPublicKey'],
],
'settingMethod' => 'getShopPublicKey',
'settingMethod' => 'getStandardPublicKey',
'settingValue' => 'productionPublicKey'
],
[
Expand All @@ -104,7 +104,7 @@ public function getSettingsDataProvider(): array
['sandbox-UnzerPrivateKey', Module::MODULE_ID, 'sandboxPrivateKey'],
['production-UnzerPrivateKey', Module::MODULE_ID, 'productionPrivateKey'],
],
'settingMethod' => 'getShopPrivateKey',
'settingMethod' => 'getStandardPrivateKey',
'settingValue' => 'sandboxPrivateKey'
],
[
Expand All @@ -113,7 +113,7 @@ public function getSettingsDataProvider(): array
['sandbox-UnzerPrivateKey', Module::MODULE_ID, 'sandboxPrivateKey'],
['production-UnzerPrivateKey', Module::MODULE_ID, 'productionPrivateKey'],
],
'settingMethod' => 'getShopPrivateKey',
'settingMethod' => 'getStandardPrivateKey',
'settingValue' => 'productionPrivateKey'
],
[
Expand Down
2 changes: 1 addition & 1 deletion Tests/Unit/Service/UnzerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function testIfImmediatePostAuthCollectFalse(): void
$paymentService = $this->getPaymentServiceMock($sut);

$paymentService->method('getUnzerOrderId')
->willReturn(666);
->willReturn('666');

$sql = "INSERT INTO oxorder SET OXID=9999, OXPAYMENTTYPE='oscunzer_paypal', OXUNZERORDERNR=666";
DatabaseProvider::getDb()->execute($sql);
Expand Down
82 changes: 47 additions & 35 deletions metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</ul>',
],
'thumbnail' => 'logo.svg',
'version' => '1.2.0-rc.6',
'version' => '1.2.0-rc.7',
'author' => 'OXID eSales AG',
'url' => 'https://www.oxid-esales.com',
'email' => 'info@oxid-esales.com',
Expand Down Expand Up @@ -272,152 +272,164 @@
'type' => 'str',
'value' => ''
],
// unzer invoice keypairs

// live Paylater Invoice B2C EUR
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPublicKeyB2CEUR',
'name' => 'production-UnzerPayLaterInvoiceB2CEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPrivateKeyB2CEUR',
'name' => 'production-UnzerPayLaterInvoiceB2CEURPublicKey',
'type' => 'str',
'value' => ''
],
// live Paylater Invoice B2B EUR
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPublicKeyB2BEUR',
'name' => 'production-UnzerPayLaterInvoiceB2BEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPrivateKeyB2BEUR',
'name' => 'production-UnzerPayLaterInvoiceB2BEURPublicKey',
'type' => 'str',
'value' => ''
],
// live Paylater Invoice B2C CHF
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPublicKeyB2CCHF',
'name' => 'production-UnzerPayLaterInvoiceB2CCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPrivateKeyB2CCHF',
'name' => 'production-UnzerPayLaterInvoiceB2CCHFPublicKey',
'type' => 'str',
'value' => ''
],
// live Paylater Invoice B2B CHF
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPublicKeyB2BCHF',
'name' => 'production-UnzerPayLaterInvoiceB2BCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPrivateKeyB2BCHF',
'name' => 'production-UnzerPayLaterInvoiceB2BCHFPublicKey',
'type' => 'str',
'value' => ''
],
// live Paylater Installment B2C EUR
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPublicKeyB2CEUR',
'group' => 'unzerpaylater',
'name' => 'production-UnzerPayLaterInstallmentB2CEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPrivateKeyB2CEUR',
'group' => 'unzerpaylater',
'name' => 'production-UnzerPayLaterInstallmentB2CEURPublicKey',
'type' => 'str',
'value' => ''
],
// live Paylater Installment B2C CHF
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPublicKeyB2BEUR',
'group' => 'unzerpaylater',
'name' => 'production-UnzerPayLaterInstallmentB2CCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPrivateKeyB2BEUR',
'group' => 'unzerpaylater',
'name' => 'production-UnzerPayLaterInstallmentB2CCHFPublicKey',
'type' => 'str',
'value' => ''
],

// sandbox Paylater Invoice B2C EUR
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPublicKeyB2CCHF',
'name' => 'sandbox-UnzerPayLaterInvoiceB2CEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPrivateKeyB2CCHF',
'name' => 'sandbox-UnzerPayLaterInvoiceB2CEURPublicKey',
'type' => 'str',
'value' => ''
],
// sandbox Paylater Invoice B2B EUR
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPublicKeyB2BCHF',
'name' => 'sandbox-UnzerPayLaterInvoiceB2BEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerinvoice',
'name' => 'production-UnzerPrivateKeyB2BCHF',
'name' => 'sandbox-UnzerPayLaterInvoiceB2BEURPublicKey',
'type' => 'str',
'value' => ''
],
// sandbox Paylater Invoice B2C CHF
[
'group' => 'unzerpaylater',
'name' => 'sandbox-UnzerPaylaterPublicKeyB2CEUR',
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPayLaterInvoiceB2CCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerpaylater',
'name' => 'sandbox-UnzerPaylaterPrivateKeyB2CEUR',
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPayLaterInvoiceB2CCHFPublicKey',
'type' => 'str',
'value' => ''
],
// sandbox Paylater Invoice B2B CHF
[
'group' => 'unzerpaylater',
'name' => 'sandbox-UnzerPaylaterPublicKeyB2CCHF',
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPayLaterInvoiceB2BCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerpaylater',
'name' => 'sandbox-UnzerPaylaterPrivateKeyB2CCHF',
'group' => 'unzerinvoice',
'name' => 'sandbox-UnzerPayLaterInvoiceB2BCHFPublicKey',
'type' => 'str',
'value' => ''
],
// sandbox Paylater Installment B2C EUR
[
'group' => 'unzerpaylater',
'name' => 'production-UnzerPaylaterPublicKeyB2CEUR',
'name' => 'sandbox-UnzerPayLaterInstallmentB2CEURPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerpaylater',
'name' => 'production-UnzerPaylaterPrivateKeyB2CEUR',
'name' => 'sandbox-UnzerPayLaterInstallmentB2CEURPublicKey',
'type' => 'str',
'value' => ''
],
// sandbox Paylater Installment B2C CHF
[
'group' => 'unzerpaylater',
'name' => 'production-UnzerPaylaterPublicKeyB2CCHF',
'name' => 'sandbox-UnzerPayLaterInstallmentB2CCHFPrivateKey',
'type' => 'str',
'value' => ''
],
[
'group' => 'unzerpaylater',
'name' => 'production-UnzerPaylaterPrivateKeyB2CCHF',
'name' => 'sandbox-UnzerPayLaterInstallmentB2CCHFPublicKey',
'type' => 'str',
'value' => ''
],

[
'group' => 'unzerother',
'name' => 'UnzerjQuery',
Expand Down
Loading

0 comments on commit edf4194

Please sign in to comment.