-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk.php
executable file
·101 lines (79 loc) · 2.25 KB
/
sdk.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/*error_reporting(E_ALL);
ini_set('display_errors', '1');*/
require_once 'lib/PayU.php';
/**
*
*/
class PayUSDK
{
//Credenciales
/**
* The account Id
*/
var $accountID = '12345';
/**
* The merchant API key
*/
var $apiKey = "7dg9ao36ro3jetgr1gkbtjb8s3"; //Ingrese aquí su propio apiKey.
/**
* The merchant API Login
*/
var $apiLogin = "5fc4e7484ad3a77"; //Ingrese aquí su propio apiLogin.
/**
* The merchant Id
*/
var $merchantId = "12345"; //Ingrese aquí su Id de Comercio.
function __construct($isCashPayment = false, $credentials = array())
{
PayU::$language = SupportedLanguages::ES; //Seleccione el idioma.
if(sizeof($credentials) > 0){
if(isset($credentials['accountID'])){
$this->setAccountID($credentials['accountID']);
}
if(isset($credentials['apiKey'])){
$this->setApiKey($credentials['apiKey']);
}
if(isset($credentials['apiLogin'])){
$this->setApiLogin($credentials['apiLogin']);
}
if(isset($credentials['merchantId'])){
$this->setMerchantId($credentials['merchantId']);
}
}
// URL de Pagos
Environment::setPaymentsCustomUrl("https://api.payulatam.com/payments-api/4.0/service.cgi");
// URL de Consultas
Environment::setReportsCustomUrl("https://api.payulatam.com/reports-api/4.0/service.cgi");
// URL de Suscripciones para Pagos Recurrentes
Environment::setSubscriptionsCustomUrl("https://api.payulatam.com/payments-api/rest/v4.3/");
//Informacion para conexion de SDK
PayU::$apiKey = $this->getApiKey();
PayU::$apiLogin = $this->getApiLogin();
PayU::$merchantId = $this->getMerchantId();
}
public function getAccountID(){
return $this->accountID;
}
public function setAccountID($accountID){
$this->accountID = $accountID;
}
public function getApiLogin(){
return $this->apiLogin;
}
public function setApiLogin($apiLogin){
$this->apiLogin = $apiLogin;
}
public function getApiKey(){
return $this->apiKey;
}
public function setApiKey($apiKey){
$this->apiKey = $apiKey;
}
public function getMerchantId(){
return $this->merchantId;
}
public function setMerchantId($merchantId){
$this->merchantId = $merchantId;
}
}