PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/public/paypal/paymentko.php

https://bitbucket.org/speedealing/speedealing
PHP | 92 lines | 35 code | 23 blank | 34 comment | 5 complexity | 5e81976e4c39da3c3fbda0e61002db48 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \file htdocs/public/paypal/paymentko.php
  21. * \ingroup paypal
  22. * \brief File to show page after a failed payment.
  23. * This page is called by paypal with url provided to payal competed with parameter TOKEN=xxx
  24. * This token can be used to get more informations.
  25. * \author Laurent Destailleur
  26. */
  27. define("NOLOGIN",1); // This means this output page does not require to be logged.
  28. define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
  29. // For MultiCompany module
  30. $entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
  31. if (is_int($entity))
  32. {
  33. define("DOLENTITY", $entity);
  34. }
  35. require '../../main.inc.php';
  36. require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
  37. require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php';
  38. require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
  39. // Security check
  40. if (empty($conf->paypal->enabled)) accessforbidden('',1,1,1);
  41. $langs->load("main");
  42. $langs->load("other");
  43. $langs->load("dict");
  44. $langs->load("bills");
  45. $langs->load("companies");
  46. $langs->load("paybox");
  47. $langs->load("paypal");
  48. /*
  49. * Actions
  50. */
  51. /*
  52. * View
  53. */
  54. dol_syslog("Callback url when a PayPal payment was canceled. query_string=".$_SERVER["QUERY_STRING"]);
  55. llxHeaderPaypal($langs->trans("PaymentForm"));
  56. // Show ko message
  57. print '<span id="dolpaymentspan"></span>'."\n";
  58. print '<div id="dolpaymentdiv" align="center">'."\n";
  59. print $langs->trans("YourPaymentHasNotBeenRecorded")."<br>";
  60. $PAYPALTOKEN=GETPOST('TOKEN');
  61. if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token');
  62. $PAYPALFULLTAG=GETPOST('FULLTAG');
  63. if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag');
  64. if (! empty($conf->global->PAYPAL_MESSAGE_KO)) print $conf->global->PAYPAL_MESSAGE_KO;
  65. print "\n</div>\n";
  66. html_print_paypal_footer($mysoc,$langs);
  67. $db->close();
  68. llxFooterPaypal();
  69. ?>