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 / Stripe / Controllers / DisconnectStripeAccountController.php

DisconnectStripeAccountController.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/PaymentGateways/Stripe/Controllers/DisconnectStripeAccountController.php

54 lines 1.1 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\Stripe\Controllers;
4
5 use Give\PaymentGateways\Stripe\DataTransferObjects\DisconnectStripeAccountDto;
6
7 /**
8 * Class DisconnectStripeAccountController
9 * @package Give\PaymentGateways\Stripe\Controllers
10 *
11 * @since 2.13.0
12 */
13 class DisconnectStripeAccountController
14 {
15
16 /**
17 * @since 2.13.0
18 */
19 public function __invoke()
20 {
21 $this->validateRequest();
22
23 $requestedData = DisconnectStripeAccountDto::fromArray(give_clean($_GET));
24
25 $this->securityCheck($requestedData->accountSlug);
26
27 give_stripe_disconnect_account($requestedData->accountSlug);
28
29 wp_send_json_success();
30 }
31
32 /**
33 * @since 2.13.0
34 */
35 private function validateRequest()
36 {
37 if ( ! current_user_can('manage_give_settings')) {
38 die();
39 }
40 }
41
42 /**
43 * @since 2.13.0
44 *
45 * @param $accountSlug
46 */
47 private function securityCheck($accountSlug)
48 {
49 if ( ! check_admin_referer('give_disconnect_connected_stripe_account_' . $accountSlug)) {
50 die();
51 }
52 }
53 }
54