Changeset 2750662
- Timestamp:
- 07/01/2022 08:33:18 AM (3 years ago)
- Location:
- profiler-donations-gravityforms/trunk
- Files:
-
- 12 edited
-
class-profilercommon.php (modified) (6 diffs)
-
class-profilerdonate-gfaddon.php (modified) (2 diffs)
-
class-profilerevents-gfaddon.php (modified) (1 diff)
-
class-profilerinteraction-gfaddon.php (modified) (1 diff)
-
class-profilerlists-gfaddon.php (modified) (1 diff)
-
class-profilerlistsbasic-gfaddon.php (modified) (1 diff)
-
class-profilermembership-gfaddon.php (modified) (1 diff)
-
class-profilerpostdonate-gfaddon.php (modified) (2 diffs)
-
class-profilerupdate-gfaddon.php (modified) (1 diff)
-
index.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
sync_users.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
profiler-donations-gravityforms/trunk/class-profilercommon.php
r2698068 r2750662 6 6 protected $_url = ""; 7 7 protected $_title = "Profiler / Gravity Forms - Integration Feed"; 8 9 protected $_capabilities_form_settings = 'gravityforms_edit_settings';10 8 11 9 protected $apifield_apikey = "apikey"; … … 25 23 add_action('gform_stripe_customer_after_create', array($this, 'stripe_customer_id_save'), 10, 4); 26 24 add_filter('gform_stripe_charge_pre_create', array($this, 'stripe_payment_intent'), 10, 5); 25 add_filter('gform_stripe_charge_description', array($this, 'stripe_payment_description'), 10, 5); 27 26 } 28 27 … … 356 355 if(method_exists($this, 'process_feed_custom')) { 357 356 $postData = $this->process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway); 357 358 if($postData === false) { 359 return false; 360 } 361 358 362 } 359 363 … … 827 831 protected function creditcard_mask($number) { 828 832 // Returns a credit card with all but the first six and last four numbers masked 833 834 if(strlen($number) < 11) { 835 // Prevents a fatal error on str_repeat in PHP8 836 return ''; 837 } 838 829 839 return implode("-", str_split(substr($number, 0, 6) . str_repeat("X", strlen($number) - 10) . substr($number, -4), 4)); 830 840 } … … 925 935 // Create a new customer 926 936 $customer_meta = array(); 927 $customer_meta['description'] = $email _address. ' ' . $name;937 $customer_meta['description'] = $email . ' ' . $name; 928 938 $customer_meta['name'] = $name; 929 $customer_meta['email'] = $email _address;939 $customer_meta['email'] = $email; 930 940 931 941 $customer = gf_stripe()->create_customer($customer_meta, $feed, $entry, $form); … … 943 953 return $charge_meta; 944 954 } 955 956 public function stripe_payment_description($description, $strings, $entry, $submission_data, $feed) { 957 958 if(!class_exists('GFAPI') || !isset($entry['form_id'])) { 959 return $description; 960 } 961 962 $description = 'Form #' . $entry['form_id'] . ', Entry #' . $entry['id']; 963 964 // Find Name field 965 $form = GFAPI::get_form($entry['form_id']); 966 foreach($form['fields'] as $fieldKey => $field) { 967 if($field->type == "name") { 968 $description .= ' - ' . $entry[$field->id . '.3'] . ' ' . $entry[$field->id . '.6']; 969 } 970 } 971 972 return $description; 973 974 } 945 975 } 946 976 -
profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php
r2698068 r2750662 25 25 26 26 self::$_instance->form = self::$_instance->get_current_form(); 27 self::$_instance->formid = self::$_instance->form["id"]; 27 if(is_array(self::$_instance->form)) { 28 self::$_instance->formid = self::$_instance->form["id"]; 29 } 28 30 29 31 return self::$_instance; … … 579 581 } 580 582 583 if($useAsGateway == false && isset($entry['payment_status']) && $entry['payment_status'] == "Failed") { 584 GFCommon::log_error("GFProfilerDonate: Skipped sending to Profiler due to Failed payment_status"); 585 return false; 586 } 587 581 588 if($useAsGateway == true) { 582 589 // Profiler processes this payment -
profiler-donations-gravityforms/trunk/class-profilerevents-gfaddon.php
r2698068 r2750662 20 20 21 21 self::$_instance->form = self::$_instance->get_current_form(); 22 self::$_instance->formid = self::$_instance->form["id"]; 22 if(is_array(self::$_instance->form)) { 23 self::$_instance->formid = self::$_instance->form["id"]; 24 } 23 25 24 26 return self::$_instance; -
profiler-donations-gravityforms/trunk/class-profilerinteraction-gfaddon.php
r2698068 r2750662 25 25 26 26 self::$_instance->form = self::$_instance->get_current_form(); 27 self::$_instance->formid = self::$_instance->form["id"]; 27 if(is_array(self::$_instance->form)) { 28 self::$_instance->formid = self::$_instance->form["id"]; 29 } 28 30 29 31 return self::$_instance; -
profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php
r2698068 r2750662 21 21 22 22 self::$_instance->form = self::$_instance->get_current_form(); 23 self::$_instance->formid = self::$_instance->form["id"]; 23 if(is_array(self::$_instance->form)) { 24 self::$_instance->formid = self::$_instance->form["id"]; 25 } 24 26 25 27 return self::$_instance; -
profiler-donations-gravityforms/trunk/class-profilerlistsbasic-gfaddon.php
r2698068 r2750662 20 20 21 21 self::$_instance->form = self::$_instance->get_current_form(); 22 self::$_instance->formid = self::$_instance->form["id"]; 22 if(is_array(self::$_instance->form)) { 23 self::$_instance->formid = self::$_instance->form["id"]; 24 } 23 25 24 26 return self::$_instance; -
profiler-donations-gravityforms/trunk/class-profilermembership-gfaddon.php
r2618948 r2750662 23 23 24 24 self::$_instance->form = self::$_instance->get_current_form(); 25 self::$_instance->formid = self::$_instance->form["id"]; 25 if(is_array(self::$_instance->form)) { 26 self::$_instance->formid = self::$_instance->form["id"]; 27 } 26 28 27 29 return self::$_instance; -
profiler-donations-gravityforms/trunk/class-profilerpostdonate-gfaddon.php
r2698068 r2750662 25 25 26 26 self::$_instance->form = self::$_instance->get_current_form(); 27 self::$_instance->formid = self::$_instance->form["id"]; 27 if(is_array(self::$_instance->form)) { 28 self::$_instance->formid = self::$_instance->form["id"]; 29 } 28 30 29 31 return self::$_instance; … … 127 129 $token = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_token']); 128 130 129 $token_required = md5( password_hash($pfIntegrationId . "/" . $gfEntryId, PASSWORD_DEFAULT, array('salt' => NONCE_SALT)));131 $token_required = md5(crypt($pfIntegrationId . "/" . $gfEntryId, '$6$rounds=5000$' . md5(NONCE_SALT) . '$')); 130 132 131 133 if($token !== $token_required) { -
profiler-donations-gravityforms/trunk/class-profilerupdate-gfaddon.php
r2618948 r2750662 24 24 25 25 self::$_instance->form = self::$_instance->get_current_form(); 26 self::$_instance->formid = self::$_instance->form["id"]; 26 if(is_array(self::$_instance->form)) { 27 self::$_instance->formid = self::$_instance->form["id"]; 28 } 27 29 28 30 return self::$_instance; -
profiler-donations-gravityforms/trunk/index.php
r2698068 r2750662 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. 2.06 Version: 2.3.0 7 7 8 8 Author: Media Realm … … 11 11 License: GPL2 12 12 13 'Profiler Donation Gravity Forms' is free software: you can redistribute it and/or modify13 'Profiler Donations - Gravity Forms Add-On' is free software: you can redistribute it and/or modify 14 14 it under the terms of the GNU General Public License as published by 15 15 the Free Software Foundation, either version 2 of the License, or 16 16 any later version. 17 17 18 'Profiler Donation Gravity Forms' is distributed in the hope that it will be useful,18 'Profiler Donations - Gravity Forms Add-On' is distributed in the hope that it will be useful, 19 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 22 22 23 23 You should have received a copy of the GNU General Public License 24 along with 'Profiler Donation Gravity Forms'. If not, see https://www.gnu.org/licenses/gpl-2.0.html.24 along with 'Profiler Donations - Gravity Forms Add-On'. If not, see https://www.gnu.org/licenses/gpl-2.0.html. 25 25 26 26 */ -
profiler-donations-gravityforms/trunk/readme.txt
r2698068 r2750662 3 3 Tags: gravity-forms, fundraising, crm, donation, profiler 4 4 Requires at least: 5.0 5 Tested up to: 5.9.25 Tested up to: 6.0.0 6 6 Stable tag: trunk 7 7 Requires PHP: 7.4.0 … … 22 22 23 23 == Changelog == 24 25 = 2.3.0 = 26 27 * BREAKING CHANGE: If you use the post-donate feed, you must update your token generation code to use crypt() instead of password_hash() 28 * PHP 8 Compatibility 29 * No longer sends data to Profiler if GF's Payment_Status field is 'Failed' 30 * Catch empty data returned from process_feed_custom 31 * Adjust permissions needed to edit feed 32 * Stripe: Fix customer meta fields, and add charge description override 24 33 25 34 = 2.2.0 = -
profiler-donations-gravityforms/trunk/sync_users.php
r2618948 r2750662 167 167 $api_data = $this->api_list_subscriptions(); 168 168 169 if(!is_array($api_data)) { 170 return; 171 } 172 169 173 if($api_data['httpstatus'] != 200) { 170 174 $this->log("HTTP Status from Profiler API: " . $api_data['httpstatus']);
Note: See TracChangeset
for help on using the changeset viewer.