'; } add_action( 'edd_after_cc_fields', 'edds_add_stripe_errors', 999 ); /** * Stripe uses it's own credit card form because the card details are tokenized. * * We don't want the name attributes to be present on the fields in order to prevent them from getting posted to the server * * @since 1.7.5 * @return void */ function edds_credit_card_form( $echo = true ) { if ( edd_stripe()->rate_limiting->has_hit_card_error_limit() ) { edd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contact support.', 'easy-digital-downloads' ) ); return; } ob_start(); ?>
rate_limiting->has_hit_card_error_limit() ) { edd_set_error( 'edd_stripe_error_limit', __( 'Adding new payment methods is currently unavailable.', 'easy-digital-downloads' ) ); edd_print_errors(); return; } $elements_mode = edds_get_elements_mode(); if ( 'payment-elements' === $elements_mode ) { edds_output_payment_elements_form(); } else { edds_output_legacy_new_card_form(); } } add_action( 'edd_stripe_new_card_form', 'edd_stripe_new_card_form' ); /** * Add the element for the Stripe Payment Elements to attach to. * * @since 2.9.0 */ function edds_output_payment_elements_form() { // Payment Elements needs to not allow checking out with mixed carts or multiple subscriptions. if ( function_exists( 'edd_recurring' ) ) { if ( ( count( edd_get_cart_contents() ) > 1 && edd_recurring()->cart_contains_recurring() ) || edd_recurring()->cart_is_mixed() ) { add_filter( 'edd_checkout_button_purchase', '__return_empty_string', 999 ); ?>
isset( $default_card->address_line1 ) ? $default_card->address_line1 : null, 'line2' => isset( $default_card->address_line2 ) ? $default_card->address_line2 : null, 'city' => isset( $default_card->address_city ) ? $default_card->address_city : null, 'state' => isset( $default_card->address_state ) ? $default_card->address_state : null, 'zip' => isset( $default_card->address_zip ) ? $default_card->address_zip : null, 'country' => isset( $default_card->address_country ) ? $default_card->address_country : null, ); $address_fields = array_filter( $address_fields ); echo esc_html( implode( ', ', $address_fields ) ); endif; ?>
rate_limiting->has_hit_card_error_limit() ) { edd_set_error( 'edd_stripe_error_limit', __( 'We are unable to process your payment at this time, please try again later or contacts support.', 'easy-digital-downloads' ) ); return; } // Can't use just edd_is_checkout() because this could happen in an AJAX request. $is_checkout = edd_is_checkout() || ( isset( $_REQUEST['action'] ) && 'edd_load_gateway' === $_REQUEST['action'] ); edd_stripe_css( true ); $existing_cards = edd_stripe_get_existing_cards( $user_id ); if ( ! empty( $existing_cards ) ) : ?>