Skip to content

Commit f1b1e3e

Browse files
committed
Clarify hidden/visible data a little with clearer method names.
1 parent 979e8be commit f1b1e3e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Message/DPMAuthorizeResponse.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class DPMAuthorizeResponse extends AbstractResponse implements RedirectResponseI
1515
{
1616
protected $postUrl;
1717

18+
/**
19+
* These will be hidden fields in the direct-post form.
20+
*/
1821
protected $hiddenFields = array(
1922
'x_fp_hash',
2023
'x_amount',
@@ -30,6 +33,7 @@ class DPMAuthorizeResponse extends AbstractResponse implements RedirectResponseI
3033
'x_login',
3134
'x_invoice_num',
3235
'x_description',
36+
'x_cust_id',
3337
);
3438

3539
public function __construct(RequestInterface $request, $data, $postUrl)
@@ -79,11 +83,11 @@ public function getRedirectData()
7983
}
8084

8185
/**
82-
* Add a field to the list of hidden fields.
86+
* Move a field to the list of hidden form fields.
8387
* The hidden fields are those we don't want to show the user, but
8488
* must still be posted.
8589
*/
86-
public function setHiddenField($field_name)
90+
public function hideField($field_name)
8791
{
8892
if (!in_array($field_name, $this->hiddenFields)) {
8993
$this->hiddenFields[] = $field_name;
@@ -93,7 +97,7 @@ public function setHiddenField($field_name)
9397
/**
9498
* Remove a field from the list of hidden fields.
9599
*/
96-
public function unsetHiddenField($field_name)
100+
public function unhideField($field_name)
97101
{
98102
if (($key = array_search($field_name, $this->hiddenFields)) !== false) {
99103
unset($this->hiddenFields[$key]);
@@ -113,7 +117,7 @@ public function getHiddenData()
113117
* These are not all mandatory, so you do not have to present all these
114118
* to the user.
115119
*/
116-
public function getNonHiddenData()
120+
public function getVisibleData()
117121
{
118122
return array_diff_key($this->getData(), array_flip($this->hiddenFields));
119123
}

0 commit comments

Comments
 (0)