PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.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 2.3.1 2.3.2 All 256 releases
give / src / PaymentGateways / Gateways / Stripe / Migrations / AddStatementDescriptorToStripeAccounts.php

AddStatementDescriptorToStripeAccounts.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/PaymentGateways/Gateways/Stripe/Migrations/AddStatementDescriptorToStripeAccounts.php

71 lines 1.8 KB
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\Migrations;
4
5 use Exception;
6 use Give\Framework\Migrations\Contracts\Migration;
7 use Give\PaymentGateways\Stripe\Repositories\Settings;
8 use Give\PaymentGateways\Stripe\Traits\HasStripeStatementDescriptorText;
9
10 /**
11 * @since 2.19.0
12 */
13 class AddStatementDescriptorToStripeAccounts extends Migration
14 {
15 use HasStripeStatementDescriptorText;
16
17 /**
18 * @inerhitDoc
19 * @since 2.19.0
20 * @since 2.19.1 Use old stripe statement descriptor requirements to filter text.
21 * https://github.com/impress-org/givewp/pull/6269
22 */
23 public function run()
24 {
25 $stripeSettings = give(Settings::class);
26 $allStripeAccount = $stripeSettings->getAllStripeAccounts();
27
28 if ($allStripeAccount) {
29 $statementDescriptor = give_get_option('stripe_statement_descriptor', get_bloginfo('name'));
30 foreach ($allStripeAccount as $index => $stripAccount) {
31 if (!isset($stripAccount['statement_descriptor'])) {
32 $allStripeAccount[$index]['statement_descriptor'] = $this->filterOldStatementDescriptor(
33 $statementDescriptor
34 );
35 }
36 }
37
38 give_update_option('_give_stripe_get_all_accounts', $allStripeAccount);
39 }
40
41 give_delete_option('stripe_statement_descriptor');
42 }
43
44 /**
45 * @inerhitDoc
46 * @since 2.19.0
47 */
48 public static function id()
49 {
50 return 'add-statement-descriptor-to-stripe-accounts';
51 }
52
53 /**
54 * @inerhitDoc
55 * @since 2.19.0
56 */
57 public static function timestamp()
58 {
59 return strtotime('10-02-2022');
60 }
61
62 /**
63 * @inerhitDoc
64 * @since 2.19.0
65 */
66 public static function title()
67 {
68 return 'Add Statement Descriptor To Stripe Accounts';
69 }
70 }
71