���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC index.js000064400000007001146731564410006222 0ustar00document.addEventListener("DOMContentLoaded",(e=>{const t=()=>{const e=document.querySelectorAll("form.wpcf7-form .wpcf7-stripe");for(let t=0;t{const t=e.detail.unitTag,s=`${t}-ve-stripe-card-element`,n=document.querySelector(`#${t} form`),o=n.closest(".wpcf7").querySelector(".screen-reader-response"),d=n.querySelector(".wpcf7-stripe .wpcf7-form-control-wrap"),c=n.querySelector(".wpcf7-stripe button.first"),a=n.querySelector(".wpcf7-stripe button.second"),l=n.querySelector('[name="_wpcf7_stripe_payment_intent"]');if(!l)return;l.setAttribute("value","");const u=e=>{const t=o.querySelector("ul"),r=t.querySelector(`li#${s}`);r&&r.remove();const i=document.createElement("li");i.setAttribute("id",s),i.insertAdjacentText("beforeend",e.message),t.appendChild(i)},p=e=>{const t=d.querySelector(".wpcf7-form-control");t.classList.add("wpcf7-not-valid"),t.setAttribute("aria-describedby",s);const r=document.createElement("span");r.setAttribute("class","wpcf7-not-valid-tip"),r.setAttribute("aria-hidden","true"),r.insertAdjacentText("beforeend",e.message),d.appendChild(r),d.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","true")})),t.closest(".use-floating-validation-tip")&&(t.addEventListener("focus",(e=>{r.setAttribute("style","display: none")})),r.addEventListener("mouseover",(e=>{r.setAttribute("style","display: none")})))},f=()=>{o.querySelectorAll(`ul li#${s}`).forEach((e=>{e.remove()})),d.querySelectorAll(".wpcf7-not-valid-tip").forEach((e=>{e.remove()})),d.querySelectorAll("[aria-invalid]").forEach((e=>{e.setAttribute("aria-invalid","false")})),d.querySelectorAll(".wpcf7-form-control").forEach((e=>{e.removeAttribute("aria-describedby"),e.classList.remove("wpcf7-not-valid")}))};if("payment_required"===e.detail.status){const s=e.detail.apiResponse.stripe.payment_intent;s.id&&l.setAttribute("value",s.id);const o=i.getElement("card")||i.create("card");o.mount(`#${t} .wpcf7-stripe .card-element`),o.clear(),d.classList.remove("hidden"),c.classList.add("hidden"),a.classList.remove("hidden"),a.disabled=!0,o.addEventListener("change",(e=>{if(f(),e.error){const t={message:e.error.message};u(t),p(t),a.disabled=!0}else a.disabled=!1})),a.addEventListener("click",(e=>{f(),a.disabled=!0,n.classList.add("submitting"),wpcf7.blocked||r.confirmCardPayment(s.client_secret,{payment_method:{card:o}}).then((e=>{if(e.error){e.error.decline_code&&["fraudulent","lost_card","merchant_blacklist","pickup_card","restricted_card","security_violation","service_not_allowed","stolen_card","transaction_not_allowed"].includes(e.error.decline_code)&&(wpcf7.blocked=!0),n.classList.remove("submitting");const t={message:e.error.message};u(t),p(t)}else"succeeded"===e.paymentIntent.status&&wpcf7.submit(n)}))}))}else d.classList.add("hidden"),c.classList.remove("hidden"),a.classList.add("hidden"),["mail_sent","mail_failed"].includes(e.detail.status)&&(c.disabled=!0)}))}));api.php000064400000006667146731564410006060 0ustar00secret = $secret; } /** * Sends a debug information for a remote request to the PHP error log. * * @param string $url URL to retrieve. * @param array $request Request arguments. * @param array|WP_Error $response The response or WP_Error on failure. */ private function log( $url, $request, $response ) { wpcf7_log_remote_request( $url, $request, $response ); } /** * Returns default set of HTTP request headers used for Stripe API. * * @link https://stripe.com/docs/building-plugins#setappinfo * * @return array An associative array of headers. */ private function default_headers() { $app_info = array( 'name' => self::app_name, 'partner_id' => self::partner_id, 'url' => self::app_url, 'version' => WPCF7_VERSION, ); $ua = array( 'lang' => 'php', 'lang_version' => PHP_VERSION, 'application' => $app_info, ); $headers = array( 'Authorization' => sprintf( 'Bearer %s', $this->secret ), 'Stripe-Version' => self::api_version, 'X-Stripe-Client-User-Agent' => wp_json_encode( $ua ), 'User-Agent' => sprintf( '%1$s/%2$s (%3$s)', self::app_name, WPCF7_VERSION, self::app_url ), ); return $headers; } /** * Creates a Payment Intent. * * @link https://stripe.com/docs/api/payment_intents/create * * @param string|array $args Optional. Arguments to control behavior. * @return array|bool An associative array if 200 OK, false otherwise. */ public function create_payment_intent( $args = '' ) { $args = wp_parse_args( $args, array( 'amount' => 0, 'currency' => '', 'receipt_email' => '', ) ); if ( ! is_email( $args['receipt_email'] ) ) { unset( $args['receipt_email'] ); } $endpoint = 'https://api.stripe.com/v1/payment_intents'; $request = array( 'headers' => $this->default_headers(), 'body' => $args, ); $response = wp_remote_post( sanitize_url( $endpoint ), $request ); if ( 200 != wp_remote_retrieve_response_code( $response ) ) { if ( WP_DEBUG ) { $this->log( $endpoint, $request, $response ); } return false; } $response_body = wp_remote_retrieve_body( $response ); $response_body = json_decode( $response_body, true ); return $response_body; } /** * Retrieve a Payment Intent. * * @link https://stripe.com/docs/api/payment_intents/retrieve * * @param string $id Payment Intent identifier. * @return array|bool An associative array if 200 OK, false otherwise. */ public function retrieve_payment_intent( $id ) { $endpoint = sprintf( 'https://api.stripe.com/v1/payment_intents/%s', urlencode( $id ) ); $request = array( 'headers' => $this->default_headers(), ); $response = wp_remote_get( sanitize_url( $endpoint ), $request ); if ( 200 != wp_remote_retrieve_response_code( $response ) ) { if ( WP_DEBUG ) { $this->log( $endpoint, $request, $response ); } return false; } $response_body = wp_remote_retrieve_body( $response ); $response_body = json_decode( $response_body, true ); return $response_body; } } index.asset.php000064400000000121146731564410007507 0ustar00 array(), 'version' => WPCF7_VERSION, ); style.css000064400000000473146731564410006435 0ustar00.wpcf7 .wpcf7-stripe .wpcf7-form-control-wrap { margin: .6em 0; } .wpcf7 .wpcf7-stripe .wpcf7-form-control { display: block; background: #f6f7f7; padding: 12px 12px; border: 1px solid #787c82; } .wpcf7 .wpcf7-stripe button:disabled { cursor: not-allowed; } .wpcf7 .wpcf7-stripe .hidden { display: none; } stripe.php000064400000015512146731564410006602 0ustar00add_service( 'stripe', WPCF7_Stripe::get_instance() ); } add_action( 'wpcf7_enqueue_scripts', 'wpcf7_stripe_enqueue_scripts', 10, 0 ); /** * Enqueues scripts and styles for the Stripe module. */ function wpcf7_stripe_enqueue_scripts() { $service = WPCF7_Stripe::get_instance(); if ( ! $service->is_active() ) { return; } wp_enqueue_style( 'wpcf7-stripe', wpcf7_plugin_url( 'modules/stripe/style.css' ), array(), WPCF7_VERSION, 'all' ); wp_register_script( 'stripe', 'https://js.stripe.com/v3/', array(), null ); $assets = array(); $asset_file = wpcf7_plugin_path( 'modules/stripe/index.asset.php' ); if ( file_exists( $asset_file ) ) { $assets = include( $asset_file ); } $assets = wp_parse_args( $assets, array( 'dependencies' => array(), 'version' => WPCF7_VERSION, ) ); wp_enqueue_script( 'wpcf7-stripe', wpcf7_plugin_url( 'modules/stripe/index.js' ), array_merge( $assets['dependencies'], array( 'wp-polyfill', 'contact-form-7', 'stripe', ) ), $assets['version'], array( 'in_footer' => true ) ); $api_keys = $service->get_api_keys(); if ( $api_keys['publishable'] ) { wp_localize_script( 'wpcf7-stripe', 'wpcf7_stripe', array( 'publishable_key' => $api_keys['publishable'], ) ); } } add_filter( 'wpcf7_skip_spam_check', 'wpcf7_stripe_skip_spam_check', 10, 2 ); /** * Skips the spam check if it is not necessary. * * @return bool True if the spam check is not necessary. */ function wpcf7_stripe_skip_spam_check( $skip_spam_check, $submission ) { $service = WPCF7_Stripe::get_instance(); if ( ! $service->is_active() ) { return $skip_spam_check; } if ( ! empty( $_POST['_wpcf7_stripe_payment_intent'] ) ) { $pi_id = trim( $_POST['_wpcf7_stripe_payment_intent'] ); $payment_intent = $service->api()->retrieve_payment_intent( $pi_id ); if ( isset( $payment_intent['status'] ) and ( 'succeeded' === $payment_intent['status'] ) ) { $submission->push( 'payment_intent', $pi_id ); } } if ( ! empty( $submission->pull( 'payment_intent' ) ) and $submission->verify_posted_data_hash() ) { $skip_spam_check = true; } return $skip_spam_check; } add_action( 'wpcf7_before_send_mail', 'wpcf7_stripe_before_send_mail', 10, 3 ); /** * Creates Stripe's Payment Intent. */ function wpcf7_stripe_before_send_mail( $contact_form, &$abort, $submission ) { $service = WPCF7_Stripe::get_instance(); if ( ! $service->is_active() ) { return; } $tags = $contact_form->scan_form_tags( array( 'type' => 'stripe' ) ); if ( ! $tags ) { return; } if ( ! empty( $submission->pull( 'payment_intent' ) ) ) { return; } $tag = $tags[0]; $amount = $tag->get_option( 'amount', 'int', true ); $currency = $tag->get_option( 'currency', '[a-zA-Z]{3}', true ); $payment_intent_params = apply_filters( 'wpcf7_stripe_payment_intent_parameters', array( 'amount' => $amount ? absint( $amount ) : null, 'currency' => $currency ? strtolower( $currency ) : null, 'receipt_email' => $submission->get_posted_data( 'your-email' ), ) ); $payment_intent = $service->api()->create_payment_intent( $payment_intent_params ); if ( $payment_intent ) { $submission->add_result_props( array( 'stripe' => array( 'payment_intent' => array( 'id' => $payment_intent['id'], 'client_secret' => $payment_intent['client_secret'], ), ), ) ); $submission->set_status( 'payment_required' ); $submission->set_response( __( "Payment is required. Please pay by credit card.", 'contact-form-7' ) ); } $abort = true; } /** * Returns payment link URL. * * @param string $pi_id Payment Intent ID. * @return string The URL. */ function wpcf7_stripe_get_payment_link( $pi_id ) { return sprintf( 'https://dashboard.stripe.com/payments/%s', urlencode( $pi_id ) ); } add_filter( 'wpcf7_special_mail_tags', 'wpcf7_stripe_smt', 10, 4 ); /** * Registers the [_stripe_payment_link] special mail-tag. */ function wpcf7_stripe_smt( $output, $tag_name, $html, $mail_tag = null ) { if ( '_stripe_payment_link' === $tag_name ) { $submission = WPCF7_Submission::get_instance(); $pi_id = $submission->pull( 'payment_intent' ); if ( ! empty( $pi_id ) ) { $output = wpcf7_stripe_get_payment_link( $pi_id ); } } return $output; } add_filter( 'wpcf7_flamingo_inbound_message_parameters', 'wpcf7_stripe_add_flamingo_inbound_message_params', 10, 1 ); /** * Adds Stripe-related meta data to Flamingo Inbound Message parameters. */ function wpcf7_stripe_add_flamingo_inbound_message_params( $args ) { $submission = WPCF7_Submission::get_instance(); $pi_id = $submission->pull( 'payment_intent' ); if ( empty( $pi_id ) ) { return $args; } $pi_link = wpcf7_stripe_get_payment_link( $pi_id ); $meta = (array) $args['meta']; $meta['stripe_payment_link'] = $pi_link; $args['meta'] = $meta; return $args; } add_action( 'wpcf7_init', 'wpcf7_add_form_tag_stripe', 10, 0 ); /** * Registers the stripe form-tag handler. */ function wpcf7_add_form_tag_stripe() { wpcf7_add_form_tag( 'stripe', 'wpcf7_stripe_form_tag_handler', array( 'display-block' => true, 'singular' => true, ) ); } /** * Defines the stripe form-tag handler. * * @return string HTML content that replaces a stripe form-tag. */ function wpcf7_stripe_form_tag_handler( $tag ) { $card_element = sprintf( '
', wpcf7_format_atts( array( 'class' => 'card-element wpcf7-form-control', 'aria-invalid' => 'false', ) ) ); $card_element = sprintf( '', $card_element ); $button_1_label = __( 'Proceed to checkout', 'contact-form-7' ); if ( isset( $tag->values[0] ) ) { $button_1_label = trim( $tag->values[0] ); } $button_1 = sprintf( '', wpcf7_format_atts( array( 'type' => 'submit', 'class' => 'first', ) ), esc_html( $button_1_label ) ); $button_2_label = __( 'Complete payment', 'contact-form-7' ); if ( isset( $tag->values[1] ) ) { $button_2_label = trim( $tag->values[1] ); } $button_2 = sprintf( '', wpcf7_format_atts( array( 'type' => 'button', 'class' => 'second hidden', ) ), esc_html( $button_2_label ) ); $buttons = sprintf( '%1$s %2$s', $button_1, $button_2 ); return sprintf( '
%1$s %2$s %3$s
', $card_element, $buttons, '' ); } service.php000064400000013640146731564410006734 0ustar00api_keys = array( 'publishable' => $option['api_keys']['publishable'], 'secret' => $option['api_keys']['secret'], ); } } public function get_title() { return __( 'Stripe', 'contact-form-7' ); } public function is_active() { return (bool) $this->get_api_keys(); } public function api() { if ( $this->is_active() ) { $api = new WPCF7_Stripe_API( $this->api_keys['secret'] ); return $api; } } public function get_api_keys() { return $this->api_keys; } public function get_categories() { return array( 'payments' ); } public function icon() { } public function link() { echo wpcf7_link( 'https://stripe.com/', 'stripe.com' ); } protected function menu_page_url( $args = '' ) { $args = wp_parse_args( $args, array() ); $url = menu_page_url( 'wpcf7-integration', false ); $url = add_query_arg( array( 'service' => 'stripe' ), $url ); if ( ! empty( $args ) ) { $url = add_query_arg( $args, $url ); } return $url; } protected function save_data() { WPCF7::update_option( 'stripe', array( 'api_keys' => $this->api_keys, ) ); } protected function reset_data() { $this->api_keys = null; $this->save_data(); } public function load( $action = '' ) { if ( 'setup' == $action and 'POST' == $_SERVER['REQUEST_METHOD'] ) { check_admin_referer( 'wpcf7-stripe-setup' ); if ( ! empty( $_POST['reset'] ) ) { $this->reset_data(); $redirect_to = $this->menu_page_url( 'action=setup' ); } else { $publishable = trim( $_POST['publishable'] ?? '' ); $secret = trim( $_POST['secret'] ?? '' ); if ( $publishable and $secret ) { $this->api_keys = array( 'publishable' => $publishable, 'secret' => $secret, ); $this->save_data(); $redirect_to = $this->menu_page_url( array( 'message' => 'success', ) ); } else { $redirect_to = $this->menu_page_url( array( 'action' => 'setup', 'message' => 'invalid', ) ); } } wp_safe_redirect( $redirect_to ); exit(); } } public function admin_notice( $message = '' ) { if ( 'invalid' == $message ) { echo sprintf( '

%1$s: %2$s

', esc_html( __( "Error", 'contact-form-7' ) ), esc_html( __( "Invalid key values.", 'contact-form-7' ) ) ); } if ( 'success' == $message ) { echo sprintf( '

%s

', esc_html( __( 'Settings saved.', 'contact-form-7' ) ) ); } } public function display( $action = '' ) { echo sprintf( '

%s

', // https://stripe.com/docs/partners/support#intro esc_html( __( "Stripe is a simple and powerful way to accept payments online. Stripe has no setup fees, no monthly fees, and no hidden costs. Millions of businesses rely on Stripe’s software tools to accept payments securely and expand globally.", 'contact-form-7' ) ) ); echo sprintf( '

%s

', wpcf7_link( __( 'https://contactform7.com/stripe-integration/', 'contact-form-7' ), __( 'Stripe integration', 'contact-form-7' ) ) ); if ( $this->is_active() ) { echo sprintf( '

%s

', esc_html( __( "Stripe is active on this site.", 'contact-form-7' ) ) ); } if ( 'setup' == $action ) { $this->display_setup(); } elseif ( is_ssl() or WP_DEBUG ) { echo sprintf( '

%2$s

', esc_url( $this->menu_page_url( 'action=setup' ) ), esc_html( __( 'Setup Integration', 'contact-form-7' ) ) ); } else { echo sprintf( '

%s

', esc_html( __( "Stripe is not available on this site. It requires an HTTPS-enabled site.", 'contact-form-7' ) ) ); } } private function display_setup() { $api_keys = $this->get_api_keys(); if ( $api_keys ) { $publishable = $api_keys['publishable']; $secret = $api_keys['secret']; } else { $publishable = ''; $secret = ''; } ?>
is_active() ) { echo esc_html( $publishable ); echo sprintf( '', esc_attr( $publishable ) ); } else { echo sprintf( '', esc_attr( $publishable ) ); } ?>
is_active() ) { echo esc_html( wpcf7_mask_password( $secret ) ); echo sprintf( '', esc_attr( $secret ) ); } else { echo sprintf( '', esc_attr( $secret ) ); } ?>
is_active() ) { submit_button( _x( 'Remove Keys', 'API keys', 'contact-form-7' ), 'small', 'reset' ); } else { submit_button( __( 'Save Changes', 'contact-form-7' ) ); } ?>