Plugin Directory

Changeset 3335722


Ignore:
Timestamp:
07/29/2025 07:35:45 AM (5 months ago)
Author:
anthonyeden
Message:

Version 2.5.4

Location:
profiler-donations-gravityforms
Files:
10 edited
6 copied

Legend:

Unmodified
Added
Removed
  • profiler-donations-gravityforms/tags/2.5.4/class-profilercommon.php

    r3239895 r3335722  
    773773        if($api_type === 'json') {
    774774            $data_decoded = json_decode($result, true);
     775
     776            if($data_decoded === null) {
     777                // In some cases (e.g. Mailing List Basic), Profiler accepts JSON but returns XML.
     778                $data_decoded = json_decode(json_encode((array)simplexml_load_string($result)), true);
     779            }
    775780        } else {
    776781            $data_decoded = json_decode(json_encode((array)simplexml_load_string($result)), true);
  • profiler-donations-gravityforms/tags/2.5.4/class-profilerdonate-gfaddon.php

    r3217308 r3335722  
    290290
    291291        $fields[] = array(
    292             "label" => 'Client: Phone',
    293             "type" => "select",
    294             "name" => "profilerdonation_clientphonemobile",
    295             "required" => false,
    296             "choices" => $field_settings,
    297             "pf_apifield" => "phoneMobile",
    298             "auto_format" => "phone",
    299         );
    300 
    301         $fields[] = array(
    302292            "label" => 'Client: Website',
    303293            "type" => "select",
     
    500490
    501491        $fields[] = array(
    502             "label" => 'Interaction: Membership/Regular Mapping Text',
     492            "label" => 'Membership/Regular Mapping Text',
    503493            "type" => "select",
    504494            "name" => "profilerdonation_membership_mapping_text",
  • profiler-donations-gravityforms/tags/2.5.4/class-profilerlists-gfaddon.php

    r2750662 r3335722  
    1010    protected static $_instance = null;
    1111
    12     protected $apifield_endpoint = "/ProfilerPROG/api/api_call.cfm";
    13     protected $apifield_apikey = "apikey";
    14     protected $apifield_apipass = "apipass";
     12    protected $api_type = "json";
     13    protected $api_domain = "profilersoftware.com";
     14    protected $apifield_endpoint = "/ProfilerAPI/SubscribeList/";
     15    protected $apifield_apikey = "apiuser";
     16    protected $apifield_apipass = "apipassword";
     17    protected $apifield_ipaddress = 'requestIPAddress';
     18    protected $apifield_formurl = 'pageURL';
     19
    1520    protected $supports_custom_fields = true;
     21    protected $supports_mailinglists = true;
    1622
    1723    public static function get_instance() {
     
    150156            "required" => false,
    151157            "choices" => $field_settings,
    152             "pf_apifield" => "phoneah",
     158            "pf_apifield" => "phoneAH",
     159            "auto_format" => "phone",
    153160        );
    154161       
     
    159166            "required" => false,
    160167            "choices" => $field_settings,
    161             "pf_apifield" => "phonebus",
     168            "pf_apifield" => "phoneBus",
     169            "auto_format" => "phone",
    162170        );
    163171       
     
    168176            "required" => false,
    169177            "choices" => $field_settings,
    170             "pf_apifield" => "phonemobile",
     178            "pf_apifield" => "phoneMobile",
     179            "auto_format" => "phone",
    171180        );
    172181       
     
    180189        );
    181190
    182         $fields[] = array(
    183             "label" => 'Number of Mailing Lists',
    184             "type" => "select",
    185             "name" => "profilerlist_mailinglist_count",
    186             "required" => false,
    187             "tooltip" => "Select a quantity of Mailing Lists, save this page, and then configure them. You may need to refresh this page after saving to see the extra fields.",
    188             "choices" => $mailingnumbers,
    189             "default" => 0,
    190         );
    191 
    192         for($i = 1; $i <= $feed['meta']['profilerlist_mailinglist_count']; $i++) {
    193             // Loop over mailing list fields
    194 
    195             $fields[] = array(
    196                 "label" => 'Mailing List #'.$i.': UDF',
    197                 "type" => "select",
    198                 "name" => "profilerlist_mailinglist_".$i."_udf",
    199                 "required" => false,
    200                 "tooltip" => "Pick the Profiler User Defined Field you wish to use for this mailing",
    201                 "choices" => $userdefinedfields,
    202             );
    203 
    204             $fields[] = array(
    205                 "label" => 'Mailing List #'.$i.': UDF Text',
    206                 "type" => "text",
    207                 "name" => "profilerlist_mailinglist_".$i."_udftext",
    208                 "required" => false,
    209                 "tooltip" => "Enter the string Profiler is expecting in this UDF",
    210             );
    211 
    212             $fields[] = array(
    213                 "label" => 'Mailing List #'.$i.': Field',
    214                 "type" => "select",
    215                 "name" => "profilerlist_mailinglist_".$i."_field",
    216                 "tooltip" => 'Link it to a checkbox field - when checked, the mailing will be sent',
    217                 "required" => false,
    218                 "choices" => array_merge($checkboxRadioFields, array(array("value" => "always", "label" => "Always Subscribe"))),
    219             );
    220         }
    221 
    222         $fields[] = array(
    223             "label" => 'UDF: Client IP Address',
    224             "type" => "select",
    225             "name" => "profilerlist_userdefined_clientip",
    226             "required" => false,
    227             "tooltip" => "Pick the Profiler User Defined Field you wish the client's IP address to be sent to",
    228             "choices" => $userdefinedfields,
    229             "pf_apifield" => "",
    230         );
    231 
    232         $fields[] = array(
    233             "label" => 'UDF: Form URL',
    234             "type" => "select",
    235             "name" => "profilerlist_userdefined_formurl",
    236             "required" => false,
    237             "tooltip" => "Pick the Profiler User Defined Field you wish the donation's form's URL to be sent to.",
    238             "choices" => $userdefinedfields,
    239             "pf_apifield" => "",
    240         );
    241 
    242191        return $fields;
    243192       
    244193    }
    245194
    246     public function process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway = false) {
    247 
    248         $postData['method'] = "integration.send";
    249         $postData['datatype'] = "LISTS";
    250         $postData['clientname'] = $postData['firstname'] . " " . $postData['surname'];
    251 
    252         // Calculate mailing list subscriptions
    253         for($i = 1; $i <= $feed['meta']['profilerlist_mailinglist_count']; $i++) {
    254             // Loop over mailing list fields
    255             $mailingFieldValue = $this->get_field_value($form, $entry, $feed['meta']["profilerlist_mailinglist_".$i."_field"]);
    256             $udf = $feed['meta']["profilerlist_mailinglist_".$i."_udf"];
    257             $udfText = $feed['meta']["profilerlist_mailinglist_".$i."_udftext"];
    258 
    259             if(!empty($udf) && !empty($udfText) && (!empty($mailingFieldValue) || $feed['meta']["profilerlist_mailinglist_".$i."_field"] == "always")) {
    260                 $postData['userdefined' . $udf] = $udfText;
     195    public function process_feed_success($feed, $entry, $form, $pfResponse, $postData) {
     196        if(isset($pfResponse['dataArray']['success']) && $pfResponse['dataArray']['success'] === true) {
     197            // Store the Integration ID as meta so we can use it later
     198            if(isset($pfResponse['dataArray']['integrationId'])) {
     199                gform_add_meta($entry["id"], "profiler_integrationid", $pfResponse['dataArray']['integrationId'], $form['id']);
     200                gform_add_meta($entry["id"], "profiler_integration_guid", $pfResponse['dataArray']['integrationGuid'], $form['id']);
    261201            }
    262 
    263         }
    264 
    265         return $postData;
    266     }
    267 
    268     public function process_feed_success($feed, $entry, $form, $pfResponse, $postData) {
    269 
    270         if(!isset($pfResponse['dataArray']['status']) || $pfResponse['dataArray']['status'] != "Pass") {
     202        } else {
    271203            // Profiler failed. Send the failure email.
    272             $this->sendFailureEmail($entry, $form, $pfResponse, $feed['meta']['profiler_erroremailaddress']);
    273 
    274         } else {
    275             // Store the Integration ID as meta so we can use it later
    276             if(isset($pfResponse['dataArray']['id']))
    277                 gform_add_meta($entry["id"], "profiler_integrationid", $pfResponse['dataArray']['id'], $form['id']);
    278         }
    279 
     204            $this->sendFailureEmail($entry, $form, $pfResponse, $feed['meta']["profiler_erroremailaddress"]);
     205        }
    280206    }
    281207
  • profiler-donations-gravityforms/tags/2.5.4/class-profilerlistsbasic-gfaddon.php

    r2750662 r3335722  
    1010    protected static $_instance = null;
    1111
     12    protected $api_type = "json";
    1213    protected $apifield_endpoint = "/ProfilerAPI/mailings/subscribe/";
    1314    protected $apifield_apikey = "apiuser";
  • profiler-donations-gravityforms/tags/2.5.4/index.php

    r3239895 r3335722  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler.
    6 Version: 2.5.3
     6Version: 2.5.4
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/tags/2.5.4/readme.txt

    r3239895 r3335722  
    2222
    2323== Changelog ==
     24
     25= 2.5.4 =
     26
     27* Mailing Lists (Advanced): Use the latest version of the Profiler API
     28* Mailing Lists (Basic): Use the latest version of the Profiler API
     29* WooCommerce: Send the order's Phone field to Profiler
     30* Fix a bug with duplicate phone field config
    2431
    2532= 2.5.3 =
  • profiler-donations-gravityforms/tags/2.5.4/woocommerce/integration.php

    r3211366 r3335722  
    147147        $last_name = $order->get_billing_last_name();
    148148        $email = $order->get_billing_email();
     149        $phone_number = $order->get_billing_phone();
    149150        $company_name = $order->get_billing_company();
    150151
     
    199200
    200201            'email' => $email,
     202            'phoneMobile' => $phone_number,
    201203
    202204            'address' => implode("\n", array($billing_address_1, $billing_address_2)),
  • profiler-donations-gravityforms/trunk/class-profilercommon.php

    r3239895 r3335722  
    773773        if($api_type === 'json') {
    774774            $data_decoded = json_decode($result, true);
     775
     776            if($data_decoded === null) {
     777                // In some cases (e.g. Mailing List Basic), Profiler accepts JSON but returns XML.
     778                $data_decoded = json_decode(json_encode((array)simplexml_load_string($result)), true);
     779            }
    775780        } else {
    776781            $data_decoded = json_decode(json_encode((array)simplexml_load_string($result)), true);
  • profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php

    r3217308 r3335722  
    290290
    291291        $fields[] = array(
    292             "label" => 'Client: Phone',
    293             "type" => "select",
    294             "name" => "profilerdonation_clientphonemobile",
    295             "required" => false,
    296             "choices" => $field_settings,
    297             "pf_apifield" => "phoneMobile",
    298             "auto_format" => "phone",
    299         );
    300 
    301         $fields[] = array(
    302292            "label" => 'Client: Website',
    303293            "type" => "select",
     
    500490
    501491        $fields[] = array(
    502             "label" => 'Interaction: Membership/Regular Mapping Text',
     492            "label" => 'Membership/Regular Mapping Text',
    503493            "type" => "select",
    504494            "name" => "profilerdonation_membership_mapping_text",
  • profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php

    r2750662 r3335722  
    1010    protected static $_instance = null;
    1111
    12     protected $apifield_endpoint = "/ProfilerPROG/api/api_call.cfm";
    13     protected $apifield_apikey = "apikey";
    14     protected $apifield_apipass = "apipass";
     12    protected $api_type = "json";
     13    protected $api_domain = "profilersoftware.com";
     14    protected $apifield_endpoint = "/ProfilerAPI/SubscribeList/";
     15    protected $apifield_apikey = "apiuser";
     16    protected $apifield_apipass = "apipassword";
     17    protected $apifield_ipaddress = 'requestIPAddress';
     18    protected $apifield_formurl = 'pageURL';
     19
    1520    protected $supports_custom_fields = true;
     21    protected $supports_mailinglists = true;
    1622
    1723    public static function get_instance() {
     
    150156            "required" => false,
    151157            "choices" => $field_settings,
    152             "pf_apifield" => "phoneah",
     158            "pf_apifield" => "phoneAH",
     159            "auto_format" => "phone",
    153160        );
    154161       
     
    159166            "required" => false,
    160167            "choices" => $field_settings,
    161             "pf_apifield" => "phonebus",
     168            "pf_apifield" => "phoneBus",
     169            "auto_format" => "phone",
    162170        );
    163171       
     
    168176            "required" => false,
    169177            "choices" => $field_settings,
    170             "pf_apifield" => "phonemobile",
     178            "pf_apifield" => "phoneMobile",
     179            "auto_format" => "phone",
    171180        );
    172181       
     
    180189        );
    181190
    182         $fields[] = array(
    183             "label" => 'Number of Mailing Lists',
    184             "type" => "select",
    185             "name" => "profilerlist_mailinglist_count",
    186             "required" => false,
    187             "tooltip" => "Select a quantity of Mailing Lists, save this page, and then configure them. You may need to refresh this page after saving to see the extra fields.",
    188             "choices" => $mailingnumbers,
    189             "default" => 0,
    190         );
    191 
    192         for($i = 1; $i <= $feed['meta']['profilerlist_mailinglist_count']; $i++) {
    193             // Loop over mailing list fields
    194 
    195             $fields[] = array(
    196                 "label" => 'Mailing List #'.$i.': UDF',
    197                 "type" => "select",
    198                 "name" => "profilerlist_mailinglist_".$i."_udf",
    199                 "required" => false,
    200                 "tooltip" => "Pick the Profiler User Defined Field you wish to use for this mailing",
    201                 "choices" => $userdefinedfields,
    202             );
    203 
    204             $fields[] = array(
    205                 "label" => 'Mailing List #'.$i.': UDF Text',
    206                 "type" => "text",
    207                 "name" => "profilerlist_mailinglist_".$i."_udftext",
    208                 "required" => false,
    209                 "tooltip" => "Enter the string Profiler is expecting in this UDF",
    210             );
    211 
    212             $fields[] = array(
    213                 "label" => 'Mailing List #'.$i.': Field',
    214                 "type" => "select",
    215                 "name" => "profilerlist_mailinglist_".$i."_field",
    216                 "tooltip" => 'Link it to a checkbox field - when checked, the mailing will be sent',
    217                 "required" => false,
    218                 "choices" => array_merge($checkboxRadioFields, array(array("value" => "always", "label" => "Always Subscribe"))),
    219             );
    220         }
    221 
    222         $fields[] = array(
    223             "label" => 'UDF: Client IP Address',
    224             "type" => "select",
    225             "name" => "profilerlist_userdefined_clientip",
    226             "required" => false,
    227             "tooltip" => "Pick the Profiler User Defined Field you wish the client's IP address to be sent to",
    228             "choices" => $userdefinedfields,
    229             "pf_apifield" => "",
    230         );
    231 
    232         $fields[] = array(
    233             "label" => 'UDF: Form URL',
    234             "type" => "select",
    235             "name" => "profilerlist_userdefined_formurl",
    236             "required" => false,
    237             "tooltip" => "Pick the Profiler User Defined Field you wish the donation's form's URL to be sent to.",
    238             "choices" => $userdefinedfields,
    239             "pf_apifield" => "",
    240         );
    241 
    242191        return $fields;
    243192       
    244193    }
    245194
    246     public function process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway = false) {
    247 
    248         $postData['method'] = "integration.send";
    249         $postData['datatype'] = "LISTS";
    250         $postData['clientname'] = $postData['firstname'] . " " . $postData['surname'];
    251 
    252         // Calculate mailing list subscriptions
    253         for($i = 1; $i <= $feed['meta']['profilerlist_mailinglist_count']; $i++) {
    254             // Loop over mailing list fields
    255             $mailingFieldValue = $this->get_field_value($form, $entry, $feed['meta']["profilerlist_mailinglist_".$i."_field"]);
    256             $udf = $feed['meta']["profilerlist_mailinglist_".$i."_udf"];
    257             $udfText = $feed['meta']["profilerlist_mailinglist_".$i."_udftext"];
    258 
    259             if(!empty($udf) && !empty($udfText) && (!empty($mailingFieldValue) || $feed['meta']["profilerlist_mailinglist_".$i."_field"] == "always")) {
    260                 $postData['userdefined' . $udf] = $udfText;
     195    public function process_feed_success($feed, $entry, $form, $pfResponse, $postData) {
     196        if(isset($pfResponse['dataArray']['success']) && $pfResponse['dataArray']['success'] === true) {
     197            // Store the Integration ID as meta so we can use it later
     198            if(isset($pfResponse['dataArray']['integrationId'])) {
     199                gform_add_meta($entry["id"], "profiler_integrationid", $pfResponse['dataArray']['integrationId'], $form['id']);
     200                gform_add_meta($entry["id"], "profiler_integration_guid", $pfResponse['dataArray']['integrationGuid'], $form['id']);
    261201            }
    262 
    263         }
    264 
    265         return $postData;
    266     }
    267 
    268     public function process_feed_success($feed, $entry, $form, $pfResponse, $postData) {
    269 
    270         if(!isset($pfResponse['dataArray']['status']) || $pfResponse['dataArray']['status'] != "Pass") {
     202        } else {
    271203            // Profiler failed. Send the failure email.
    272             $this->sendFailureEmail($entry, $form, $pfResponse, $feed['meta']['profiler_erroremailaddress']);
    273 
    274         } else {
    275             // Store the Integration ID as meta so we can use it later
    276             if(isset($pfResponse['dataArray']['id']))
    277                 gform_add_meta($entry["id"], "profiler_integrationid", $pfResponse['dataArray']['id'], $form['id']);
    278         }
    279 
     204            $this->sendFailureEmail($entry, $form, $pfResponse, $feed['meta']["profiler_erroremailaddress"]);
     205        }
    280206    }
    281207
  • profiler-donations-gravityforms/trunk/class-profilerlistsbasic-gfaddon.php

    r2750662 r3335722  
    1010    protected static $_instance = null;
    1111
     12    protected $api_type = "json";
    1213    protected $apifield_endpoint = "/ProfilerAPI/mailings/subscribe/";
    1314    protected $apifield_apikey = "apiuser";
  • profiler-donations-gravityforms/trunk/index.php

    r3239895 r3335722  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler.
    6 Version: 2.5.3
     6Version: 2.5.4
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/trunk/readme.txt

    r3239895 r3335722  
    2222
    2323== Changelog ==
     24
     25= 2.5.4 =
     26
     27* Mailing Lists (Advanced): Use the latest version of the Profiler API
     28* Mailing Lists (Basic): Use the latest version of the Profiler API
     29* WooCommerce: Send the order's Phone field to Profiler
     30* Fix a bug with duplicate phone field config
    2431
    2532= 2.5.3 =
  • profiler-donations-gravityforms/trunk/woocommerce/integration.php

    r3211366 r3335722  
    147147        $last_name = $order->get_billing_last_name();
    148148        $email = $order->get_billing_email();
     149        $phone_number = $order->get_billing_phone();
    149150        $company_name = $order->get_billing_company();
    150151
     
    199200
    200201            'email' => $email,
     202            'phoneMobile' => $phone_number,
    201203
    202204            'address' => implode("\n", array($billing_address_1, $billing_address_2)),
Note: See TracChangeset for help on using the changeset viewer.