diff --git a/wp/wp-content/themes/medicalalert/functions.php b/wp/wp-content/themes/medicalalert/functions.php index 5a08cfc3..05519fcf 100644 --- a/wp/wp-content/themes/medicalalert/functions.php +++ b/wp/wp-content/themes/medicalalert/functions.php @@ -161,102 +161,24 @@ function wpdocs_excerpt_more( $more ) { } add_filter( 'excerpt_more', 'wpdocs_excerpt_more' ); -function update_individual_fields_11($entry, $form) -{ - echo ''; - echo ''; - - $aarpval = rgpost('input_3', true); - $aarp_val = str_replace(' ', '', $aarpval); - - return $aarp_val; - global $aarp_val; -} - -// AARP API -add_filter('gform_get_form_filter', 'shortcode_unautop', 11); -add_filter('gform_get_form_filter', 'do_shortcode', 11); -add_action('gform_pre_submission_7', 'aarp_api'); - - -function aarp_api() { - - $app_id = 'prodAppId'; - $app_secret = 'prodSecret@123'; - - $aarpval = rgpost('input_3', true); - $aarp_val = str_replace(' ', '', $aarpval); - $apiUrl = 'https://selfserviceportal.lifeline.com/api/address/v1/affiliates/verify?externalIdType1=memberId&externalIdValue1=' . $aarp_val .'&affiliate=AARP'; - $request = wp_remote_get($apiUrl, array('timeout' => 10, 'sslverify' => false, 'headers' => array('appId' => $app_id, 'appSecret' => $app_secret, 'Content-Type' => 'application/json'))); - $body = wp_remote_retrieve_body($request); - $result = json_decode($body, true); - $memberstatus = $result["status"]; - - if ($memberstatus == "ACTIVE") { - add_shortcode('aarpCode', 'aarp_form'); - $aarp_coupon = "E6Y8"; - $_SESSION['SSESSmember']=$aarp_coupon; - - } else { - add_shortcode('aarpCode', 'aarp_form_notfound'); - } -} - -function aarp_form() -{ - $aarp_member .= ' -
Thank you for providing your Member ID, your discount code will be applied to the your product selection.
-Your discount code is:
-E6Y8
- -We could not find the AARP Membership you entered. Please re-type your number and try again. If that does not work, or you need assistance, please call our customer service team: 1-855-345-0130
- -