-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from YWatchman/master
Hotfixed DPA status request
- Loading branch information
Showing
3 changed files
with
32 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
global $config; | ||
$config = array(); | ||
|
||
// Custom field code ('Veldcode', not the name) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,9 +47,7 @@ public function isActivated() | |
if (file_exists(CUSTOMPATH . '/plugins/dpa/docs/' . $this->config['pdffile'])) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
return false; | ||
} | ||
|
||
// No config input entered. | ||
|
@@ -79,7 +77,7 @@ public function getCurrentDebtor() | |
* | ||
* @return boolean | ||
*/ | ||
public function sendEmail($debtorid) { | ||
public function sendEmail($debtorid) { | ||
$debtorParams = array( | ||
'Identifier' => $debtorid, | ||
'TemplateID' => $this->config['templateid'], | ||
|
@@ -90,9 +88,7 @@ public function sendEmail($debtorid) { | |
if ($response['status'] == "success") { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
|
@@ -133,26 +129,26 @@ public function updatePreference() { | |
} | ||
|
||
// Error processing signing. | ||
else { | ||
return false; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* Retrieve debtor DPA info. | ||
* | ||
* @return string | ||
*/ | ||
public function debtorDPAStatus() { | ||
* Retrieve debtor DPA info. | ||
* Hotfix by YWatchman <[email protected]> | ||
* | ||
* @return string | ||
*/ | ||
public function debtorDPAStatus($config = null) | ||
{ | ||
$debtor = $this->getCurrentDebtor(); | ||
$response = $this->APIRequest('debtor', 'show', array('Identifier' => $debtor)); | ||
|
||
// If custom field is filled, debtor agreed already | ||
if (isset($response['debtor']['CustomFields'][$this->config['fieldname']]) && $response['debtor']['CustomFields'][$this->config['fieldname']] != "") { | ||
$this->config = $config != null ? $config : $this->config; | ||
|
||
// If custom field is filled, debtor agreed already | ||
if ( isset($response['debtor']['CustomFields'][$this->config['fieldname']]) && $response['debtor']['CustomFields'][$this->config['fieldname']] != "" ) { | ||
return $response['debtor']['CustomFields'][$this->config['fieldname']]; | ||
} | ||
else { | ||
return ''; | ||
} | ||
return ''; | ||
} | ||
} |