- Handle Custom Stripe Webhook Events
- suredonation_export_secret_option_keys Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- Validate Field Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- Validatable Blocks Filter Hook
- Update donation data, Filter Hook
- OttoKit Integration: suredonation_suretriggers_integration_data_filter Filter Hook
- suredonation_show_setup_gateway_notice Filter Hook
- suredonation_show_review_notice_gateway Filter Hook
- suredonation_show_review_notice_donation Filter Hook
- suredonation_registered_payment_methods Filter Hook
- suredonation_register_additional_blocks Filter Hook
- suredonation_receipt_html Filter Hook
- suredonation_phone_geo_enabled Filter Hook
- suredonation_phone_geo_api_hourly_cap Filter Hook
- suredonation_paypal_webhook_handle_event Filter Hook
- suredonation_paypal_sdk_args Filter Hook
- suredonation_output_campaign_meta_tags Filter Hook
- suredonation_new_donor_user_data Filter Hook
- suredonation_integration_payload Filter Hook
- suredonation_import_phase_mappers Filter Hook
- suredonation_import_givewp_phases Filter Hook
- suredonation_import_givewp_phase_mappers Filter Hook
- suredonation_import_donation_row Filter Hook
- suredonation_import_campaigns_limit Filter Hook
- suredonation_field_block_config Filter Hook
- suredonation_export_secret_option_keys Filter Hook
- suredonation_export_one_time_only Filter Hook
- suredonation_export_campaigns_limit Filter Hook
- suredonation_email_smart_tags Filter Hook
- suredonation_email_smart_tag_groups Filter Hook
- suredonation_email_field_char_limits Filter Hook
- suredonation_disable_default_styles Filter Hook
- suredonation_default_validation_messages Filter Hook
- suredonation_default_email_notifications Filter Hook
- suredonation_create_donation_data Filter Hook
- suredonation_config_abilities Filter Hook
- suredonation_available_payment_methods Filter Hook
- suredonation_allowed_form_html Filter Hook
- suredonation_allowed_form_blocks Filter Hook
- suredonation_import_batch_complete Action Hook
- suredonation_import_complete Action Hook
- suredonation_import_donation_inserted Action Hook
- suredonation_import_donor_inserted Action Hook
- suredonation_import_session_created Action Hook
- suredonation_import_givewp_batch_complete Action Hook
- suredonation_import_givewp_session_created Action Hook
- suredonation_privacy_data_exported Action Hook
- suredonation_enqueue_form_frontend_scripts Action Hook
- suredonation_after_form_duplicated Action Hook
- suredonation_email_sent Action Hook
- suredonation_donor_user_created Action Hook
- suredonation_donation_refunded Action Hook
- suredonation_donation_status_changed Action Hook
- suredonation_donation_completed Action Hook
- suredonation_new_donation Action Hook
- suredonation_donation_created Action Hook
suredonation_registered_payment_methods Filter Hook
Overview
The suredonation_registered_payment_methods filter allows developers to modify the payment methods registered for a SureDonation payment block.
It acts as the gateway-independent source for determining which payment methods are available for rendering in the payment methods accordion on the frontend.
You can use this filter to:
- Add a custom payment method.
- Modify an existing payment method.
- Change the payment method label.
- Enable or disable a payment method.
- Customize the frontend container class or ID.
- Add custom payment method configuration.
When to Use This Filter
Use this filter when you need to register a custom payment method or modify the frontend configuration of an existing payment method.
For example, a custom gateway can use this filter to register its payment method so SureDonation can include it in the payment methods accordion.
Filter Signature
apply_filters( 'suredonation_registered_payment_methods', $methods, $this->payment_methods, $this->block_id);Parameters
| Parameter | Type | Description |
| $methods | array | Registered payment methods keyed by method ID. |
| $payment_methods | array | Payment methods selected in the current payment block. |
| $block_id | string | ID of the payment block. |
$methods
Each registered payment method can contain configuration values such as:
| Key | Description |
| id | Unique ID of the payment method. |
| label | Display label shown to the donor. |
| enabled | Determines whether the payment method is enabled. |
| container_class | CSS class used for the payment method container. |
| container_id | Container ID used by payment methods such as Stripe. |
| content | HTML content displayed for payment methods such as Offline payments. |
The exact configuration can vary depending on the payment method.
Return Value
Return an array containing the registered payment method configurations.
The array should be keyed by the payment method ID.
$methods['mygateway'] = [Â Â
// Payment method configuration.
];Basic Usage
Use add_filter() to register your callback.
add_filter(Â 'suredonation_registered_payment_methods', 'your_custom_function', 10, 3);
function your_custom_function( $methods, $payment_methods, $block_id ) {
    // Add or modify registered methods here.
    return $methods;
}Example: Register a Custom Payment Method
The following example registers a custom payment method named mygateway when it has been selected in the payment block.
add_filter( 'suredonation_registered_payment_methods', 'mysite_register_method', 10, 3);
function mysite_register_method( $methods, $payment_methods, $block_id ) {
    if ( in_array( 'mygateway', $payment_methods, true ) ) {
        $methods['mygateway'] = [
            'id'       => 'mygateway',
            'label'      => __( 'My Gateway', 'my-plugin' ),
            'enabled'     => true,
            'container_class' => 'sd-mygateway',
            'container_id'  => 'sd-mygateway-' . $block_id,
        ];
    }
    return $methods;
}How the Example Works
- The callback checks whether mygateway is selected in the payment block.
- If selected, the custom payment method is added to $methods.
- A label is defined for the payment method.
- The method is enabled.
- A CSS class and unique container ID are assigned.
- The modified $methods array is returned.
Example: Modify an Existing Payment Method
You can also modify the configuration of an existing payment method.
add_filter( 'suredonation_registered_payment_methods', 'mysite_modify_payment_label', 10, 3);
function mysite_modify_payment_label( $methods, $payment_methods, $block_id ) {
    if ( isset( $methods['stripe'] ) ) {
        $methods['stripe']['label'] = __( 'Pay by Card', 'my-plugin' );
    }
    return $methods;
}This changes the frontend label of the Stripe payment method to Pay by Card.
Payment Method Rendering
The registered payment methods returned by this filter are used by SureDonation to generate the frontend payment methods accordion.
The general flow is:
- A payment block is loaded.
- SureDonation determines the payment methods selected in the block.
- Registered payment method configurations are prepared.
- The suredonation_registered_payment_methods filter is applied.
- Custom code can add or modify payment methods.
- SureDonation uses the returned configuration to render the payment methods accordion.
Related Hooks
- suredonation_available_payment_methods: Controls the available payment methods that can be selected for a payment block.
We don't respond to the article feedback, we use it to improve our support content.