-
Notifications
You must be signed in to change notification settings - Fork 147
/
Pagarme.php
42 lines (34 loc) · 1.38 KB
/
Pagarme.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
if (!function_exists('curl_init')) {
throw new Exception('PagarMe needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('PagarMe needs the JSON PHP extension.');
}
function __autoload($class){
$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "Pagarme" . DIRECTORY_SEPARATOR;
$file = $dir . ((strstr($class, "PagarMe_")) ? str_replace("PagarMe_", "", $class) : $class) . ".php";
if (file_exists($file)){
require_once($file);
return;
}else{
throw new Exception("Unable to load" .$class);
}
}
/*
require(dirname(__FILE__) . '/lib/Pagarme/Pagarme.php');
require(dirname(__FILE__) . '/lib/Pagarme/Error.php');
require(dirname(__FILE__) . '/lib/Pagarme/Exception.php');
require(dirname(__FILE__) . '/lib/Pagarme/ApiException.php');
require(dirname(__FILE__) . '/lib/Pagarme/RestClient.php');
require(dirname(__FILE__) . '/lib/Pagarme/Request.php');
require(dirname(__FILE__) . '/lib/Pagarme/model.php');
require(dirname(__FILE__) . '/lib/Pagarme/TransactionCommon.php');
require(dirname(__FILE__) . '/lib/Pagarme/Transaction.php');
require(dirname(__FILE__). '/lib/Pagarme/Plan.php');
require(dirname(__FILE__) . '/lib/Pagarme/Subscription.php');
require(dirname(__FILE__) . '/lib/Pagarme/Customer.php');
require(dirname(__FILE__) . '/lib/Pagarme/Address.php');
require(dirname(__FILE__) . '/lib/Pagarme/Phone.php');
*/
?>