PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.15
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.15
6.2.15 6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 All 197 releases
← All changes | app/Modules/Payments/PaymentHelper.php +34 -10 6.2.14 → 6.2.15 View file →
@@ -817,21 +817,45 @@
817 817
818 818 $stripe = ArrayHelper::get($methods, 'stripe');
819 819 $stripeInlineStyles = ArrayHelper::get(Helper::getFormMeta($formId, '_ff_form_styles', []), 'stripe_inline_element_style', false);
820 820 if ($stripe) {
821 - return apply_filters(
822 - 'fluentform/stripe_inline_config',
823 - [
824 - 'is_inline' => ArrayHelper::get($stripe, 'settings.embedded_checkout.value') == 'yes',
825 - 'inline_styles' => $stripeInlineStyles,
826 - 'verifyZip' => ArrayHelper::get($methods['stripe'], 'settings.verify_zip_code.value') === 'yes',
827 - 'disable_link' => false
828 - ],
829 - $formId
830 - );
821 + $config = [
822 + 'is_inline' => ArrayHelper::get($stripe, 'settings.embedded_checkout.value') == 'yes',
823 + 'inline_styles' => $stripeInlineStyles,
824 + 'verifyZip' => ArrayHelper::get($methods['stripe'], 'settings.verify_zip_code.value') === 'yes',
825 + 'disable_link' => false,
826 + 'enable_payment_element' => static::isStripePaymentElement($stripe),
827 + 'is_zero_decimal' => static::isZeroDecimal(static::getFormCurrency($formId)),
828 + ];
829 +
830 + // Classic and conversational forms both create the Payment Element with these options
831 + if ($config['enable_payment_element']) {
832 + $config['payment_element_options'] = apply_filters(
833 + 'fluentform/stripe_payment_element_options',
834 + [
835 + 'layout' => 'tabs',
836 + 'wallets' => ['applePay' => 'auto', 'googlePay' => 'auto', 'link' => 'never'],
837 + 'fields' => ['billingDetails' => ['address' => $config['verifyZip'] ? 'auto' : 'if_required']],
838 + 'appearance' => [],
839 + ],
840 + $formId
841 + );
842 + }
843 +
844 + return apply_filters('fluentform/stripe_inline_config', $config, $formId);
831 845 }
832 846
833 847 return [];
848 + }
849 +
850 + /**
851 + * Stripe's Payment Element (card plus Apple Pay / Google Pay) replaces the Card Element on the embedded field,
852 + * so it only applies with Embedded Checkout on.
853 + */
854 + public static function isStripePaymentElement($stripeMethod)
855 + {
856 + return ArrayHelper::get($stripeMethod, 'settings.embedded_checkout.value') === 'yes'
857 + && ArrayHelper::get($stripeMethod, 'settings.enable_payment_element.value') === 'yes';
834 858 }
835 859
836 860 public static function log($data, $submission = false, $forceInsert = false)
837 861 {