PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.0
GiveWP – Donation Plugin and Fundraising Platform v4.15.0
4.18.0.1 4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 All 258 releases
give / src / PaymentGateways / Gateways / Stripe / StripePaymentElementGateway / Actions / AddStripeAttributesToNewForms.php

AddStripeAttributesToNewForms.php in GiveWP – Donation Plugin and Fundraising Platform 4.15.0, at src/PaymentGateways/Gateways/Stripe/StripePaymentElementGateway/Actions/AddStripeAttributesToNewForms.php

27 lines 715 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\PaymentGateways\Gateways\Stripe\StripePaymentElementGateway\Actions;
4
5
6 use Give\DonationForms\Models\DonationForm;
7
8 class AddStripeAttributesToNewForms
9 {
10
11 /**
12 * Add Stripe attributes to the PaymentGateways block new forms.
13 */
14 public function __invoke(DonationForm $form)
15 {
16 $block = $form->blocks->findByName('givewp/payment-gateways');
17 if ($block) {
18 $enabledGateways = array_keys(give_get_option('gateways_v3', []));
19 $stripeEnabled = in_array('stripe_payment_element', $enabledGateways, true);
20
21 if ($stripeEnabled) {
22 $block->setAttribute('stripeUseGlobalDefault', true);
23 }
24 }
25 }
26 }
27