Plugin Directory

Changeset 3362220


Ignore:
Timestamp:
09/16/2025 05:47:53 AM (3 months ago)
Author:
anthonyeden
Message:

Version 2.6.0

Location:
profiler-donations-gravityforms
Files:
7 edited
9 copied

Legend:

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

    r3335722 r3362220  
    2929        add_filter('gform_stripe_charge_description',       array($this, 'stripe_payment_description'), 10, 5);
    3030        add_filter('gform_stripe_payment_element_initial_payment_information', array($this, 'stripe_elements_setup'), 10, 3);
     31
     32        // Stripe - allow immediate refund upon payment success.
     33        // Designed for Card Update workflows - preauth would be better, but the GF Stripe add-on has issues with this
     34        add_filter('gform_form_settings_fields',                        array($this, 'stripe_refund_form_setting'), 10, 2);
     35        add_action('gform_after_submission',                            array($this, 'stripe_refund_after_submission'), 10, 2);
    3136
    3237        // Workaround for change/bug introduced in v2.9.1
     
    292297
    293298        foreach($fields as $field) {
    294             if(isset($field['pf_apifield']) && $this->get_field_value($form, $entry, $feed['meta'][$field['name']]) != '') {
    295                 $postData[$field['pf_apifield']] = trim($this->get_field_value($form, $entry, $feed['meta'][$field['name']]));
     299            $field_value = $this->get_field_value($form, $entry, $feed['meta'][$field['name']]);
     300            if(isset($field['pf_apifield']) && !empty($field['pf_apifield']) && !empty($field_value)) {
     301
     302                $postData[$field['pf_apifield']] = trim($field_value);
     303
     304                $field_object = GFFormsModel::get_field($form, $feed['meta'][$field['name']]);
     305
     306                if(is_object($field_object)) {
     307                    if($field_object->type == 'product' && ($field_object->get_input_type() == 'radio' || $field_object->get_input_type() == 'select')) {
     308                        // By default these fields return 'Value ($ 1.00)', but we only want 'Value'
     309                        if(strpos($field_value, "(") !== false) {
     310                            $postData[$field['pf_apifield']] = trim(substr($field_value, 0, strrpos($field_value, "(") - 1));
     311                        }
     312                    }
     313                }
    296314
    297315                // Auto formatting for phone fields
     
    11271145    }
    11281146
     1147    public function stripe_refund_form_setting($fields, $form) {
     1148        // Form setting to enable immediate Stripe refunds
     1149
     1150        // Only show this setting if the form has a Stripe feed
     1151        $feeds = GFAPI::get_feeds(null, $form['id']);
     1152        $has_stripe_feed = false;
     1153
     1154        foreach($feeds as $feed) {
     1155            if($feed['addon_slug'] === 'gravityformsstripe') {
     1156                $has_stripe_feed = true;
     1157                break;
     1158            }
     1159        }
     1160
     1161        if ($has_stripe_feed === false) {
     1162            return $fields;
     1163        }
     1164
     1165        $fields['stripe_immediate_refund'] = array(
     1166            'title'      => 'Stripe Immediate Refund',
     1167            'tooltip'    => 'By default, Stripe captures the payment when the form is submitted. If you wish to issue an immediate refund during the form submission process, emails this option. This option is used for Card Update workflows, such as updating regular pledge payment details.',
     1168            'fields'     => array(),
     1169        );
     1170
     1171        $fields['stripe_immediate_refund']['fields'][] = array(
     1172            'name'       => 'stripe_immediate_refund_mode',
     1173            'label'      => 'Stripe Immediate Refund Mode',
     1174            'type'       => 'checkbox',
     1175            'choices' => array(
     1176                array(
     1177                    'label'         => 'Enable Immediate Refund',
     1178                    'name'          => 'stripe_immediate_refund',
     1179                    'default_value' => 0,
     1180                ),
     1181            ),
     1182        );
     1183
     1184        return $fields;
     1185    }
     1186
     1187    public function stripe_refund_after_submission($entry, $form) {
     1188        // Processes the refund from Stripe
     1189
     1190        if(!isset($form['stripe_immediate_refund']) || $form['stripe_immediate_refund'] != 1) {
     1191            return $entry;
     1192        }
     1193
     1194        if(!isset($entry['transaction_id']) || substr($entry['transaction_id'], 0, 3) !== "pi_") {
     1195            return $entry;
     1196        }
     1197
     1198        if(gform_get_meta($entry['id'], 'stripe_immediate_refund_id') != false) {
     1199            // If refund has already been processed, don't try and refund again
     1200            return $entry;
     1201        }
     1202
     1203        try {
     1204            if(!class_exists('\Stripe\Stripe')) {
     1205                require_once(plugin_dir_path(__DIR__) . 'gravityformsstripe/includes/autoload.php');
     1206            }
     1207
     1208            // Set Stripe API key.
     1209            $stripe_options = get_option('gravityformsaddon_gravityformsstripe_settings');
     1210            \Stripe\Stripe::setApiKey($stripe_options[$stripe_options['api_mode'] . '_secret_key']);
     1211
     1212        } catch(Exception $e) {
     1213            error_log("STRIPE/PROFILER IMMEDIATE REFUND SETUP ERROR: " . print_r($e, true));
     1214            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Failed. Error Technical Information (Setup): ' . $e->getMessage(), $this->_slug, 'error');
     1215            return $entry;
     1216        }
     1217
     1218        try {
     1219            $refund = \Stripe\Refund::create([
     1220                'payment_intent' => $entry['transaction_id'],
     1221                'metadata' => array(
     1222                    'refund_source' => 'profiler_gravityforms_stripe_immediate_refund',
     1223                ),
     1224            ]);
     1225
     1226            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Successful. Refund ID: ' . $refund->id, $this->_slug, 'success');
     1227            gform_add_meta($entry['id'], 'stripe_immediate_refund_id', $refund->id, $form['id']);
     1228
     1229        } catch(Exception $e) {
     1230            error_log("STRIPE/PROFILER IMMEDIATE REFUND ERROR: " . print_r($e, true));
     1231            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Failed. Error Technical Information: ' . $e->getMessage(), $this->_slug, 'error');
     1232        }
     1233
     1234        return $entry;
     1235    }
     1236
     1237
    11291238    public function meta_box_entry($meta_boxes, $entry, $form) {
    11301239        // Custom Metabox
  • profiler-donations-gravityforms/tags/2.6.0/class-profilerdonate-gfaddon.php

    r3335722 r3362220  
    131131            "required" => false,
    132132            "choices" => $field_settings,
    133             "tooltip" => "The value of this field must be set to 'weekly', 'monthly' or 'yearly'. This field will be used if 'Donation Type' is set to 'regular'."
     133            "tooltip" => "The value of this field must be set to 'weekly', 'fortnightly', 'monthly', '3m', '6m', or 'yearly'. This field will be used if 'Donation Type' is set to 'regular'."
    134134        );
    135135       
     
    413413            "name" => "profilerdonation_sourcecode",
    414414            "required" => false,
    415             "tooltip" => "Can be overriden by GET parameter or Short Code. Sent to the UDF specificed above.",
     415            "tooltip" => "Can be overriden by GET parameter or Short Code.",
    416416        );
    417417
     
    436436            "name" => "profilerdonation_pledgesourcecode",
    437437            "required" => false,
    438             "tooltip" => "Can be overriden by GET parameter or Short Code. Sent to the UDF specificed above.",
     438            "tooltip" => "Can be overriden by GET parameter or Short Code.",
    439439        );
    440440
     
    645645
    646646        if(empty($postData['regularType'])) {
    647             // Default value if above field is empty
    648             $postData['regularType'] = $feed['meta']['profilerdonation_pledgetypeid_default'];
     647            if(isset($feed['meta']['profilerdonation_pledgetypeid_default'])) {
     648                // Default value if above field is empty
     649                $postData['regularType'] = $feed['meta']['profilerdonation_pledgetypeid_default'];
     650            } else {
     651                unset($postData['regularType']);
     652            }
    649653        }
    650654
  • profiler-donations-gravityforms/tags/2.6.0/class-profilerlists-gfaddon.php

    r3335722 r3362220  
    200200                gform_add_meta($entry["id"], "profiler_integration_guid", $pfResponse['dataArray']['integrationGuid'], $form['id']);
    201201            }
     202        } else if($pfResponse['data'] == 'Subscribe request complete') {
     203            // For some reason this endpoint returns plain text
     204            // Do nothing - just don't send a failure email (below)
     205
    202206        } else {
    203207            // Profiler failed. Send the failure email.
  • profiler-donations-gravityforms/tags/2.6.0/class-profilerupdate-gfaddon.php

    r2750662 r3362220  
    1010    protected static $_instance = null;
    1111
    12     protected $apifield_endpoint = "/ProfilerAPI/Legacy/";
    13     protected $apifield_apikey = "apikey";
    14     protected $apifield_apipass = "apipass";
    15     protected $apifield_ipaddress = 'udf';
    16     protected $apifield_formurl = true;
     12    protected $api_type = "json";
     13    protected $api_domain = "profilersoftware.com";
     14    protected $apifield_endpoint = "/ProfilerAPI/RapidEndpoint/";
     15    protected $apifield_apikey = "apiuser";
     16    protected $apifield_apipass = "apipassword";
     17    protected $apifield_ipaddress = 'requestIPAddress';
     18    protected $apifield_formurl = 'pageURL';
    1719    protected $gffield_legacyname = "update";
    1820    protected $supports_custom_fields = true;
     21    protected $supports_mailinglists = true;
    1922
    2023    public static function get_instance() {
     
    149152            "required" => false,
    150153            "choices" => $field_settings,
    151             "pf_apifield" => "phoneah",
     154            "pf_apifield" => "phoneAH",
     155            "auto_format" => "phone",
    152156        );
    153157       
     
    158162            "required" => false,
    159163            "choices" => $field_settings,
    160             "pf_apifield" => "phonebus",
     164            "pf_apifield" => "phoneBus",
     165            "auto_format" => "phone",
    161166        );
    162167       
     
    167172            "required" => false,
    168173            "choices" => $field_settings,
    169             "pf_apifield" => "phonemobile",
     174            "pf_apifield" => "phoneMobile",
     175            "auto_format" => "phone",
    170176        );
    171177       
     
    189195
    190196        $fields[] = array(
    191             "label" => 'UDF: Receipt Name',
    192             "type" => "select",
    193             "name" => "profilerdonation_userdefined_receiptname",
    194             "required" => false,
    195             "tooltip" => "Pick the Profiler User Defined Field you wish the donation receipt name to be sent to",
    196             "choices" => $userdefinedfields,
    197         );
    198 
    199         $fields[] = array(
    200197            "label" => 'Receipt Name Field',
    201198            "type" => "select",
     
    203200            "required" => false,
    204201            "choices" => $field_settings,
    205         );
    206 
    207         $fields[] = array(
    208             "label" => 'UDF: Client IP Address',
    209             "type" => "select",
    210             "name" => "profilerdonation_userdefined_clientip",
    211             "required" => false,
    212             "tooltip" => "Pick the Profiler User Defined Field you wish the client's IP address to be sent to",
    213             "choices" => $userdefinedfields,
    214         );
    215 
    216 
     202            "pf_apifield" => "receiptName",
     203        );
     204
     205        $fields[] = array(
     206            "label" => 'Amount Field',
     207            "type" => "select",
     208            "name" => "profilerdonation_amount",
     209            "required" => false,
     210            "choices" => $product_field_settings
     211        );
     212
     213        $fields[] = array(
     214            "label" => 'Payment Gateway ID Used (Field)',
     215            "type" => "select",
     216            "name" => "profilerdonation_paymentgatewayidused",
     217            "required" => false,
     218            "tooltip" => "Pick the Profiler Gateway ID used for this transaction (if you are conditionally using multiple gateways in Gravity Forms)",
     219            "choices" => $field_settings
     220        );
     221
     222        $fields[] = array(
     223            "label" => 'Payment Gateway ID Used (Default)',
     224            "type" => "text",
     225            "name" => "profilerdonation_paymentgatewayidused_default",
     226            "required" => false,
     227            "tooltip" => "Specify a default Payment Gateway ID to send through to Profiler",
     228            "choices" => $field_settings
     229        );
    217230
    218231        return $fields;
     
    224237
    225238        $postData = parent::process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway, true);
    226         $postData['datatype'] = "UPD";
     239
     240        if(is_array($postData)) {
     241            $postData['dataType'] = "UPD";
     242
     243            if(isset($postData['gatewayCardToken']) || isset($postData['paymentGatewayCustomerId'])) {
     244                $postData['updateRegularPaymentsWithToken'] = true;
     245            }
     246        }
    227247
    228248        return $postData;
  • profiler-donations-gravityforms/tags/2.6.0/index.php

    r3335722 r3362220  
    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.4
     6Version: 2.6.0
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/tags/2.6.0/readme.txt

    r3336354 r3362220  
    2222
    2323== Changelog ==
     24
     25= 2.6.0 =
     26
     27Please backup your site before upgrading, and test all your integrations thoroughly after upgrading this plugin. If you experience trouble, please roll back to a previous version of your site.
     28
     29* New Feature: Add option to immediately issue a refund after payment with Stripe (useful for Pledge Updates)
     30* Donate: Regular Frequency - Update list of supported frequencies in the help text
     31* Update Client Details: Upgrade to new version of API
     32* Field Mappings: Translate Product Select/Radio values from 'Value ($ 1.00)' to 'Value' before sending to Profiler
     33* Mailing Lists (Advanced): Prevent error email when Profiler responds with plain text
    2434
    2535= 2.5.4 =
  • profiler-donations-gravityforms/trunk/class-profilercommon.php

    r3335722 r3362220  
    2929        add_filter('gform_stripe_charge_description',       array($this, 'stripe_payment_description'), 10, 5);
    3030        add_filter('gform_stripe_payment_element_initial_payment_information', array($this, 'stripe_elements_setup'), 10, 3);
     31
     32        // Stripe - allow immediate refund upon payment success.
     33        // Designed for Card Update workflows - preauth would be better, but the GF Stripe add-on has issues with this
     34        add_filter('gform_form_settings_fields',                        array($this, 'stripe_refund_form_setting'), 10, 2);
     35        add_action('gform_after_submission',                            array($this, 'stripe_refund_after_submission'), 10, 2);
    3136
    3237        // Workaround for change/bug introduced in v2.9.1
     
    292297
    293298        foreach($fields as $field) {
    294             if(isset($field['pf_apifield']) && $this->get_field_value($form, $entry, $feed['meta'][$field['name']]) != '') {
    295                 $postData[$field['pf_apifield']] = trim($this->get_field_value($form, $entry, $feed['meta'][$field['name']]));
     299            $field_value = $this->get_field_value($form, $entry, $feed['meta'][$field['name']]);
     300            if(isset($field['pf_apifield']) && !empty($field['pf_apifield']) && !empty($field_value)) {
     301
     302                $postData[$field['pf_apifield']] = trim($field_value);
     303
     304                $field_object = GFFormsModel::get_field($form, $feed['meta'][$field['name']]);
     305
     306                if(is_object($field_object)) {
     307                    if($field_object->type == 'product' && ($field_object->get_input_type() == 'radio' || $field_object->get_input_type() == 'select')) {
     308                        // By default these fields return 'Value ($ 1.00)', but we only want 'Value'
     309                        if(strpos($field_value, "(") !== false) {
     310                            $postData[$field['pf_apifield']] = trim(substr($field_value, 0, strrpos($field_value, "(") - 1));
     311                        }
     312                    }
     313                }
    296314
    297315                // Auto formatting for phone fields
     
    11271145    }
    11281146
     1147    public function stripe_refund_form_setting($fields, $form) {
     1148        // Form setting to enable immediate Stripe refunds
     1149
     1150        // Only show this setting if the form has a Stripe feed
     1151        $feeds = GFAPI::get_feeds(null, $form['id']);
     1152        $has_stripe_feed = false;
     1153
     1154        foreach($feeds as $feed) {
     1155            if($feed['addon_slug'] === 'gravityformsstripe') {
     1156                $has_stripe_feed = true;
     1157                break;
     1158            }
     1159        }
     1160
     1161        if ($has_stripe_feed === false) {
     1162            return $fields;
     1163        }
     1164
     1165        $fields['stripe_immediate_refund'] = array(
     1166            'title'      => 'Stripe Immediate Refund',
     1167            'tooltip'    => 'By default, Stripe captures the payment when the form is submitted. If you wish to issue an immediate refund during the form submission process, emails this option. This option is used for Card Update workflows, such as updating regular pledge payment details.',
     1168            'fields'     => array(),
     1169        );
     1170
     1171        $fields['stripe_immediate_refund']['fields'][] = array(
     1172            'name'       => 'stripe_immediate_refund_mode',
     1173            'label'      => 'Stripe Immediate Refund Mode',
     1174            'type'       => 'checkbox',
     1175            'choices' => array(
     1176                array(
     1177                    'label'         => 'Enable Immediate Refund',
     1178                    'name'          => 'stripe_immediate_refund',
     1179                    'default_value' => 0,
     1180                ),
     1181            ),
     1182        );
     1183
     1184        return $fields;
     1185    }
     1186
     1187    public function stripe_refund_after_submission($entry, $form) {
     1188        // Processes the refund from Stripe
     1189
     1190        if(!isset($form['stripe_immediate_refund']) || $form['stripe_immediate_refund'] != 1) {
     1191            return $entry;
     1192        }
     1193
     1194        if(!isset($entry['transaction_id']) || substr($entry['transaction_id'], 0, 3) !== "pi_") {
     1195            return $entry;
     1196        }
     1197
     1198        if(gform_get_meta($entry['id'], 'stripe_immediate_refund_id') != false) {
     1199            // If refund has already been processed, don't try and refund again
     1200            return $entry;
     1201        }
     1202
     1203        try {
     1204            if(!class_exists('\Stripe\Stripe')) {
     1205                require_once(plugin_dir_path(__DIR__) . 'gravityformsstripe/includes/autoload.php');
     1206            }
     1207
     1208            // Set Stripe API key.
     1209            $stripe_options = get_option('gravityformsaddon_gravityformsstripe_settings');
     1210            \Stripe\Stripe::setApiKey($stripe_options[$stripe_options['api_mode'] . '_secret_key']);
     1211
     1212        } catch(Exception $e) {
     1213            error_log("STRIPE/PROFILER IMMEDIATE REFUND SETUP ERROR: " . print_r($e, true));
     1214            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Failed. Error Technical Information (Setup): ' . $e->getMessage(), $this->_slug, 'error');
     1215            return $entry;
     1216        }
     1217
     1218        try {
     1219            $refund = \Stripe\Refund::create([
     1220                'payment_intent' => $entry['transaction_id'],
     1221                'metadata' => array(
     1222                    'refund_source' => 'profiler_gravityforms_stripe_immediate_refund',
     1223                ),
     1224            ]);
     1225
     1226            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Successful. Refund ID: ' . $refund->id, $this->_slug, 'success');
     1227            gform_add_meta($entry['id'], 'stripe_immediate_refund_id', $refund->id, $form['id']);
     1228
     1229        } catch(Exception $e) {
     1230            error_log("STRIPE/PROFILER IMMEDIATE REFUND ERROR: " . print_r($e, true));
     1231            GFAPI::add_note($entry['id'], 0, '', 'Stripe Immediate Refund - Failed. Error Technical Information: ' . $e->getMessage(), $this->_slug, 'error');
     1232        }
     1233
     1234        return $entry;
     1235    }
     1236
     1237
    11291238    public function meta_box_entry($meta_boxes, $entry, $form) {
    11301239        // Custom Metabox
  • profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php

    r3335722 r3362220  
    131131            "required" => false,
    132132            "choices" => $field_settings,
    133             "tooltip" => "The value of this field must be set to 'weekly', 'monthly' or 'yearly'. This field will be used if 'Donation Type' is set to 'regular'."
     133            "tooltip" => "The value of this field must be set to 'weekly', 'fortnightly', 'monthly', '3m', '6m', or 'yearly'. This field will be used if 'Donation Type' is set to 'regular'."
    134134        );
    135135       
     
    413413            "name" => "profilerdonation_sourcecode",
    414414            "required" => false,
    415             "tooltip" => "Can be overriden by GET parameter or Short Code. Sent to the UDF specificed above.",
     415            "tooltip" => "Can be overriden by GET parameter or Short Code.",
    416416        );
    417417
     
    436436            "name" => "profilerdonation_pledgesourcecode",
    437437            "required" => false,
    438             "tooltip" => "Can be overriden by GET parameter or Short Code. Sent to the UDF specificed above.",
     438            "tooltip" => "Can be overriden by GET parameter or Short Code.",
    439439        );
    440440
     
    645645
    646646        if(empty($postData['regularType'])) {
    647             // Default value if above field is empty
    648             $postData['regularType'] = $feed['meta']['profilerdonation_pledgetypeid_default'];
     647            if(isset($feed['meta']['profilerdonation_pledgetypeid_default'])) {
     648                // Default value if above field is empty
     649                $postData['regularType'] = $feed['meta']['profilerdonation_pledgetypeid_default'];
     650            } else {
     651                unset($postData['regularType']);
     652            }
    649653        }
    650654
  • profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php

    r3335722 r3362220  
    200200                gform_add_meta($entry["id"], "profiler_integration_guid", $pfResponse['dataArray']['integrationGuid'], $form['id']);
    201201            }
     202        } else if($pfResponse['data'] == 'Subscribe request complete') {
     203            // For some reason this endpoint returns plain text
     204            // Do nothing - just don't send a failure email (below)
     205
    202206        } else {
    203207            // Profiler failed. Send the failure email.
  • profiler-donations-gravityforms/trunk/class-profilerupdate-gfaddon.php

    r2750662 r3362220  
    1010    protected static $_instance = null;
    1111
    12     protected $apifield_endpoint = "/ProfilerAPI/Legacy/";
    13     protected $apifield_apikey = "apikey";
    14     protected $apifield_apipass = "apipass";
    15     protected $apifield_ipaddress = 'udf';
    16     protected $apifield_formurl = true;
     12    protected $api_type = "json";
     13    protected $api_domain = "profilersoftware.com";
     14    protected $apifield_endpoint = "/ProfilerAPI/RapidEndpoint/";
     15    protected $apifield_apikey = "apiuser";
     16    protected $apifield_apipass = "apipassword";
     17    protected $apifield_ipaddress = 'requestIPAddress';
     18    protected $apifield_formurl = 'pageURL';
    1719    protected $gffield_legacyname = "update";
    1820    protected $supports_custom_fields = true;
     21    protected $supports_mailinglists = true;
    1922
    2023    public static function get_instance() {
     
    149152            "required" => false,
    150153            "choices" => $field_settings,
    151             "pf_apifield" => "phoneah",
     154            "pf_apifield" => "phoneAH",
     155            "auto_format" => "phone",
    152156        );
    153157       
     
    158162            "required" => false,
    159163            "choices" => $field_settings,
    160             "pf_apifield" => "phonebus",
     164            "pf_apifield" => "phoneBus",
     165            "auto_format" => "phone",
    161166        );
    162167       
     
    167172            "required" => false,
    168173            "choices" => $field_settings,
    169             "pf_apifield" => "phonemobile",
     174            "pf_apifield" => "phoneMobile",
     175            "auto_format" => "phone",
    170176        );
    171177       
     
    189195
    190196        $fields[] = array(
    191             "label" => 'UDF: Receipt Name',
    192             "type" => "select",
    193             "name" => "profilerdonation_userdefined_receiptname",
    194             "required" => false,
    195             "tooltip" => "Pick the Profiler User Defined Field you wish the donation receipt name to be sent to",
    196             "choices" => $userdefinedfields,
    197         );
    198 
    199         $fields[] = array(
    200197            "label" => 'Receipt Name Field',
    201198            "type" => "select",
     
    203200            "required" => false,
    204201            "choices" => $field_settings,
    205         );
    206 
    207         $fields[] = array(
    208             "label" => 'UDF: Client IP Address',
    209             "type" => "select",
    210             "name" => "profilerdonation_userdefined_clientip",
    211             "required" => false,
    212             "tooltip" => "Pick the Profiler User Defined Field you wish the client's IP address to be sent to",
    213             "choices" => $userdefinedfields,
    214         );
    215 
    216 
     202            "pf_apifield" => "receiptName",
     203        );
     204
     205        $fields[] = array(
     206            "label" => 'Amount Field',
     207            "type" => "select",
     208            "name" => "profilerdonation_amount",
     209            "required" => false,
     210            "choices" => $product_field_settings
     211        );
     212
     213        $fields[] = array(
     214            "label" => 'Payment Gateway ID Used (Field)',
     215            "type" => "select",
     216            "name" => "profilerdonation_paymentgatewayidused",
     217            "required" => false,
     218            "tooltip" => "Pick the Profiler Gateway ID used for this transaction (if you are conditionally using multiple gateways in Gravity Forms)",
     219            "choices" => $field_settings
     220        );
     221
     222        $fields[] = array(
     223            "label" => 'Payment Gateway ID Used (Default)',
     224            "type" => "text",
     225            "name" => "profilerdonation_paymentgatewayidused_default",
     226            "required" => false,
     227            "tooltip" => "Specify a default Payment Gateway ID to send through to Profiler",
     228            "choices" => $field_settings
     229        );
    217230
    218231        return $fields;
     
    224237
    225238        $postData = parent::process_feed_custom($feed, $entry, $form, $postData, $fromValidatorProcessPFGateway, true);
    226         $postData['datatype'] = "UPD";
     239
     240        if(is_array($postData)) {
     241            $postData['dataType'] = "UPD";
     242
     243            if(isset($postData['gatewayCardToken']) || isset($postData['paymentGatewayCustomerId'])) {
     244                $postData['updateRegularPaymentsWithToken'] = true;
     245            }
     246        }
    227247
    228248        return $postData;
  • profiler-donations-gravityforms/trunk/index.php

    r3335722 r3362220  
    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.4
     6Version: 2.6.0
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/trunk/readme.txt

    r3336354 r3362220  
    2222
    2323== Changelog ==
     24
     25= 2.6.0 =
     26
     27Please backup your site before upgrading, and test all your integrations thoroughly after upgrading this plugin. If you experience trouble, please roll back to a previous version of your site.
     28
     29* New Feature: Add option to immediately issue a refund after payment with Stripe (useful for Pledge Updates)
     30* Donate: Regular Frequency - Update list of supported frequencies in the help text
     31* Update Client Details: Upgrade to new version of API
     32* Field Mappings: Translate Product Select/Radio values from 'Value ($ 1.00)' to 'Value' before sending to Profiler
     33* Mailing Lists (Advanced): Prevent error email when Profiler responds with plain text
    2434
    2535= 2.5.4 =
Note: See TracChangeset for help on using the changeset viewer.