Changeset 3335722
- Timestamp:
- 07/29/2025 07:35:45 AM (5 months ago)
- Location:
- profiler-donations-gravityforms
- Files:
-
- 10 edited
- 6 copied
-
tags/2.5.4 (copied) (copied from profiler-donations-gravityforms/trunk)
-
tags/2.5.4/class-feedlist-gfaddon.php (copied) (copied from profiler-donations-gravityforms/trunk/class-feedlist-gfaddon.php)
-
tags/2.5.4/class-profilercommon.php (copied) (copied from profiler-donations-gravityforms/trunk/class-profilercommon.php) (1 diff)
-
tags/2.5.4/class-profilerdonate-gfaddon.php (copied) (copied from profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php) (2 diffs)
-
tags/2.5.4/class-profilerlists-gfaddon.php (modified) (5 diffs)
-
tags/2.5.4/class-profilerlistsbasic-gfaddon.php (modified) (1 diff)
-
tags/2.5.4/index.php (copied) (copied from profiler-donations-gravityforms/trunk/index.php) (1 diff)
-
tags/2.5.4/readme.txt (copied) (copied from profiler-donations-gravityforms/trunk/readme.txt) (1 diff)
-
tags/2.5.4/woocommerce/integration.php (modified) (2 diffs)
-
trunk/class-profilercommon.php (modified) (1 diff)
-
trunk/class-profilerdonate-gfaddon.php (modified) (2 diffs)
-
trunk/class-profilerlists-gfaddon.php (modified) (5 diffs)
-
trunk/class-profilerlistsbasic-gfaddon.php (modified) (1 diff)
-
trunk/index.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/woocommerce/integration.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
profiler-donations-gravityforms/tags/2.5.4/class-profilercommon.php
r3239895 r3335722 773 773 if($api_type === 'json') { 774 774 $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 } 775 780 } else { 776 781 $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 290 290 291 291 $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(302 292 "label" => 'Client: Website', 303 293 "type" => "select", … … 500 490 501 491 $fields[] = array( 502 "label" => ' Interaction:Membership/Regular Mapping Text',492 "label" => 'Membership/Regular Mapping Text', 503 493 "type" => "select", 504 494 "name" => "profilerdonation_membership_mapping_text", -
profiler-donations-gravityforms/tags/2.5.4/class-profilerlists-gfaddon.php
r2750662 r3335722 10 10 protected static $_instance = null; 11 11 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 15 20 protected $supports_custom_fields = true; 21 protected $supports_mailinglists = true; 16 22 17 23 public static function get_instance() { … … 150 156 "required" => false, 151 157 "choices" => $field_settings, 152 "pf_apifield" => "phoneah", 158 "pf_apifield" => "phoneAH", 159 "auto_format" => "phone", 153 160 ); 154 161 … … 159 166 "required" => false, 160 167 "choices" => $field_settings, 161 "pf_apifield" => "phonebus", 168 "pf_apifield" => "phoneBus", 169 "auto_format" => "phone", 162 170 ); 163 171 … … 168 176 "required" => false, 169 177 "choices" => $field_settings, 170 "pf_apifield" => "phonemobile", 178 "pf_apifield" => "phoneMobile", 179 "auto_format" => "phone", 171 180 ); 172 181 … … 180 189 ); 181 190 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 fields194 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 242 191 return $fields; 243 192 244 193 } 245 194 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']); 261 201 } 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 { 271 203 // 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 } 280 206 } 281 207 -
profiler-donations-gravityforms/tags/2.5.4/class-profilerlistsbasic-gfaddon.php
r2750662 r3335722 10 10 protected static $_instance = null; 11 11 12 protected $api_type = "json"; 12 13 protected $apifield_endpoint = "/ProfilerAPI/mailings/subscribe/"; 13 14 protected $apifield_apikey = "apiuser"; -
profiler-donations-gravityforms/tags/2.5.4/index.php
r3239895 r3335722 4 4 Plugin URI: https://mediarealm.com.au/ 5 5 Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler. 6 Version: 2.5. 36 Version: 2.5.4 7 7 8 8 Author: Media Realm -
profiler-donations-gravityforms/tags/2.5.4/readme.txt
r3239895 r3335722 22 22 23 23 == 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 24 31 25 32 = 2.5.3 = -
profiler-donations-gravityforms/tags/2.5.4/woocommerce/integration.php
r3211366 r3335722 147 147 $last_name = $order->get_billing_last_name(); 148 148 $email = $order->get_billing_email(); 149 $phone_number = $order->get_billing_phone(); 149 150 $company_name = $order->get_billing_company(); 150 151 … … 199 200 200 201 'email' => $email, 202 'phoneMobile' => $phone_number, 201 203 202 204 'address' => implode("\n", array($billing_address_1, $billing_address_2)), -
profiler-donations-gravityforms/trunk/class-profilercommon.php
r3239895 r3335722 773 773 if($api_type === 'json') { 774 774 $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 } 775 780 } else { 776 781 $data_decoded = json_decode(json_encode((array)simplexml_load_string($result)), true); -
profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php
r3217308 r3335722 290 290 291 291 $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(302 292 "label" => 'Client: Website', 303 293 "type" => "select", … … 500 490 501 491 $fields[] = array( 502 "label" => ' Interaction:Membership/Regular Mapping Text',492 "label" => 'Membership/Regular Mapping Text', 503 493 "type" => "select", 504 494 "name" => "profilerdonation_membership_mapping_text", -
profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php
r2750662 r3335722 10 10 protected static $_instance = null; 11 11 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 15 20 protected $supports_custom_fields = true; 21 protected $supports_mailinglists = true; 16 22 17 23 public static function get_instance() { … … 150 156 "required" => false, 151 157 "choices" => $field_settings, 152 "pf_apifield" => "phoneah", 158 "pf_apifield" => "phoneAH", 159 "auto_format" => "phone", 153 160 ); 154 161 … … 159 166 "required" => false, 160 167 "choices" => $field_settings, 161 "pf_apifield" => "phonebus", 168 "pf_apifield" => "phoneBus", 169 "auto_format" => "phone", 162 170 ); 163 171 … … 168 176 "required" => false, 169 177 "choices" => $field_settings, 170 "pf_apifield" => "phonemobile", 178 "pf_apifield" => "phoneMobile", 179 "auto_format" => "phone", 171 180 ); 172 181 … … 180 189 ); 181 190 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 fields194 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 242 191 return $fields; 243 192 244 193 } 245 194 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']); 261 201 } 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 { 271 203 // 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 } 280 206 } 281 207 -
profiler-donations-gravityforms/trunk/class-profilerlistsbasic-gfaddon.php
r2750662 r3335722 10 10 protected static $_instance = null; 11 11 12 protected $api_type = "json"; 12 13 protected $apifield_endpoint = "/ProfilerAPI/mailings/subscribe/"; 13 14 protected $apifield_apikey = "apiuser"; -
profiler-donations-gravityforms/trunk/index.php
r3239895 r3335722 4 4 Plugin URI: https://mediarealm.com.au/ 5 5 Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler. 6 Version: 2.5. 36 Version: 2.5.4 7 7 8 8 Author: Media Realm -
profiler-donations-gravityforms/trunk/readme.txt
r3239895 r3335722 22 22 23 23 == 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 24 31 25 32 = 2.5.3 = -
profiler-donations-gravityforms/trunk/woocommerce/integration.php
r3211366 r3335722 147 147 $last_name = $order->get_billing_last_name(); 148 148 $email = $order->get_billing_email(); 149 $phone_number = $order->get_billing_phone(); 149 150 $company_name = $order->get_billing_company(); 150 151 … … 199 200 200 201 'email' => $email, 202 'phoneMobile' => $phone_number, 201 203 202 204 'address' => implode("\n", array($billing_address_1, $billing_address_2)),
Note: See TracChangeset
for help on using the changeset viewer.