PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | inc/fields/payment-markup.php +3 -28 2.12.1 → 2.12.8 View file →
@@ -498,36 +498,11 @@
498 498 * @return array Array of payment method configurations.
499 499 * @since 2.4.0
500 500 */
501 501 private function get_registered_payment_methods() {
502 - $methods = [];
503 -
504 - // Get enabled payment methods from block attributes.
505 - $enabled_methods = $this->payment_methods;
506 -
507 - // Filter to get method configurations - start with Stripe as default.
508 - $available_methods = apply_filters(
509 - 'srfm_payment_methods_registry',
510 - [
511 - 'stripe' => [
512 - 'id' => 'stripe',
513 - 'label' => __( 'Stripe', 'sureforms' ),
514 - 'description' => __( 'Pay with credit or debit card', 'sureforms' ),
515 - 'icon' => 'credit-card',
516 - 'enabled' => $this->stripe_connected,
517 - 'container_class' => 'srfm-stripe-payment-element',
518 - ],
519 - ]
520 - );
521 -
522 - // Filter enabled methods.
523 - foreach ( $enabled_methods as $method_id ) {
524 - if ( isset( $available_methods[ $method_id ] ) && $available_methods[ $method_id ]['enabled'] ) {
525 - $methods[ $method_id ] = $available_methods[ $method_id ];
526 - }
527 - }
528 -
529 - return $methods;
502 + // Shared with the submission-side guard (Front_End::validate_payment_fields), so
503 + // the renderer and the guard can never disagree about whether this field is usable.
504 + return Payment_Helper::get_registered_payment_methods( [ 'paymentMethods' => $this->payment_methods ] );
530 505 }
531 506
532 507 // BOTH MODE: start — helper renderers for the dual-mode chooser and amount displays.
533 508