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 / DataTransferObjects / NewStripeAccountOnBoardingDto.php

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

76 lines 1.9 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\DataTransferObjects;
4
5 /**
6 * Class NewStripeAccountOnBoardingDto
7 * @package Give\PaymentGateways\Stripe\DataTransferObjects
8 *
9 * @since 2.13.0
10 */
11 final class NewStripeAccountOnBoardingDto
12 {
13 /**
14 * @var mixed|string
15 */
16 public $stripePublishableKey;
17 /**
18 * @var mixed|string
19 */
20 public $stripeUserId;
21 /**
22 * @var mixed|string
23 */
24 public $stripeAccessToken;
25 /**
26 * @var mixed|string
27 */
28 public $stripeAccessTokenTest;
29 /**
30 * @var bool
31 */
32 public $isConnected;
33 /**
34 * @var mixed|string
35 */
36 public $stripePublishableKeyTest;
37 /**
38 * @var int
39 */
40 public $formId;
41
42 /**
43 * @since 2.13.0
44 *
45 * @param array $array
46 *
47 */
48 public static function fromArray($array)
49 {
50 $self = new static();
51
52 $self->formId = ! empty($array['post']) ? absint($array['post']) : 0;
53 $self->stripePublishableKey = ! empty($array['stripe_publishable_key']) ? $array['stripe_publishable_key'] : '';
54 $self->stripePublishableKeyTest = ! empty($array['stripe_publishable_key_test']) ? $array['stripe_publishable_key_test'] : '';
55 $self->stripeUserId = ! empty($array['stripe_user_id']) ? $array['stripe_user_id'] : '';
56 $self->stripeAccessToken = ! empty($array['stripe_access_token']) ? $array['stripe_access_token'] : '';
57 $self->stripeAccessTokenTest = ! empty($array['stripe_access_token_test']) ? $array['stripe_access_token_test'] : '';
58 $self->isConnected = ! empty($array['connected']) && absint($array['connected']);
59
60 return $self;
61 }
62
63 /**
64 * @since 2.13.0
65 * @return bool
66 */
67 public function hasValidateData()
68 {
69 return $this->stripePublishableKey &&
70 $this->stripeUserId &&
71 $this->stripeAccessToken &&
72 $this->stripeAccessTokenTest &&
73 $this->isConnected;
74 }
75 }
76