array( 'id' => 'stripe_connect_button', 'name' => __( 'Connection Status', 'easy-digital-downloads' ), 'desc' => edds_stripe_connect_setting_field(), 'type' => 'descriptive_text', 'class' => 'edd-stripe-connect-row', ), 'test_publishable_key' => array( 'id' => 'test_publishable_key', 'name' => __( 'Test Publishable Key', 'easy-digital-downloads' ), 'desc' => __( 'Enter your test publishable key, found in your Stripe Account Settings', 'easy-digital-downloads' ), 'type' => 'text', 'size' => 'regular', 'class' => 'edd-hidden edds-api-key-row', ), 'test_secret_key' => array( 'id' => 'test_secret_key', 'name' => __( 'Test Secret Key', 'easy-digital-downloads' ), 'desc' => __( 'Enter your test secret key, found in your Stripe Account Settings', 'easy-digital-downloads' ), 'type' => 'text', 'size' => 'regular', 'class' => 'edd-hidden edds-api-key-row', ), 'live_publishable_key' => array( 'id' => 'live_publishable_key', 'name' => __( 'Live Publishable Key', 'easy-digital-downloads' ), 'desc' => __( 'Enter your live publishable key, found in your Stripe Account Settings', 'easy-digital-downloads' ), 'type' => 'text', 'size' => 'regular', 'class' => 'edd-hidden edds-api-key-row', ), 'live_secret_key' => array( 'id' => 'live_secret_key', 'name' => __( 'Live Secret Key', 'easy-digital-downloads' ), 'desc' => __( 'Enter your live secret key, found in your Stripe Account Settings', 'easy-digital-downloads' ), 'type' => 'text', 'size' => 'regular', 'class' => 'edd-hidden edds-api-key-row', ), 'stripe_webhook_description' => array( 'id' => 'stripe_webhook_description', 'type' => 'descriptive_text', 'name' => __( 'Webhooks', 'easy-digital-downloads' ), 'desc' => '
' . sprintf( /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ __( 'In order for Stripe to function completely, you must configure your Stripe webhooks. Visit your %1$saccount dashboard%2$s to configure them. Please add a webhook endpoint for the URL below.', 'easy-digital-downloads' ), '', '' ) . '
' . '' . sprintf( /* translators: %s Webhook URL. Do not translate. */ __( 'Webhook URL: %s', 'easy-digital-downloads' ), home_url( 'index.php?edd-listener=stripe' ) ) . '
' . '' . sprintf( /* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */ __( 'See our %1$sdocumentation%2$s for more information.', 'easy-digital-downloads' ), '', '' ) . '
', ), 'stripe_billing_fields' => array( 'id' => 'stripe_billing_fields', 'name' => __( 'Billing Address Display', 'easy-digital-downloads' ), 'desc' => __( 'Select how you would like to display the billing address fields on the checkout form.Notes:
If taxes are enabled, this option cannot be changed from "Full address".
If set to "No address fields", you must disable "zip code verification" in your Stripe account.
', 'easy-digital-downloads' ), 'type' => 'select', 'std' => 'full', 'options' => array( 'full' => __( 'Full address', 'easy-digital-downloads' ), 'zip_country' => __( 'Zip / Postal Code and Country only', 'easy-digital-downloads' ), 'none' => __( 'No address fields', 'easy-digital-downloads' ), ), ), 'stripe_statement_descriptor' => array( 'id' => 'stripe_statement_descriptor', 'name' => __( 'Statement Descriptor', 'easy-digital-downloads' ), 'desc' => __( 'Choose how charges will appear on customer\'s credit card statements. Max 22 characters', 'easy-digital-downloads' ), 'type' => 'text', ), 'stripe_restrict_assets' => array( 'id' => 'stripe_restrict_assets', 'name' => ( __( 'Restrict Stripe Assets', 'easy-digital-downloads' ) ), 'check' => ( __( 'Only load Stripe.com hosted assets on pages that specifically utilize Stripe functionality.', 'easy-digital-downloads' ) ), 'type' => 'checkbox_description', 'desc' => sprintf( /* translators: 1. opening link tag; 2. closing link tag */ __( 'Stripe advises that their Javascript library be loaded on every page to take advantage of their advanced fraud detection rules. If you are not concerned with this, enable this setting to only load the Javascript when necessary. %1$sLearn more about Stripe\'s recommended setup.%2$s', 'easy-digital-downloads' ), '', '' ), ), ); if ( _edds_legacy_elements_enabled() ) { $elements_mode = edds_get_elements_mode(); if ( ! edds_stripe_connect_can_manage_keys() ) { $stripe_settings['stripe_elements_mode'] = array( 'id' => 'stripe_elements_mode', 'name' => __( 'Elements Mode', 'easy-digital-downloads' ), 'desc' => __( 'Toggle between using the legacy Card Elements Stripe integration and the new Payment Elements experience.', 'easy-digital-downloads' ), 'type' => 'select', 'options' => array( 'card-elements' => __( 'Card Element', 'easy-digital-downloads' ), 'payment-elements' => __( 'Payment Element', 'easy-digital-downloads' ), ), 'class' => 'stripe-elements-mode', 'tooltip_title' => __( 'Transitioning to Payment Elements', 'easy-digital-downloads' ), 'tooltip_desc' => __( 'You are seeing this option because your store has been using Card Elements prior to the EDD Stripe 2.9.0 update.' . __( 'The following settings are available while Easy Digital Downloads is in debug mode. They are not designed to be primary settings and should be used only while debugging or when instructed to be used by the Easy Digital Downloads Team.', 'easy-digital-downloads' ) . '
' . '' . __( 'There is no guarantee that these settings will remain available in future versions of Easy Digital Downloads. Easy Digital Downloads Debug Mode should be disabled once changes to these settings have been made.', 'easy-digital-downloads' ) . '
' . '' . __( 'You have disabled the "Test Mode" option. Once you have saved your changes, please verify your Stripe connection, especially if you have not previously connected in with "Test Mode" disabled.', 'easy-digital-downloads' ) . '
', 'type' => 'stripe_connect_notice', 'field_class' => 'edd-hidden', ), ); // Insert the new setting after the Test Mode checkbox. $position = array_search( 'test_mode', array_keys( $settings['main'] ), true ); $settings = array_merge( array_slice( $settings['main'], $position, 1, true ), $notice, $settings ); return $settings; } add_filter( 'edd_settings_gateways', 'edds_add_settings' ); /** * Force full billing address display when taxes are enabled * * @access public * @since 2.5 * * @param string $value The value currently set for the Stripe billing fields setting. * @param string $key The Stripe setting key to detect, stripe_billing_fields. * * @return string */ function edd_stripe_sanitize_stripe_billing_fields_save( $value, $key ) { if ( 'stripe_billing_fields' === $key && edd_use_taxes() ) { $value = 'full'; } return $value; } add_filter( 'edd_settings_sanitize_select', 'edd_stripe_sanitize_stripe_billing_fields_save', 10, 2 ); /** * Filter the output of the statement descriptor option to add a max length to the text string * * @since 2.6 * @param string $html The full html for the setting output. * @param array $args The original arguments passed in to output the html. * * @return string */ function edd_stripe_max_length_statement_descriptor( $html, $args ) { if ( 'stripe_statement_descriptor' !== $args['id'] ) { return $html; } $html = str_replace( '';
echo wp_kses(
sprintf(
/* translators: %1$s PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */
__(
'Processing credit cards with Stripe requires PHP version %1$s or higher. It looks like you\'re using version %2$s, which means you will need to %3$supgrade your version of PHP before acceping credit card payments%4$s.',
'easy-digital-downloads'
),
'' . $required_version . '
',
'' . $current_version . '
',
'',
''
),
array(
'code' => true,
'strong' => true,
)
);
echo '
';
echo '';
esc_html_e( 'Need help upgrading? Ask your web host!', 'easy-digital-downloads' );
echo '
';
echo wp_kses(
sprintf(
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */
__(
'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.',
'easy-digital-downloads'
),
'',
''
),
array(
'a' => array(
'href' => true,
'target' => true,
'rel' => true,
),
)
);
echo '
' .
wp_kses(
sprintf(
/* translators: %1$s PHP version requirement. %2$s Current PHP version. %3$s Opening strong tag, do not translate. %4$s Closing strong tag, do not translate. */
__(
'Processing credit cards with Stripe requires PHP version %1$s or higher. It looks like you\'re using version %2$s, which means you will need to %3$supgrade your version of PHP before acceping credit card payments%4$s.',
'easy-digital-downloads'
),
'' . $required_version . '
',
'' . $current_version . '
',
'',
''
),
array(
'code' => true,
'strong' => true,
)
) .
'
' .
esc_html__( 'Need help upgrading? Ask your web host!', 'easy-digital-downloads' ) .
'
' .
wp_kses(
sprintf(
/* translators: %1$s Opening anchor tag, do not translate. %2$s Closing anchor tag, do not translate. */
__(
'Many web hosts can give you instructions on how/where to upgrade your version of PHP through their control panel, or may even be able to do it for you. If you need to change hosts, please see %1$sour hosting recommendations%2$s.',
'easy-digital-downloads'
),
'',
''
),
array(
'a' => array(
'href' => true,
'target' => true,
'rel' => true,
),
)
) . '