@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(array $items = null) |
39 | 39 | { |
40 | - if (!is_null($items) && count($items) > 0) { |
|
40 | + if ( ! is_null($items) && count($items) > 0) { |
|
41 | 41 | $this->setItems($items); |
42 | 42 | } |
43 | 43 | } |
@@ -27,45 +27,45 @@ |
||
27 | 27 | class PagSeguroMetaData |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * @var array |
32 | 32 | */ |
33 | - private $items; |
|
33 | + private $items; |
|
34 | 34 | |
35 | - /*** |
|
35 | + /*** |
|
36 | 36 | * @param array $items |
37 | 37 | */ |
38 | - public function __construct(array $items = null) |
|
39 | - { |
|
40 | - if (!is_null($items) && count($items) > 0) { |
|
41 | - $this->setItems($items); |
|
42 | - } |
|
43 | - } |
|
38 | + public function __construct(array $items = null) |
|
39 | + { |
|
40 | + if (!is_null($items) && count($items) > 0) { |
|
41 | + $this->setItems($items); |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - /*** |
|
45 | + /*** |
|
46 | 46 | * @param PagSeguroMetaDataItem $metaDataItem |
47 | 47 | */ |
48 | - public function addItem(PagSeguroMetaDataItem $metaDataItem) |
|
49 | - { |
|
50 | - $this->items[] = $metaDataItem; |
|
51 | - } |
|
48 | + public function addItem(PagSeguroMetaDataItem $metaDataItem) |
|
49 | + { |
|
50 | + $this->items[] = $metaDataItem; |
|
51 | + } |
|
52 | 52 | |
53 | - /*** |
|
53 | + /*** |
|
54 | 54 | * @param array $items |
55 | 55 | */ |
56 | - public function setItems(array $items) |
|
57 | - { |
|
58 | - $this->items = $items; |
|
59 | - } |
|
56 | + public function setItems(array $items) |
|
57 | + { |
|
58 | + $this->items = $items; |
|
59 | + } |
|
60 | 60 | |
61 | - /*** |
|
61 | + /*** |
|
62 | 62 | * @return array |
63 | 63 | */ |
64 | - public function getItems() |
|
65 | - { |
|
66 | - if ($this->items == null) { |
|
67 | - $this->items = array(); |
|
68 | - } |
|
69 | - return $this->items; |
|
70 | - } |
|
64 | + public function getItems() |
|
65 | + { |
|
66 | + if ($this->items == null) { |
|
67 | + $this->items = array(); |
|
68 | + } |
|
69 | + return $this->items; |
|
70 | + } |
|
71 | 71 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function __construct(array $items = null) |
33 | 33 | { |
34 | - if (!is_null($items) && count($items) > 0) { |
|
34 | + if ( ! is_null($items) && count($items) > 0) { |
|
35 | 35 | $this->setItems($items); |
36 | 36 | } |
37 | 37 | } |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | public function addItem(PagSeguroParameterItem $parameterItem) |
40 | 40 | { |
41 | 41 | |
42 | - if (!PagSeguroHelper::isEmpty($parameterItem->getKey())) { |
|
43 | - if (!PagSeguroHelper::isEmpty($parameterItem->getValue())) { |
|
42 | + if ( ! PagSeguroHelper::isEmpty($parameterItem->getKey())) { |
|
43 | + if ( ! PagSeguroHelper::isEmpty($parameterItem->getValue())) { |
|
44 | 44 | $this->items[] = $parameterItem; |
45 | 45 | } else { |
46 | 46 | die('requered parameterValue.'); |
@@ -27,39 +27,39 @@ |
||
27 | 27 | class PagSeguroParameter |
28 | 28 | { |
29 | 29 | |
30 | - private $items; |
|
30 | + private $items; |
|
31 | 31 | |
32 | - public function __construct(array $items = null) |
|
33 | - { |
|
34 | - if (!is_null($items) && count($items) > 0) { |
|
35 | - $this->setItems($items); |
|
36 | - } |
|
37 | - } |
|
32 | + public function __construct(array $items = null) |
|
33 | + { |
|
34 | + if (!is_null($items) && count($items) > 0) { |
|
35 | + $this->setItems($items); |
|
36 | + } |
|
37 | + } |
|
38 | 38 | |
39 | - public function addItem(PagSeguroParameterItem $parameterItem) |
|
40 | - { |
|
39 | + public function addItem(PagSeguroParameterItem $parameterItem) |
|
40 | + { |
|
41 | 41 | |
42 | - if (!PagSeguroHelper::isEmpty($parameterItem->getKey())) { |
|
43 | - if (!PagSeguroHelper::isEmpty($parameterItem->getValue())) { |
|
44 | - $this->items[] = $parameterItem; |
|
45 | - } else { |
|
46 | - die('requered parameterValue.'); |
|
47 | - } |
|
48 | - } else { |
|
49 | - die('requered parameterKey.'); |
|
50 | - } |
|
51 | - } |
|
42 | + if (!PagSeguroHelper::isEmpty($parameterItem->getKey())) { |
|
43 | + if (!PagSeguroHelper::isEmpty($parameterItem->getValue())) { |
|
44 | + $this->items[] = $parameterItem; |
|
45 | + } else { |
|
46 | + die('requered parameterValue.'); |
|
47 | + } |
|
48 | + } else { |
|
49 | + die('requered parameterKey.'); |
|
50 | + } |
|
51 | + } |
|
52 | 52 | |
53 | - public function setItems(array $items) |
|
54 | - { |
|
55 | - $this->items = $items; |
|
56 | - } |
|
53 | + public function setItems(array $items) |
|
54 | + { |
|
55 | + $this->items = $items; |
|
56 | + } |
|
57 | 57 | |
58 | - public function getItems() |
|
59 | - { |
|
60 | - if ($this->items == null) { |
|
61 | - $this->items = array(); |
|
62 | - } |
|
63 | - return $this->items; |
|
64 | - } |
|
58 | + public function getItems() |
|
59 | + { |
|
60 | + if ($this->items == null) { |
|
61 | + $this->items = array(); |
|
62 | + } |
|
63 | + return $this->items; |
|
64 | + } |
|
65 | 65 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function __construct(array $config = null) |
39 | 39 | { |
40 | - if (!is_null($config) && count($config) > 0) { |
|
40 | + if ( ! is_null($config) && count($config) > 0) { |
|
41 | 41 | $this->setConfig($config); |
42 | 42 | } |
43 | 43 | } |
@@ -27,45 +27,45 @@ |
||
27 | 27 | class PagSeguroPaymentMethodConfig |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * @var array |
32 | 32 | */ |
33 | - private $config; |
|
33 | + private $config; |
|
34 | 34 | |
35 | - /*** |
|
35 | + /*** |
|
36 | 36 | * @param array $config |
37 | 37 | */ |
38 | - public function __construct(array $config = null) |
|
39 | - { |
|
40 | - if (!is_null($config) && count($config) > 0) { |
|
41 | - $this->setConfig($config); |
|
42 | - } |
|
43 | - } |
|
38 | + public function __construct(array $config = null) |
|
39 | + { |
|
40 | + if (!is_null($config) && count($config) > 0) { |
|
41 | + $this->setConfig($config); |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - /*** |
|
45 | + /*** |
|
46 | 46 | * @param PagSeguroPaymentMethodConfigItem $configItem |
47 | 47 | */ |
48 | - public function addConfig(PagSeguroPaymentMethodConfigItem $configItem) |
|
49 | - { |
|
50 | - $this->config[] = $configItem; |
|
51 | - } |
|
48 | + public function addConfig(PagSeguroPaymentMethodConfigItem $configItem) |
|
49 | + { |
|
50 | + $this->config[] = $configItem; |
|
51 | + } |
|
52 | 52 | |
53 | - /*** |
|
53 | + /*** |
|
54 | 54 | * @param array $config |
55 | 55 | */ |
56 | - public function setConfig(array $config) |
|
57 | - { |
|
58 | - $this->config = $config; |
|
59 | - } |
|
56 | + public function setConfig(array $config) |
|
57 | + { |
|
58 | + $this->config = $config; |
|
59 | + } |
|
60 | 60 | |
61 | - /*** |
|
61 | + /*** |
|
62 | 62 | * @return array |
63 | 63 | */ |
64 | - public function getConfig() |
|
65 | - { |
|
66 | - if ($this->config == null) { |
|
67 | - $this->config = array(); |
|
68 | - } |
|
69 | - return $this->config; |
|
70 | - } |
|
64 | + public function getConfig() |
|
65 | + { |
|
66 | + if ($this->config == null) { |
|
67 | + $this->config = array(); |
|
68 | + } |
|
69 | + return $this->config; |
|
70 | + } |
|
71 | 71 | } |
@@ -50,13 +50,13 @@ |
||
50 | 50 | public function __construct($group = null, $value = null, $key = null) |
51 | 51 | { |
52 | 52 | |
53 | - if (isset($key) && !PagSeguroHelper::isEmpty($key)) { |
|
53 | + if (isset($key) && ! PagSeguroHelper::isEmpty($key)) { |
|
54 | 54 | $this->setKey($key); |
55 | 55 | } |
56 | - if (isset($value) && !PagSeguroHelper::isEmpty($value)) { |
|
56 | + if (isset($value) && ! PagSeguroHelper::isEmpty($value)) { |
|
57 | 57 | $this->setValue($value); |
58 | 58 | } |
59 | - if (isset($group) && !PagSeguroHelper::isEmpty($group)) { |
|
59 | + if (isset($group) && ! PagSeguroHelper::isEmpty($group)) { |
|
60 | 60 | $this->setGroup($group); |
61 | 61 | } |
62 | 62 | } |
@@ -27,95 +27,95 @@ |
||
27 | 27 | class PagSeguroPaymentMethodConfigItem |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * Allow add extra information to order |
32 | 32 | * |
33 | 33 | * @var string |
34 | 34 | */ |
35 | - private $key; |
|
35 | + private $key; |
|
36 | 36 | |
37 | - /*** |
|
37 | + /*** |
|
38 | 38 | * Value of corresponding key |
39 | 39 | * |
40 | 40 | * @var mixed |
41 | 41 | */ |
42 | - private $value; |
|
42 | + private $value; |
|
43 | 43 | |
44 | - /*** |
|
44 | + /*** |
|
45 | 45 | * Used for grouping values of payment method configuration |
46 | 46 | * @var mixed |
47 | 47 | */ |
48 | - private $group; |
|
48 | + private $group; |
|
49 | 49 | |
50 | - public function __construct($group = null, $value = null, $key = null) |
|
51 | - { |
|
50 | + public function __construct($group = null, $value = null, $key = null) |
|
51 | + { |
|
52 | 52 | |
53 | - if (isset($key) && !PagSeguroHelper::isEmpty($key)) { |
|
54 | - $this->setKey($key); |
|
55 | - } |
|
56 | - if (isset($value) && !PagSeguroHelper::isEmpty($value)) { |
|
57 | - $this->setValue($value); |
|
58 | - } |
|
59 | - if (isset($group) && !PagSeguroHelper::isEmpty($group)) { |
|
60 | - $this->setGroup($group); |
|
61 | - } |
|
62 | - } |
|
53 | + if (isset($key) && !PagSeguroHelper::isEmpty($key)) { |
|
54 | + $this->setKey($key); |
|
55 | + } |
|
56 | + if (isset($value) && !PagSeguroHelper::isEmpty($value)) { |
|
57 | + $this->setValue($value); |
|
58 | + } |
|
59 | + if (isset($group) && !PagSeguroHelper::isEmpty($group)) { |
|
60 | + $this->setGroup($group); |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | - /*** |
|
64 | + /*** |
|
65 | 65 | * Gets the payment method config item key |
66 | 66 | * @return string |
67 | 67 | */ |
68 | - public function getKey() |
|
69 | - { |
|
70 | - return $this->key; |
|
71 | - } |
|
68 | + public function getKey() |
|
69 | + { |
|
70 | + return $this->key; |
|
71 | + } |
|
72 | 72 | |
73 | - /*** |
|
73 | + /*** |
|
74 | 74 | * Sets the payment method config item key |
75 | 75 | * |
76 | 76 | * @param string $key |
77 | 77 | */ |
78 | - public function setKey($key) |
|
79 | - { |
|
80 | - $this->key = $key; |
|
81 | - } |
|
78 | + public function setKey($key) |
|
79 | + { |
|
80 | + $this->key = $key; |
|
81 | + } |
|
82 | 82 | |
83 | - /*** |
|
83 | + /*** |
|
84 | 84 | * Gets payment method config item value |
85 | 85 | * @return string |
86 | 86 | */ |
87 | - public function getValue() |
|
88 | - { |
|
89 | - return $this->value; |
|
90 | - } |
|
87 | + public function getValue() |
|
88 | + { |
|
89 | + return $this->value; |
|
90 | + } |
|
91 | 91 | |
92 | - /*** |
|
92 | + /*** |
|
93 | 93 | * Sets payment method config item value |
94 | 94 | * |
95 | 95 | * @param string $value |
96 | 96 | */ |
97 | - public function setValue($value) |
|
98 | - { |
|
99 | - $this->value = PagSeguroHelper::decimalFormat($value); |
|
100 | - } |
|
97 | + public function setValue($value) |
|
98 | + { |
|
99 | + $this->value = PagSeguroHelper::decimalFormat($value); |
|
100 | + } |
|
101 | 101 | |
102 | - /*** |
|
102 | + /*** |
|
103 | 103 | * Gets payment method config item group |
104 | 104 | * |
105 | 105 | * @return int |
106 | 106 | */ |
107 | - public function getGroup() |
|
108 | - { |
|
109 | - return $this->group; |
|
110 | - } |
|
107 | + public function getGroup() |
|
108 | + { |
|
109 | + return $this->group; |
|
110 | + } |
|
111 | 111 | |
112 | - /*** |
|
112 | + /*** |
|
113 | 113 | * Sets payment method config item group |
114 | 114 | * |
115 | 115 | * @param int $group |
116 | 116 | */ |
117 | - public function setGroup($group) |
|
118 | - { |
|
119 | - $this->group = $group; |
|
120 | - } |
|
117 | + public function setGroup($group) |
|
118 | + { |
|
119 | + $this->group = $group; |
|
120 | + } |
|
121 | 121 | } |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | public function addPaymentMethodConfig($itemGroup, $itemValue, $itemKey) |
612 | 612 | { |
613 | 613 | $this->getPaymentMethodConfig()->addConfig( |
614 | - new PagSeguroPaymentMethodConfigItem($itemGroup,$itemValue,$itemKey) |
|
614 | + new PagSeguroPaymentMethodConfigItem($itemGroup, $itemValue, $itemKey) |
|
615 | 615 | ); |
616 | 616 | } |
617 | 617 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | $request['Reference'] = $this->reference; |
685 | 685 | $request['SenderEmail'] = $email; |
686 | 686 | |
687 | - return "PagSeguroPaymentRequest: " . var_export($request, true); |
|
687 | + return "PagSeguroPaymentRequest: ".var_export($request, true); |
|
688 | 688 | } |
689 | 689 | |
690 | 690 | /*** |
@@ -27,111 +27,111 @@ discard block |
||
27 | 27 | class PagSeguroPaymentRequest |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * Party that will be sending the money |
32 | 32 | * @var PagSeguroSender |
33 | 33 | */ |
34 | - private $sender; |
|
34 | + private $sender; |
|
35 | 35 | |
36 | - /*** |
|
36 | + /*** |
|
37 | 37 | * Payment currency |
38 | 38 | */ |
39 | - private $currency; |
|
39 | + private $currency; |
|
40 | 40 | |
41 | - /*** |
|
41 | + /*** |
|
42 | 42 | * Products/items in this payment request |
43 | 43 | */ |
44 | - private $items; |
|
44 | + private $items; |
|
45 | 45 | |
46 | - /*** |
|
46 | + /*** |
|
47 | 47 | * Uri to where the PagSeguro payment page should redirect the user after the payment information is processed. |
48 | 48 | * Typically this is a confirmation page on your web site. |
49 | 49 | * @var String |
50 | 50 | */ |
51 | - private $redirectURL; |
|
51 | + private $redirectURL; |
|
52 | 52 | |
53 | - /*** |
|
53 | + /*** |
|
54 | 54 | * Extra amount to be added to the transaction total |
55 | 55 | * |
56 | 56 | * This value can be used to add an extra charge to the transaction |
57 | 57 | * or provide a discount in the case ExtraAmount is a negative value. |
58 | 58 | * @var float |
59 | 59 | */ |
60 | - private $extraAmount; |
|
60 | + private $extraAmount; |
|
61 | 61 | |
62 | - /*** |
|
62 | + /*** |
|
63 | 63 | * Reference code |
64 | 64 | * |
65 | 65 | * Optional. You can use the reference code to store an identifier so you can |
66 | 66 | * associate the PagSeguro transaction to a transaction in your system. |
67 | 67 | */ |
68 | - private $reference; |
|
68 | + private $reference; |
|
69 | 69 | |
70 | - /*** |
|
70 | + /*** |
|
71 | 71 | * Shipping information associated with this payment request |
72 | 72 | */ |
73 | - private $shipping; |
|
73 | + private $shipping; |
|
74 | 74 | |
75 | - /*** |
|
75 | + /*** |
|
76 | 76 | * How long this payment request will remain valid, in seconds. |
77 | 77 | * |
78 | 78 | * Optional. After this payment request is submitted, the payment code returned |
79 | 79 | * will remain valid for the period specified here. |
80 | 80 | */ |
81 | - private $maxAge; |
|
81 | + private $maxAge; |
|
82 | 82 | |
83 | - /*** |
|
83 | + /*** |
|
84 | 84 | * How many times the payment redirect uri returned by the payment web service can be accessed. |
85 | 85 | * |
86 | 86 | * Optional. After this payment request is submitted, the payment redirect uri returned by |
87 | 87 | * the payment web service will remain valid for the number of uses specified here. |
88 | 88 | */ |
89 | - private $maxUses; |
|
89 | + private $maxUses; |
|
90 | 90 | |
91 | - /*** |
|
91 | + /*** |
|
92 | 92 | * Determines for which url PagSeguro will send the order related notifications codes. |
93 | 93 | * |
94 | 94 | * Optional. Any change happens in the transaction status, a new notification request will be send |
95 | 95 | * to this url. You can use that for update the related order. |
96 | 96 | */ |
97 | - private $notificationURL; |
|
97 | + private $notificationURL; |
|
98 | 98 | |
99 | - /*** |
|
99 | + /*** |
|
100 | 100 | * Extra parameters that user can add to a PagSeguro checkout request |
101 | 101 | * |
102 | 102 | * Optional. |
103 | 103 | * @var PagSeguroMetaData |
104 | 104 | */ |
105 | - private $metadata; |
|
105 | + private $metadata; |
|
106 | 106 | |
107 | - /*** |
|
107 | + /*** |
|
108 | 108 | * Extra parameters that user can add to a PagSeguro checkout request |
109 | 109 | * |
110 | 110 | * Optional. |
111 | 111 | * @var $paymentMethodConfig |
112 | 112 | */ |
113 | - private $paymentMethodConfig; |
|
113 | + private $paymentMethodConfig; |
|
114 | 114 | |
115 | - /*** |
|
115 | + /*** |
|
116 | 116 | * Extra parameters that user can add to a PagSeguro checkout request |
117 | 117 | * |
118 | 118 | * Optional |
119 | 119 | * @var PagSeguroParameter |
120 | 120 | */ |
121 | - private $parameter; |
|
121 | + private $parameter; |
|
122 | 122 | |
123 | - /*** |
|
123 | + /*** |
|
124 | 124 | * @return PagSeguroSender the sender |
125 | 125 | * |
126 | 126 | * Party that will be sending the Uri to where the PagSeguro payment page should redirect the |
127 | 127 | * user after the payment information is processed. |
128 | 128 | */ |
129 | - public function getSender() |
|
130 | - { |
|
131 | - return $this->sender; |
|
132 | - } |
|
129 | + public function getSender() |
|
130 | + { |
|
131 | + return $this->sender; |
|
132 | + } |
|
133 | 133 | |
134 | - /*** |
|
134 | + /*** |
|
135 | 135 | * Sets the Sender, party that will be sending the money |
136 | 136 | * @param String $name |
137 | 137 | * @param String $email |
@@ -140,120 +140,120 @@ discard block |
||
140 | 140 | * @param String $documentType |
141 | 141 | * @param String $documentValue |
142 | 142 | */ |
143 | - public function setSender( |
|
144 | - $name, |
|
145 | - $email = null, |
|
146 | - $areaCode = null, |
|
147 | - $number = null, |
|
148 | - $documentType = null, |
|
149 | - $documentValue = null |
|
150 | - ) { |
|
151 | - $param = $name; |
|
152 | - if (is_array($param)) { |
|
153 | - $this->sender = new PagSeguroSender($param); |
|
154 | - } elseif ($param instanceof PagSeguroSender) { |
|
155 | - $this->sender = $param; |
|
156 | - } else { |
|
157 | - $sender = new PagSeguroSender(); |
|
158 | - $sender->setName($param); |
|
159 | - $sender->setEmail($email); |
|
160 | - $sender->setPhone(new PagSeguroPhone($areaCode, $number)); |
|
161 | - $sender->addDocument($documentType, $documentValue); |
|
162 | - $this->sender = $sender; |
|
163 | - } |
|
164 | - } |
|
165 | - |
|
166 | - /*** |
|
143 | + public function setSender( |
|
144 | + $name, |
|
145 | + $email = null, |
|
146 | + $areaCode = null, |
|
147 | + $number = null, |
|
148 | + $documentType = null, |
|
149 | + $documentValue = null |
|
150 | + ) { |
|
151 | + $param = $name; |
|
152 | + if (is_array($param)) { |
|
153 | + $this->sender = new PagSeguroSender($param); |
|
154 | + } elseif ($param instanceof PagSeguroSender) { |
|
155 | + $this->sender = $param; |
|
156 | + } else { |
|
157 | + $sender = new PagSeguroSender(); |
|
158 | + $sender->setName($param); |
|
159 | + $sender->setEmail($email); |
|
160 | + $sender->setPhone(new PagSeguroPhone($areaCode, $number)); |
|
161 | + $sender->addDocument($documentType, $documentValue); |
|
162 | + $this->sender = $sender; |
|
163 | + } |
|
164 | + } |
|
165 | + |
|
166 | + /*** |
|
167 | 167 | * Sets the name of the sender, party that will be sending the money |
168 | 168 | * @param String $senderName |
169 | 169 | */ |
170 | - public function setSenderName($senderName) |
|
171 | - { |
|
172 | - if ($this->sender == null) { |
|
173 | - $this->sender = new PagSeguroSender(); |
|
174 | - } |
|
175 | - $this->sender->setName($senderName); |
|
176 | - } |
|
170 | + public function setSenderName($senderName) |
|
171 | + { |
|
172 | + if ($this->sender == null) { |
|
173 | + $this->sender = new PagSeguroSender(); |
|
174 | + } |
|
175 | + $this->sender->setName($senderName); |
|
176 | + } |
|
177 | 177 | |
178 | - /*** |
|
178 | + /*** |
|
179 | 179 | * Sets the name of the sender, party that will be sending the money |
180 | 180 | * @param String $senderEmail |
181 | 181 | */ |
182 | - public function setSenderEmail($senderEmail) |
|
183 | - { |
|
184 | - if ($this->sender == null) { |
|
185 | - $this->sender = new PagSeguroSender(); |
|
186 | - } |
|
187 | - $this->sender->setEmail($senderEmail); |
|
188 | - } |
|
182 | + public function setSenderEmail($senderEmail) |
|
183 | + { |
|
184 | + if ($this->sender == null) { |
|
185 | + $this->sender = new PagSeguroSender(); |
|
186 | + } |
|
187 | + $this->sender->setEmail($senderEmail); |
|
188 | + } |
|
189 | 189 | |
190 | - /*** |
|
190 | + /*** |
|
191 | 191 | * Sets the Sender phone number, phone of the party that will be sending the money |
192 | 192 | * |
193 | 193 | * @param areaCode |
194 | 194 | * @param number |
195 | 195 | */ |
196 | - public function setSenderPhone($areaCode, $number = null) |
|
197 | - { |
|
198 | - $param = $areaCode; |
|
199 | - if ($this->sender == null) { |
|
200 | - $this->sender = new PagSeguroSender(); |
|
201 | - } |
|
202 | - if ($param instanceof PagSeguroPhone) { |
|
203 | - $this->sender->setPhone($param); |
|
204 | - } else { |
|
205 | - $this->sender->setPhone(new PagSeguroPhone($param, $number)); |
|
206 | - } |
|
207 | - } |
|
208 | - |
|
209 | - /*** |
|
196 | + public function setSenderPhone($areaCode, $number = null) |
|
197 | + { |
|
198 | + $param = $areaCode; |
|
199 | + if ($this->sender == null) { |
|
200 | + $this->sender = new PagSeguroSender(); |
|
201 | + } |
|
202 | + if ($param instanceof PagSeguroPhone) { |
|
203 | + $this->sender->setPhone($param); |
|
204 | + } else { |
|
205 | + $this->sender->setPhone(new PagSeguroPhone($param, $number)); |
|
206 | + } |
|
207 | + } |
|
208 | + |
|
209 | + /*** |
|
210 | 210 | * @return String the currency |
211 | 211 | * Example: BRL |
212 | 212 | */ |
213 | - public function getCurrency() |
|
214 | - { |
|
215 | - return $this->currency; |
|
216 | - } |
|
213 | + public function getCurrency() |
|
214 | + { |
|
215 | + return $this->currency; |
|
216 | + } |
|
217 | 217 | |
218 | - /*** |
|
218 | + /*** |
|
219 | 219 | * Sets the currency |
220 | 220 | * @param String $currency |
221 | 221 | */ |
222 | - public function setCurrency($currency) |
|
223 | - { |
|
224 | - $this->currency = $currency; |
|
225 | - } |
|
222 | + public function setCurrency($currency) |
|
223 | + { |
|
224 | + $this->currency = $currency; |
|
225 | + } |
|
226 | 226 | |
227 | - /*** |
|
227 | + /*** |
|
228 | 228 | * @return array the items/products list in this payment request |
229 | 229 | */ |
230 | - public function getItems() |
|
231 | - { |
|
232 | - return $this->items; |
|
233 | - } |
|
230 | + public function getItems() |
|
231 | + { |
|
232 | + return $this->items; |
|
233 | + } |
|
234 | 234 | |
235 | - /*** |
|
235 | + /*** |
|
236 | 236 | * Sets the items/products list in this payment request |
237 | 237 | * @param array $items |
238 | 238 | */ |
239 | - public function setItems(array $items) |
|
240 | - { |
|
241 | - if (is_array($items)) { |
|
242 | - $i = array(); |
|
243 | - foreach ($items as $key => $item) { |
|
244 | - if ($item instanceof PagSeguroItem) { |
|
245 | - $i[$key] = $item; |
|
246 | - } else { |
|
247 | - if (is_array($item)) { |
|
248 | - $i[$key] = new PagSeguroItem($item); |
|
249 | - } |
|
250 | - } |
|
251 | - } |
|
252 | - $this->items = $i; |
|
253 | - } |
|
254 | - } |
|
255 | - |
|
256 | - /*** |
|
239 | + public function setItems(array $items) |
|
240 | + { |
|
241 | + if (is_array($items)) { |
|
242 | + $i = array(); |
|
243 | + foreach ($items as $key => $item) { |
|
244 | + if ($item instanceof PagSeguroItem) { |
|
245 | + $i[$key] = $item; |
|
246 | + } else { |
|
247 | + if (is_array($item)) { |
|
248 | + $i[$key] = new PagSeguroItem($item); |
|
249 | + } |
|
250 | + } |
|
251 | + } |
|
252 | + $this->items = $i; |
|
253 | + } |
|
254 | + } |
|
255 | + |
|
256 | + /*** |
|
257 | 257 | * Adds a new product/item in this payment request |
258 | 258 | * |
259 | 259 | * @param String $id |
@@ -263,55 +263,55 @@ discard block |
||
263 | 263 | * @param String $weight |
264 | 264 | * @param String $shippingCost |
265 | 265 | */ |
266 | - public function addItem( |
|
267 | - $id, |
|
268 | - $description = null, |
|
269 | - $quantity = null, |
|
270 | - $amount = null, |
|
271 | - $weight = null, |
|
272 | - $shippingCost = null |
|
273 | - ) { |
|
274 | - $param = $id; |
|
275 | - if ($this->items == null) { |
|
276 | - $this->items = array(); |
|
277 | - } |
|
278 | - if (is_array($param)) { |
|
279 | - array_push($this->items, new PagSeguroItem($param)); |
|
280 | - } else { |
|
281 | - if ($param instanceof PagSeguroItem) { |
|
282 | - array_push($this->items, $param); |
|
283 | - } else { |
|
284 | - $item = new PagSeguroItem(); |
|
285 | - $item->setId($param); |
|
286 | - $item->setDescription($description); |
|
287 | - $item->setQuantity($quantity); |
|
288 | - $item->setAmount($amount); |
|
289 | - $item->setWeight($weight); |
|
290 | - $item->setShippingCost($shippingCost); |
|
291 | - array_push($this->items, $item); |
|
292 | - } |
|
293 | - } |
|
294 | - } |
|
295 | - |
|
296 | - public function addSenderDocument($type, $value) |
|
297 | - { |
|
298 | - if ($this->getSender() instanceof PagSeguroSender) { |
|
299 | - $this->getSender()->addDocument($type, $value); |
|
300 | - } |
|
301 | - } |
|
302 | - |
|
303 | - /*** |
|
266 | + public function addItem( |
|
267 | + $id, |
|
268 | + $description = null, |
|
269 | + $quantity = null, |
|
270 | + $amount = null, |
|
271 | + $weight = null, |
|
272 | + $shippingCost = null |
|
273 | + ) { |
|
274 | + $param = $id; |
|
275 | + if ($this->items == null) { |
|
276 | + $this->items = array(); |
|
277 | + } |
|
278 | + if (is_array($param)) { |
|
279 | + array_push($this->items, new PagSeguroItem($param)); |
|
280 | + } else { |
|
281 | + if ($param instanceof PagSeguroItem) { |
|
282 | + array_push($this->items, $param); |
|
283 | + } else { |
|
284 | + $item = new PagSeguroItem(); |
|
285 | + $item->setId($param); |
|
286 | + $item->setDescription($description); |
|
287 | + $item->setQuantity($quantity); |
|
288 | + $item->setAmount($amount); |
|
289 | + $item->setWeight($weight); |
|
290 | + $item->setShippingCost($shippingCost); |
|
291 | + array_push($this->items, $item); |
|
292 | + } |
|
293 | + } |
|
294 | + } |
|
295 | + |
|
296 | + public function addSenderDocument($type, $value) |
|
297 | + { |
|
298 | + if ($this->getSender() instanceof PagSeguroSender) { |
|
299 | + $this->getSender()->addDocument($type, $value); |
|
300 | + } |
|
301 | + } |
|
302 | + |
|
303 | + /*** |
|
304 | 304 | * URI to where the PagSeguro payment page should redirect the user after the payment information is processed. |
305 | 305 | * Typically this is a confirmation page on your web site. |
306 | 306 | * |
307 | 307 | * @return String the redirectURL |
308 | 308 | */ |
309 | - public function getRedirectURL() |
|
310 | - { |
|
311 | - return $this->redirectURL; |
|
312 | - } |
|
309 | + public function getRedirectURL() |
|
310 | + { |
|
311 | + return $this->redirectURL; |
|
312 | + } |
|
313 | 313 | |
314 | - /*** |
|
314 | + /*** |
|
315 | 315 | * Sets the redirect URL |
316 | 316 | * |
317 | 317 | * Uri to where the PagSeguro payment page should redirect the user after the payment information is processed. |
@@ -319,91 +319,91 @@ discard block |
||
319 | 319 | * |
320 | 320 | * @param String $redirectURL |
321 | 321 | */ |
322 | - public function setRedirectURL($redirectURL) |
|
323 | - { |
|
324 | - $this->redirectURL = $this->verifyURLTest($redirectURL); |
|
325 | - } |
|
322 | + public function setRedirectURL($redirectURL) |
|
323 | + { |
|
324 | + $this->redirectURL = $this->verifyURLTest($redirectURL); |
|
325 | + } |
|
326 | 326 | |
327 | - /*** |
|
327 | + /*** |
|
328 | 328 | * This value can be used to add an extra charge to the transaction |
329 | 329 | * or provide a discount in the case ExtraAmount is a negative value. |
330 | 330 | * |
331 | 331 | * @return float the extra amount |
332 | 332 | */ |
333 | - public function getExtraAmount() |
|
334 | - { |
|
335 | - return $this->extraAmount; |
|
336 | - } |
|
333 | + public function getExtraAmount() |
|
334 | + { |
|
335 | + return $this->extraAmount; |
|
336 | + } |
|
337 | 337 | |
338 | - /*** |
|
338 | + /*** |
|
339 | 339 | * Sets the extra amount |
340 | 340 | * This value can be used to add an extra charge to the transaction |
341 | 341 | * or provide a discount in the case <b>extraAmount</b> is a negative value. |
342 | 342 | * |
343 | 343 | * @param extraAmount |
344 | 344 | */ |
345 | - public function setExtraAmount($extraAmount) |
|
346 | - { |
|
347 | - $this->extraAmount = $extraAmount; |
|
348 | - } |
|
345 | + public function setExtraAmount($extraAmount) |
|
346 | + { |
|
347 | + $this->extraAmount = $extraAmount; |
|
348 | + } |
|
349 | 349 | |
350 | - /*** |
|
350 | + /*** |
|
351 | 351 | * @return mixed the reference of this payment request |
352 | 352 | */ |
353 | - public function getReference() |
|
354 | - { |
|
355 | - return $this->reference; |
|
356 | - } |
|
353 | + public function getReference() |
|
354 | + { |
|
355 | + return $this->reference; |
|
356 | + } |
|
357 | 357 | |
358 | - /*** |
|
358 | + /*** |
|
359 | 359 | * Sets the reference of this payment request |
360 | 360 | * @param reference |
361 | 361 | */ |
362 | - public function setReference($reference) |
|
363 | - { |
|
364 | - $this->reference = $reference; |
|
365 | - } |
|
362 | + public function setReference($reference) |
|
363 | + { |
|
364 | + $this->reference = $reference; |
|
365 | + } |
|
366 | 366 | |
367 | - /*** |
|
367 | + /*** |
|
368 | 368 | * @return PagSeguroShipping the shipping information for this payment request |
369 | 369 | * @see PagSeguroShipping |
370 | 370 | */ |
371 | - public function getShipping() |
|
372 | - { |
|
373 | - return $this->shipping; |
|
374 | - } |
|
371 | + public function getShipping() |
|
372 | + { |
|
373 | + return $this->shipping; |
|
374 | + } |
|
375 | 375 | |
376 | - /*** |
|
376 | + /*** |
|
377 | 377 | * Sets the shipping information for this payment request |
378 | 378 | * @param PagSeguroShipping $address |
379 | 379 | * @param PagSeguroShippingType $type |
380 | 380 | */ |
381 | - public function setShipping($address, $type = null) |
|
382 | - { |
|
383 | - $param = $address; |
|
384 | - if ($param instanceof PagSeguroShipping) { |
|
385 | - $this->shipping = $param; |
|
386 | - } else { |
|
387 | - $shipping = new PagSeguroShipping(); |
|
388 | - if (is_array($param)) { |
|
389 | - $shipping->setAddress(new PagSeguroAddress($param)); |
|
390 | - } else { |
|
391 | - if ($param instanceof PagSeguroAddress) { |
|
392 | - $shipping->setAddress($param); |
|
393 | - } |
|
394 | - } |
|
395 | - if ($type) { |
|
396 | - if ($type instanceof PagSeguroShippingType) { |
|
397 | - $shipping->setType($type); |
|
398 | - } else { |
|
399 | - $shipping->setType(new PagSeguroShippingType($type)); |
|
400 | - } |
|
401 | - } |
|
402 | - $this->shipping = $shipping; |
|
403 | - } |
|
404 | - } |
|
405 | - |
|
406 | - /*** |
|
381 | + public function setShipping($address, $type = null) |
|
382 | + { |
|
383 | + $param = $address; |
|
384 | + if ($param instanceof PagSeguroShipping) { |
|
385 | + $this->shipping = $param; |
|
386 | + } else { |
|
387 | + $shipping = new PagSeguroShipping(); |
|
388 | + if (is_array($param)) { |
|
389 | + $shipping->setAddress(new PagSeguroAddress($param)); |
|
390 | + } else { |
|
391 | + if ($param instanceof PagSeguroAddress) { |
|
392 | + $shipping->setAddress($param); |
|
393 | + } |
|
394 | + } |
|
395 | + if ($type) { |
|
396 | + if ($type instanceof PagSeguroShippingType) { |
|
397 | + $shipping->setType($type); |
|
398 | + } else { |
|
399 | + $shipping->setType(new PagSeguroShippingType($type)); |
|
400 | + } |
|
401 | + } |
|
402 | + $this->shipping = $shipping; |
|
403 | + } |
|
404 | + } |
|
405 | + |
|
406 | + /*** |
|
407 | 407 | * Sets the shipping address for this payment request |
408 | 408 | * @param String $postalCode |
409 | 409 | * @param String $street |
@@ -414,104 +414,104 @@ discard block |
||
414 | 414 | * @param String $state |
415 | 415 | * @param String $country |
416 | 416 | */ |
417 | - public function setShippingAddress( |
|
418 | - $postalCode = null, |
|
419 | - $street = null, |
|
420 | - $number = null, |
|
421 | - $complement = null, |
|
422 | - $district = null, |
|
423 | - $city = null, |
|
424 | - $state = null, |
|
425 | - $country = null |
|
426 | - ) { |
|
427 | - $param = $postalCode; |
|
428 | - if ($this->shipping == null) { |
|
429 | - $this->shipping = new PagSeguroShipping(); |
|
430 | - } |
|
431 | - if (is_array($param)) { |
|
432 | - $this->shipping->setAddress(new PagSeguroAddress($param)); |
|
433 | - } elseif ($param instanceof PagSeguroAddress) { |
|
434 | - $this->shipping->setAddress($param); |
|
435 | - } else { |
|
436 | - $address = new PagSeguroAddress(); |
|
437 | - $address->setPostalCode($postalCode); |
|
438 | - $address->setStreet($street); |
|
439 | - $address->setNumber($number); |
|
440 | - $address->setComplement($complement); |
|
441 | - $address->setDistrict($district); |
|
442 | - $address->setCity($city); |
|
443 | - $address->setState($state); |
|
444 | - $address->setCountry($country); |
|
445 | - $this->shipping->setAddress($address); |
|
446 | - } |
|
447 | - } |
|
448 | - |
|
449 | - /*** |
|
417 | + public function setShippingAddress( |
|
418 | + $postalCode = null, |
|
419 | + $street = null, |
|
420 | + $number = null, |
|
421 | + $complement = null, |
|
422 | + $district = null, |
|
423 | + $city = null, |
|
424 | + $state = null, |
|
425 | + $country = null |
|
426 | + ) { |
|
427 | + $param = $postalCode; |
|
428 | + if ($this->shipping == null) { |
|
429 | + $this->shipping = new PagSeguroShipping(); |
|
430 | + } |
|
431 | + if (is_array($param)) { |
|
432 | + $this->shipping->setAddress(new PagSeguroAddress($param)); |
|
433 | + } elseif ($param instanceof PagSeguroAddress) { |
|
434 | + $this->shipping->setAddress($param); |
|
435 | + } else { |
|
436 | + $address = new PagSeguroAddress(); |
|
437 | + $address->setPostalCode($postalCode); |
|
438 | + $address->setStreet($street); |
|
439 | + $address->setNumber($number); |
|
440 | + $address->setComplement($complement); |
|
441 | + $address->setDistrict($district); |
|
442 | + $address->setCity($city); |
|
443 | + $address->setState($state); |
|
444 | + $address->setCountry($country); |
|
445 | + $this->shipping->setAddress($address); |
|
446 | + } |
|
447 | + } |
|
448 | + |
|
449 | + /*** |
|
450 | 450 | * Sets the shipping type for this payment request |
451 | 451 | * @param PagSeguroShippingType $type |
452 | 452 | */ |
453 | - public function setShippingType($type) |
|
454 | - { |
|
455 | - $param = $type; |
|
456 | - if ($this->shipping == null) { |
|
457 | - $this->shipping = new PagSeguroShipping(); |
|
458 | - } |
|
459 | - if ($param instanceof PagSeguroShippingType) { |
|
460 | - $this->shipping->setType($param); |
|
461 | - } else { |
|
462 | - $this->shipping->setType(new PagSeguroShippingType($param)); |
|
463 | - } |
|
464 | - } |
|
465 | - |
|
466 | - /*** |
|
453 | + public function setShippingType($type) |
|
454 | + { |
|
455 | + $param = $type; |
|
456 | + if ($this->shipping == null) { |
|
457 | + $this->shipping = new PagSeguroShipping(); |
|
458 | + } |
|
459 | + if ($param instanceof PagSeguroShippingType) { |
|
460 | + $this->shipping->setType($param); |
|
461 | + } else { |
|
462 | + $this->shipping->setType(new PagSeguroShippingType($param)); |
|
463 | + } |
|
464 | + } |
|
465 | + |
|
466 | + /*** |
|
467 | 467 | * Sets the shipping cost for this payment request |
468 | 468 | * @param float $shippingCost |
469 | 469 | */ |
470 | - public function setShippingCost($shippingCost) |
|
471 | - { |
|
472 | - $param = $shippingCost; |
|
473 | - if ($this->shipping == null) { |
|
474 | - $this->shipping = new PagSeguroShipping(); |
|
475 | - } |
|
470 | + public function setShippingCost($shippingCost) |
|
471 | + { |
|
472 | + $param = $shippingCost; |
|
473 | + if ($this->shipping == null) { |
|
474 | + $this->shipping = new PagSeguroShipping(); |
|
475 | + } |
|
476 | 476 | |
477 | - $this->shipping->setCost($param); |
|
478 | - } |
|
477 | + $this->shipping->setCost($param); |
|
478 | + } |
|
479 | 479 | |
480 | - /*** |
|
480 | + /*** |
|
481 | 481 | * @return integer the max age of this payment request |
482 | 482 | * |
483 | 483 | * After this payment request is submitted, the payment code returned |
484 | 484 | * will remain valid for the period specified. |
485 | 485 | */ |
486 | - public function getMaxAge() |
|
487 | - { |
|
488 | - return $this->maxAge; |
|
489 | - } |
|
486 | + public function getMaxAge() |
|
487 | + { |
|
488 | + return $this->maxAge; |
|
489 | + } |
|
490 | 490 | |
491 | - /*** |
|
491 | + /*** |
|
492 | 492 | * Sets the max age of this payment request |
493 | 493 | * After this payment request is submitted, the payment code returned |
494 | 494 | * will remain valid for the period specified here. |
495 | 495 | * |
496 | 496 | * @param maxAge |
497 | 497 | */ |
498 | - public function setMaxAge($maxAge) |
|
499 | - { |
|
500 | - $this->maxAge = $maxAge; |
|
501 | - } |
|
498 | + public function setMaxAge($maxAge) |
|
499 | + { |
|
500 | + $this->maxAge = $maxAge; |
|
501 | + } |
|
502 | 502 | |
503 | - /*** |
|
503 | + /*** |
|
504 | 504 | * After this payment request is submitted, the payment redirect uri returned by |
505 | 505 | * the payment web service will remain valid for the number of uses specified here. |
506 | 506 | * |
507 | 507 | * @return integer the max uses configured for this payment request |
508 | 508 | */ |
509 | - public function getMaxUses() |
|
510 | - { |
|
511 | - return $this->maxUses; |
|
512 | - } |
|
509 | + public function getMaxUses() |
|
510 | + { |
|
511 | + return $this->maxUses; |
|
512 | + } |
|
513 | 513 | |
514 | - /*** |
|
514 | + /*** |
|
515 | 515 | * Sets the max uses of this payment request |
516 | 516 | * |
517 | 517 | * After this payment request is submitted, the payment redirect uri returned by |
@@ -519,197 +519,197 @@ discard block |
||
519 | 519 | * |
520 | 520 | * @param maxUses |
521 | 521 | */ |
522 | - public function setMaxUses($maxUses) |
|
523 | - { |
|
524 | - $this->maxUses = $maxUses; |
|
525 | - } |
|
522 | + public function setMaxUses($maxUses) |
|
523 | + { |
|
524 | + $this->maxUses = $maxUses; |
|
525 | + } |
|
526 | 526 | |
527 | - /*** |
|
527 | + /*** |
|
528 | 528 | * Get the notification status url |
529 | 529 | * |
530 | 530 | * @return String |
531 | 531 | */ |
532 | - public function getNotificationURL() |
|
533 | - { |
|
534 | - return $this->notificationURL; |
|
535 | - } |
|
532 | + public function getNotificationURL() |
|
533 | + { |
|
534 | + return $this->notificationURL; |
|
535 | + } |
|
536 | 536 | |
537 | - /*** |
|
537 | + /*** |
|
538 | 538 | * Sets the url that PagSeguro will send the new notifications statuses |
539 | 539 | * |
540 | 540 | * @param String $notificationURL |
541 | 541 | */ |
542 | - public function setNotificationURL($notificationURL) |
|
543 | - { |
|
544 | - $this->notificationURL = $this->verifyURLTest($notificationURL); |
|
545 | - } |
|
542 | + public function setNotificationURL($notificationURL) |
|
543 | + { |
|
544 | + $this->notificationURL = $this->verifyURLTest($notificationURL); |
|
545 | + } |
|
546 | 546 | |
547 | - /*** |
|
547 | + /*** |
|
548 | 548 | * Sets metadata for PagSeguro checkout requests |
549 | 549 | * |
550 | 550 | * @param PagSeguroMetaData $metaData |
551 | 551 | */ |
552 | - public function setMetaData($metaData) |
|
553 | - { |
|
554 | - $this->metadata = $metaData; |
|
555 | - } |
|
552 | + public function setMetaData($metaData) |
|
553 | + { |
|
554 | + $this->metadata = $metaData; |
|
555 | + } |
|
556 | 556 | |
557 | - /*** |
|
557 | + /*** |
|
558 | 558 | * Gets metadata for PagSeguro checkout requests |
559 | 559 | * |
560 | 560 | * @return PagSeguroMetaData $metaData |
561 | 561 | */ |
562 | - public function getMetaData() |
|
563 | - { |
|
562 | + public function getMetaData() |
|
563 | + { |
|
564 | 564 | |
565 | - if ($this->metadata == null) { |
|
566 | - $this->metadata = new PagSeguroMetaData(); |
|
567 | - } |
|
568 | - return $this->metadata; |
|
569 | - } |
|
565 | + if ($this->metadata == null) { |
|
566 | + $this->metadata = new PagSeguroMetaData(); |
|
567 | + } |
|
568 | + return $this->metadata; |
|
569 | + } |
|
570 | 570 | |
571 | - /*** |
|
571 | + /*** |
|
572 | 572 | * add a parameter for PagSeguro metadata checkout request |
573 | 573 | * |
574 | 574 | * @param PagSeguroMetaDataItem $itemKey key |
575 | 575 | * @param PagSeguroMetaDataItem $itemValue value |
576 | 576 | * @param PagSeguroMetaDataItem $itemGroup group |
577 | 577 | */ |
578 | - public function addMetaData($itemKey, $itemValue, $itemGroup = null) |
|
579 | - { |
|
580 | - $this->getMetaData()->addItem(new PagSeguroMetaDataItem($itemKey, $itemValue, $itemGroup)); |
|
581 | - } |
|
578 | + public function addMetaData($itemKey, $itemValue, $itemGroup = null) |
|
579 | + { |
|
580 | + $this->getMetaData()->addItem(new PagSeguroMetaDataItem($itemKey, $itemValue, $itemGroup)); |
|
581 | + } |
|
582 | 582 | |
583 | - /*** |
|
583 | + /*** |
|
584 | 584 | * Sets payment method config for PagSeguro checkout requests |
585 | 585 | * @param PagSeguroPaymentMethodConfig $paymentMethodConfig |
586 | 586 | */ |
587 | - public function setPaymentMethodConfig($paymentMethodConfig) |
|
588 | - { |
|
589 | - $this->paymentMethodConfig = $paymentMethodConfig; |
|
590 | - } |
|
587 | + public function setPaymentMethodConfig($paymentMethodConfig) |
|
588 | + { |
|
589 | + $this->paymentMethodConfig = $paymentMethodConfig; |
|
590 | + } |
|
591 | 591 | |
592 | - /*** |
|
592 | + /*** |
|
593 | 593 | * Gets payment method config for PagSeguro checkout requests |
594 | 594 | * @return PagSeguroPaymentMethodConfig $paymentMethodConfig |
595 | 595 | */ |
596 | - public function getPaymentMethodConfig() |
|
597 | - { |
|
596 | + public function getPaymentMethodConfig() |
|
597 | + { |
|
598 | 598 | |
599 | - if ($this->paymentMethodConfig == null) { |
|
600 | - $this->paymentMethodConfig = new PagSeguroPaymentMethodConfig(); |
|
601 | - } |
|
602 | - return $this->paymentMethodConfig; |
|
603 | - } |
|
599 | + if ($this->paymentMethodConfig == null) { |
|
600 | + $this->paymentMethodConfig = new PagSeguroPaymentMethodConfig(); |
|
601 | + } |
|
602 | + return $this->paymentMethodConfig; |
|
603 | + } |
|
604 | 604 | |
605 | - /*** |
|
605 | + /*** |
|
606 | 606 | * add a parameter for PagSeguro payment method config checkout request |
607 | 607 | * @param PagSeguroPaymentMethodConfig $itemKey key |
608 | 608 | * @param PagSeguroPaymentMethodConfig $itemValue value |
609 | 609 | * @param PagSeguroPaymentMethodGroups $itemGroup group |
610 | 610 | */ |
611 | - public function addPaymentMethodConfig($itemGroup, $itemValue, $itemKey) |
|
612 | - { |
|
613 | - $this->getPaymentMethodConfig()->addConfig( |
|
614 | - new PagSeguroPaymentMethodConfigItem($itemGroup,$itemValue,$itemKey) |
|
615 | - ); |
|
616 | - } |
|
611 | + public function addPaymentMethodConfig($itemGroup, $itemValue, $itemKey) |
|
612 | + { |
|
613 | + $this->getPaymentMethodConfig()->addConfig( |
|
614 | + new PagSeguroPaymentMethodConfigItem($itemGroup,$itemValue,$itemKey) |
|
615 | + ); |
|
616 | + } |
|
617 | 617 | |
618 | - /*** |
|
618 | + /*** |
|
619 | 619 | * Sets parameter for PagSeguro checkout requests |
620 | 620 | * |
621 | 621 | * @param PagSeguroParameter $parameter |
622 | 622 | */ |
623 | - public function setParameter($parameter) |
|
624 | - { |
|
625 | - $this->parameter = $parameter; |
|
626 | - } |
|
623 | + public function setParameter($parameter) |
|
624 | + { |
|
625 | + $this->parameter = $parameter; |
|
626 | + } |
|
627 | 627 | |
628 | - /*** |
|
628 | + /*** |
|
629 | 629 | * Gets parameter for PagSeguro checkout requests |
630 | 630 | * |
631 | 631 | * @return PagSeguroParameter |
632 | 632 | */ |
633 | - public function getParameter() |
|
634 | - { |
|
635 | - if ($this->parameter == null) { |
|
636 | - $this->parameter = new PagSeguroParameter(); |
|
637 | - } |
|
638 | - return $this->parameter; |
|
639 | - } |
|
633 | + public function getParameter() |
|
634 | + { |
|
635 | + if ($this->parameter == null) { |
|
636 | + $this->parameter = new PagSeguroParameter(); |
|
637 | + } |
|
638 | + return $this->parameter; |
|
639 | + } |
|
640 | 640 | |
641 | - /*** |
|
641 | + /*** |
|
642 | 642 | * add a parameter for PagSeguro checkout request |
643 | 643 | * |
644 | 644 | * @param PagSeguroParameterItem $parameterName key |
645 | 645 | * @param PagSeguroParameterItem $parameterValue value |
646 | 646 | */ |
647 | - public function addParameter($parameterName, $parameterValue) |
|
648 | - { |
|
649 | - $this->getParameter()->addItem(new PagSeguroParameterItem($parameterName, $parameterValue)); |
|
650 | - } |
|
647 | + public function addParameter($parameterName, $parameterValue) |
|
648 | + { |
|
649 | + $this->getParameter()->addItem(new PagSeguroParameterItem($parameterName, $parameterValue)); |
|
650 | + } |
|
651 | 651 | |
652 | - /*** |
|
652 | + /*** |
|
653 | 653 | * add a parameter for PagSeguro checkout request |
654 | 654 | * |
655 | 655 | * @param PagSeguroParameterItem $parameterName key |
656 | 656 | * @param PagSeguroParameterItem $parameterValue value |
657 | 657 | * @param PagSeguroParameterItem $parameterIndex group |
658 | 658 | */ |
659 | - public function addIndexedParameter($parameterName, $parameterValue, $parameterIndex) |
|
660 | - { |
|
661 | - $this->getParameter()->addItem(new PagSeguroParameterItem($parameterName, $parameterValue, $parameterIndex)); |
|
662 | - } |
|
659 | + public function addIndexedParameter($parameterName, $parameterValue, $parameterIndex) |
|
660 | + { |
|
661 | + $this->getParameter()->addItem(new PagSeguroParameterItem($parameterName, $parameterValue, $parameterIndex)); |
|
662 | + } |
|
663 | 663 | |
664 | - /*** |
|
664 | + /*** |
|
665 | 665 | * Calls the PagSeguro web service and register this request for payment |
666 | 666 | * |
667 | 667 | * @param PagSeguroCredentials $credentials, lighbox |
668 | 668 | * @return String The URL to where the user needs to be redirected to in order to complete the payment process or |
669 | 669 | * the CODE when use lightbox |
670 | 670 | */ |
671 | - public function register(PagSeguroCredentials $credentials, $onlyCheckoutCode = false) |
|
672 | - { |
|
673 | - return PagSeguroPaymentService::createCheckoutRequest($credentials, $this, $onlyCheckoutCode); |
|
674 | - } |
|
671 | + public function register(PagSeguroCredentials $credentials, $onlyCheckoutCode = false) |
|
672 | + { |
|
673 | + return PagSeguroPaymentService::createCheckoutRequest($credentials, $this, $onlyCheckoutCode); |
|
674 | + } |
|
675 | 675 | |
676 | - /*** |
|
676 | + /*** |
|
677 | 677 | * @return String a string that represents the current object |
678 | 678 | */ |
679 | - public function toString() |
|
680 | - { |
|
681 | - $email = $this->sender ? $this->sender->getEmail() : "null"; |
|
679 | + public function toString() |
|
680 | + { |
|
681 | + $email = $this->sender ? $this->sender->getEmail() : "null"; |
|
682 | 682 | |
683 | - $request = array(); |
|
684 | - $request['Reference'] = $this->reference; |
|
685 | - $request['SenderEmail'] = $email; |
|
683 | + $request = array(); |
|
684 | + $request['Reference'] = $this->reference; |
|
685 | + $request['SenderEmail'] = $email; |
|
686 | 686 | |
687 | - return "PagSeguroPaymentRequest: " . var_export($request, true); |
|
688 | - } |
|
687 | + return "PagSeguroPaymentRequest: " . var_export($request, true); |
|
688 | + } |
|
689 | 689 | |
690 | - /*** |
|
690 | + /*** |
|
691 | 691 | * Verify if the adress of NotificationURL or RedirectURL is for tests and return empty |
692 | 692 | * @param type $url |
693 | 693 | * @return type |
694 | 694 | */ |
695 | - public function verifyURLTest($url) |
|
696 | - { |
|
697 | - $adress = array( |
|
698 | - '127.0.0.1', |
|
699 | - '::1' |
|
700 | - ); |
|
701 | - |
|
702 | - foreach ($adress as $item) { |
|
703 | - $find = strpos($url, $item); |
|
704 | - |
|
705 | - if ($find) { |
|
706 | - $urlReturn = ''; |
|
707 | - break; |
|
708 | - } else { |
|
709 | - $urlReturn = $url; |
|
710 | - } |
|
711 | - } |
|
712 | - |
|
713 | - return $urlReturn; |
|
714 | - } |
|
695 | + public function verifyURLTest($url) |
|
696 | + { |
|
697 | + $adress = array( |
|
698 | + '127.0.0.1', |
|
699 | + '::1' |
|
700 | + ); |
|
701 | + |
|
702 | + foreach ($adress as $item) { |
|
703 | + $find = strpos($url, $item); |
|
704 | + |
|
705 | + if ($find) { |
|
706 | + $urlReturn = ''; |
|
707 | + break; |
|
708 | + } else { |
|
709 | + $urlReturn = $url; |
|
710 | + } |
|
711 | + } |
|
712 | + |
|
713 | + return $urlReturn; |
|
714 | + } |
|
715 | 715 | } |
@@ -103,12 +103,12 @@ |
||
103 | 103 | $number = $number[0] == 0 ? substr($number, 1) : $number; |
104 | 104 | |
105 | 105 | $number = str_split($number, 1); |
106 | - $areaCode = array_shift($number) . array_shift($number); |
|
106 | + $areaCode = array_shift($number).array_shift($number); |
|
107 | 107 | $phone = implode('', $number); |
108 | 108 | |
109 | 109 | $this->setAreaCode($areaCode); |
110 | 110 | $this->setNumber($phone); |
111 | 111 | |
112 | - return $this->areaCode . $this->number; |
|
112 | + return $this->areaCode.$this->number; |
|
113 | 113 | } |
114 | 114 | } |
@@ -27,88 +27,88 @@ |
||
27 | 27 | class PagSeguroPhone |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * Area code |
32 | 32 | */ |
33 | - private $areaCode; |
|
33 | + private $areaCode; |
|
34 | 34 | |
35 | - /*** |
|
35 | + /*** |
|
36 | 36 | * Phone number |
37 | 37 | */ |
38 | - private $number; |
|
38 | + private $number; |
|
39 | 39 | |
40 | - /*** |
|
40 | + /*** |
|
41 | 41 | * Initializes a new instance of the PagSeguroPhone class |
42 | 42 | * |
43 | 43 | * @param String $areaCode |
44 | 44 | * @param String $number |
45 | 45 | * @return PagSeguroPhone |
46 | 46 | */ |
47 | - public function __construct($areaCode = null, $number = null) |
|
48 | - { |
|
49 | - $this->areaCode = ($areaCode == null ? null : $areaCode); |
|
50 | - $this->number = ($number == null ? null : $number); |
|
51 | - return $this; |
|
52 | - } |
|
47 | + public function __construct($areaCode = null, $number = null) |
|
48 | + { |
|
49 | + $this->areaCode = ($areaCode == null ? null : $areaCode); |
|
50 | + $this->number = ($number == null ? null : $number); |
|
51 | + return $this; |
|
52 | + } |
|
53 | 53 | |
54 | - /*** |
|
54 | + /*** |
|
55 | 55 | * @return int the area code |
56 | 56 | */ |
57 | - public function getAreaCode() |
|
58 | - { |
|
59 | - return $this->areaCode; |
|
60 | - } |
|
57 | + public function getAreaCode() |
|
58 | + { |
|
59 | + return $this->areaCode; |
|
60 | + } |
|
61 | 61 | |
62 | - /*** |
|
62 | + /*** |
|
63 | 63 | * @return int the number |
64 | 64 | */ |
65 | - public function getNumber() |
|
66 | - { |
|
67 | - return $this->number; |
|
68 | - } |
|
65 | + public function getNumber() |
|
66 | + { |
|
67 | + return $this->number; |
|
68 | + } |
|
69 | 69 | |
70 | - /*** |
|
70 | + /*** |
|
71 | 71 | * Sets the area code |
72 | 72 | * @param String $areaCode |
73 | 73 | * @return PagSeguroPhone |
74 | 74 | */ |
75 | - public function setAreaCode($areaCode) |
|
76 | - { |
|
77 | - $this->areaCode = $areaCode; |
|
78 | - return $this; |
|
79 | - } |
|
75 | + public function setAreaCode($areaCode) |
|
76 | + { |
|
77 | + $this->areaCode = $areaCode; |
|
78 | + return $this; |
|
79 | + } |
|
80 | 80 | |
81 | - /*** |
|
81 | + /*** |
|
82 | 82 | * Sets the number |
83 | 83 | * @param String $number |
84 | 84 | * @return PagSeguroPhone |
85 | 85 | */ |
86 | - public function setNumber($number) |
|
87 | - { |
|
88 | - $this->number = $number; |
|
89 | - return $this; |
|
90 | - } |
|
86 | + public function setNumber($number) |
|
87 | + { |
|
88 | + $this->number = $number; |
|
89 | + return $this; |
|
90 | + } |
|
91 | 91 | |
92 | - /*** |
|
92 | + /*** |
|
93 | 93 | * Sets the number from a formatted string |
94 | 94 | * |
95 | 95 | * @param $number String formatted string like <code>(099) [9]9999-9999</code> |
96 | 96 | * @return $this |
97 | 97 | */ |
98 | - public function setFullPhone($number) |
|
99 | - { |
|
100 | - /** We clean the string that is coming. Can be formatted or not */ |
|
98 | + public function setFullPhone($number) |
|
99 | + { |
|
100 | + /** We clean the string that is coming. Can be formatted or not */ |
|
101 | 101 | |
102 | - $number = preg_replace("/[^0-9]/", '', $number); |
|
103 | - $number = $number[0] == 0 ? substr($number, 1) : $number; |
|
102 | + $number = preg_replace("/[^0-9]/", '', $number); |
|
103 | + $number = $number[0] == 0 ? substr($number, 1) : $number; |
|
104 | 104 | |
105 | - $number = str_split($number, 1); |
|
106 | - $areaCode = array_shift($number) . array_shift($number); |
|
107 | - $phone = implode('', $number); |
|
105 | + $number = str_split($number, 1); |
|
106 | + $areaCode = array_shift($number) . array_shift($number); |
|
107 | + $phone = implode('', $number); |
|
108 | 108 | |
109 | - $this->setAreaCode($areaCode); |
|
110 | - $this->setNumber($phone); |
|
109 | + $this->setAreaCode($areaCode); |
|
110 | + $this->setNumber($phone); |
|
111 | 111 | |
112 | - return $this->areaCode . $this->number; |
|
113 | - } |
|
112 | + return $this->areaCode . $this->number; |
|
113 | + } |
|
114 | 114 | } |
@@ -97,6 +97,6 @@ |
||
97 | 97 | $document['type'] = $this->type; |
98 | 98 | $document['value'] = $this->value; |
99 | 99 | |
100 | - return "PagSeguroSenderDocument: " . var_export($document, true); |
|
100 | + return "PagSeguroSenderDocument: ".var_export($document, true); |
|
101 | 101 | } |
102 | 102 | } |
@@ -27,76 +27,76 @@ |
||
27 | 27 | class PagSeguroSenderDocument |
28 | 28 | { |
29 | 29 | |
30 | - /*** |
|
30 | + /*** |
|
31 | 31 | * The type of document |
32 | 32 | * @var string |
33 | 33 | */ |
34 | - private $type; |
|
34 | + private $type; |
|
35 | 35 | |
36 | - /*** |
|
36 | + /*** |
|
37 | 37 | * The value of document |
38 | 38 | * @var string |
39 | 39 | */ |
40 | - private $value; |
|
40 | + private $value; |
|
41 | 41 | |
42 | - /*** |
|
42 | + /*** |
|
43 | 43 | * @param $type |
44 | 44 | * @param $value |
45 | 45 | */ |
46 | - public function __construct($type, $value) |
|
47 | - { |
|
48 | - if ($type && $value) { |
|
49 | - $this->setType($type); |
|
50 | - $this->setValue($value); |
|
51 | - } |
|
52 | - } |
|
46 | + public function __construct($type, $value) |
|
47 | + { |
|
48 | + if ($type && $value) { |
|
49 | + $this->setType($type); |
|
50 | + $this->setValue($value); |
|
51 | + } |
|
52 | + } |
|
53 | 53 | |
54 | - /*** |
|
54 | + /*** |
|
55 | 55 | * Get document type |
56 | 56 | * @return string |
57 | 57 | */ |
58 | - public function getType() |
|
59 | - { |
|
60 | - return $this->type; |
|
61 | - } |
|
58 | + public function getType() |
|
59 | + { |
|
60 | + return $this->type; |
|
61 | + } |
|
62 | 62 | |
63 | - /*** |
|
63 | + /*** |
|
64 | 64 | * Set document type |
65 | 65 | * @param string $type |
66 | 66 | */ |
67 | - public function setType($type) |
|
68 | - { |
|
69 | - $this->type = strtoupper($type); |
|
70 | - } |
|
67 | + public function setType($type) |
|
68 | + { |
|
69 | + $this->type = strtoupper($type); |
|
70 | + } |
|
71 | 71 | |
72 | - /*** |
|
72 | + /*** |
|
73 | 73 | * Get document value |
74 | 74 | * @return string |
75 | 75 | */ |
76 | - public function getValue() |
|
77 | - { |
|
78 | - return $this->value; |
|
79 | - } |
|
76 | + public function getValue() |
|
77 | + { |
|
78 | + return $this->value; |
|
79 | + } |
|
80 | 80 | |
81 | - /*** |
|
81 | + /*** |
|
82 | 82 | * Set document value |
83 | 83 | * @param string $value |
84 | 84 | */ |
85 | - public function setValue($value) |
|
86 | - { |
|
87 | - $this->value = PagSeguroHelper::getOnlyNumbers($value); |
|
88 | - } |
|
85 | + public function setValue($value) |
|
86 | + { |
|
87 | + $this->value = PagSeguroHelper::getOnlyNumbers($value); |
|
88 | + } |
|
89 | 89 | |
90 | - /*** |
|
90 | + /*** |
|
91 | 91 | * Gets toString class |
92 | 92 | * @return string |
93 | 93 | */ |
94 | - public function toString() |
|
95 | - { |
|
96 | - $document = array(); |
|
97 | - $document['type'] = $this->type; |
|
98 | - $document['value'] = $this->value; |
|
94 | + public function toString() |
|
95 | + { |
|
96 | + $document = array(); |
|
97 | + $document['type'] = $this->type; |
|
98 | + $document['value'] = $this->value; |
|
99 | 99 | |
100 | - return "PagSeguroSenderDocument: " . var_export($document, true); |
|
101 | - } |
|
100 | + return "PagSeguroSenderDocument: " . var_export($document, true); |
|
101 | + } |
|
102 | 102 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $session = array(); |
60 | 60 | $session['id'] = $this->id; |
61 | 61 | |
62 | - $session = "Session: " . var_export($session, true); |
|
62 | + $session = "Session: ".var_export($session, true); |
|
63 | 63 | |
64 | 64 | return $session; |
65 | 65 | } |
@@ -28,39 +28,39 @@ |
||
28 | 28 | class PagSeguroSession |
29 | 29 | { |
30 | 30 | |
31 | - /*** |
|
31 | + /*** |
|
32 | 32 | * Session id |
33 | 33 | */ |
34 | - private $id; |
|
34 | + private $id; |
|
35 | 35 | |
36 | - /*** |
|
36 | + /*** |
|
37 | 37 | * @return session id |
38 | 38 | */ |
39 | - public function getId() |
|
40 | - { |
|
41 | - return $this->id; |
|
42 | - } |
|
39 | + public function getId() |
|
40 | + { |
|
41 | + return $this->id; |
|
42 | + } |
|
43 | 43 | |
44 | - /*** |
|
44 | + /*** |
|
45 | 45 | * Sets the session id |
46 | 46 | * |
47 | 47 | * @param string id |
48 | 48 | */ |
49 | - public function setId($id) |
|
50 | - { |
|
51 | - $this->id = $id; |
|
52 | - } |
|
49 | + public function setId($id) |
|
50 | + { |
|
51 | + $this->id = $id; |
|
52 | + } |
|
53 | 53 | |
54 | - /*** |
|
54 | + /*** |
|
55 | 55 | * @return String a string that represents the current object |
56 | 56 | */ |
57 | - public function toString() |
|
58 | - { |
|
59 | - $session = array(); |
|
60 | - $session['id'] = $this->id; |
|
57 | + public function toString() |
|
58 | + { |
|
59 | + $session = array(); |
|
60 | + $session['id'] = $this->id; |
|
61 | 61 | |
62 | - $session = "Session: " . var_export($session, true); |
|
62 | + $session = "Session: " . var_export($session, true); |
|
63 | 63 | |
64 | - return $session; |
|
65 | - } |
|
64 | + return $session; |
|
65 | + } |
|
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -597,7 +597,7 @@ |
||
597 | 597 | $transaction['status'] = $this->status ? $this->status->getValue() : "null"; |
598 | 598 | $transaction['itemsCount'] = is_array($this->items) ? count($this->items) : "null"; |
599 | 599 | |
600 | - $transaction = "Transaction: " . var_export($transaction, true); |
|
600 | + $transaction = "Transaction: ".var_export($transaction, true); |
|
601 | 601 | |
602 | 602 | return $transaction; |
603 | 603 |
@@ -31,575 +31,575 @@ |
||
31 | 31 | class PagSeguroTransaction |
32 | 32 | { |
33 | 33 | |
34 | - /*** |
|
34 | + /*** |
|
35 | 35 | * Transaction date |
36 | 36 | */ |
37 | - private $date; |
|
37 | + private $date; |
|
38 | 38 | |
39 | - /*** |
|
39 | + /*** |
|
40 | 40 | * Last event date |
41 | 41 | * Date the last notification about this transaction was sent |
42 | 42 | */ |
43 | - private $lastEventDate; |
|
43 | + private $lastEventDate; |
|
44 | 44 | |
45 | - /*** |
|
45 | + /*** |
|
46 | 46 | * Transaction code |
47 | 47 | */ |
48 | - private $code; |
|
48 | + private $code; |
|
49 | 49 | |
50 | - /*** |
|
50 | + /*** |
|
51 | 51 | * Reference code |
52 | 52 | * You can use the reference code to store an identifier so you can |
53 | 53 | * associate the PagSeguro transaction to a transaction in your system. |
54 | 54 | */ |
55 | - private $reference; |
|
55 | + private $reference; |
|
56 | 56 | |
57 | - /*** |
|
57 | + /*** |
|
58 | 58 | * Recovery code |
59 | 59 | */ |
60 | - private $recoveryCode; |
|
60 | + private $recoveryCode; |
|
61 | 61 | |
62 | - /*** |
|
62 | + /*** |
|
63 | 63 | * Transaction type |
64 | 64 | * @see PagSeguroTransactionType |
65 | 65 | * @var PagSeguroTransactionType |
66 | 66 | */ |
67 | - private $type; |
|
67 | + private $type; |
|
68 | 68 | |
69 | - /*** |
|
69 | + /*** |
|
70 | 70 | * Transaction Status |
71 | 71 | * @see PagSeguroTransactionStatus |
72 | 72 | * @var PagSeguroTransactionStatus |
73 | 73 | */ |
74 | - private $status; |
|
74 | + private $status; |
|
75 | 75 | |
76 | - /** |
|
77 | - * Transaction cancellationSource |
|
78 | - * @see PagSeguroTransactionCancellationSource |
|
79 | - * @var PagSeguroTransactionCancellationSource |
|
80 | - */ |
|
81 | - private $cancellationSource; |
|
76 | + /** |
|
77 | + * Transaction cancellationSource |
|
78 | + * @see PagSeguroTransactionCancellationSource |
|
79 | + * @var PagSeguroTransactionCancellationSource |
|
80 | + */ |
|
81 | + private $cancellationSource; |
|
82 | 82 | |
83 | - /*** |
|
83 | + /*** |
|
84 | 84 | * Payment method |
85 | 85 | * @see PagSeguroPaymentMethod |
86 | 86 | * @var PagSeguroPaymentMethod |
87 | 87 | */ |
88 | - private $paymentMethod; |
|
88 | + private $paymentMethod; |
|
89 | 89 | |
90 | - /*** |
|
90 | + /*** |
|
91 | 91 | * Payment Link |
92 | 92 | */ |
93 | - private $paymentLink; |
|
93 | + private $paymentLink; |
|
94 | 94 | |
95 | - /*** |
|
95 | + /*** |
|
96 | 96 | * Gross amount of the transaction |
97 | 97 | */ |
98 | - private $grossAmount; |
|
98 | + private $grossAmount; |
|
99 | 99 | |
100 | - /*** |
|
100 | + /*** |
|
101 | 101 | * Discount amount |
102 | 102 | */ |
103 | - private $discountAmount; |
|
103 | + private $discountAmount; |
|
104 | 104 | |
105 | - /*** |
|
105 | + /*** |
|
106 | 106 | * Fee amount |
107 | 107 | */ |
108 | - private $feeAmount; |
|
108 | + private $feeAmount; |
|
109 | 109 | |
110 | - /*** |
|
110 | + /*** |
|
111 | 111 | * Net amount |
112 | 112 | */ |
113 | - private $netAmount; |
|
113 | + private $netAmount; |
|
114 | 114 | |
115 | - /*** |
|
115 | + /*** |
|
116 | 116 | * Escrow End Date |
117 | 117 | */ |
118 | - private $escrowEndDate; |
|
118 | + private $escrowEndDate; |
|
119 | 119 | |
120 | - /*** |
|
120 | + /*** |
|
121 | 121 | * Extra amount |
122 | 122 | */ |
123 | - private $extraAmount; |
|
123 | + private $extraAmount; |
|
124 | 124 | |
125 | - /*** |
|
125 | + /*** |
|
126 | 126 | * Installment count |
127 | 127 | */ |
128 | - private $installmentCount; |
|
128 | + private $installmentCount; |
|
129 | 129 | |
130 | - /*** |
|
130 | + /*** |
|
131 | 131 | * creditorFees amount |
132 | 132 | */ |
133 | - private $creditorFees; |
|
133 | + private $creditorFees; |
|
134 | 134 | |
135 | - /*** |
|
135 | + /*** |
|
136 | 136 | * Operational Fee Amount amount |
137 | 137 | */ |
138 | - private $operationalFeeAmount; |
|
138 | + private $operationalFeeAmount; |
|
139 | 139 | |
140 | - /*** |
|
140 | + /*** |
|
141 | 141 | * Installment Fee Amount amount |
142 | 142 | */ |
143 | - private $installmentFeeAmount; |
|
143 | + private $installmentFeeAmount; |
|
144 | 144 | |
145 | - /*** |
|
145 | + /*** |
|
146 | 146 | * Item count |
147 | 147 | */ |
148 | - private $itemCount; |
|
148 | + private $itemCount; |
|
149 | 149 | |
150 | - /*** |
|
150 | + /*** |
|
151 | 151 | * item/product list in this transaction |
152 | 152 | * @see PagSeguroItem |
153 | 153 | */ |
154 | - private $items; |
|
154 | + private $items; |
|
155 | 155 | |
156 | - /*** |
|
156 | + /*** |
|
157 | 157 | * Payer information, who is sending money |
158 | 158 | * @see PagSeguroSender |
159 | 159 | * @var PagSeguroSender |
160 | 160 | */ |
161 | - private $sender; |
|
161 | + private $sender; |
|
162 | 162 | |
163 | - /*** |
|
163 | + /*** |
|
164 | 164 | * Shipping information |
165 | 165 | * @see PagSeguroShipping |
166 | 166 | * @var PagSeguroShipping |
167 | 167 | */ |
168 | - private $shipping; |
|
168 | + private $shipping; |
|
169 | 169 | |
170 | - /*** |
|
170 | + /*** |
|
171 | 171 | * Date the last notification about this transaction was sent |
172 | 172 | * @return datetime the last event date |
173 | 173 | */ |
174 | - public function getLastEventDate() |
|
175 | - { |
|
176 | - return $this->lastEventDate; |
|
177 | - } |
|
174 | + public function getLastEventDate() |
|
175 | + { |
|
176 | + return $this->lastEventDate; |
|
177 | + } |
|
178 | 178 | |
179 | - /*** |
|
179 | + /*** |
|
180 | 180 | * Sets the last event date |
181 | 181 | * |
182 | 182 | * @param lastEventDate |
183 | 183 | */ |
184 | - public function setLastEventDate($lastEventDate) |
|
185 | - { |
|
186 | - $this->lastEventDate = $lastEventDate; |
|
187 | - } |
|
184 | + public function setLastEventDate($lastEventDate) |
|
185 | + { |
|
186 | + $this->lastEventDate = $lastEventDate; |
|
187 | + } |
|
188 | 188 | |
189 | - /*** |
|
189 | + /*** |
|
190 | 190 | * @return datetime the transaction date |
191 | 191 | */ |
192 | - public function getDate() |
|
193 | - { |
|
194 | - return $this->date; |
|
195 | - } |
|
192 | + public function getDate() |
|
193 | + { |
|
194 | + return $this->date; |
|
195 | + } |
|
196 | 196 | |
197 | - /*** |
|
197 | + /*** |
|
198 | 198 | * Sets the transaction date |
199 | 199 | * |
200 | 200 | * @param string date |
201 | 201 | */ |
202 | - public function setDate($date) |
|
203 | - { |
|
204 | - $this->date = $date; |
|
205 | - } |
|
202 | + public function setDate($date) |
|
203 | + { |
|
204 | + $this->date = $date; |
|
205 | + } |
|
206 | 206 | |
207 | - /*** |
|
207 | + /*** |
|
208 | 208 | * @return string the transaction code |
209 | 209 | */ |
210 | - public function getCode() |
|
211 | - { |
|
212 | - return $this->code; |
|
213 | - } |
|
210 | + public function getCode() |
|
211 | + { |
|
212 | + return $this->code; |
|
213 | + } |
|
214 | 214 | |
215 | - /*** |
|
215 | + /*** |
|
216 | 216 | * Sets the transaction code |
217 | 217 | * |
218 | 218 | * @param code |
219 | 219 | */ |
220 | - public function setCode($code) |
|
221 | - { |
|
222 | - $this->code = $code; |
|
223 | - } |
|
220 | + public function setCode($code) |
|
221 | + { |
|
222 | + $this->code = $code; |
|
223 | + } |
|
224 | 224 | |
225 | - /*** |
|
225 | + /*** |
|
226 | 226 | * You can use the reference code to store an identifier so you can |
227 | 227 | * associate the PagSeguro transaction to a transaction in your system. |
228 | 228 | * |
229 | 229 | * @return string the reference code |
230 | 230 | */ |
231 | - public function getReference() |
|
232 | - { |
|
233 | - return $this->reference; |
|
234 | - } |
|
231 | + public function getReference() |
|
232 | + { |
|
233 | + return $this->reference; |
|
234 | + } |
|
235 | 235 | |
236 | - /*** |
|
236 | + /*** |
|
237 | 237 | * Sets the reference code |
238 | 238 | * |
239 | 239 | * @param reference |
240 | 240 | */ |
241 | - public function setReference($reference) |
|
242 | - { |
|
243 | - $this->reference = $reference; |
|
244 | - } |
|
241 | + public function setReference($reference) |
|
242 | + { |
|
243 | + $this->reference = $reference; |
|
244 | + } |
|
245 | 245 | |
246 | - /*** |
|
246 | + /*** |
|
247 | 247 | * @return string the recovery code |
248 | 248 | */ |
249 | - public function getRecoveryCode() |
|
250 | - { |
|
251 | - return $this->recoveryCode; |
|
252 | - } |
|
249 | + public function getRecoveryCode() |
|
250 | + { |
|
251 | + return $this->recoveryCode; |
|
252 | + } |
|
253 | 253 | |
254 | - /*** |
|
254 | + /*** |
|
255 | 255 | * Sets the recovery code |
256 | 256 | * |
257 | 257 | * @param code |
258 | 258 | */ |
259 | - public function setRecoveryCode($recoveryCode) |
|
260 | - { |
|
261 | - $this->recoveryCode = $recoveryCode; |
|
262 | - } |
|
259 | + public function setRecoveryCode($recoveryCode) |
|
260 | + { |
|
261 | + $this->recoveryCode = $recoveryCode; |
|
262 | + } |
|
263 | 263 | |
264 | - /*** |
|
264 | + /*** |
|
265 | 265 | * @return PagSeguroTransactionType the transaction type |
266 | 266 | * @see PagSeguroTransactionType |
267 | 267 | */ |
268 | - public function getType() |
|
269 | - { |
|
270 | - return $this->type; |
|
271 | - } |
|
268 | + public function getType() |
|
269 | + { |
|
270 | + return $this->type; |
|
271 | + } |
|
272 | 272 | |
273 | - /*** |
|
273 | + /*** |
|
274 | 274 | * Sets the transaction type |
275 | 275 | * @param PagSeguroTransactionType $type |
276 | 276 | */ |
277 | - public function setType(PagSeguroTransactionType $type) |
|
278 | - { |
|
279 | - $this->type = $type; |
|
280 | - } |
|
277 | + public function setType(PagSeguroTransactionType $type) |
|
278 | + { |
|
279 | + $this->type = $type; |
|
280 | + } |
|
281 | 281 | |
282 | - /*** |
|
282 | + /*** |
|
283 | 283 | * @return PagSeguroTransactionStatus the transaction status |
284 | 284 | * @see PagSeguroTransactionStatus |
285 | 285 | */ |
286 | - public function getStatus() |
|
287 | - { |
|
288 | - return $this->status; |
|
289 | - } |
|
286 | + public function getStatus() |
|
287 | + { |
|
288 | + return $this->status; |
|
289 | + } |
|
290 | 290 | |
291 | - /*** |
|
291 | + /*** |
|
292 | 292 | * Sets the transaction status |
293 | 293 | * @param PagSeguroTransactionStatus $status |
294 | 294 | */ |
295 | - public function setStatus(PagSeguroTransactionStatus $status) |
|
296 | - { |
|
297 | - $this->status = $status; |
|
298 | - } |
|
299 | - |
|
300 | - /** |
|
301 | - * @return PagSeguroTransactionCancellationSource the transaction cancellation source |
|
302 | - * @see PagSeguroTransactionCancellationSource |
|
303 | - */ |
|
304 | - public function getCancellationSource() |
|
305 | - { |
|
306 | - return $this->cancellationSource; |
|
307 | - } |
|
308 | - |
|
309 | - /** |
|
310 | - * Sets the transaction cancellation source |
|
311 | - * @param PagSeguroTransactionCancellationSource $cancellationSource |
|
312 | - */ |
|
313 | - public function setCancellationSource(PagSeguroTransactionCancellationSource $cancellationSource) |
|
314 | - { |
|
315 | - $this->cancellationSource = $cancellationSource; |
|
316 | - } |
|
317 | - |
|
318 | - /*** |
|
295 | + public function setStatus(PagSeguroTransactionStatus $status) |
|
296 | + { |
|
297 | + $this->status = $status; |
|
298 | + } |
|
299 | + |
|
300 | + /** |
|
301 | + * @return PagSeguroTransactionCancellationSource the transaction cancellation source |
|
302 | + * @see PagSeguroTransactionCancellationSource |
|
303 | + */ |
|
304 | + public function getCancellationSource() |
|
305 | + { |
|
306 | + return $this->cancellationSource; |
|
307 | + } |
|
308 | + |
|
309 | + /** |
|
310 | + * Sets the transaction cancellation source |
|
311 | + * @param PagSeguroTransactionCancellationSource $cancellationSource |
|
312 | + */ |
|
313 | + public function setCancellationSource(PagSeguroTransactionCancellationSource $cancellationSource) |
|
314 | + { |
|
315 | + $this->cancellationSource = $cancellationSource; |
|
316 | + } |
|
317 | + |
|
318 | + /*** |
|
319 | 319 | * @return PagSeguroPaymentMethod the payment method used in this transaction |
320 | 320 | * @see PagSeguroPaymentMethod |
321 | 321 | */ |
322 | - public function getPaymentMethod() |
|
323 | - { |
|
324 | - return $this->paymentMethod; |
|
325 | - } |
|
322 | + public function getPaymentMethod() |
|
323 | + { |
|
324 | + return $this->paymentMethod; |
|
325 | + } |
|
326 | 326 | |
327 | - /*** |
|
327 | + /*** |
|
328 | 328 | * Sets the payment link used in this transaction |
329 | 329 | * @param url $paymentLink |
330 | 330 | */ |
331 | - public function setPaymentLink($paymentLink) |
|
332 | - { |
|
333 | - $this->paymentLink = $paymentLink; |
|
334 | - } |
|
331 | + public function setPaymentLink($paymentLink) |
|
332 | + { |
|
333 | + $this->paymentLink = $paymentLink; |
|
334 | + } |
|
335 | 335 | |
336 | - /*** |
|
336 | + /*** |
|
337 | 337 | * @return the payment link method used in this transaction |
338 | 338 | */ |
339 | - public function getPaymentLink() |
|
340 | - { |
|
341 | - return $this->paymentLink; |
|
342 | - } |
|
339 | + public function getPaymentLink() |
|
340 | + { |
|
341 | + return $this->paymentLink; |
|
342 | + } |
|
343 | 343 | |
344 | - /*** |
|
344 | + /*** |
|
345 | 345 | * Sets the payment method used in this transaction |
346 | 346 | * @param PagSeguroPaymentMethod $paymentMethod |
347 | 347 | */ |
348 | - public function setPaymentMethod(PagSeguroPaymentMethod $paymentMethod) |
|
349 | - { |
|
350 | - $this->paymentMethod = $paymentMethod; |
|
351 | - } |
|
348 | + public function setPaymentMethod(PagSeguroPaymentMethod $paymentMethod) |
|
349 | + { |
|
350 | + $this->paymentMethod = $paymentMethod; |
|
351 | + } |
|
352 | 352 | |
353 | - /*** |
|
353 | + /*** |
|
354 | 354 | * @return float the transaction gross amount |
355 | 355 | */ |
356 | - public function getGrossAmount() |
|
357 | - { |
|
358 | - return $this->grossAmount; |
|
359 | - } |
|
356 | + public function getGrossAmount() |
|
357 | + { |
|
358 | + return $this->grossAmount; |
|
359 | + } |
|
360 | 360 | |
361 | - /*** |
|
361 | + /*** |
|
362 | 362 | * Sets the transaction gross amount |
363 | 363 | * @param float $totalValue |
364 | 364 | */ |
365 | - public function setGrossAmount($totalValue) |
|
366 | - { |
|
367 | - $this->grossAmount = $totalValue; |
|
368 | - } |
|
365 | + public function setGrossAmount($totalValue) |
|
366 | + { |
|
367 | + $this->grossAmount = $totalValue; |
|
368 | + } |
|
369 | 369 | |
370 | - /*** |
|
370 | + /*** |
|
371 | 371 | * @return float the transaction gross amount |
372 | 372 | */ |
373 | - public function getDiscountAmount() |
|
374 | - { |
|
375 | - return $this->discountAmount; |
|
376 | - } |
|
373 | + public function getDiscountAmount() |
|
374 | + { |
|
375 | + return $this->discountAmount; |
|
376 | + } |
|
377 | 377 | |
378 | - /*** |
|
378 | + /*** |
|
379 | 379 | * Sets the transaction gross amount |
380 | 380 | * @param float $discountAmount |
381 | 381 | */ |
382 | - public function setDiscountAmount($discountAmount) |
|
383 | - { |
|
384 | - $this->discountAmount = $discountAmount; |
|
385 | - } |
|
382 | + public function setDiscountAmount($discountAmount) |
|
383 | + { |
|
384 | + $this->discountAmount = $discountAmount; |
|
385 | + } |
|
386 | 386 | |
387 | - /*** |
|
387 | + /*** |
|
388 | 388 | * @return float the fee amount |
389 | 389 | */ |
390 | - public function getFeeAmount() |
|
391 | - { |
|
392 | - return $this->feeAmount; |
|
393 | - } |
|
390 | + public function getFeeAmount() |
|
391 | + { |
|
392 | + return $this->feeAmount; |
|
393 | + } |
|
394 | 394 | |
395 | - /*** |
|
395 | + /*** |
|
396 | 396 | * Sets the transaction fee amount |
397 | 397 | * @param float $feeAmount |
398 | 398 | */ |
399 | - public function setFeeAmount($feeAmount) |
|
400 | - { |
|
401 | - $this->feeAmount = $feeAmount; |
|
402 | - } |
|
399 | + public function setFeeAmount($feeAmount) |
|
400 | + { |
|
401 | + $this->feeAmount = $feeAmount; |
|
402 | + } |
|
403 | 403 | |
404 | - /*** |
|
404 | + /*** |
|
405 | 405 | * @return float the net amount |
406 | 406 | */ |
407 | - public function getNetAmount() |
|
408 | - { |
|
409 | - return $this->netAmount; |
|
410 | - } |
|
407 | + public function getNetAmount() |
|
408 | + { |
|
409 | + return $this->netAmount; |
|
410 | + } |
|
411 | 411 | |
412 | - /*** |
|
412 | + /*** |
|
413 | 413 | * Sets the net amount |
414 | 414 | * @param float $netAmount |
415 | 415 | */ |
416 | - public function setNetAmount($netAmount) |
|
417 | - { |
|
418 | - $this->netAmount = $netAmount; |
|
419 | - } |
|
416 | + public function setNetAmount($netAmount) |
|
417 | + { |
|
418 | + $this->netAmount = $netAmount; |
|
419 | + } |
|
420 | 420 | |
421 | - /*** |
|
421 | + /*** |
|
422 | 422 | * @return date the escrow end date |
423 | 423 | */ |
424 | - public function getEscrowEndDate() |
|
425 | - { |
|
426 | - return $this->escrowEndDate; |
|
427 | - } |
|
424 | + public function getEscrowEndDate() |
|
425 | + { |
|
426 | + return $this->escrowEndDate; |
|
427 | + } |
|
428 | 428 | |
429 | - /*** |
|
429 | + /*** |
|
430 | 430 | * Sets the escrow end date |
431 | 431 | * @param date $escrowEndDate |
432 | 432 | */ |
433 | - public function setEscrowEndDate($escrowEndDate) |
|
434 | - { |
|
435 | - $this->escrowEndDate = $escrowEndDate; |
|
436 | - } |
|
433 | + public function setEscrowEndDate($escrowEndDate) |
|
434 | + { |
|
435 | + $this->escrowEndDate = $escrowEndDate; |
|
436 | + } |
|
437 | 437 | |
438 | - /*** |
|
438 | + /*** |
|
439 | 439 | * @return float the extra amount |
440 | 440 | */ |
441 | - public function getExtraAmount() |
|
442 | - { |
|
443 | - return $this->extraAmount; |
|
444 | - } |
|
441 | + public function getExtraAmount() |
|
442 | + { |
|
443 | + return $this->extraAmount; |
|
444 | + } |
|
445 | 445 | |
446 | - /*** |
|
446 | + /*** |
|
447 | 447 | * Sets the extra amount |
448 | 448 | * @param float $extraAmount |
449 | 449 | */ |
450 | - public function setExtraAmount($extraAmount) |
|
451 | - { |
|
452 | - $this->extraAmount = $extraAmount; |
|
453 | - } |
|
450 | + public function setExtraAmount($extraAmount) |
|
451 | + { |
|
452 | + $this->extraAmount = $extraAmount; |
|
453 | + } |
|
454 | 454 | |
455 | - /*** |
|
455 | + /*** |
|
456 | 456 | * @return integer the installment count |
457 | 457 | */ |
458 | - public function getInstallmentCount() |
|
459 | - { |
|
460 | - return $this->installmentCount; |
|
461 | - } |
|
458 | + public function getInstallmentCount() |
|
459 | + { |
|
460 | + return $this->installmentCount; |
|
461 | + } |
|
462 | 462 | |
463 | - /*** |
|
463 | + /*** |
|
464 | 464 | * Sets the installment count |
465 | 465 | * @param integer $installmentCount |
466 | 466 | */ |
467 | - public function setInstallmentCount($installmentCount) |
|
468 | - { |
|
469 | - $this->installmentCount = $installmentCount; |
|
470 | - } |
|
467 | + public function setInstallmentCount($installmentCount) |
|
468 | + { |
|
469 | + $this->installmentCount = $installmentCount; |
|
470 | + } |
|
471 | 471 | |
472 | - /*** |
|
472 | + /*** |
|
473 | 473 | * Sets the transaction creditorFees |
474 | 474 | * @param float $creditorFees |
475 | 475 | */ |
476 | - public function setCreditorFees($creditorFees) |
|
477 | - { |
|
478 | - $this->creditorFees = $creditorFees; |
|
479 | - } |
|
476 | + public function setCreditorFees($creditorFees) |
|
477 | + { |
|
478 | + $this->creditorFees = $creditorFees; |
|
479 | + } |
|
480 | 480 | |
481 | - /*** |
|
481 | + /*** |
|
482 | 482 | * @return object the transaction creditor fees |
483 | 483 | */ |
484 | - public function getCreditorFees() |
|
485 | - { |
|
486 | - return $this->creditorFees; |
|
487 | - } |
|
484 | + public function getCreditorFees() |
|
485 | + { |
|
486 | + return $this->creditorFees; |
|
487 | + } |
|
488 | 488 | |
489 | - /*** |
|
489 | + /*** |
|
490 | 490 | * Sets the transaction Operational Fee Amount |
491 | 491 | * @param float $operationalFeeAmount |
492 | 492 | */ |
493 | - public function setOperationalFeeAmount($operationalFeeAmount) |
|
494 | - { |
|
495 | - $this->operationalFeeAmount = $operationalFeeAmount; |
|
496 | - } |
|
493 | + public function setOperationalFeeAmount($operationalFeeAmount) |
|
494 | + { |
|
495 | + $this->operationalFeeAmount = $operationalFeeAmount; |
|
496 | + } |
|
497 | 497 | |
498 | - /*** |
|
498 | + /*** |
|
499 | 499 | * @return float the transaction operational fee amount |
500 | 500 | */ |
501 | - public function getOperationalFeeAmount() |
|
502 | - { |
|
503 | - return $this->operationalFeeAmount; |
|
504 | - } |
|
501 | + public function getOperationalFeeAmount() |
|
502 | + { |
|
503 | + return $this->operationalFeeAmount; |
|
504 | + } |
|
505 | 505 | |
506 | - /*** |
|
506 | + /*** |
|
507 | 507 | * Sets the transaction Installment Fee Amount |
508 | 508 | * @param float $installmentFeeAmount |
509 | 509 | */ |
510 | - public function setInstallmentFeeAmount($installmentFeeAmount) |
|
511 | - { |
|
512 | - $this->installmentFeeAmount = $installmentFeeAmount; |
|
513 | - } |
|
510 | + public function setInstallmentFeeAmount($installmentFeeAmount) |
|
511 | + { |
|
512 | + $this->installmentFeeAmount = $installmentFeeAmount; |
|
513 | + } |
|
514 | 514 | |
515 | - /*** |
|
515 | + /*** |
|
516 | 516 | * @return float the transaction installment fee amount |
517 | 517 | */ |
518 | - public function getInstallmentFeeAmount() |
|
519 | - { |
|
520 | - return $this->installmentFeeAmount; |
|
521 | - } |
|
518 | + public function getInstallmentFeeAmount() |
|
519 | + { |
|
520 | + return $this->installmentFeeAmount; |
|
521 | + } |
|
522 | 522 | |
523 | - /*** |
|
523 | + /*** |
|
524 | 524 | * @return array PagSeguroItem the items/products list in this transaction |
525 | 525 | * @see PagSeguroItem |
526 | 526 | */ |
527 | - public function getItems() |
|
528 | - { |
|
529 | - return $this->items; |
|
530 | - } |
|
527 | + public function getItems() |
|
528 | + { |
|
529 | + return $this->items; |
|
530 | + } |
|
531 | 531 | |
532 | - /*** |
|
532 | + /*** |
|
533 | 533 | * Sets the list of items/products in this transaction |
534 | 534 | * @param array $items |
535 | 535 | * @see PagSeguroItem |
536 | 536 | */ |
537 | - public function setItems(array $items) |
|
538 | - { |
|
539 | - $this->items = $items; |
|
540 | - } |
|
537 | + public function setItems(array $items) |
|
538 | + { |
|
539 | + $this->items = $items; |
|
540 | + } |
|
541 | 541 | |
542 | - /*** |
|
542 | + /*** |
|
543 | 543 | * @return integer the items/products count in this transaction |
544 | 544 | */ |
545 | - public function getItemCount() |
|
546 | - { |
|
547 | - return $this->items == null ? null : count($this->items); |
|
548 | - } |
|
545 | + public function getItemCount() |
|
546 | + { |
|
547 | + return $this->items == null ? null : count($this->items); |
|
548 | + } |
|
549 | 549 | |
550 | - /*** |
|
550 | + /*** |
|
551 | 551 | * @return PagSeguroSender the sender information, who is sending money in this transaction |
552 | 552 | * @see PagSeguroSender |
553 | 553 | */ |
554 | - public function getSender() |
|
555 | - { |
|
556 | - return $this->sender; |
|
557 | - } |
|
554 | + public function getSender() |
|
555 | + { |
|
556 | + return $this->sender; |
|
557 | + } |
|
558 | 558 | |
559 | - /*** |
|
559 | + /*** |
|
560 | 560 | * Sets the sender information, who is sending money in this transaction |
561 | 561 | * @param PagSeguroSender $sender |
562 | 562 | */ |
563 | - public function setSender(PagSeguroSender $sender) |
|
564 | - { |
|
565 | - $this->sender = $sender; |
|
566 | - } |
|
563 | + public function setSender(PagSeguroSender $sender) |
|
564 | + { |
|
565 | + $this->sender = $sender; |
|
566 | + } |
|
567 | 567 | |
568 | - /*** |
|
568 | + /*** |
|
569 | 569 | * @return PagSeguroShipping the shipping information |
570 | 570 | * @see PagSeguroShipping |
571 | 571 | */ |
572 | - public function getShipping() |
|
573 | - { |
|
574 | - return $this->shipping; |
|
575 | - } |
|
572 | + public function getShipping() |
|
573 | + { |
|
574 | + return $this->shipping; |
|
575 | + } |
|
576 | 576 | |
577 | - /*** |
|
577 | + /*** |
|
578 | 578 | * sets the shipping information for this transaction |
579 | 579 | * @param PagSeguroShipping $shipping |
580 | 580 | */ |
581 | - public function setShipping(PagSeguroShipping $shipping) |
|
582 | - { |
|
583 | - $this->shipping = $shipping; |
|
584 | - } |
|
581 | + public function setShipping(PagSeguroShipping $shipping) |
|
582 | + { |
|
583 | + $this->shipping = $shipping; |
|
584 | + } |
|
585 | 585 | |
586 | - /*** |
|
586 | + /*** |
|
587 | 587 | * @return String a string that represents the current object |
588 | 588 | */ |
589 | - public function toString() |
|
590 | - { |
|
589 | + public function toString() |
|
590 | + { |
|
591 | 591 | |
592 | - $transaction = array(); |
|
593 | - $transaction['code'] = $this->code; |
|
594 | - $transaction['email'] = $this->sender ? $this->sender->getEmail() : "null"; |
|
595 | - $transaction['date'] = $this->date; |
|
596 | - $transaction['reference'] = $this->reference; |
|
597 | - $transaction['status'] = $this->status ? $this->status->getValue() : "null"; |
|
598 | - $transaction['itemsCount'] = is_array($this->items) ? count($this->items) : "null"; |
|
592 | + $transaction = array(); |
|
593 | + $transaction['code'] = $this->code; |
|
594 | + $transaction['email'] = $this->sender ? $this->sender->getEmail() : "null"; |
|
595 | + $transaction['date'] = $this->date; |
|
596 | + $transaction['reference'] = $this->reference; |
|
597 | + $transaction['status'] = $this->status ? $this->status->getValue() : "null"; |
|
598 | + $transaction['itemsCount'] = is_array($this->items) ? count($this->items) : "null"; |
|
599 | 599 | |
600 | - $transaction = "Transaction: " . var_export($transaction, true); |
|
600 | + $transaction = "Transaction: " . var_export($transaction, true); |
|
601 | 601 | |
602 | - return $transaction; |
|
602 | + return $transaction; |
|
603 | 603 | |
604 | - } |
|
604 | + } |
|
605 | 605 | } |