Skip to content

Commit 402e78e

Browse files
committed
Merge branch 'release/4.2.2'
2 parents 0960a57 + b751c0c commit 402e78e

File tree

8 files changed

+371
-338
lines changed

8 files changed

+371
-338
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
77
## [Unreleased][unreleased]
88
-
99

10+
## [4.2.2] - 2022-10-11
11+
- Fixed catching exceptions in issuer field (pronamic/wp-pronamic-pay-gravityforms#10).
12+
1013
## [4.2.1] - 2022-09-27
1114
- Update to `wp-pay/core` version `^4.4`.
1215

@@ -352,7 +355,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
352355
## 1.0.0 - 2015-01-01
353356
- First release.
354357

355-
[unreleased]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.2.1...HEAD
358+
[unreleased]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.2.2...HEAD
359+
[4.2.2]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.2.1...4.2.2
356360
[4.2.1]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.2.0...4.2.1
357361
[4.2.0]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.1.1...4.2.0
358362
[4.1.1]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.1.0...4.1.1

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@
5050
"php-coveralls/php-coveralls": "^2.4",
5151
"phpmd/phpmd": "^2.9",
5252
"phpunit/phpunit": "^5.7 || ^6.0",
53+
"pronamic/gravityforms": "^2.6",
5354
"pronamic/wp-coding-standards": "^1.0",
5455
"roots/wordpress": "^5.8",
5556
"wp-phpunit/wp-phpunit": "^5.8",
56-
"wp-premium/gravityforms": "^2.3",
5757
"yoast/phpunit-polyfills": "^1.0"
5858
},
5959
"scripts": {
@@ -62,7 +62,7 @@
6262
"phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v",
6363
"phplint": "find src tests -name '*.php' | xargs -n 1 -P 4 php -l",
6464
"phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php",
65-
"phpstan": "vendor/bin/phpstan analyse",
65+
"phpstan": "vendor/bin/phpstan analyse --memory-limit=-1",
6666
"phpunit": "vendor/bin/phpunit",
6767
"post-install-cmd": "echo 'Optionally run: composer bin all install'",
6868
"post-update-cmd": "echo 'Optionally run: composer bin all update'",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gravityforms",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "Gravity Forms driver for the WordPress payment processing library.",
55
"repository": {
66
"type": "git",

pronamic-pay-gravityforms.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://www.pronamic.eu/plugins/pronamic-pay-gravityforms/
55
* Description: Extend the Pronamic Pay plugin with Gravity Forms support to receive payments through a variety of payment providers.
66
*
7-
* Version: 4.2.1
7+
* Version: 4.2.2
88
* Requires at least: 4.7
99
*
1010
* Author: Pronamic

src/IssuersField.php

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,19 @@ private function get_gateway() {
151151
continue;
152152
}
153153

154-
$options = $issuer_field->get_options();
154+
/**
155+
* The iDEAL issuer field options can be requested from the
156+
* gateway and that can result in exceptions. In this case,
157+
* that's no problem and we'll move on to the next
158+
* feed/gateway.
159+
*
160+
* @link https://github.com/pronamic/wp-pronamic-pay-gravityforms/issues/10
161+
*/
162+
try {
163+
$options = $issuer_field->get_options();
164+
} catch ( \Exception $e ) {
165+
continue;
166+
}
155167

156168
if ( 1 === count( $options ) ) {
157169
continue;
@@ -191,17 +203,29 @@ private function set_choices( $form_id ) {
191203
}
192204

193205
/**
194-
* Gravity Forms has no support for <optgroup> elements.
195-
*
196-
* @link https://github.com/pronamic/wp-pronamic-pay/issues/154#issuecomment-1183309350
206+
* The iDEAL issuer field options can be requested from the
207+
* gateway and that can result in exceptions. In this case,
208+
* that's no problem and we'll move on to the next
209+
* feed/gateway.
210+
*
211+
* @link https://github.com/pronamic/wp-pronamic-pay-gravityforms/issues/10
197212
*/
198-
$options = $issuer_field->get_flat_options();
199-
200-
foreach ( $options as $option ) {
201-
$this->choices[] = [
202-
'value' => $option->value,
203-
'text' => $option->label,
204-
];
213+
try {
214+
/**
215+
* Gravity Forms has no support for <optgroup> elements.
216+
*
217+
* @link https://github.com/pronamic/wp-pronamic-pay/issues/154#issuecomment-1183309350
218+
*/
219+
$options = $issuer_field->get_flat_options();
220+
221+
foreach ( $options as $option ) {
222+
$this->choices[] = [
223+
'value' => $option->value,
224+
'text' => $option->label,
225+
];
226+
}
227+
} catch ( \Exception $e ) {
228+
return;
205229
}
206230
}
207231

vendor-bin/phpstan/composer.lock

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

0 commit comments

Comments
 (0)