|
1
|
|
|
<?php |
|
2
|
|
|
/* Copyright (C) 2017 Alexandre Spangaro <[email protected]> |
|
3
|
|
|
* Copyright (C) 2017 Saasprov <[email protected]> |
|
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
|
|
|
/** |
|
20
|
|
|
* \defgroup stripe Module stripe |
|
21
|
|
|
* \brief Add integration with Stripe online payment system. |
|
22
|
|
|
* \file htdocs/core/modules/modStripe.class.php |
|
23
|
|
|
* \ingroup stripe |
|
24
|
|
|
* \brief Description and activation file for module Stripe |
|
25
|
|
|
*/ |
|
26
|
|
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; |
|
27
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Description and activation class for module Paybox |
|
31
|
|
|
*/ |
|
32
|
|
|
class modStripe extends DolibarrModules |
|
33
|
|
|
{ |
|
34
|
|
|
/** |
|
35
|
|
|
* Constructor. Define names, constants, directories, boxes, permissions |
|
36
|
|
|
* |
|
37
|
|
|
* @param DoliDB $db Database handler |
|
38
|
|
|
*/ |
|
39
|
|
|
function __construct($db) |
|
40
|
|
|
{ |
|
41
|
|
|
$this->db = $db; |
|
42
|
|
|
|
|
43
|
|
|
// Id for module (must be unique). |
|
44
|
|
|
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). |
|
45
|
|
|
$this->numero = 50300; |
|
46
|
|
|
// Key text used to identify module (for permissions, menus, etc...) |
|
47
|
|
|
$this->rights_class = 'stripe'; |
|
48
|
|
|
|
|
49
|
|
|
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other' |
|
50
|
|
|
// It is used to group modules in module setup page |
|
51
|
|
|
$this->family = "other"; |
|
52
|
|
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) |
|
53
|
|
|
$this->name = preg_replace('/^mod/i','',get_class($this)); |
|
54
|
|
|
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) |
|
55
|
|
|
$this->description = "Module to offer an online payment page by credit card with Stripe"; |
|
56
|
|
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version |
|
57
|
|
|
$this->version = 'dolibarr'; |
|
58
|
|
|
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) |
|
59
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); |
|
60
|
|
|
// Where to store the module in setup page (0=common,1=interface,2=other) |
|
61
|
|
|
$this->special = 1; |
|
62
|
|
|
// Name of image file used for this module. |
|
63
|
|
|
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' |
|
64
|
|
|
// If file is in module/img directory, use this->picto=DOL_URL_ROOT.'/module/img/file.png' |
|
65
|
|
|
$this->picto='stripe@stripe'; |
|
66
|
|
|
|
|
67
|
|
|
// Data directories to create when module is enabled. |
|
68
|
|
|
$this->dirs = array(); |
|
69
|
|
|
|
|
70
|
|
|
// Config pages. Put here list of php page names stored in admmin directory used to setup module. |
|
71
|
|
|
$this->config_page_url = array("stripe.php@stripe"); |
|
72
|
|
|
|
|
73
|
|
|
// Dependencies |
|
74
|
|
|
$this->depends = array(); // List of modules id that must be enabled if this module is enabled |
|
75
|
|
|
$this->requiredby = array(); // List of modules id to disable if this one is disabled |
|
76
|
|
|
$this->phpmin = array(5,3); // Minimum version of PHP required by module |
|
77
|
|
|
$this->need_dolibarr_version = array(5,0); // Minimum version of Dolibarr required by module |
|
78
|
|
|
$this->langfiles = array("stripe"); |
|
79
|
|
|
|
|
80
|
|
|
// Constants |
|
81
|
|
|
$this->const = array(); // List of particular constants to add when module is enabled |
|
82
|
|
|
|
|
83
|
|
|
// New pages on tabs |
|
84
|
|
|
$this->tabs = array(); |
|
85
|
|
|
|
|
86
|
|
|
// Boxes |
|
87
|
|
|
$this->boxes = array(); // List of boxes |
|
88
|
|
|
$r=0; |
|
89
|
|
|
|
|
90
|
|
|
// Permissions |
|
91
|
|
|
$this->rights = array(); // Permission array used by this module |
|
92
|
|
|
$r=0; |
|
93
|
|
|
|
|
94
|
|
|
// Main menu entries |
|
95
|
|
|
$this->menus = array(); // List of menus to add |
|
96
|
|
|
$r=0; |
|
97
|
|
|
|
|
98
|
|
|
// Exports |
|
99
|
|
|
$r=1; |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
|