PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.0 3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 All 102 releases
payplug / src / Service / Configuration.php

Configuration.php in PayPlug for WooCommerce (Official) 3.1.0, at src/Service/Configuration.php

817 lines 30.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Payplug\PayplugWoocommerce\Service;
4
5 class Configuration
6 {
7 private $current_configuration = [];
8 private $expected_fields = [
9 // merchant configuration
10 'email' => [
11 'type' => 'string',
12 'default' => '',
13 ],
14 'company_id' => [
15 'type' => 'string',
16 'default' => '',
17 ],
18 'company_iso' => [
19 'type' => 'string',
20 'default' => '',
21 ],
22 'country' => [
23 'type' => 'string',
24 'default' => '',
25 ],
26 'currencies' => [
27 'type' => 'string',
28 'default' => '{}',
29 ],
30
31 // authentication
32 'jwt' => [
33 'type' => 'string',
34 'default' => '{}',
35 ],
36 'api_key' => [
37 'type' => 'string',
38 'default' => '{}',
39 ],
40 'oauth_client_data' => [
41 'type' => 'string',
42 'default' => '{}',
43 ],
44 'oauth_client_id' => [
45 'type' => 'string',
46 'default' => '',
47 ],
48 'oauth_callback_uri' => [
49 'type' => 'string',
50 'default' => '',
51 ],
52 'oauth_code_verifier' => [
53 'type' => 'string',
54 'default' => '',
55 ],
56 'oauth_company_id' => [
57 'type' => 'string',
58 'default' => '',
59 ],
60
61 // payment_methods permissions
62 'payment_methods' => [
63 'permissions' => [
64 //
65 'payplug' => [
66 'enabled' => [
67 'type' => 'bool',
68 'default' => false,
69 ],
70 'countries' => [
71 'type' => 'string',
72 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
73 ],
74 'amounts' => [
75 'type' => 'string',
76 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
77 ],
78 ],
79 'installment' => [
80 'enabled' => [
81 'type' => 'bool',
82 'default' => false,
83 ],
84 'countries' => [
85 'type' => 'string',
86 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
87 ],
88 'amounts' => [
89 'type' => 'string',
90 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
91 ],
92 ],
93 'deferred' => [
94 'enabled' => [
95 'type' => 'bool',
96 'default' => false,
97 ],
98 'countries' => [
99 'type' => 'string',
100 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
101 ],
102 'amounts' => [
103 'type' => 'string',
104 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
105 ],
106 ],
107 'one_click' => [
108 'enabled' => [
109 'type' => 'bool',
110 'default' => false,
111 ],
112 'countries' => [
113 'type' => 'string',
114 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
115 ],
116 'amounts' => [
117 'type' => 'string',
118 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
119 ],
120 ],
121
122 //
123 'apple_pay' => [
124 'allowed_domains' => [
125 'type' => 'string',
126 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
127 ],
128 'enabled' => [
129 'type' => 'bool',
130 'default' => false,
131 ],
132 'countries' => [
133 'type' => 'string',
134 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
135 ],
136 'amounts' => [
137 'type' => 'string',
138 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
139 ],
140 ],
141 'american_express' => [
142 'enabled' => [
143 'type' => 'bool',
144 'default' => false,
145 ],
146 'countries' => [
147 'type' => 'string',
148 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
149 ],
150 'amounts' => [
151 'type' => 'string',
152 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
153 ],
154 ],
155 'oney_x3_with_fees' => [
156 'enabled' => [
157 'type' => 'bool',
158 'default' => false,
159 ],
160 'countries' => [
161 'type' => 'string',
162 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
163 ],
164 'amounts' => [
165 'type' => 'string',
166 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
167 ],
168 ],
169 'oney_x4_with_fees' => [
170 'enabled' => [
171 'type' => 'bool',
172 'default' => false,
173 ],
174 'countries' => [
175 'type' => 'string',
176 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
177 ],
178 'amounts' => [
179 'type' => 'string',
180 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
181 ],
182 ],
183 'oney_x3_without_fees' => [
184 'enabled' => [
185 'type' => 'bool',
186 'default' => false,
187 ],
188 'countries' => [
189 'type' => 'string',
190 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
191 ],
192 'amounts' => [
193 'type' => 'string',
194 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
195 ],
196 ],
197 'oney_x4_without_fees' => [
198 'enabled' => [
199 'type' => 'bool',
200 'default' => false,
201 ],
202 'countries' => [
203 'type' => 'string',
204 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
205 ],
206 'amounts' => [
207 'type' => 'string',
208 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
209 ],
210 ],
211 'bancontact' => [
212 'enabled' => [
213 'type' => 'bool',
214 'default' => false,
215 ],
216 'countries' => [
217 'type' => 'string',
218 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
219 ],
220 'amounts' => [
221 'type' => 'string',
222 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
223 ],
224 ],
225 'giropay' => [
226 'enabled' => [
227 'type' => 'bool',
228 'default' => false,
229 ],
230 'countries' => [
231 'type' => 'string',
232 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
233 ],
234 'amounts' => [
235 'type' => 'string',
236 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
237 ],
238 ],
239 'ideal' => [
240 'enabled' => [
241 'type' => 'bool',
242 'default' => false,
243 ],
244 'countries' => [
245 'type' => 'string',
246 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
247 ],
248 'amounts' => [
249 'type' => 'string',
250 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
251 ],
252 ],
253 'mybank' => [
254 'enabled' => [
255 'type' => 'bool',
256 'default' => false,
257 ],
258 'countries' => [
259 'type' => 'string',
260 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
261 ],
262 'amounts' => [
263 'type' => 'string',
264 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
265 ],
266 ],
267 'satispay' => [
268 'enabled' => [
269 'type' => 'bool',
270 'default' => false,
271 ],
272 'countries' => [
273 'type' => 'string',
274 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
275 ],
276 'amounts' => [
277 'type' => 'string',
278 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
279 ],
280 ],
281 'sofort' => [
282 'enabled' => [
283 'type' => 'bool',
284 'default' => false,
285 ],
286 'countries' => [
287 'type' => 'string',
288 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
289 ],
290 'amounts' => [
291 'type' => 'string',
292 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
293 ],
294 ],
295 'wero' => [
296 'enabled' => [
297 'type' => 'bool',
298 'default' => false,
299 ],
300 'countries' => [
301 'type' => 'string',
302 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
303 ],
304 'amounts' => [
305 'type' => 'string',
306 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
307 ],
308 ],
309 'bizum' => [
310 'enabled' => [
311 'type' => 'bool',
312 'default' => false,
313 ],
314 'countries' => [
315 'type' => 'string',
316 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
317 ],
318 'amounts' => [
319 'type' => 'string',
320 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
321 ],
322 ],
323 'scalapay' => [
324 'enabled' => [
325 'type' => 'bool',
326 'default' => false,
327 ],
328 'countries' => [
329 'type' => 'string',
330 'default' => '{}', // Precise iso code if require e.g. "0 => 'FR'" or "0 => 'ALL'"
331 ],
332 'amounts' => [
333 'type' => 'string',
334 'default' => '{}', // Contain currency e.g. "{"min":{"EUR": 30}, "max":{"EUR": 2000000}}"
335 ],
336 ],
337 ],
338 'configuration' => [
339 'payplug' => [
340 'active' => [
341 'type' => 'bool',
342 'default' => true,
343 ],
344 'title' => [
345 'type' => 'string',
346 'default' => '',
347 ],
348 'description' => [
349 'type' => 'string',
350 'default' => '',
351 ],
352 'save_card' => [
353 'type' => 'bool',
354 'default' => false,
355 ],
356 'defered' => [
357 'type' => 'bool',
358 'default' => false,
359 ],
360 'auto_capture' => [
361 'type' => 'integer',
362 'default' => 0,
363 ],
364 'embedded_mode' => [
365 'type' => 'string',
366 'default' => 'redirect',
367 ],
368 ],
369 'installments' => [
370 'active' => [
371 'type' => 'bool',
372 'default' => false,
373 ],
374 'min_amount' => [
375 'type' => 'integer',
376 'default' => 150,
377 ],
378 'mode' => [
379 'type' => 'integer',
380 'default' => 3,
381 ],
382 ],
383 'apple_pay' => [
384 'active' => [
385 'type' => 'bool',
386 'default' => false,
387 ],
388 'carriers' => [
389 'type' => 'string',
390 'default' => '{}',
391 ],
392 'display' => [
393 'type' => 'string',
394 'default' => '{"cart":true,"checkout":true,"product":false}',
395 ],
396 ],
397 'oney' => [
398 'active' => [
399 'type' => 'bool',
400 'default' => false,
401 ],
402 'cta_cart' => [
403 'type' => 'bool',
404 'default' => false,
405 ],
406 'cta_product' => [
407 'type' => 'bool',
408 'default' => false,
409 ],
410 'default_amounts' => [
411 'type' => 'string',
412 'default' => '{"min":10000, "max":300000}',
413 ],
414 'custom_amounts' => [
415 'type' => 'string',
416 'default' => '{"min":10000, "max":300000}',
417 ],
418 'with_fees' => [
419 'type' => 'bool',
420 'default' => false,
421 ],
422 'optimized' => [
423 'type' => 'bool',
424 'default' => false,
425 ],
426 ],
427 'american_express' => [
428 'active' => [
429 'type' => 'bool',
430 'default' => false,
431 ],
432 ],
433 'bancontact' => [
434 'active' => [
435 'type' => 'bool',
436 'default' => false,
437 ],
438 ],
439 'giropay' => [
440 'active' => [
441 'type' => 'bool',
442 'default' => false,
443 ],
444 ],
445 'ideal' => [
446 'active' => [
447 'type' => 'bool',
448 'default' => false,
449 ],
450 ],
451 'mybank' => [
452 'active' => [
453 'type' => 'bool',
454 'default' => false,
455 ],
456 ],
457 'satispay' => [
458 'active' => [
459 'type' => 'bool',
460 'default' => false,
461 ],
462 ],
463 'sofort' => [
464 'active' => [
465 'type' => 'bool',
466 'default' => false,
467 ],
468 ],
469 'wero' => [
470 'active' => [
471 'type' => 'bool',
472 'default' => false,
473 ],
474 ],
475 'bizum' => [
476 'active' => [
477 'type' => 'bool',
478 'default' => false,
479 ],
480 ],
481 'scalapay' => [
482 'active' => [
483 'type' => 'bool',
484 'default' => false,
485 ],
486 'default_amounts' => [
487 'type' => 'string',
488 // Last-resort fallback only, used when the account's live API bounds
489 // (payment_methods.permissions.scalapay.amounts) aren't available yet.
490 // Kept in sync with Scalapay::DEFAULT_MIN_AMOUNT/DEFAULT_MAX_AMOUNT,
491 // which cover the case where this key itself is missing from a stored
492 // options array. This schema is intentionally dependency-free, so the
493 // values are repeated here as a literal rather than referenced.
494 'default' => '{"min":500, "max":400000}',
495 ],
496 'custom_amounts' => [
497 'type' => 'string',
498 // Empty means "not customized yet" - the merchant's actual choice, if
499 // any. Must NOT default to a concrete value, or that value would be
500 // read as an explicit override of the account's live API bounds.
501 'default' => '{}',
502 ],
503 ],
504 ],
505 ],
506
507 // other configuration
508 'telemetry_hash' => [
509 'type' => 'string',
510 'default' => '',
511 ],
512 'enabled' => [
513 'type' => 'bool',
514 'default' => true,
515 ],
516 'debug' => [
517 'type' => 'bool',
518 'default' => false,
519 ],
520 'mode' => [
521 'type' => 'bool',
522 'default' => false,
523 ],
524 'version' => [
525 'type' => 'string',
526 'default' => '',
527 ],
528 ];
529 private $old_keys = [
530 'american_express' => 'payment_methods.configuration.american_express.active',
531 'apple_pay' => 'payment_methods.configuration.apple_pay.active',
532 'applepay_carriers' => 'payment_methods.configuration.apple_pay.carriers',
533 'applepay_cart' => 'payment_methods.configuration.apple_pay.display.cart',
534 'applepay_checkout' => 'payment_methods.configuration.apple_pay.display.checkout',
535 'applepay_product' => 'payment_methods.configuration.apple_pay.display.product',
536 'bancontact' => 'payment_methods.configuration.bancontact.active',
537 'debug' => 'debug',
538 'description' => 'payment_methods.configuration.payplug.description',
539 'email' => 'email',
540 'enabled' => 'enabled',
541 'ideal' => 'payment_methods.configuration.ideal.active',
542 'mode' => 'mode',
543 'mybank' => 'payment_methods.configuration.mybank.active',
544 'oneclick' => 'payment_methods.configuration.payplug.save_card',
545 'oney' => 'payment_methods.configuration.oney.active',
546 'oney_product_animation' => 'payment_methods.configuration.oney.cta_product',
547 'oney_thresholds_max' => 'payment_methods.configuration.oney.custom_amounts.max',
548 'oney_thresholds_min' => 'payment_methods.configuration.oney.custom_amounts.min',
549 'oney_type' => 'payment_methods.configuration.oney.with_fees',
550 'payment_method' => 'payment_methods.configuration.payplug.embedded_mode',
551 'payplug' => 'payment_methods.configuration.payplug.active',
552 'payplug_live_key' => 'api_key.live',
553 'payplug_merchant_id' => 'company_id',
554 'payplug_test_key' => 'api_key.test',
555 'satispay' => 'payment_methods.configuration.satispay.active',
556 'title' => 'payment_methods.configuration.payplug.title',
557 ];
558
559 public function __construct()
560 {
561 $this->current_configuration = get_option('woocommerce_payplug_settings', []);
562 }
563
564 /**
565 * @description initialize option from expected fields
566 *
567 * @return array
568 */
569 public function initialize_option()
570 {
571 $options = $this->extract_options_from_fields();
572
573 return $this->update_options($options);
574 }
575
576 /**
577 * @description get default configuration value from expected fields (recursively)
578 *
579 * @param $fields
580 *
581 * @return array
582 */
583 public function extract_options_from_fields($fields = null)
584 {
585 if ($fields === null) {
586 $fields = $this->get_expected_fields();
587 }
588 $options = [];
589 foreach ($fields as $key => $value) {
590 if (is_array($value) && array_key_exists('default', $value)) {
591 $options[$key] = $value['default'];
592 } elseif (is_array($value)) {
593 $options[$key] = $this->extract_options_from_fields($value);
594 }
595 }
596
597 return $options;
598 }
599
600 /**
601 * @description Delete all configurations related to the plugin
602 *
603 * @return void
604 */
605 public function clean_option(): void
606 {
607 $this->current_configuration = null;
608 delete_option('woocommerce_payplug_settings');
609 delete_site_option('woocommerce_payplug_settings');
610 }
611
612 /**
613 * @description Get configurations
614 *
615 * @return mixed
616 */
617 public function get_options()
618 {
619 return $this->current_configuration;
620 }
621
622 /**
623 * @description Return configuration value for a given key
624 * todo: add default return value
625 *
626 * @param $option_name
627 * @param $options
628 *
629 * @return mixed|null
630 */
631 public function get_option($option_name = '', $options = null)
632 {
633 if (!is_string($option_name) || empty($option_name)) {
634 return null;
635 }
636
637 $options = $options ? $options : $this->get_options();
638
639 // Convert name to array
640 $option_name = explode('.', $option_name);
641
642 // Get first iteration
643 $name = reset($option_name);
644 if (!array_key_exists($name, $options)) {
645 return null;
646 }
647
648 // if no more sub option, return current one
649 unset($option_name[0]);
650 if (empty($option_name)) {
651 return $options[$name];
652 }
653
654 // else return the sub option
655 $option_name = implode('.', $option_name);
656
657 return $this->get_option($option_name, $options[$name]);
658 }
659
660 /**
661 * @description Update confurations values
662 * todo: check return value type
663 *
664 * @param $options_to_update
665 *
666 * @return mixed
667 */
668 public function update_options($options_to_update = [])
669 {
670 $options = $this->get_options();
671 foreach ($options_to_update as $key => $value) {
672 $options[$key] = $value;
673 }
674 $this->current_configuration = $options;
675
676 return update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options));
677 }
678
679 /**
680 * @description Update confurations for a given key
681 *
682 * @param $key
683 * @param $value
684 *
685 * @return array
686 */
687 public function update_option($key = '', $value = null)
688 {
689 if (!is_string($key) || empty($key)) {
690 return [];
691 }
692
693 if (!array_key_exists($key, $this->expected_fields)) {
694 return [];
695 }
696
697 $options = $this->get_options();
698 $options[$key] = $value;
699
700 return $this->update_options($options);
701 }
702
703 /**
704 * @description Update payment configuration permission
705 *
706 * @param $payment_permissions
707 *
708 * @return mixed
709 */
710 public function update_payment_permissions($payment_permissions = [])
711 {
712 $options = $this->get_options();
713 $options['payment_methods']['permissions'] = $payment_permissions;
714 $this->current_configuration = $options;
715
716 return update_option('woocommerce_payplug_settings', apply_filters('woocommerce_settings_api_sanitized_fields_payplug', $options));
717 }
718
719 /**
720 * @description Get the expected fields
721 *
722 * @return array
723 */
724 public function get_expected_fields()
725 {
726 return $this->expected_fields;
727 }
728
729 /**
730 * @description Validate if the current configuration is valide (for example: when plugin is upgraded)
731 *
732 * @return array
733 */
734 public function validate_configuration()
735 {
736 $options = $this->extract_options_from_fields();
737 foreach ($this->old_keys as $key => $value) {
738 if (!isset($this->current_configuration[$key])) {
739 continue;
740 }
741 switch ($key) {
742 case 'applepay_carriers':
743 $carriers = $this->current_configuration['applepay_carriers'];
744 if (!empty($carriers)) {
745 $options['payment_methods']['configuration']['apple_pay']['carriers'] = json_encode($carriers);
746 }
747 break;
748
749 case 'applepay_cart':
750 case 'applepay_checkout':
751 case 'applepay_product':
752 $display = str_replace('applepay_', '', $key);
753 $applepay_display = json_decode($options['payment_methods']['configuration']['apple_pay']['display'], true);
754 $applepay_display[$display] = 'yes' == $this->current_configuration[$key];
755 $options['payment_methods']['configuration']['apple_pay']['display'] = json_encode($applepay_display);
756 break;
757 case 'oney_product_animation':
758 $options['payment_methods']['configuration']['oney']['cta_product'] = 'yes' == $this->current_configuration['oney_product_animation'];
759 break;
760 case 'oney_thresholds_min':
761 case 'oney_thresholds_max':
762 $thresholds = str_replace('oney_thresholds_', '', $key);
763 $custom_amounts = json_decode($options['payment_methods']['configuration']['oney']['custom_amounts'], true);
764 $custom_amounts[$thresholds] = $this->current_configuration[$key];
765 $options['payment_methods']['configuration']['oney']['custom_amounts'] = json_encode($custom_amounts);
766 break;
767 case 'oney_type':
768 $options['payment_methods']['configuration']['oney']['with_fees'] = $this->current_configuration['oney_type'];
769 break;
770 case 'description':
771 $options['payment_methods']['configuration']['payplug']['description'] = $this->current_configuration['description'];
772 break;
773 case 'payment_method':
774 $options['payment_methods']['configuration']['payplug']['embedded_mode'] = $this->current_configuration['payment_method'];
775 break;
776 case 'oneclick':
777 $options['payment_methods']['configuration']['payplug']['save_card'] = 'yes' == $this->current_configuration['oneclick'];
778 break;
779 case 'title':
780 $options['payment_methods']['configuration']['payplug']['title'] = $this->current_configuration['title'];
781 break;
782
783 case 'payplug_test_key':
784 case 'payplug_live_key':
785 $mode = str_replace('payplug_', '', $key);
786 $mode = str_replace('_key', '', $mode);
787 $api = json_decode($options['api_key'], true);
788 $api[$mode] = $this->current_configuration['payplug_' . $mode . '_key'];
789 $options['api_key'] = json_encode($api);
790 break;
791
792 case 'payplug_merchant_id':
793 $options['company_id'] = $this->current_configuration['payplug_merchant_id'];
794 break;
795
796 case 'american_express':
797 case 'apple_pay':
798 case 'bancontact':
799 case 'ideal':
800 case 'mybank':
801 case 'oney':
802 case 'payplug':
803 case 'satispay':
804 $options['payment_methods']['configuration'][$key]['active'] = 'yes' == $this->current_configuration[$key];
805 break;
806
807 default:
808 $value = 'no' == $this->current_configuration[$key] ? false : $this->current_configuration[$key];
809 $options[$key] = 'yes' == $value ? true : $value;
810 break;
811 }
812 }
813
814 return $options;
815 }
816 }
817