Payment::setReturnUrl()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Alcalyn\PayplugBundle\Model;
4
5
/**
6
 * Payment
7
 * 
8
 * Payment instance that you create
9
 * before redirect your customer to payplug payment page.
10
 * 
11
 * @method Payment setAmount(integer $amount)
12
 * @method Payment setEmail($email)
13
 * @method Payment setFirstName($firstName)
14
 * @method Payment setLastName($lastName)
15
 * @method Payment setCustomer($customer)
16
 * @method Payment setOrder($order)
17
 * @method Payment setCustomData($customData)
18
 * @method Payment setOrigin($origin)
19
 */
20
class Payment extends Transaction
21
{
22
    /**
23
     * Currency euro
24
     * 
25
     * @var string
26
     */
27
    const EUROS = 'EUR';
28
    
29
    /**
30
     * REQUIRED
31
     * 
32
     * Transaction currency. Only 'EUR' is allowed at the moment.
33
     * 
34
     * @var string
35
     */
36
    private $currency;
37
    
38
    /**
39
     * REQUIRED
40
     * 
41
     * URL pointing to the ipn.php page, to which PayPlug will send payment and refund notifications.
42
     * This URL must be accessible from anywhere on the Internet (usually not the case in localhost environments).
43
     * 
44
     * @var string
45
     */
46
    private $ipnUrl;
47
48
    /**
49
     * URL pointing to your payment confirmation page,
50
     * to which PayPlug will redirect your customer after the payment.
51
     * 
52
     * @var string
53
     */
54
    private $returnUrl;
55
56
    /**
57
     * URL pointing to your payment cancelation page,
58
     * to which PayPlug will redirect your customer if he cancels the payment.
59
     * 
60
     * @var string
61
     */
62
    private $cancelUrl;
63
    
64
    /**
65
     * @param integer Transaction amount, in cents (such as 4207 for 42,07€).
66
     * @param string $currency Transaction currency
67
     */
68
    public function __construct($amount = 0, $currency = self::EUROS)
69
    {
70
        $this
71
            ->setAmount($amount)
72
            ->setCurrency($currency)
73
        ;
74
    }
75
    
76
    /**
77
     * Set currency
78
     *
79
     * @param string $currency
80
     * @return Payment
81
     */
82
    public function setCurrency($currency)
83
    {
84
        $this->currency = $currency;
85
86
        return $this;
87
    }
88
89
    /**
90
     * Get currency
91
     *
92
     * @return string 
93
     */
94
    public function getCurrency()
95
    {
96
        return $this->currency;
97
    }
98
99
    /**
100
     * Set ipnUrl
101
     *
102
     * @param string $ipnUrl
103
     * @return Payment
104
     */
105
    public function setIpnUrl($ipnUrl)
106
    {
107
        $this->ipnUrl = $ipnUrl;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Get ipnUrl
114
     *
115
     * @return string 
116
     */
117
    public function getIpnUrl()
118
    {
119
        return $this->ipnUrl;
120
    }
121
122
    /**
123
     * Set returnUrl
124
     *
125
     * @param string $returnUrl
126
     * @return Payment
127
     */
128
    public function setReturnUrl($returnUrl)
129
    {
130
        $this->returnUrl = $returnUrl;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Get returnUrl
137
     *
138
     * @return string 
139
     */
140
    public function getReturnUrl()
141
    {
142
        return $this->returnUrl;
143
    }
144
145
    /**
146
     * Set cancelUrl
147
     *
148
     * @param string $cancelUrl
149
     * @return Payment
150
     */
151
    public function setCancelUrl($cancelUrl)
152
    {
153
        $this->cancelUrl = $cancelUrl;
154
155
        return $this;
156
    }
157
158
    /**
159
     * Get cancelUrl
160
     *
161
     * @return string 
162
     */
163
    public function getCancelUrl()
164
    {
165
        return $this->cancelUrl;
166
    }
167
}
168