paymentko.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/public/paybox/paymentko.php
  20. * \ingroup paybox
  21. * \brief File to show page after a failed payment
  22. * \author Laurent Destailleur
  23. */
  24. define("NOLOGIN",1); // This means this output page does not require to be logged.
  25. define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
  26. require '../../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/paybox/lib/paybox.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
  29. // Security check
  30. if (empty($conf->paybox->enabled)) accessforbidden('',1,1,1);
  31. $langs->load("main");
  32. $langs->load("other");
  33. $langs->load("dict");
  34. $langs->load("bills");
  35. $langs->load("companies");
  36. $langs->load("paybox");
  37. $langs->load("paypal");
  38. /*
  39. * Actions
  40. */
  41. /*
  42. * View
  43. */
  44. dol_syslog("Callback url when a PayBox payment was canceled. query_string=".(empty($_SERVER["QUERY_STRING"])?'':$_SERVER["QUERY_STRING"])." script_uri=".(empty($_SERVER["SCRIPT_URI"])?'':$_SERVER["SCRIPT_URI"]), LOG_DEBUG, 0, '_paybox');
  45. $tracepost = "";
  46. foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
  47. dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paybox');
  48. // Send an email
  49. if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=/',$fulltag))
  50. {
  51. $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
  52. $from=$conf->global->MAILING_EMAIL_FROM;
  53. require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
  54. $mailfile = new CMailFile(
  55. 'New subscription payed',
  56. $sendto,
  57. $from,
  58. 'New subscription payed '.$fulltag
  59. );
  60. $result=$mailfile->sendfile();
  61. if ($result)
  62. {
  63. dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_paybox');
  64. }
  65. else
  66. {
  67. dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_paybox');
  68. }
  69. }
  70. llxHeaderPayBox($langs->trans("PaymentForm"));
  71. // Show message
  72. print '<span id="dolpaymentspan"></span>'."\n";
  73. print '<div id="dolpaymentdiv" align="center">'."\n";
  74. print $langs->trans("YourPaymentHasNotBeenRecorded")."<br>\n";
  75. if (! empty($conf->global->PAYBOX_MESSAGE_KO)) print $conf->global->PAYBOX_MESSAGE_KO;
  76. print "\n</div>\n";
  77. html_print_paybox_footer($mysoc,$langs);
  78. llxFooterPayBox();
  79. $db->close();
  80. ?>