| @@ -21,9 +21,10 @@ | ||
| 21 | 21 | /** |
| 22 | 22 | * Get some associated payment objects based on the URL param data. |
| 23 | 23 | * This includes the intent, the entry, and the payments table model instance. |
| 24 | 24 | * |
| 25 | - * @param string|int $form_id | |
| 25 | + * @param int|string $form_id | |
| 26 | + * | |
| 26 | 27 | * @return array|false |
| 27 | 28 | */ |
| 28 | 29 | public static function get_details_for_form( $form_id ) { |
| 29 | 30 | if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
| @@ -28,9 +29,9 @@ | ||
| 28 | 29 | public static function get_details_for_form( $form_id ) { |
| 29 | 30 | if ( ! isset( self::$details_by_form_id[ $form_id ] ) ) { |
| 30 | 31 | self::set_details_for_form( (int) $form_id ); |
| 31 | 32 | } |
| 32 | - return isset( self::$details_by_form_id[ $form_id ] ) ? self::$details_by_form_id[ $form_id ] : false; | |
| 33 | + return self::$details_by_form_id[ $form_id ] ?? false; | |
| 33 | 34 | } |
| 34 | 35 | |
| 35 | 36 | /** |
| 36 | 37 | * Check the URL params for Stripe intent details. |
| @@ -43,9 +44,10 @@ | ||
| 43 | 44 | * - The charge ID (if applicable) |
| 44 | 45 | * |
| 45 | 46 | * @since 6.5.1 |
| 46 | 47 | * |
| 47 | - * @param string|int $form_id | |
| 48 | + * @param int|string $form_id | |
| 49 | + * | |
| 48 | 50 | * @return void |
| 49 | 51 | */ |
| 50 | 52 | private static function set_details_for_form( $form_id ) { |
| 51 | 53 | $intent_id = FrmAppHelper::simple_get( 'payment_intent' ); |
| @@ -85,8 +87,9 @@ | ||
| 85 | 87 | return; |
| 86 | 88 | } |
| 87 | 89 | |
| 88 | 90 | $entry = FrmEntry::getOne( $payment->item_id, true ); |
| 91 | + | |
| 89 | 92 | if ( ! is_object( $entry ) || (int) $entry->form_id !== $form_id ) { |
| 90 | 93 | return; |
| 91 | 94 | } |
| 92 | 95 | |
| @@ -103,8 +106,9 @@ | ||
| 103 | 106 | * @since 6.5.1 |
| 104 | 107 | * |
| 105 | 108 | * @param object $intent |
| 106 | 109 | * @param bool $is_setup_intent |
| 110 | + * | |
| 107 | 111 | * @return bool True if the client secret is set and valid. |
| 108 | 112 | */ |
| 109 | 113 | private static function verify_client_secret( $intent, $is_setup_intent ) { |
| 110 | 114 | $client_secret_param = $is_setup_intent ? 'setup_intent_client_secret' : 'payment_intent_client_secret'; |