Plugin Directory

Changeset 2750662


Ignore:
Timestamp:
07/01/2022 08:33:18 AM (3 years ago)
Author:
anthonyeden
Message:

Version 2.3.0

Location:
profiler-donations-gravityforms/trunk
Files:
12 edited

Legend:

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

    r2698068 r2750662  
    66    protected $_url = "";
    77    protected $_title = "Profiler / Gravity Forms - Integration Feed";
    8 
    9     protected $_capabilities_form_settings = 'gravityforms_edit_settings';
    108
    119    protected $apifield_apikey = "apikey";
     
    2523        add_action('gform_stripe_customer_after_create',    array($this, 'stripe_customer_id_save'), 10, 4);
    2624        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);
    2726    }
    2827
     
    356355        if(method_exists($this, 'process_feed_custom')) {
    357356            $postData = $this->process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway);
     357
     358            if($postData === false) {
     359                return false;
     360            }
     361
    358362        }
    359363
     
    827831    protected function creditcard_mask($number) {
    828832        // 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
    829839        return implode("-", str_split(substr($number, 0, 6) . str_repeat("X", strlen($number) - 10) . substr($number, -4), 4));
    830840    }
     
    925935        // Create a new customer
    926936        $customer_meta = array();
    927         $customer_meta['description'] = $email_address . ' ' . $name;
     937        $customer_meta['description'] = $email . ' ' . $name;
    928938        $customer_meta['name'] = $name;
    929         $customer_meta['email'] = $email_address;
     939        $customer_meta['email'] = $email;
    930940
    931941        $customer = gf_stripe()->create_customer($customer_meta, $feed, $entry, $form);
     
    943953        return $charge_meta;
    944954    }
     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    }
    945975}
    946976
  • profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php

    r2698068 r2750662  
    2525
    2626        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        }
    2830
    2931        return self::$_instance;
     
    579581        }
    580582
     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
    581588        if($useAsGateway == true) {
    582589            // Profiler processes this payment
  • profiler-donations-gravityforms/trunk/class-profilerevents-gfaddon.php

    r2698068 r2750662  
    2020       
    2121        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        }
    2325       
    2426        return self::$_instance;
  • profiler-donations-gravityforms/trunk/class-profilerinteraction-gfaddon.php

    r2698068 r2750662  
    2525
    2626        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        }
    2830
    2931        return self::$_instance;
  • profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php

    r2698068 r2750662  
    2121
    2222        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        }
    2426
    2527        return self::$_instance;
  • profiler-donations-gravityforms/trunk/class-profilerlistsbasic-gfaddon.php

    r2698068 r2750662  
    2020
    2121        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        }
    2325
    2426        return self::$_instance;
  • profiler-donations-gravityforms/trunk/class-profilermembership-gfaddon.php

    r2618948 r2750662  
    2323
    2424        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        }
    2628
    2729        return self::$_instance;
  • profiler-donations-gravityforms/trunk/class-profilerpostdonate-gfaddon.php

    r2698068 r2750662  
    2525
    2626        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        }
    2830
    2931        return self::$_instance;
     
    127129        $token = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_token']);
    128130
    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) . '$'));
    130132
    131133        if($token !== $token_required) {
  • profiler-donations-gravityforms/trunk/class-profilerupdate-gfaddon.php

    r2618948 r2750662  
    2424
    2525        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        }
    2729
    2830        return self::$_instance;
  • profiler-donations-gravityforms/trunk/index.php

    r2698068 r2750662  
    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.2.0
     6Version: 2.3.0
    77
    88Author: Media Realm
     
    1111License: GPL2
    1212
    13 'Profiler Donation Gravity Forms' is free software: you can redistribute it and/or modify
     13'Profiler Donations - Gravity Forms Add-On' is free software: you can redistribute it and/or modify
    1414it under the terms of the GNU General Public License as published by
    1515the Free Software Foundation, either version 2 of the License, or
    1616any later version.
    1717 
    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,
    1919but WITHOUT ANY WARRANTY; without even the implied warranty of
    2020MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     
    2222 
    2323You 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.
     24along with 'Profiler Donations - Gravity Forms Add-On'. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
    2525
    2626*/
  • profiler-donations-gravityforms/trunk/readme.txt

    r2698068 r2750662  
    33Tags: gravity-forms, fundraising, crm, donation, profiler
    44Requires at least: 5.0
    5 Tested up to: 5.9.2
     5Tested up to: 6.0.0
    66Stable tag: trunk
    77Requires PHP: 7.4.0
     
    2222
    2323== 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
    2433
    2534= 2.2.0 =
  • profiler-donations-gravityforms/trunk/sync_users.php

    r2618948 r2750662  
    167167        $api_data = $this->api_list_subscriptions();
    168168
     169        if(!is_array($api_data)) {
     170            return;
     171        }
     172
    169173        if($api_data['httpstatus'] != 200) {
    170174            $this->log("HTTP Status from Profiler API: " . $api_data['httpstatus']);
Note: See TracChangeset for help on using the changeset viewer.