Skip to content

Commit e006c7f

Browse files
committed
PBX_BILLING & PBX_SHOPPINGCART update
1 parent 2857d0b commit e006c7f

File tree

11 files changed

+612
-104
lines changed

11 files changed

+612
-104
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
/behat.yml
1212
/phpspec.yml
1313
/phpunit.xml
14-
/.php-version

composer.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
"description": "Acme example plugin for Sylius.",
66
"license": "MIT",
77
"require": {
8-
"php": "^8.0",
9-
10-
"sylius/sylius": "^1.9"
8+
"php": "^7.3 || ^8.0",
9+
"sylius/sylius": "^1.8"
1110
},
1211
"require-dev": {
1312
"behat/behat": "^3.6.1",
@@ -21,17 +20,16 @@
2120
"friends-of-behat/suite-settings-extension": "^1.0",
2221
"friends-of-behat/symfony-extension": "^2.1",
2322
"friends-of-behat/variadic-extension": "^1.3",
24-
"lakion/mink-debug-extension": "^2.0",
23+
"lakion/mink-debug-extension": "^1.2.3 || ^2.0",
2524
"phpspec/phpspec": "^6.1",
2625
"phpstan/extension-installer": "^1.0",
27-
"phpstan/phpstan": "^1.0",
28-
"phpstan/phpstan-doctrine": "^1.0",
29-
"phpstan/phpstan-strict-rules": "^1.0",
30-
"phpstan/phpstan-webmozart-assert": "^1.0",
26+
"phpstan/phpstan": "0.12.25 || ^1.0",
27+
"phpstan/phpstan-doctrine": "0.12.13 || ^1.0",
28+
"phpstan/phpstan-strict-rules": "^0.12.0 || ^1.0",
29+
"phpstan/phpstan-webmozart-assert": "0.12.4 || ^1.0",
3130
"phpunit/phpunit": "^8.5",
32-
"rector/rector": "^0.13.10",
3331
"sensiolabs/security-checker": "^6.0",
34-
"sylius-labs/coding-standard": "^4.2",
32+
"sylius-labs/coding-standard": "^3.1 || ^4.2",
3533
"symfony/browser-kit": "^4.4",
3634
"symfony/debug-bundle": "^4.4|^5.0",
3735
"symfony/dotenv": "^4.4|^5.0",

src/Action/CaptureAction.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,29 @@ final class CaptureAction implements ActionInterface, ApiAwareInterface
3434
{
3535
use GatewayAwareTrait;
3636

37-
private array $api = [];
37+
private $api = [];
3838

39-
public function __construct(private Payum $payum, private EtransactionsBridgeInterface $etransactionsBridge)
39+
/**
40+
* @var Payum
41+
*/
42+
private $payum;
43+
44+
/**
45+
* @var EtransactionsBridgeInterface
46+
*/
47+
private $etransactionsBridge;
48+
49+
/**
50+
* @param Payum $payum
51+
* @param EtransactionsBridgeInterface $etransactionsBridge
52+
*/
53+
public function __construct(
54+
Payum $payum,
55+
EtransactionsBridgeInterface $etransactionsBridge
56+
)
4057
{
58+
$this->etransactionsBridge = $etransactionsBridge;
59+
$this->payum = $payum;
4160
}
4261

4362
/**
@@ -75,7 +94,7 @@ public function execute($request)
7594
/** @var TokenInterface $token */
7695
$token = $request->getToken();
7796

78-
$transactionReference = $model['transactionReference'] ?? null;
97+
$transactionReference = isset($model['transactionReference']) ? $model['transactionReference'] : null;
7998

8099
if ($transactionReference !== null) {
81100

@@ -126,7 +145,8 @@ public function execute($request)
126145
$currencyCode,
127146
$transactionReference,
128147
$customerEmail,
129-
$automaticResponseUrl
148+
$automaticResponseUrl,
149+
$order
130150
);
131151

132152
$request->setModel($model);

src/Action/NotifyAction.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,29 @@ final class NotifyAction implements ActionInterface, ApiAwareInterface
2929
{
3030
use GatewayAwareTrait;
3131

32-
private array $api = [];
32+
private $api = [];
3333

34-
public function __construct(private EtransactionsBridgeInterface $etransactionsBridge, private FactoryInterface $stateMachineFactory)
34+
/**
35+
* @var EtransactionsBridgeInterface
36+
*/
37+
private $etransactionsBridge;
38+
39+
/**
40+
* @var FactoryInterface
41+
*/
42+
private $stateMachineFactory;
43+
44+
/**
45+
* @param EtransactionsBridgeInterface $etransactionsBridge
46+
* @param FactoryInterface $stateMachineFactory
47+
*/
48+
public function __construct(
49+
EtransactionsBridgeInterface $etransactionsBridge,
50+
FactoryInterface $stateMachineFactory
51+
)
3552
{
53+
$this->etransactionsBridge = $etransactionsBridge;
54+
$this->stateMachineFactory = $stateMachineFactory;
3655
}
3756

3857
/**

src/Action/StatusAction.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,17 @@
2323
*/
2424
final class StatusAction implements ActionInterface
2525
{
26-
public function __construct(private RequestStack $requestStack)
26+
/**
27+
* @var RequestStack
28+
*/
29+
private $requestStack;
30+
31+
/**
32+
* @param RequestStack $requestStack
33+
*/
34+
public function __construct(RequestStack $requestStack)
2735
{
36+
$this->requestStack = $requestStack;
2837
}
2938

3039
/**
@@ -40,9 +49,9 @@ public function execute($request)
4049

4150
$requestCurrent = $this->requestStack->getCurrentRequest();
4251

43-
$transactionReference = $model['transactionReference'] ?? null;
52+
$transactionReference = isset($model['transactionReference']) ? $model['transactionReference'] : null;
4453

45-
$status = $model['status'] ?? null;
54+
$status = isset($model['status']) ? $model['status'] : null;
4655

4756
if ((null === $transactionReference) && !$requestCurrent->isMethod('POST')) {
4857

src/Bridge/EtransactionsBridge.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@
1818
*/
1919
final class EtransactionsBridge implements EtransactionsBridgeInterface
2020
{
21-
public function __construct(private RequestStack $requestStack)
21+
/**
22+
* @var RequestStack
23+
*/
24+
private $requestStack;
25+
26+
/**
27+
* @param RequestStack $requestStack
28+
*/
29+
public function __construct(RequestStack $requestStack)
2230
{
31+
$this->requestStack = $requestStack;
2332
}
2433

2534
/**

src/EtransactionsGatewayFactory.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ protected function populateConfig(ArrayObject $config)
2121
]);
2222

2323
if (false == $config['payum.api']) {
24-
$config['payum.default_options'] = ['site' => '', 'rang' => '', 'identifiant' => '', 'hmac' => '', 'hash' => 'SHA512', 'retour' => 'Mt:M;Ref:R;Auto:A;error_code:E', 'sandbox' => false, 'type_paiement' => '', 'type_carte' => ''];
24+
$config['payum.default_options'] = array(
25+
'site' => '',
26+
'rang' => '',
27+
'identifiant' => '',
28+
'hmac' => '',
29+
'hash' => 'SHA512',
30+
'retour' => 'Mt:M;Ref:R;Auto:A;error_code:E',
31+
'sandbox' => false,
32+
'type_paiement' => '',
33+
'type_carte' => ''
34+
);
2535
$config->defaults($config['payum.default_options']);
26-
$config['payum.required_options'] = ['site', 'rang', 'identifiant', 'hmac'];
36+
$config['payum.required_options'] = array('site', 'rang', 'identifiant', 'hmac');
2737

2838
// $config['payum.api'] = function (ArrayObject $config) {
2939
// $config->validateNotEmpty($config['payum.required_options']);

0 commit comments

Comments
 (0)