- 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_paypal_sdk_args Filter Hook
Overview
The suredonation_paypal_sdk_args filter allows developers to modify the query arguments used when SureDonation loads the PayPal JavaScript SDK for a donation form.
You can use this filter to customize how the PayPal SDK is loaded, such as setting a specific locale or adding supported PayPal SDK parameters.
SureDonation Pro also uses this filter to modify the SDK configuration for subscription forms, including parameters such as vault=true and intent=subscription.
When to Use This Filter
Use this filter when you need to customize the PayPal JavaScript SDK configuration.
For example, you can use it to:
- Set a specific PayPal locale.
- Modify the payment intent.
- Add supported PayPal SDK parameters.
- Customize the SDK configuration for specific forms.
- Support custom PayPal integration requirements.
Filter Signature
apply_filters( 'suredonation_paypal_sdk_args', $sdk_args, $form_id);Parameters
| Parameter | Type | Description |
| $sdk_args | array | Query arguments used to load the PayPal JavaScript SDK. |
| $form_id | int | The SureDonation donation form post ID for which the SDK is being loaded. |
Default SDK Arguments
The $sdk_args array contains the following default parameters:
| Parameter | Default Value | Description |
| client-id | Partner client ID | Identifies the PayPal partner application. |
| merchant-id | Connected seller merchant ID | Identifies the connected PayPal seller account. |
| currency | Site currency | Currency configured for the site. |
| components | buttons | Loads the PayPal Buttons component. |
| intent | capture | Defines the default PayPal payment intent. |
Return Value
Return the modified $sdk_args array.
The returned values are converted into the query string used when loading:
Basic Usage
Use add_filter() to register your callback.
add_filter('suredonation_paypal_sdk_args', 'your_custom_function',10, 2);
function your_custom_function( $sdk_args, $form_id ) {
    // Modify the SDK args here.
    return $sdk_args;
}Example: Set the PayPal Locale
The following example sets the buyer-facing PayPal locale to en_US.
add_filter( 'suredonation_paypal_sdk_args', 'mysite_paypal_locale', 10, 2);
function mysite_paypal_locale( $sdk_args, $form_id ) {
    // Force a specific buyer-facing locale.
    $sdk_args['locale'] = 'en_US';
    return $sdk_args;
}Example: Apply a Setting to a Specific Form
You can use the $form_id parameter to customize the PayPal SDK configuration for a specific donation form.
add_filter( 'suredonation_paypal_sdk_args', 'mysite_custom_paypal_settings',  10, 2);
function mysite_custom_paypal_settings( $sdk_args, $form_id ) {
    if ( 123 === $form_id ) {
        $sdk_args['locale'] = 'en_US';
    }
    return $sdk_args;
}Replace 123 with the ID of the donation form where you want to apply the custom configuration.
Example: Add a Supported SDK Parameter
You can add additional supported PayPal SDK parameters when required.
add_filter( 'suredonation_paypal_sdk_args', 'mysite_add_paypal_parameter', 10, 2);
function mysite_add_paypal_parameter( $sdk_args, $form_id ) {
    $sdk_args['buyer-country'] = 'US';
    return $sdk_args;
}Only add parameters supported by the PayPal JavaScript SDK.
PayPal Subscription Support
SureDonation Pro uses this filter to customize the PayPal SDK configuration for subscription forms.
For subscription payments, additional parameters can include:
- vault=true
- intent=subscription
These parameters allow the PayPal SDK to support subscription-related functionality.
SDK Loading Flow
The filter is part of the PayPal SDK loading process:
- SureDonation loads a donation form.
- SureDonation checks whether the form uses PayPal.
- SureDonation verifies that the PayPal partner client ID and merchant ID are available.
- The default PayPal SDK arguments are prepared.
- The suredonation_paypal_sdk_args filter is applied.
- Your callback can modify the SDK arguments.
- SureDonation builds the PayPal SDK URL using the returned arguments.
- The PayPal JavaScript SDK is loaded for the donation form.
Related Hooks
- suredonation_paypal_webhook_handle_event: Allows developers to handle additional PayPal webhook events.
- suredonation_enqueue_form_frontend_scripts: Allows developers to enqueue additional frontend scripts for SureDonation forms.
We don't respond to the article feedback, we use it to improve our support content.