diff --git a/debian/changelog b/debian/changelog
index 59a72583..da831805 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-hedera-web (22.48.8) stable; urgency=low
+hedera-web (22.48.9) stable; urgency=low
* Initial Release.
diff --git a/debian/cron.d b/debian/cron.d
index 1037bb2c..846174c7 100755
--- a/debian/cron.d
+++ b/debian/cron.d
@@ -1,6 +1,5 @@
MAILTO=webmaster
*/1 * * * * root hedera-web.php -m misc/mail
-*/4 * * * * root hedera-web.php -m tpv/confirm-mail
*/2 * * * * root hedera-web.php -m edi/load
0 23 * * * root hedera-web.php -m edi/clean
0 5 * * * root hedera-web.php -m edi/update
diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js
index dc759476..6deacca8 100644
--- a/js/hedera/tpv.js
+++ b/js/hedera/tpv.js
@@ -9,11 +9,10 @@ module.exports = new Class({
this.tpvStatus = this.hash.$.tpvStatus;
if (this.tpvStatus) {
- const query = 'CALL myTpvTransaction_end(#transaction, #status)';
- this.conn.execQuery(query, {
- transaction: this.tpvOrder,
+ this.conn.post('TpvTransactions/end', {
+ orderId: this.tpvOrder,
status: this.tpvStatus
- });
+ })
}
return this.tpvStatus;
@@ -29,11 +28,11 @@ module.exports = new Class({
return;
}
- const json = await this.conn.send('tpv/transaction', {
- amount: parseInt(amount)
- ,urlOk: this._makeUrl('ok')
- ,urlKo: this._makeUrl('ko')
- ,company
+ const json = await this.conn.post('TpvTransactions/start', {
+ amount: parseInt(amount),
+ urlOk: this._makeUrl('ok'),
+ urlKo: this._makeUrl('ko'),
+ company
});
const postValues = json.postValues;
diff --git a/package.json b/package.json
index 2ba47960..a1bdf7e1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "hedera-web",
- "version": "22.48.8",
+ "version": "22.48.9",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {
diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php
deleted file mode 100644
index 719bfed1..00000000
--- a/rest/tpv/confirm-mail.php
+++ /dev/null
@@ -1,98 +0,0 @@
-getObject(
- 'SELECT host, user, pass, cleanPeriod, successFolder, errorFolder
- FROM tpvImapConfig'
- );
-
- $mailbox = sprintf('{%s/imap/ssl/novalidate-cert}',
- $imapConf->host);
-
- $imap = imap_open($mailbox
- ,$imapConf->user
- ,base64_decode($imapConf->pass)
- );
-
- if (!$imap)
- throw new Exception(imap_last_error());
-
- // Fetchs and confirms new transaction mails
-
- $count = 0;
- $inbox = imap_search($imap, 'ALL');
-
- if ($inbox)
- foreach ($inbox as $msg) {
- // Decodes the mail body
-
- $params = [];
- $body = imap_fetchbody($imap, $msg, '1');
- $strings = explode(';', $body);
-
- foreach ($strings as $string) {
- $x = explode(':', $string);
- $params[trim($x[0])] = trim($x[1]);
- }
-
- // Confirms the transaction
-
- $success = FALSE;
-
- try {
- $success = Tpv::confirm($db, $params);
- } catch (\Exception $e) {
- trigger_error($e->getMessage(), E_USER_WARNING);
- }
-
- // Moves the processed mail to another folder
-
- if ($success)
- $folder = $imapConf->successFolder;
- else
- $folder = $imapConf->errorFolder;
-
- if (!imap_mail_move($imap, $msg, "$folder"))
- trigger_error(imap_last_error(), E_USER_WARNING);
-
- $count++;
- }
-
- imap_expunge($imap);
-
- // Cleans the old mails
-
- $deleted = 0;
-
- if (rand(1, 20) == 1) {
- $folders = array(
- $imapConf->successFolder
- ,$imapConf->errorFolder
- );
-
- $date = new \DateTime(NULL);
- $date->sub(new \DateInterval($imapConf->cleanPeriod));
- $filter = sprintf('BEFORE "%s"', $date->format('D, j M Y'));
-
- foreach ($folders as $folder)
- if (imap_reopen($imap, $mailbox.$folder))
- if ($messages = imap_search($imap, $filter)) {
- foreach ($messages as $message)
- imap_delete($imap, $message);
-
- imap_expunge($imap);
- $deleted += count($messages);
- }
- }
-
- echo "$count mails processed, $deleted mails deleted.\n";
- }
-}
-
diff --git a/rest/tpv/confirm-post.php b/rest/tpv/confirm-post.php
deleted file mode 100644
index 20d3cb79..00000000
--- a/rest/tpv/confirm-post.php
+++ /dev/null
@@ -1,13 +0,0 @@
-addFunction('procesaNotificacionSIS');
- $server->handle();
- }
-}
-
-function procesaNotificacionSIS($XML) {
- global $tpvConfirmSoap;
-
- $db = $tpvConfirmSoap->app->getSysConn();
-
- $status = 'OK';
- $requestString = $XML;
-
- // Processes the request
-
- try {
- $xml = new SimpleXMLElement($requestString);
- $params =(array) $xml->{'Request'};
-
- if (!(isset($params['Ds_Amount'])
- && isset($params['Ds_Order'])
- && isset($params['Ds_MerchantCode'])
- && isset($params['Ds_Currency'])
- && isset($params['Ds_Response'])))
- throw new Exception('Missing required parameters');
-
- // Checks the signature
-
- $start = strpos($requestString, '
- Response
- =htmlentities($result)?>
-
- Calculated: =$shaHash?> -
-- Valid: /> -
- - diff --git a/rest/tpv/soap.wsdl b/rest/tpv/soap.wsdl deleted file mode 100644 index bd85821d..00000000 --- a/rest/tpv/soap.wsdl +++ /dev/null @@ -1,51 +0,0 @@ - - -