← All changes
|
app/Modules/Payments/PaymentMethods/Stripe/Components/StripeInline.php
+5
-1
6.2.9
→
trunk
View file →
| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentForm\App\Modules\Payments\PaymentMethods\Stripe\Components; |
| 4 | 4 | |
| 5 | 5 | use FluentForm\Framework\Helpers\ArrayHelper; |
| 6 | +use FluentForm\App\Modules\Payments\PaymentHelper; | |
| 6 | 7 | use FluentForm\App\Services\FormBuilder\BaseFieldManager; |
| 7 | 8 | use FluentForm\App\Modules\Payments\PaymentMethods\Stripe\StripeSettings; |
| 8 | 9 | |
| 9 | 10 | if (!defined('ABSPATH')) { |
| @@ -33,8 +34,10 @@ | ||
| 33 | 34 | if (ArrayHelper::get($method, 'settings.embedded_checkout.value') !== 'yes') { |
| 34 | 35 | return $inlineContents; |
| 35 | 36 | } |
| 36 | 37 | |
| 38 | + $paymentElement = PaymentHelper::isStripePaymentElement($method); | |
| 39 | + | |
| 37 | 40 | add_filter('fluentform/form_class', function ($classes, $targetForm) use ($form) { |
| 38 | 41 | if ($form->instance_index == $targetForm->instance_index) { |
| 39 | 42 | $classes .= ' ff_has_stripe_inline'; |
| 40 | 43 | } |
| @@ -52,9 +55,10 @@ | ||
| 52 | 55 | $markup .= '</div>'; |
| 53 | 56 | |
| 54 | 57 | $attributes = [ |
| 55 | 58 | 'name' => 'stripe_card_element', |
| 56 | - 'class' => 'ff_stripe_card_element ff-el-form-control', | |
| 59 | + // The Payment Element draws its own inputs; only the bare Card Element needs the input box | |
| 60 | + 'class' => $paymentElement ? 'ff_stripe_card_element' : 'ff_stripe_card_element ff-el-form-control', | |
| 57 | 61 | 'data-wpf_payment_method' => 'stripe', |
| 58 | 62 | 'id' => $elementId, |
| 59 | 63 | 'data-checkout_style' => 'embedded_form', |
| 60 | 64 | 'data-verify_zip' => ArrayHelper::get($method, 'settings.verify_zip.value') === 'yes' |