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 / RemovePaymentIntentSecretMeta.php

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

59 lines 1.3 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 Give\Framework\Database\DB;
6 use Give\Framework\Migrations\Contracts\Migration;
7
8 /**
9 * Removes the secret meta that was unnecessarily stored in the database for donations.
10 *
11 * @since 2.33.0
12 */
13 class RemovePaymentIntentSecretMeta extends Migration
14 {
15 /**
16 * @inheritDoc
17 */
18 public static function id(): string
19 {
20 return 'remove_payment_intent_secret_meta';
21 }
22
23 /**
24 * @inheritDoc
25 */
26 public static function title(): string
27 {
28 return __('Remove payment intent secret meta', 'give');
29 }
30
31 /**
32 * @inheritDoc
33 */
34 public static function timestamp()
35 {
36 return strtotime('2023-06-29 00:00:00');
37 }
38
39 /**
40 * @inheritDoc
41 */
42 public function run()
43 {
44 DB::delete(
45 DB::prefix('give_donationmeta'),
46 ['meta_key' => '_give_stripe_payment_intent_client_secret'],
47 ['%s']
48 );
49
50 $commentsTable = DB::prefix('give_comments');
51 DB::query(
52 DB::prepare(
53 "DELETE FROM {$commentsTable} WHERE comment_type = 'donation' AND comment_content LIKE %s",
54 'Stripe Payment Intent Client Secret:%'
55 )
56 );
57 }
58 }
59