RenewalInfo::getGracePeriodExpiresDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Appvise\AppStoreNotifications\Model;
4
5
class RenewalInfo
6
{
7
    private $autoRenewProductId;
8
    private $autoRenewStatus;
9
    private $expirationIntent;
10
    private $originalTransactionId;
11
    private $isInBillingRetryPeriod;
12
    private $productId;
13
    private $priceConsentStatus;
14
    private $gracePeriodExpiresDate;
15
    private $gracePeriodExpiresDateMs;
16
    private $gracePeriodExpiresDatePst;
17
18
    public function __construct()
19
    {
20
    }
21
22
    public static function createFromRequest(array $pendingRenewalInfo)
23
    {
24
        $instance = new self();
25
        $instance->autoRenewProductId = $pendingRenewalInfo['auto_renew_product_id'] ?? null;
26
        $instance->autoRenewStatus = $pendingRenewalInfo['auto_renew_status'] ?? null;
27
        $instance->expirationIntent = $pendingRenewalInfo['expiration_intent'] ?? null;
28
        $instance->originalTransactionId = $pendingRenewalInfo['original_transaction_id'] ?? null;
29
        $instance->isInBillingRetryPeriod = $pendingRenewalInfo['is_in_billing_retry_period'] ?? null;
30
        $instance->productId = $pendingRenewalInfo['product_id'] ?? null;
31
        $instance->priceConsentStatus = $pendingRenewalInfo['price_consent_status'] ?? null;
32
        $instance->gracePeriodExpiresDate = $pendingRenewalInfo['grace_period_expires_date'] ?? null;
33
        $instance->gracePeriodExpiresDatePst = $pendingRenewalInfo['grace_period_expires_date_pst'] ?? null;
34
35
        return $instance;
36
    }
37
38
    /**
39
     * Get the value of autoRenewProductId.
40
     */
41
    public function getAutoRenewProductId()
42
    {
43
        return $this->autoRenewProductId;
44
    }
45
46
    /**
47
     * Get the value of autoRenewStatus.
48
     */
49
    public function getAutoRenewStatus()
50
    {
51
        return $this->autoRenewStatus;
52
    }
53
54
    /**
55
     * Get the value of expirationIntent.
56
     */
57
    public function getExpirationIntent()
58
    {
59
        return $this->expirationIntent;
60
    }
61
62
    /**
63
     * Get the value of originalTransactionId.
64
     */
65
    public function getOriginalTransactionId()
66
    {
67
        return $this->originalTransactionId;
68
    }
69
70
    /**
71
     * Get the value of isInBillingRetryPeriod.
72
     */
73
    public function getIsInBillingRetryPeriod()
74
    {
75
        return $this->isInBillingRetryPeriod;
76
    }
77
78
    /**
79
     * Get the value of productId.
80
     */
81
    public function getProductId()
82
    {
83
        return $this->productId;
84
    }
85
86
    /**
87
     * Get the value of priceConsentStatus.
88
     */
89
    public function getPriceConsentStatus()
90
    {
91
        return $this->priceConsentStatus;
92
    }
93
94
    /**
95
     * Get the value of gracePeriodExpiresDate.
96
     */
97
    public function getGracePeriodExpiresDate()
98
    {
99
        return $this->gracePeriodExpiresDate;
100
    }
101
102
    /**
103
     * Get the value of gracePeriodExpiresDateMs.
104
     */
105
    public function getGracePeriodExpiresDateMs()
106
    {
107
        return $this->gracePeriodExpiresDateMs;
108
    }
109
110
    /**
111
     * Get the value of gracePeriodExpiresDatePst.
112
     */
113
    public function getGracePeriodExpiresDatePst()
114
    {
115
        return $this->gracePeriodExpiresDatePst;
116
    }
117
}
118