Skip to content

Commit 3073eba

Browse files
committed
Merge branch 'release/2.3'
2 parents 022a1d7 + 46efb47 commit 3073eba

23 files changed

Lines changed: 247 additions & 210 deletions

change_log.txt

Lines changed: 116 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,119 @@
1-
---------------------------------------------------
2-
Version 2.2
3-
- Added $meta_key as the fifth parameter of the gform_stripe_field_value filter, containing the custom meta key currently being processed.
4-
- Updated string "Stripe Receipt" so it could be translated.
5-
- Updated Stripe API library to version 4.3.0.
6-
7-
---------------------------------------------------
8-
Version 2.1
9-
- Added the gform_stripe_subscription_cancel_at_period_end filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_subscription_cancel_at_period_end/
10-
- Added the gform_stripe_charge_authorization_only filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_charge_authorization_only/
11-
- Added the gform_stripe_customer_id filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_customer_id/
12-
- Added logging of error retrieving Stripe Event object.
13-
- Added the 'gform_stripe_customer_after_create' hook allowing custom actions to be performed between the customer being created and subscribed to the plan. See https://www.gravityhelp.com/documentation/article/gform_stripe_customer_after_create/
14-
- Updated included Stripe API library to latest version.
15-
- Updated subscription process to define subscription when customer is created if 'gform_stripe_customer_after_create' filter is not defined.
16-
- Updated to only repopulate the card field within the last four digits on successful form submission.
17-
- Fixed a JavaScript error which occurred when the frontend scripts were included when the form had an active feed but no credit card field.
18-
- Fixed an issue where entry ID was not correctly populated in charge metadata.
19-
- Fixed an issue where entry ID was not correctly populated in customer metadata (for subscription feeds).
20-
- Fixed an issue which caused the credit card field required indicator to be missing when the form is displayed after a validation failure.
21-
- Fixed an issue with the card type validation.
22-
- Fixed an issue with the trial property from the $submission_data not being used.
23-
- Fixed an issue with the trial property from the $submission_data not being used when generating the plan id.
24-
- Fixed issue when sending empty meta data.
25-
- Fixed issue which could occur when saving an incomplete submission.
26-
27-
---------------------------------------------------
28-
Version 2.0
29-
- Added support for sending notifications on payment/subscription events. Configured on the edit notification page using the 'Event' setting.
30-
- Added the gform_stripe_api_mode filter e.g.
1+
# 2.3 | 2017-04-28
2+
- Added the gform_stripe_charge_pre_create filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_charge_pre_create/
3+
- Added translations.
4+
- Fixed spinner appearing when the previous button on the last page of a multi-page non-AJAX form is clicked.
5+
- Fixed Stripe.js request being made when the previous button on the last page of a multi-page form is clicked.
6+
- Fixed a fatal error which could occur if an older version of the Stripe API library is loaded by another plugin.
7+
8+
9+
# 2.2 | 2017-01-05
10+
- Added $meta_key as the fifth parameter of the gform_stripe_field_value filter, containing the custom meta key currently being processed.
11+
- Updated string "Stripe Receipt" so it could be translated.
12+
- Updated Stripe API library to version 4.3.0.
13+
14+
15+
# 2.1 | 2016-09-23
16+
- Added the gform_stripe_subscription_cancel_at_period_end filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_subscription_cancel_at_period_end/
17+
- Added the gform_stripe_charge_authorization_only filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_charge_authorization_only/
18+
- Added the gform_stripe_customer_id filter. See https://www.gravityhelp.com/documentation/article/gform_stripe_customer_id/
19+
- Added logging of error retrieving Stripe Event object.
20+
- Added the 'gform_stripe_customer_after_create' hook allowing custom actions to be performed between the customer being created and subscribed to the plan. See https://www.gravityhelp.com/documentation/article/gform_stripe_customer_after_create/
21+
- Updated included Stripe API library to latest version.
22+
- Updated subscription process to define subscription when customer is created if 'gform_stripe_customer_after_create' filter is not defined.
23+
- Updated to only repopulate the card field within the last four digits on successful form submission.
24+
- Fixed a JavaScript error which occurred when the frontend scripts were included when the form had an active feed but no credit card field.
25+
- Fixed an issue where entry ID was not correctly populated in charge metadata.
26+
- Fixed an issue where entry ID was not correctly populated in customer metadata (for subscription feeds).
27+
- Fixed an issue which caused the credit card field required indicator to be missing when the form is displayed after a validation failure.
28+
- Fixed an issue with the card type validation.
29+
- Fixed an issue with the trial property from the $submission_data not being used.
30+
- Fixed an issue with the trial property from the $submission_data not being used when generating the plan id.
31+
- Fixed issue when sending empty meta data.
32+
- Fixed issue which could occur when saving an incomplete submission.
33+
34+
35+
# 2.0 | 2016-01-07
36+
- Added support for sending notifications on payment/subscription events. Configured on the edit notification page using the 'Event' setting.
37+
- Added the gform_stripe_api_mode filter e.g.
3138
add_filter( 'gform_stripe_api_mode', function ( $api_mode ) {
3239
return 'live';
3340
} );
34-
- Added support for mapping a Coupon field when configuring a subscription feed.
35-
- Updated minimum Gravity Forms version to 1.9.14.17.
36-
- Updated billing cycle to include days.
37-
- Fixed an issue with zero decimal currencies.
38-
- Fixed an issue with the validation messages.
39-
- Fixed an issue with validation not returning an error if the stripe js response is empty or doesn’t contain an id.
40-
- Fixed an issue in authorize_product() and subscribe() where the entry currency was not being used.
41-
42-
---------------------------------------------------
43-
Version 1.9
44-
- Updated feed list and edit pages to display configure settings message if the api keys for the selected mode are invalid.
45-
- Fixed an issue with credit card field validation when the field is marked as required.
46-
47-
---------------------------------------------------
48-
Version 1.8
49-
- Updated Stripe Receipt drop down to only list email or hidden type fields.
50-
- Updated to use object notation when accessing $field.
51-
- Updated minimum Gravity Forms version to 1.9.10.19.
52-
- Fixed an issue which allowed feeds to be created with only partially configured metadata.
53-
- Fixed PHP notice related to the Metadata setting on the feed edit page.
54-
- Fixed php notice when saving a feed without any custom metadata.
55-
56-
---------------------------------------------------
57-
Version 1.7
58-
- Added the ability to pass custom metadata to Stripe.
59-
- Added logging of API key validation failure (key is obfuscated).
60-
- Added $feed as the fifth parameter of the gform_stripe_charge_description filter.
61-
- Updated instructions on the settings tab for configuring Stripe webhooks.
62-
- Updated form submission to ensure form is only submitted once.
63-
64-
---------------------------------------------------
65-
Version 1.6
66-
- Fixed a low severity security vulnerability in the admin area which could be exploited by authenticated users with form administration permissions.
67-
- Fixed issue where jQuery JSON library wasn't getting included.
68-
- Fixed issue that caused credit card field to get validated even when payment amount was zero.
69-
70-
---------------------------------------------------
71-
Version 1.5
72-
- Added capability support and Member plugin integration.
73-
- Updated POT file.
74-
- Added Spanish (es_ES) translation.
75-
- Fixed a text domain typo in class-gf-stripe.php
76-
- Fixed issue that prevents the form from being submitted if jQuery is put into no-conflict mode by subsequent plugins.
77-
- Created POT file
78-
- Updated translation strings to using gravityformsstripe instead of gravityforms
79-
80-
---------------------------------------------------
81-
Version 1.4
82-
- Added text domain/path to header.
83-
- Added function gf_stripe to easily get a Stripe instance.
84-
- Updated to have the file class-gf-stripe.php and organized code into this file and stripe.php.
85-
- Updated protected functions to be public.
86-
- Updated key validation so that is is more forgiving with conflicts by trimming response before using it.
87-
88-
---------------------------------------------------
89-
Version 1.3
90-
- Fixed conflict with the PayPal Add-On
91-
- Fixed issue with email receipt feature displaying a warning when 'Do not send receipt' option was selected
92-
- Fixed Notice message
93-
94-
---------------------------------------------------
95-
Version 1.2
96-
- Fixed issue when validating the live publishable key
97-
98-
---------------------------------------------------
99-
Version 1.1
100-
- Added receipt email feature so that Stripe receipts can be sent.
101-
- Updated key validation so that keys are trimmed before being validated and saved.
102-
- Updated API include statement so that it checks if API has already been included.
103-
- Fixed scripts from being output on every page of admin.
104-
- Fixed issue where credit card field generated validation error when navigating form.
105-
- Fixed issue with javascript error caused by the admin.js not being enqueued.
106-
- Fixed issue causing notification and confirmation to be sent blank.
107-
- Fixed issue with credit card validation.
108-
- Fixed issue where credit card was failing validation even when feed condition was not met.
109-
110-
---------------------------------------------------
111-
Version 1.0
112-
- Initial release
41+
- Added support for mapping a Coupon field when configuring a subscription feed.
42+
- Updated minimum Gravity Forms version to 1.9.14.17.
43+
- Updated billing cycle to include days.
44+
- Fixed an issue with zero decimal currencies.
45+
- Fixed an issue with the validation messages.
46+
- Fixed an issue with validation not returning an error if the stripe js response is empty or doesn’t contain an id.
47+
- Fixed an issue in authorize_product() and subscribe() where the entry currency was not being used.
48+
49+
50+
# 1.9 | 2015-10-09
51+
- Updated feed list and edit pages to display configure settings message if the api keys for the selected mode are invalid.
52+
- Fixed an issue with credit card field validation when the field is marked as required.
53+
54+
55+
# 1.8 | 2015-08-06
56+
- Updated Stripe Receipt drop down to only list email or hidden type fields.
57+
- Updated to use object notation when accessing $field.
58+
- Updated minimum Gravity Forms version to 1.9.10.19.
59+
- Fixed an issue which allowed feeds to be created with only partially configured metadata.
60+
- Fixed PHP notice related to the Metadata setting on the feed edit page.
61+
- Fixed php notice when saving a feed without any custom metadata.
62+
63+
64+
# 1.7 | 2015-06-23
65+
- Added the ability to pass custom metadata to Stripe.
66+
- Added logging of API key validation failure (key is obfuscated).
67+
- Added $feed as the fifth parameter of the gform_stripe_charge_description filter.
68+
- Updated instructions on the settings tab for configuring Stripe webhooks.
69+
- Updated form submission to ensure form is only submitted once.
70+
71+
72+
# 1.6 | 2015-04-20
73+
- Fixed a low severity security vulnerability in the admin area which could be exploited by authenticated users with form administration permissions.
74+
- Fixed issue where jQuery JSON library wasn't getting included.
75+
- Fixed issue that caused credit card field to get validated even when payment amount was zero.
76+
77+
78+
# 1.5 | 2014-11-19
79+
- Added capability support and Member plugin integration.
80+
- Updated POT file.
81+
- Added Spanish (es_ES) translation.
82+
- Fixed a text domain typo in class-gf-stripe.php
83+
- Fixed issue that prevents the form from being submitted if jQuery is put into no-conflict mode by subsequent plugins.
84+
- Created POT file
85+
- Updated translation strings to using gravityformsstripe instead of gravityforms
86+
87+
88+
# 1.4 | 2014-10-16
89+
- Added text domain/path to header.
90+
- Added function gf_stripe to easily get a Stripe instance.
91+
- Updated to have the file class-gf-stripe.php and organized code into this file and stripe.php.
92+
- Updated protected functions to be public.
93+
- Updated key validation so that is is more forgiving with conflicts by trimming response before using it.
94+
95+
96+
# 1.3 | 2014-09-24
97+
- Fixed conflict with the PayPal Add-On
98+
- Fixed issue with email receipt feature displaying a warning when 'Do not send receipt' option was selected
99+
- Fixed Notice message
100+
101+
102+
# 1.2 | 2014-08-06
103+
- Fixed issue when validating the live publishable key
104+
105+
106+
# 1.1 | 2014-07-29
107+
- Added receipt email feature so that Stripe receipts can be sent.
108+
- Updated key validation so that keys are trimmed before being validated and saved.
109+
- Updated API include statement so that it checks if API has already been included.
110+
- Fixed scripts from being output on every page of admin.
111+
- Fixed issue where credit card field generated validation error when navigating form.
112+
- Fixed issue with javascript error caused by the admin.js not being enqueued.
113+
- Fixed issue causing notification and confirmation to be sent blank.
114+
- Fixed issue with credit card validation.
115+
- Fixed issue where credit card was failing validation even when feed condition was not met.
116+
117+
118+
# 1.0 | 2014-05-28
119+
- Initial release

class-gf-stripe.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,19 @@ public function authorize_product( $feed, $submission_data, $form, $entry ) {
13601360
$charge_meta['metadata'] = $metadata;
13611361
}
13621362

1363+
/**
1364+
* Allow the charge properties to be overridden before the charge is created by the Stripe API.
1365+
*
1366+
* @since 2.2.2
1367+
*
1368+
* @param array $charge_meta The properties for the charge to be created.
1369+
* @param array $feed The feed object currently being processed.
1370+
* @param array $submission_data The customer and transaction data.
1371+
* @param array $form The form object currently being processed.
1372+
* @param array $entry The entry object currently being processed.
1373+
*/
1374+
$charge_meta = apply_filters( 'gform_stripe_charge_pre_create', $charge_meta, $feed, $submission_data, $form, $entry );
1375+
13631376
// Log the charge we're about to process.
13641377
$this->log_debug( __METHOD__ . '(): Charge meta to be created => ' . print_r( $charge_meta, 1 ) );
13651378

@@ -2091,8 +2104,10 @@ public function include_stripe_api() {
20912104
// Set Stripe API key.
20922105
\Stripe\Stripe::setApiKey( $this->get_secret_api_key() );
20932106

2094-
// Send plugin title, version and site url along with API calls.
2095-
\Stripe\Stripe::setAppInfo( $this->_title, $this->_version, esc_url( site_url() ) );
2107+
if ( method_exists( '\Stripe\Stripe', 'setAppInfo' ) ) {
2108+
// Send plugin title, version and site url along with API calls.
2109+
\Stripe\Stripe::setAppInfo( $this->_title, $this->_version, esc_url( site_url() ) );
2110+
}
20962111

20972112
/**
20982113
* Run post Stripe API initialization action.

js/admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)