ltedHD'^Uh;wh;w D Dde. * * @since 1.8.2 ng $payment_method_id PaymentMethod id. * * @throws Exception If a Customer fails to update. */ protected function update_remote_cust_payHD'^Uhi;wi;w D D[ 'default_payment_ method_id, ], ], Helpers::get_auth_opts() ); } /** * Detach all active Subscriptions PaymentMethods having the same fingerpwentM@ * @since 1.8.2 * * @param PaymentMethod $new_payment_method PaymentMethod object. * * @throws Exception In case of rrorHD'^Uj;wj;w D Dions = Subscription::all ' => $this->get_customer( 'id' ), 'status' => 'active', 'limit' => 100, // Maximum limit allowed by Stripe (https://stripe.com/wns/lpZ@scriptions-limit). 'expand' => [ 'data.default_payment_method' ], ], Helpers::get_auth_opts() ); $detach_me' fHD'^Uk;wl;w D D } if ( $new_paymen erprint === $subscription->default_payment_method->card->fingerprint ) { Subscription::update( $subscription->id, [ 'default_wnew_Fod->id ], Helpers::get_auth_opts() ); $detach_methods[ $subscription->default_payment_method->id ] = $subscriptFv_metpF} foreach ( $detach_methods as $detach_method ) { $detach_method->detach(); } } /** * Set an encrypted token as3tentHD'^U m;wXVv D D*/ private function setFvcureF $form_data = wpforms()->get( 'process' )->form_data; // Set token only if captcha is enabled for the form. if ( emptywgs']F] ) ) { return; } $this->intent->metadata['captcha_3dsecure_token'] = Crypto::encrypt( $this->intent->id ); $this;dateHD'^U8n;wVv D D on successful 3dSecure EHD'^U8rv09rv D D. * @param array $form? datHD'^Uo;wo;w D D*/ public function bypadre_submit( $is_bypassed, $entry, $form_data ) { // Firstly, run checks that may prevent bypassing: // 1) Sanity check to prevent possibwptchFment forms. // 2) Both reCAPTCHA and hCaptcha are enabled by the same setting. if ( ! Helpers::is_payments_enabled( $Fvpty(XF'settings']['recaptcha'] ) || empty( $entry['payment_intent_id'] ) ) { return $is_bypassed; } // This is executKymenHD'^U2{Xv D Dtting it from `$this->inPuwthis:rvayme:rventr(;rvntent_id'] ); if ( empty( $intent->status ) || $intent->status !== 'succeeded' ) { retw} SWGempty( $intent->metadata['captcha_3dsecure_token'] ) ? $intent->metadata['captcha_3dsecure_token'] : ''; if ( Crypto::decW ) !HD'^U2{2{ D Detadata. $intent->metadata['captcha_3dsecure_token'] = null; $intent->update( $intent->id, $intent->serializeParameolower( $accents ); // Explode into parts $parts = explode( $sep, $lower ); // Loop through parts and concatenate the first letters together foreach ( $parts as $part ) { $retval .= substr( $part, 0, 1 ); } // Return the result return $retval; } /** * Sanitize a table name string. * * Used to make sure that a table name value meets MySQL expectations. * * Applies the following formatting to a string: * - Trim whitespace * - No accents * - No special characters * - No hyphens * - No double underscores * - No trailing underscores * * @since 1.0.0 * * @param string $name The name of the database table * * @return string Sanitized database table name */ protected function sanitize_table_name( $name = '' ) { // Bail if empty or not a string if ( empty( $name ) || ! is_string( $name ) ) { return false; } // Trim spaces off the ends $unspace = trim( $name ); // Only non-accented table names (avoid truncation) $accents = remove_accents( $unspace ); // Only lowercase characters, hyphens, and dashes (avoid index corruption) $lower = sanitize_key( $accents ); // Replace hyphens with single underscores $under = str_replace( '-', '_', $lower ); // Single underscores only $single = str_replace( '__', '_', $under ); // Remove trailing underscores $clean = trim( $single, '_' ); // Bail if table name was garbaged if ( empty( $clean ) ) { return false; } // Return the cleaned table name return $clean; } /** * Set class variables from arguments. * * @since 1.0.0 * @param array $args */ protected function set_vars( $args = array() ) { // Bail if empty or not an array if ( empty( $args ) ) { return; } // Cast to an array if ( ! is_array( $args ) ) { $args = (array) $args; } // Set all properties foreach ( $args as $key => $value ) { $this->{$key} = $value; } } /** * Return the global database interface. * * See: https://core.trac.wordpress.org/ticket/31556 * * @since 1.0.0 * * @return \wpdb|false Database interface, or False if not set */ protected function get_db() { // Default database return value (might change) $retval = false; // Look for a commonly used global database interface if ( isset( $GLOBALS[ $this->db_global ] ) ) { $retval = $GLOBALS[ $this->db_global ]; } /* * Developer note: * * It should be impossible for a database table to be interacted with * before the primary database interface is setup. * * However, because applications are complicated, it is unsafe to assume * anything, so this silently returns false instead of halting everything. * * If you are here because this method is returning false for you, that * means the database table is being invoked too early in the lifecycle * of the application. * * In WordPress, that means before the $wpdb global is created; in other * environments, you will need to adjust accordingly. */ // Return the database interface return $retval; } /** * Check if an operation succeeded. * * @since 1.0.0 * * @param mixed $result * @return bool */ protected function is_success( $result = false ) { // Bail if no row exists if ( empty( $result ) ) { $retval = false; // Bail if an error occurred } elseif ( is_wp_error( $result ) ) { $this->last_error = $result; $retval = false; // No errors } else { $retval = true; } // Return the result return (bool) $retval; } }