← All changes
|
stripe/controllers/FrmTransLiteActionsController.php
+13
-0
6.31
→
trunk
View file →
| @@ -410,8 +410,9 @@ | ||
| 410 | 410 | $settings_for_action = array( |
| 411 | 411 | 'id' => $payment_action->ID, |
| 412 | 412 | 'first_name' => $payment_action->post_content['billing_first_name'], |
| 413 | 413 | 'last_name' => $payment_action->post_content['billing_last_name'], |
| 414 | + 'address' => $payment_action->post_content['billing_address'] ?? '', | |
| 414 | 415 | 'gateways' => $payment_action->post_content['gateway'], |
| 415 | 416 | 'fields' => self::get_fields_for_price( $payment_action ), |
| 416 | 417 | 'one' => $payment_action->post_content['type'], |
| 417 | 418 | 'email' => $payment_action->post_content['email'], |
| @@ -472,8 +473,14 @@ | ||
| 472 | 473 | if ( $field->type !== 'gateway' ) { |
| 473 | 474 | return $values; |
| 474 | 475 | } |
| 475 | 476 | |
| 477 | + if ( FrmAppHelper::is_form_builder_page() ) { | |
| 478 | + // The hooks this uses can get called in the form builder and settings pages. | |
| 479 | + // But we do not need the script in this case. | |
| 480 | + return $values; | |
| 481 | + } | |
| 482 | + | |
| 476 | 483 | // This is also called from the frm_enqueue_form_scripts hook. |
| 477 | 484 | // With this here, the value of frm_stripe_vars.settings[0].fields is -1 |
| 478 | 485 | // This is because the amount value is processed and a shortcode is not found in '000'. |
| 479 | 486 | FrmStrpLiteActionsController::load_scripts( (int) $field->form_id ); |
| @@ -586,8 +593,14 @@ | ||
| 586 | 593 | |
| 587 | 594 | if ( $credit_card_field_id ) { |
| 588 | 595 | $settings['credit_card'] = $credit_card_field_id; |
| 589 | 596 | } |
| 597 | + } | |
| 598 | + | |
| 599 | + if ( ! in_array( 'stripe', $settings['gateway'], true ) ) { | |
| 600 | + // We only need a gateway field for Stripe add-on compatibility, | |
| 601 | + // so unless Stripe is selected, we can return early. | |
| 602 | + return $settings; | |
| 590 | 603 | } |
| 591 | 604 | |
| 592 | 605 | $gateway_field_id = FrmDb::get_var( |
| 593 | 606 | 'frm_fields', |