Skip to content

Commit 02abe99

Browse files
author
Gravity Forms
committed
Updates to 5.6.0
1 parent 2529882 commit 02abe99

31 files changed

+1059
-320
lines changed

change_log.txt

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
### 5.6.0 | 2024-04-29
2+
- Added a new [`gform_stripe_payment_element_updated_payment_information`](https://docs.gravityforms.com/gform_stripe_payment_element_updated_payment_information/) JavaScript filter to allow modifying the payment element payment information when the form total changes.
3+
- Updated logging to decrease the log file size and make it easier to track issues.
4+
- Fixed a fatal error that occurs when the customer is redirected back after a no-cost checkout order payment.
5+
- Fixed PHP 8.1+ deprecation notices displaying on the settings page.
6+
- Fixed a fatal error that occurs when the webhooks signing secret is invalid.
7+
- Fixed an issue where the loading spinner is not hidden after the form fails validation.
8+
- Fixed a fatal error that can occur when the Stripe field is hidden by conditional logic.
9+
- Fixed an issue where the Link option for the Stripe Payment Element can not be disabled once an email field is selected.
10+
111
### 5.5.0 | 2024-02-22
212
- Added a Stripe API wrapper and deprecated the use of the Stripe PHP SDK.
313
- Added new notification events for pending and authorized payment states.

class-gf-stripe.php

+124-64
Large diffs are not rendered by default.

includes/api/model/class-account.php

+25
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@
1010
*/
1111
class Account extends Base {
1212

13+
/**
14+
* Initialize properties that will be used throughout this class and link to the Stripe API.
15+
*
16+
* @since 5.5.2
17+
*/
18+
public $capabilities;
19+
public $company;
20+
public $controller;
21+
public $country;
22+
public $email;
23+
public $individual;
24+
public $metadata;
25+
public $requirements;
26+
public $settings;
27+
public $type;
28+
public $business_type;
29+
public $business_profile;
30+
public $charges_enabled;
31+
public $default_currency;
32+
public $details_submitted;
33+
public $external_accounts;
34+
public $future_requirements;
35+
public $payouts_enabled;
36+
public $tos_acceptance;
37+
1338
/**
1439
* Returns the API endpoint for this object.
1540
*

includes/api/model/class-base.php

+13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ class Base implements \ArrayAccess {
2727
*/
2828
private $original_values = array();
2929

30+
/**
31+
* Initialize properties that will be used throughout this class, all subclasses, and link to the Stripe API.
32+
*
33+
* @since 5.5.2
34+
*/
35+
public $id;
36+
public $object;
37+
public $created;
38+
3039
/**
3140
* Instantiates the object.
3241
*
@@ -178,6 +187,7 @@ protected function serialize_parameters( $supported_params ) {
178187
*
179188
* @return void
180189
*/
190+
#[\ReturnTypeWillChange]
181191
public function offsetSet( $offset, $value ) {
182192
$this->{$offset} = $value;
183193
}
@@ -191,6 +201,7 @@ public function offsetSet( $offset, $value ) {
191201
*
192202
* @return bool Returns true if the offset exists, false otherwise.
193203
*/
204+
#[\ReturnTypeWillChange]
194205
public function offsetExists( $offset ) {
195206
return isset( $this->{$offset} );
196207
}
@@ -204,6 +215,7 @@ public function offsetExists( $offset ) {
204215
*
205216
* @return void
206217
*/
218+
#[\ReturnTypeWillChange]
207219
public function offsetUnset( $offset ) {
208220
unset( $this->{$offset} );
209221
}
@@ -217,6 +229,7 @@ public function offsetUnset( $offset ) {
217229
*
218230
* @return mixed Returns the value at the specified offset, or null if it doesn't exist.
219231
*/
232+
#[\ReturnTypeWillChange]
220233
public function offsetGet( $offset ) {
221234
return isset( $this->{$offset} ) ? $this->{$offset} : null;
222235
}

includes/api/model/class-charge.php

+45
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,51 @@
1414
*/
1515
class Charge extends Base {
1616

17+
/**
18+
* Initialize properties that will be used throughout this class and link to the Stripe API.
19+
*
20+
* @since 5.5.2
21+
*/
22+
public $amount;
23+
public $application;
24+
public $balance_transaction;
25+
public $captured;
26+
public $currency;
27+
public $customer;
28+
public $description;
29+
public $disputed;
30+
public $livemode;
31+
public $metadata;
32+
public $outcome;
33+
public $paid;
34+
public $payment_intent;
35+
public $payment_method;
36+
public $receipt_number;
37+
public $refunded;
38+
public $review;
39+
public $shipping;
40+
public $statement_descriptor;
41+
public $status;
42+
public $transfer;
43+
public $amount_captured;
44+
public $amount_refunded;
45+
public $application_fee;
46+
public $application_fee_amount;
47+
public $billing_details;
48+
public $calculated_statement_descriptor;
49+
public $failure_balance_transaction;
50+
public $failure_code;
51+
public $failure_message;
52+
public $fraud_details;
53+
public $on_behalf_of;
54+
public $payment_method_details;
55+
public $receipt_email;
56+
public $reciept_url;
57+
public $source_transfer;
58+
public $statement_descriptor_suffix;
59+
public $transfer_data;
60+
public $transfer_group;
61+
1762
/**
1863
* Returns the API endpoint for this object.
1964
*

includes/api/model/class-coupon.php

+20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
*/
1212
class Coupon extends Base {
1313

14+
/**
15+
* Initialize properties that will be used throughout this class and link to the Stripe API.
16+
*
17+
* @since 5.5.2
18+
*/
19+
public $amount_off;
20+
public $currency;
21+
public $duration;
22+
public $livemode;
23+
public $metadata;
24+
public $name;
25+
public $percent_off;
26+
public $valid;
27+
public $applies_to;
28+
public $currency_options;
29+
public $duration_in_months;
30+
public $max_redemptions;
31+
public $redeem_by;
32+
public $times_redeemed;
33+
1434
/**
1535
* Returns the API endpoint for this object.
1636
*

includes/api/model/class-customer.php

+31
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,37 @@
1111
*/
1212
class Customer extends Base {
1313

14+
/**
15+
* Initialize properties that will be used throughout this class and link to the Stripe API.
16+
*
17+
* @since 5.5.2
18+
*/
19+
public $address;
20+
public $balance;
21+
public $currency;
22+
public $description;
23+
public $discount;
24+
public $email;
25+
public $livemode;
26+
public $metadata;
27+
public $name;
28+
public $phone;
29+
public $shipping;
30+
public $sources;
31+
public $subscriptions;
32+
public $tax;
33+
public $tax_ids;
34+
public $cash_balance;
35+
public $default_source;
36+
public $delinquent;
37+
public $invoice_credit_balance;
38+
public $invoice_prefix;
39+
public $invoice_settings;
40+
public $next_invoice_sequence;
41+
public $preferred_locales;
42+
public $tax_exempt;
43+
public $test_clock;
44+
1445
/**
1546
* Gets the supported parameters for the update endpoint.
1647
*

includes/api/model/class-customerbalancetransaction.php

+17
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111
*/
1212
class CustomerBalanceTransaction extends Base {
1313

14+
/**
15+
* Initialize properties that will be used throughout this class and link to the Stripe API.
16+
*
17+
* @since 5.5.2
18+
*/
19+
public $amount;
20+
public $currency;
21+
public $customer;
22+
public $description;
23+
public $invoice;
24+
public $livemode;
25+
public $metadata;
26+
public $type;
27+
public $credit_note;
28+
public $ending_balance;
29+
30+
1431
/**
1532
* This method is not supported by this object
1633
*

includes/api/model/class-event.php

+19-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212
*/
1313
class Event extends Base {
1414

15+
/**
16+
* Initialize properties that will be used throughout this class and link to the Stripe API.
17+
*
18+
* @since 5.5.2
19+
*/
20+
public $account;
21+
public $api_version;
22+
public $data;
23+
public $livemode;
24+
public $request;
25+
public $type;
26+
public $pending_webhooks;
27+
1528
/**
1629
* This method is not supported by this object
1730
*
@@ -58,16 +71,16 @@ public static function construct_event( $payload, $sig_header, $secret, $api, $t
5871

5972
try {
6073
self::verify_header( $payload, $sig_header, $secret, $tolerance );
61-
} catch ( Exception $e ) {
62-
return new WP_Error( $e->getMessage() );
74+
} catch ( \Exception $e ) {
75+
return new \WP_Error( $e->getMessage() );
6376
}
6477

6578
$data = \json_decode( $payload, true );
6679
$json_error = \json_last_error();
6780
if ( null === $data && \JSON_ERROR_NONE !== $json_error ) {
6881
$msg = "Invalid payload: {$payload} " . "(json_last_error() was {$json_error})";
6982

70-
return new WP_Error( $msg );
83+
return new \WP_Error( $msg );
7184
}
7285

7386
return new Event( $data, $api );
@@ -82,7 +95,7 @@ public static function construct_event( $payload, $sig_header, $secret, $api, $t
8295
* @param string $secret secret used to generate the signature
8396
* @param int $tolerance maximum difference allowed between the header's timestamp and the current time
8497
*
85-
* @throws Exception if the verification fails
98+
* @throws \Exception if the verification fails
8699
*
87100
* @return bool
88101
*/
@@ -91,10 +104,10 @@ public static function verify_header( $payload, $header, $secret, $tolerance = n
91104
$timestamp = self::get_timestamp( $header );
92105
$signatures = self::get_signatures( $header, self::EXPECTED_SCHEME );
93106
if ( -1 === $timestamp ) {
94-
throw \Exception( 'Unable to extract timestamp and signatures from header' );
107+
throw new \Exception( 'Unable to extract timestamp and signatures from header' );
95108
}
96109
if ( empty( $signatures ) ) {
97-
throw \Exception( 'No signatures found with expected scheme' );
110+
throw new \Exception( 'No signatures found with expected scheme' );
98111
}
99112

100113
// Check if expected signature is found in list of signatures from

includes/api/model/class-invoice.php

+88
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,94 @@
1212
*/
1313
class Invoice extends Base {
1414

15+
/**
16+
* Initialize properties that will be used throughout this class and link to the Stripe API.
17+
*
18+
* @since 5.5.2
19+
*/
20+
public $application;
21+
public $attempted;
22+
public $charge;
23+
public $currency;
24+
public $custom_fields;
25+
public $customer;
26+
public $description;
27+
public $discount;
28+
public $discounts;
29+
public $due_date;
30+
public $footer;
31+
public $lines;
32+
public $livemode;
33+
public $metadata;
34+
public $number;
35+
public $paid;
36+
public $payment_intent;
37+
public $quote;
38+
public $receipt_number;
39+
public $rendering;
40+
public $statement_descriptor;
41+
public $status;
42+
public $subscription;
43+
public $subtotal;
44+
public $tax;
45+
public $total;
46+
public $account_country;
47+
public $account_name;
48+
public $account_tax_ids;
49+
public $amount_due;
50+
public $amount_paid;
51+
public $amount_remaining;
52+
public $amount_shipping;
53+
public $application_fee_amount;
54+
public $attempt_count;
55+
public $auto_advance;
56+
public $automatic_tax;
57+
public $billing_reason;
58+
public $collection_method;
59+
public $customer_address;
60+
public $customer_email;
61+
public $customer_name;
62+
public $customer_phone;
63+
public $customer_shipping;
64+
public $customer_tax_exempt;
65+
public $customer_tax_ids;
66+
public $default_payment_method;
67+
public $default_source;
68+
public $default_tax_rates;
69+
public $effective_at;
70+
public $ending_balance;
71+
public $from_invoice;
72+
public $hosted_invoice_url;
73+
public $invoice_pdf;
74+
public $issuer;
75+
public $last_finalization_error;
76+
public $latest_revision;
77+
public $next_payment_attempt;
78+
public $on_behalf_of;
79+
public $paid_out_of_band;
80+
public $payment_settings;
81+
public $period_end;
82+
public $period_start;
83+
public $post_payment_credit_notes_amount;
84+
public $pre_payment_credit_notes_amount;
85+
public $rendering_options;
86+
public $shipping_cost;
87+
public $shipping_details;
88+
public $starting_balance;
89+
public $status_transitions;
90+
public $subscription_details;
91+
public $subscription_proration_date;
92+
public $subtotal_excluding_tax;
93+
public $test_clock;
94+
public $threshold_reason;
95+
public $total_discount_amounts;
96+
public $total_excluding_tax;
97+
public $total_tax_amounts;
98+
public $transfer_data;
99+
public $webhooks_delivered_at;
100+
101+
102+
15103
/**
16104
* Returns the API endpoint for this object.
17105
*

0 commit comments

Comments
 (0)