Skip to content

Commit 20a692e

Browse files
committed
Bugfix: proper creation of external payment services from config
1 parent 8712657 commit 20a692e

File tree

12 files changed

+3627
-18
lines changed

12 files changed

+3627
-18
lines changed

.gitignore

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
log/*
2-
temp/*
31
vendor/*
42
certs/*
5-
!.gitignore
63
!.htaccess
7-
!web.config
84
app/config/config.local.neon
9-
composer.lock
105
/nbproject/private/
116
/nbproject
127
/articles_img/*
@@ -15,3 +10,83 @@ composer.lock
1510
/profiles_img/*
1611
/showroom_img/*
1712
app/payment/ecomm/Merchant.php
13+
14+
15+
16+
# Created by https://www.gitignore.io/api/nette,phpstorm
17+
18+
### Nette ###
19+
# Nette - http://nette.org
20+
# Ignore /log and /temp directories content but commit .htaccess settings
21+
/log/*
22+
!/log/.htaccess
23+
/temp/*
24+
!/temp/.htaccess
25+
26+
### PhpStorm ###
27+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
28+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
29+
30+
# User-specific stuff:
31+
.idea/**/workspace.xml
32+
.idea/**/tasks.xml
33+
.idea/dictionaries
34+
35+
# Sensitive or high-churn files:
36+
.idea/**/dataSources/
37+
.idea/**/dataSources.ids
38+
.idea/**/dataSources.xml
39+
.idea/**/dataSources.local.xml
40+
.idea/**/sqlDataSources.xml
41+
.idea/**/dynamic.xml
42+
.idea/**/uiDesigner.xml
43+
44+
# Gradle:
45+
.idea/**/gradle.xml
46+
.idea/**/libraries
47+
48+
# CMake
49+
cmake-build-debug/
50+
51+
# Mongo Explorer plugin:
52+
.idea/**/mongoSettings.xml
53+
54+
## File-based project format:
55+
*.iws
56+
57+
## Plugin-specific files:
58+
59+
# IntelliJ
60+
/out/
61+
62+
# mpeltonen/sbt-idea plugin
63+
.idea_modules/
64+
65+
# JIRA plugin
66+
atlassian-ide-plugin.xml
67+
68+
# Cursive Clojure plugin
69+
.idea/replstate.xml
70+
71+
# Ruby plugin and RubyMine
72+
/.rakeTasks
73+
74+
# Crashlytics plugin (for Android Studio and IntelliJ)
75+
com_crashlytics_export_strings.xml
76+
crashlytics.properties
77+
crashlytics-build.properties
78+
fabric.properties
79+
80+
### PhpStorm Patch ###
81+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
82+
83+
# *.iml
84+
# modules.xml
85+
# .idea/misc.xml
86+
# *.ipr
87+
88+
# Sonarlint plugin
89+
.idea/sonarlint
90+
91+
92+
# End of https://www.gitignore.io/api/nette,phpstorm

.idea/cuk.iml

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ It is CRITICAL that whole `app/`, `log/` and `temp/` directories are not accessi
3333

3434
## Requirements
3535

36-
PHP 7.0 or higher.
36+
PHP 7.0 or 7.1, Nette 2.3 is not compatible with newer versions of PHP starting with 7.2.
3737

3838
## Documentation
3939

app/helpers/IfmsaConnectionHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ public function fetchPersonCC($afNumber, & $personInfo)
987987
@$dom_view_cc->loadHTML($body);
988988

989989
foreach ($dom_view_cc->getElementsByTagName('div') as $node) { // load information from Card of Confirmation
990-
991990
// get emergency contact
992991
if (strpos($node->getAttribute('class'), 'item-title') !== false &&
993992
$node->nodeValue == 'In case of emergency, please contact :') {

app/helpers/date/DateHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function createFromDateOrLastDayOfMonth($text): DateTimeHolder
4545
* @param string $text
4646
* @return \App\Helpers\Date\DateTimeHolder
4747
*/
48-
public function createDateOrDefault($text): DateTimeHolder {
48+
public function createDateOrDefault($text): DateTimeHolder
49+
{
4950
$holder = new DateTimeHolder;
5051
try {
5152
$date = new \DateTime($text);

app/helpers/pdf/IfmsaRemotePdfFactory.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ private function getimgsize($url)
5151
{
5252
return @getimagesize($url);
5353
/*$ch = curl_init();
54-
curl_setopt($ch, CURLOPT_URL, $url);
55-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
56-
$file_contents = curl_exec($ch);
57-
curl_close($ch);
54+
curl_setopt($ch, CURLOPT_URL, $url);
55+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
56+
$file_contents = curl_exec($ch);
57+
curl_close($ch);
5858
59-
$new_image = ImageCreateFromString($file_contents);
59+
$new_image = ImageCreateFromString($file_contents);
6060
61-
$return = array(imagesx($new_image), imagesy($new_image));
61+
$return = array(imagesx($new_image), imagesy($new_image));
6262
63-
imagedestroy($new_image);
63+
imagedestroy($new_image);
6464
65-
return $return;*/
65+
return $return;*/
6666
}
6767

6868
/**

app/payment/external/ExternalServices.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function __construct(array $params)
2727
$value['okRedirectionUrl'],
2828
$value['failRedirectionUrl']
2929
);
30+
$this->services[$service->getId()] = $service;
3031
}
31-
$this->services[$service->getId()] = $service;
3232
}
3333

3434
/**
@@ -44,4 +44,13 @@ public function findService(string $id): ExternalService
4444
}
4545
throw new PaymentException("Service {$id} cannot be found");
4646
}
47+
48+
/**
49+
* Return all currently registered services.
50+
* @return array
51+
*/
52+
public function getServices(): array
53+
{
54+
return $this->services;
55+
}
4756
}

0 commit comments

Comments
 (0)