Version Notes
* Feature: Currency Exchange for USD EUR GBP
* Bug-Fix: Conflic resolution in providers selector
Download this release
Release Info
Developer | Eduardo Aguilar |
Extension | Compropago_Payment_Extension |
Version | 2.1.0 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.1.0
- app/code/community/Compropago/CpPayment/Model/Standard.php +26 -27
- app/code/community/Compropago/CpPayment/controllers/IndexController.php +17 -37
- app/code/community/Compropago/CpPayment/etc/config.xml +1 -1
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Webhook.php → app/code/community/Compropago/CpPayment/sql/cppayment_setup/install-2.1.0.php +11 -9
- app/design/frontend/base/default/template/compropago/cppayment/cash.phtml +1 -29
- lib/Compropago/composer.json +1 -1
- lib/Compropago/composer.lock +6 -10
- lib/Compropago/vendor/autoload.php +2 -2
- lib/Compropago/vendor/composer/ClassLoader.php +38 -10
- lib/Compropago/vendor/composer/autoload_classmap.php +16 -36
- lib/Compropago/vendor/composer/autoload_real.php +5 -5
- lib/Compropago/vendor/composer/autoload_static.php +20 -40
- lib/Compropago/vendor/composer/installed.json +6 -9
- lib/Compropago/vendor/compropago/php-sdk/.gitignore +2 -1
- lib/Compropago/vendor/compropago/php-sdk/CHANGELOG.md +11 -1
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Client.php +15 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php +0 -9
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/CpOrderInfo.php +0 -112
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/FeeDetails.php +0 -62
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/InstrcutionDetails.php +0 -47
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/Instructions.php +0 -67
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/NewOrderInfo.php +0 -67
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/OrderInfo.php +0 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/SmsInfo.php +0 -47
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Factory.php +64 -173
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Json/Serialize.php +0 -261
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/CpOrderInfo.php +33 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Customer.php +10 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/EvalAuthInfo.php +13 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/FeeDetails.php +15 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/InstructionDetails.php +19 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Instructions.php +20 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/NewOrderInfo.php +31 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/OrderInfo.php +15 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/PlaceOrderInfo.php +44 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Provider.php +16 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsData.php +13 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsInfo.php +15 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsObject.php +10 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Webhook.php +11 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Serialize.php +291 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/CpObject.php +0 -50
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/CpOrderInfo10.php +0 -193
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/Data.php +0 -34
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/FeeDetails10.php +0 -96
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/InstructionDetails10.php +0 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/Instructions10.php +0 -108
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/NewOrderInfo10.php +0 -117
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/OrderInfo10.php +0 -82
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/PaymentDetails.php +0 -43
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/ProductInformation.php +0 -36
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/SmsInfo10.php +0 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/SmsPayment.php +0 -34
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/CpOrderInfo11.php +0 -142
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/FeeDetails11.php +0 -76
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/InstructionDetails11.php +0 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/Instructions11.php +0 -108
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/NewOrderInfo11.php +0 -114
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/OrderInfo11.php +0 -82
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsData.php +0 -34
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsInfo11.php +0 -70
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsObject.php +0 -35
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Customer.php +0 -35
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/EvalAuthInfo.php +0 -56
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/PlaceOrderInfo.php +0 -53
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Provider.php +0 -41
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/WebhookError.php +0 -29
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Service.php +84 -126
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Http.php +61 -82
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Request.php +77 -0
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Rest.php +0 -136
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Validations.php +12 -49
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php +121 -207
- lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/UnitTest/autoload.php +24 -0
- lib/Compropago/vendor/compropago/php-sdk/README.md +54 -52
- lib/Compropago/vendor/compropago/php-sdk/composer.json +0 -3
- package.xml +11 -9
app/code/community/Compropago/CpPayment/Model/Standard.php
CHANGED
@@ -21,7 +21,7 @@
|
|
21 |
require_once(Mage::getBaseDir('lib') . DS . 'Compropago' . DS . 'vendor' . DS . 'autoload.php');
|
22 |
|
23 |
use CompropagoSdk\Client;
|
24 |
-
use CompropagoSdk\
|
25 |
use CompropagoSdk\Tools\Validations;
|
26 |
|
27 |
class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abstract
|
@@ -34,8 +34,6 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
34 |
protected $_canUseInternal = false;
|
35 |
protected $_isInitializeNeeded = true;
|
36 |
|
37 |
-
|
38 |
-
|
39 |
/**
|
40 |
* Asignacion inicial de informacion
|
41 |
*
|
@@ -133,22 +131,23 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
133 |
$infoIntance = $this->getInfoInstance();
|
134 |
$info = unserialize($infoIntance->getAdditionalData());
|
135 |
|
136 |
-
|
137 |
-
$order = new PlaceOrderInfo(
|
138 |
-
$orderNumber,
|
139 |
-
$name,
|
140 |
-
$grandTotal,
|
141 |
-
$info['customer_name'],
|
142 |
-
$info['customer_email'],
|
143 |
-
$info['payment_type'],
|
144 |
-
null,
|
145 |
-
'magento',
|
146 |
-
Mage::getVersion()
|
147 |
-
);
|
148 |
-
|
149 |
-
|
150 |
try
|
151 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
$client = new Client(
|
153 |
$this->getConfigData('compropago_publickey'),
|
154 |
$this->getConfigData('compropago_privatekey'),
|
@@ -157,11 +156,11 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
157 |
|
158 |
$response = $client->api->placeOrder($order);
|
159 |
|
160 |
-
if (empty($response->
|
161 |
Mage::throwException("El servicio de ComproPago no se encuentra disponible.");
|
162 |
}
|
163 |
|
164 |
-
Mage::getSingleton('core/session')->setCompropagoId($response->
|
165 |
|
166 |
|
167 |
|
@@ -214,8 +213,8 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
214 |
$DB->insert($prefix."compropago_orders", array(
|
215 |
'date' => $date,
|
216 |
'modified' => $date,
|
217 |
-
'compropagoId' => $response->
|
218 |
-
'compropagoStatus' => $response->
|
219 |
'storeCartId' => $orderNumber,
|
220 |
'storeOrderId' => $orderNumber,
|
221 |
'storeExtra' => 'COMPROPAGO_PENDING',
|
@@ -230,15 +229,15 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
230 |
$DB->insert($prefix."compropago_transactions", array(
|
231 |
'orderId' => $orderNumber,
|
232 |
'date' => $date,
|
233 |
-
'compropagoId' => $response->
|
234 |
-
'compropagoStatus' => $response->
|
235 |
-
'compropagoStatusLast' => $response->
|
236 |
'ioIn' => $ioin,
|
237 |
'ioOut' => $ioout
|
238 |
));
|
239 |
|
240 |
|
241 |
-
}catch (Exception $error){
|
242 |
Mage::throwException($error->getMessage());
|
243 |
}
|
244 |
|
@@ -263,7 +262,7 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
263 |
$quoteData = $quote->getData();
|
264 |
$grandTotal = $quoteData['grand_total'];
|
265 |
|
266 |
-
$providers = $client->api->listProviders(
|
267 |
$filter = explode(',', $this->getConfigData('compropago_provider_available'));
|
268 |
|
269 |
$record = array();
|
@@ -308,7 +307,7 @@ class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abst
|
|
308 |
|
309 |
/**
|
310 |
* Despliegue de retroalimentacion en el panel de administración
|
311 |
-
*
|
312 |
* @param bool $enabled
|
313 |
* @param string $publickey
|
314 |
* @param string $privatekey
|
21 |
require_once(Mage::getBaseDir('lib') . DS . 'Compropago' . DS . 'vendor' . DS . 'autoload.php');
|
22 |
|
23 |
use CompropagoSdk\Client;
|
24 |
+
use CompropagoSdk\Factory\Factory;
|
25 |
use CompropagoSdk\Tools\Validations;
|
26 |
|
27 |
class Compropago_CpPayment_Model_Standard extends Mage_Payment_Model_Method_Abstract
|
34 |
protected $_canUseInternal = false;
|
35 |
protected $_isInitializeNeeded = true;
|
36 |
|
|
|
|
|
37 |
/**
|
38 |
* Asignacion inicial de informacion
|
39 |
*
|
131 |
$infoIntance = $this->getInfoInstance();
|
132 |
$info = unserialize($infoIntance->getAdditionalData());
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
try
|
135 |
{
|
136 |
+
$order_info = [
|
137 |
+
'order_id' => $orderNumber,
|
138 |
+
'order_name' => $name,
|
139 |
+
'order_price' => $grandTotal,
|
140 |
+
'customer_name' => $info['customer_name'],
|
141 |
+
'customer_email' => $info['customer_email'],
|
142 |
+
'payment_type' => $info['payment_type'],
|
143 |
+
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
144 |
+
'image_url' => null,
|
145 |
+
'app_client_name' => 'magento',
|
146 |
+
'app_client_version' => Mage::getVersion()
|
147 |
+
];
|
148 |
+
|
149 |
+
$order = Factory::getInstanceOf('PlaceOrderInfo', $order_info);
|
150 |
+
|
151 |
$client = new Client(
|
152 |
$this->getConfigData('compropago_publickey'),
|
153 |
$this->getConfigData('compropago_privatekey'),
|
156 |
|
157 |
$response = $client->api->placeOrder($order);
|
158 |
|
159 |
+
if (empty($response->id)) {
|
160 |
Mage::throwException("El servicio de ComproPago no se encuentra disponible.");
|
161 |
}
|
162 |
|
163 |
+
Mage::getSingleton('core/session')->setCompropagoId($response->id);
|
164 |
|
165 |
|
166 |
|
213 |
$DB->insert($prefix."compropago_orders", array(
|
214 |
'date' => $date,
|
215 |
'modified' => $date,
|
216 |
+
'compropagoId' => $response->id,
|
217 |
+
'compropagoStatus' => $response->status,
|
218 |
'storeCartId' => $orderNumber,
|
219 |
'storeOrderId' => $orderNumber,
|
220 |
'storeExtra' => 'COMPROPAGO_PENDING',
|
229 |
$DB->insert($prefix."compropago_transactions", array(
|
230 |
'orderId' => $orderNumber,
|
231 |
'date' => $date,
|
232 |
+
'compropagoId' => $response->id,
|
233 |
+
'compropagoStatus' => $response->status,
|
234 |
+
'compropagoStatusLast' => $response->status,
|
235 |
'ioIn' => $ioin,
|
236 |
'ioOut' => $ioout
|
237 |
));
|
238 |
|
239 |
|
240 |
+
} catch (Exception $error) {
|
241 |
Mage::throwException($error->getMessage());
|
242 |
}
|
243 |
|
262 |
$quoteData = $quote->getData();
|
263 |
$grandTotal = $quoteData['grand_total'];
|
264 |
|
265 |
+
$providers = $client->api->listProviders(true, $grandTotal, Mage::app()->getStore()->getCurrentCurrencyCode());
|
266 |
$filter = explode(',', $this->getConfigData('compropago_provider_available'));
|
267 |
|
268 |
$record = array();
|
307 |
|
308 |
/**
|
309 |
* Despliegue de retroalimentacion en el panel de administración
|
310 |
+
*
|
311 |
* @param bool $enabled
|
312 |
* @param string $publickey
|
313 |
* @param string $privatekey
|
app/code/community/Compropago/CpPayment/controllers/IndexController.php
CHANGED
@@ -34,14 +34,11 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
34 |
*/
|
35 |
protected $_model = null;
|
36 |
|
37 |
-
|
38 |
-
|
39 |
public function _construct()
|
40 |
{
|
41 |
$this->_model = Mage::getModel('cppayment/Standard');
|
42 |
}
|
43 |
|
44 |
-
|
45 |
public function indexAction()
|
46 |
{
|
47 |
/**
|
@@ -49,15 +46,13 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
49 |
*/
|
50 |
$request = @file_get_contents('php://input');
|
51 |
|
52 |
-
|
53 |
/**
|
54 |
* Se valida el request y se transforma con la cadena a un objeto de tipo CpOrderInfo con el Factory
|
55 |
*/
|
56 |
-
if(!$resp_webhook = Factory::
|
57 |
die('Tipo de Request no Valido');
|
58 |
}
|
59 |
|
60 |
-
|
61 |
/**
|
62 |
* Gurdamos la informacion necesaria para el Cliente
|
63 |
* las llaves de compropago y el modo de ejecucion de la tienda
|
@@ -66,7 +61,6 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
66 |
$privatekey = $this->_model->getConfigData('compropago_privatekey');
|
67 |
$live = (int)trim($this->_model->getConfigData('compropago_mode')) == 1 ? true : false;
|
68 |
|
69 |
-
|
70 |
/**
|
71 |
* Se valida que las llaves no esten vacias (No es obligatorio pero si recomendado)
|
72 |
*/
|
@@ -74,49 +68,39 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
74 |
die("Se requieren las llaves de compropago");
|
75 |
}
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
$client = new Client(
|
80 |
-
$publickey,
|
81 |
-
$privatekey,
|
82 |
-
$live
|
83 |
-
);
|
84 |
|
85 |
Validations::validateGateway($client);
|
86 |
-
}catch (Exception $e) {
|
87 |
die($e->getMessage());
|
88 |
}
|
89 |
|
90 |
-
|
91 |
/**
|
92 |
* Verificamos si recivimos una peticion de prueba
|
93 |
*/
|
94 |
-
if($resp_webhook->
|
95 |
-
die("Probando el WebHook?,
|
96 |
}
|
97 |
|
98 |
|
99 |
-
try{
|
100 |
/**
|
101 |
* Verificamos la informacion del Webhook recivido
|
102 |
*/
|
103 |
-
$response = $client->api->verifyOrder($resp_webhook->
|
104 |
-
|
105 |
|
106 |
/**
|
107 |
* Comprovamos que la verificacion fue exitosa
|
108 |
*/
|
109 |
-
if($response->
|
110 |
die('Error procesando el número de orden');
|
111 |
}
|
112 |
|
113 |
-
|
114 |
-
|
115 |
/* ************************************************************************
|
116 |
RUTINAS DE BASE DE DATOS
|
117 |
************************************************************************ */
|
118 |
|
119 |
-
|
120 |
$DBread = Mage::getSingleton('core/resource')->getConnection('core_read');
|
121 |
$DBwrite = Mage::getSingleton('core/resource')->getConnection('core_write');
|
122 |
$prefix = Mage::getConfig()->getTablePrefix();
|
@@ -126,27 +110,23 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
126 |
$date = time();
|
127 |
|
128 |
|
129 |
-
$sql = "SELECT * FROM " . $prefix . "compropago_orders where compropagoId = '{$response->
|
130 |
$res = $DBread->fetchAll($sql);
|
131 |
|
132 |
$storedId = $res[0]['storeOrderId'];
|
133 |
|
134 |
-
if(empty($storedId)){
|
135 |
throw new Exception('El pago no corresponde a esta tienda.');
|
136 |
}
|
137 |
|
138 |
-
|
139 |
-
|
140 |
/* Rutinas de aprovación
|
141 |
------------------------------------------------------------------------*/
|
142 |
-
|
143 |
-
$_order = Mage::getModel('sales/order')->loadByIncrementId($response->getOrderInfo()->getOrderId());
|
144 |
-
|
145 |
|
146 |
/**
|
147 |
* Generamos las rutinas correspondientes para cada uno de los casos posible del webhook
|
148 |
*/
|
149 |
-
switch ($response->
|
150 |
case 'charge.pending':
|
151 |
$status = $this->_model->getConfigData('compropago_order_status_new');
|
152 |
$message = 'The user has not completed the payment process yet.';
|
@@ -209,7 +189,7 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
209 |
|
210 |
$DBwrite->update($prefix."compropago_orders",array(
|
211 |
'modified' => $date,
|
212 |
-
'compropagoStatus' => $response->
|
213 |
'storeExtra' => $nomestatus,
|
214 |
), 'id='.$res[0]['id']);
|
215 |
|
@@ -220,15 +200,15 @@ class Compropago_CpPayment_IndexController extends Mage_Core_Controller_Front_Ac
|
|
220 |
$DBwrite->insert($prefix."compropago_transactions", array(
|
221 |
'orderId' => $storedId,
|
222 |
'date' => $date,
|
223 |
-
'compropagoId' => $response->
|
224 |
-
'compropagoStatus' => $response->
|
225 |
'compropagoStatusLast' => $res[0]['compropagoStatus'],
|
226 |
'ioIn' => $ioin,
|
227 |
'ioOut' => $ioout
|
228 |
));
|
229 |
|
230 |
|
231 |
-
}catch (Exception $e){
|
232 |
//something went wrong at sdk lvl
|
233 |
die($e->getMessage());
|
234 |
}
|
34 |
*/
|
35 |
protected $_model = null;
|
36 |
|
|
|
|
|
37 |
public function _construct()
|
38 |
{
|
39 |
$this->_model = Mage::getModel('cppayment/Standard');
|
40 |
}
|
41 |
|
|
|
42 |
public function indexAction()
|
43 |
{
|
44 |
/**
|
46 |
*/
|
47 |
$request = @file_get_contents('php://input');
|
48 |
|
|
|
49 |
/**
|
50 |
* Se valida el request y se transforma con la cadena a un objeto de tipo CpOrderInfo con el Factory
|
51 |
*/
|
52 |
+
if (!$resp_webhook = Factory::getInstanceOf('CpOrderInfo', $request)) {
|
53 |
die('Tipo de Request no Valido');
|
54 |
}
|
55 |
|
|
|
56 |
/**
|
57 |
* Gurdamos la informacion necesaria para el Cliente
|
58 |
* las llaves de compropago y el modo de ejecucion de la tienda
|
61 |
$privatekey = $this->_model->getConfigData('compropago_privatekey');
|
62 |
$live = (int)trim($this->_model->getConfigData('compropago_mode')) == 1 ? true : false;
|
63 |
|
|
|
64 |
/**
|
65 |
* Se valida que las llaves no esten vacias (No es obligatorio pero si recomendado)
|
66 |
*/
|
68 |
die("Se requieren las llaves de compropago");
|
69 |
}
|
70 |
|
71 |
+
try {
|
72 |
+
$client = new Client($publickey, $privatekey, $live);
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
Validations::validateGateway($client);
|
75 |
+
} catch (Exception $e) {
|
76 |
die($e->getMessage());
|
77 |
}
|
78 |
|
|
|
79 |
/**
|
80 |
* Verificamos si recivimos una peticion de prueba
|
81 |
*/
|
82 |
+
if ($resp_webhook->id == "ch_00000-000-0000-000000") {
|
83 |
+
die("Probando el WebHook?, Ruta correcta.");
|
84 |
}
|
85 |
|
86 |
|
87 |
+
try {
|
88 |
/**
|
89 |
* Verificamos la informacion del Webhook recivido
|
90 |
*/
|
91 |
+
$response = $client->api->verifyOrder($resp_webhook->id);
|
|
|
92 |
|
93 |
/**
|
94 |
* Comprovamos que la verificacion fue exitosa
|
95 |
*/
|
96 |
+
if ($response->type == 'error') {
|
97 |
die('Error procesando el número de orden');
|
98 |
}
|
99 |
|
|
|
|
|
100 |
/* ************************************************************************
|
101 |
RUTINAS DE BASE DE DATOS
|
102 |
************************************************************************ */
|
103 |
|
|
|
104 |
$DBread = Mage::getSingleton('core/resource')->getConnection('core_read');
|
105 |
$DBwrite = Mage::getSingleton('core/resource')->getConnection('core_write');
|
106 |
$prefix = Mage::getConfig()->getTablePrefix();
|
110 |
$date = time();
|
111 |
|
112 |
|
113 |
+
$sql = "SELECT * FROM " . $prefix . "compropago_orders where compropagoId = '{$response->id}'";
|
114 |
$res = $DBread->fetchAll($sql);
|
115 |
|
116 |
$storedId = $res[0]['storeOrderId'];
|
117 |
|
118 |
+
if (empty($storedId)) {
|
119 |
throw new Exception('El pago no corresponde a esta tienda.');
|
120 |
}
|
121 |
|
|
|
|
|
122 |
/* Rutinas de aprovación
|
123 |
------------------------------------------------------------------------*/
|
124 |
+
$_order = Mage::getModel('sales/order')->loadByIncrementId($response->order_info->order_id);
|
|
|
|
|
125 |
|
126 |
/**
|
127 |
* Generamos las rutinas correspondientes para cada uno de los casos posible del webhook
|
128 |
*/
|
129 |
+
switch ($response->type) {
|
130 |
case 'charge.pending':
|
131 |
$status = $this->_model->getConfigData('compropago_order_status_new');
|
132 |
$message = 'The user has not completed the payment process yet.';
|
189 |
|
190 |
$DBwrite->update($prefix."compropago_orders",array(
|
191 |
'modified' => $date,
|
192 |
+
'compropagoStatus' => $response->type,
|
193 |
'storeExtra' => $nomestatus,
|
194 |
), 'id='.$res[0]['id']);
|
195 |
|
200 |
$DBwrite->insert($prefix."compropago_transactions", array(
|
201 |
'orderId' => $storedId,
|
202 |
'date' => $date,
|
203 |
+
'compropagoId' => $response->id,
|
204 |
+
'compropagoStatus' => $response->type,
|
205 |
'compropagoStatusLast' => $res[0]['compropagoStatus'],
|
206 |
'ioIn' => $ioin,
|
207 |
'ioOut' => $ioout
|
208 |
));
|
209 |
|
210 |
|
211 |
+
} catch (Exception $e) {
|
212 |
//something went wrong at sdk lvl
|
213 |
die($e->getMessage());
|
214 |
}
|
app/code/community/Compropago/CpPayment/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Compropago_CpPayment>
|
5 |
-
<version>2.
|
6 |
</Compropago_CpPayment>
|
7 |
</modules>
|
8 |
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Compropago_CpPayment>
|
5 |
+
<version>2.1.0</version>
|
6 |
</Compropago_CpPayment>
|
7 |
</modules>
|
8 |
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Webhook.php → app/code/community/Compropago/CpPayment/sql/cppayment_setup/install-2.1.0.php
RENAMED
@@ -18,17 +18,19 @@
|
|
18 |
* Compropago $Library
|
19 |
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
*/
|
|
|
21 |
|
|
|
22 |
|
23 |
-
|
|
|
24 |
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
public $url;
|
30 |
-
public $mode;
|
31 |
-
public $status;
|
32 |
|
33 |
-
|
34 |
-
}
|
18 |
* Compropago $Library
|
19 |
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
*/
|
21 |
+
require_once(Mage::getBaseDir('lib') . DS . 'Compropago' . DS . 'vendor' . DS . 'autoload.php');
|
22 |
|
23 |
+
use CompropagoSdk\Extern\TransactTables;
|
24 |
|
25 |
+
$installer = $this;
|
26 |
+
$installer->startSetup();
|
27 |
|
28 |
+
foreach (TransactTables::sqlDropTables(Mage::getConfig()->getTablePrefix()) as $table){
|
29 |
+
$installer->run($table);
|
30 |
+
}
|
31 |
|
32 |
+
foreach (TransactTables::sqlCreateTables(Mage::getConfig()->getTablePrefix()) as $table){
|
33 |
+
$installer->run($table);
|
34 |
+
}
|
|
|
|
|
|
|
35 |
|
36 |
+
$installer->endSetup();
|
|
app/design/frontend/base/default/template/compropago/cppayment/cash.phtml
CHANGED
@@ -4,35 +4,7 @@ $_model = $this->getMethod();
|
|
4 |
$_getProviders = $_model->getProviders();
|
5 |
?>
|
6 |
|
7 |
-
<script>
|
8 |
-
paymentcheck = document.querySelector("#p_method_cppayment");
|
9 |
-
provider = document.querySelector("#store_code_selected");
|
10 |
-
paymentcheck.checked = true;
|
11 |
-
|
12 |
-
btn = document.querySelector("button[ onclick^=payment ]");
|
13 |
-
btn.setAttribute("onclick"," ");
|
14 |
-
|
15 |
-
phone = document.querySelector("[title=Telephone]").value;
|
16 |
-
document.querySelector("#customer_phone").value = phone;
|
17 |
-
|
18 |
-
btn.addEventListener("click",function(evt){
|
19 |
-
evt.preventDefault();
|
20 |
-
|
21 |
-
if(paymentcheck.checked){
|
22 |
-
if(provider.value == ""){
|
23 |
-
alert("Seleccione una tienda para realizar el pago");
|
24 |
-
}else{
|
25 |
-
payment.save();
|
26 |
-
}
|
27 |
-
}else{
|
28 |
-
payment.save();
|
29 |
-
}
|
30 |
-
});
|
31 |
-
|
32 |
-
setBack(document.getElementById("store_code_selected").value.toLowerCase());
|
33 |
-
</script>
|
34 |
-
|
35 |
-
|
36 |
|
37 |
<div>
|
38 |
<ul id="payment_form_<?php echo $_code; ?>" style="display: none">
|
4 |
$_getProviders = $_model->getProviders();
|
5 |
?>
|
6 |
|
7 |
+
<script> setBack(document.getElementById("store_code_selected").value.toLowerCase()); </script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
<div>
|
10 |
<ul id="payment_form_<?php echo $_code; ?>" style="display: none">
|
lib/Compropago/composer.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
"require": {
|
3 |
-
"compropago/php-sdk": "^
|
4 |
}
|
5 |
}
|
1 |
{
|
2 |
"require": {
|
3 |
+
"compropago/php-sdk": "^3.0"
|
4 |
}
|
5 |
}
|
lib/Compropago/composer.lock
CHANGED
@@ -4,21 +4,20 @@
|
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
-
"hash": "
|
8 |
-
"content-hash": "61b025aad9e0c1e8ba54e9a410e90384",
|
9 |
"packages": [
|
10 |
{
|
11 |
"name": "compropago/php-sdk",
|
12 |
-
"version": "
|
13 |
"source": {
|
14 |
"type": "git",
|
15 |
"url": "https://github.com/compropago/compropago-php.git",
|
16 |
-
"reference": "
|
17 |
},
|
18 |
"dist": {
|
19 |
"type": "zip",
|
20 |
-
"url": "https://api.github.com/repos/compropago/compropago-php/zipball/
|
21 |
-
"reference": "
|
22 |
"shasum": ""
|
23 |
},
|
24 |
"require": {
|
@@ -27,9 +26,6 @@
|
|
27 |
"require-dev": {
|
28 |
"phpunit/phpunit": ">=5.3"
|
29 |
},
|
30 |
-
"suggest": {
|
31 |
-
"compropago/views-sdk": "Permite la manipulacion de Listado de Proveedores, Recibos de compra y botones de pago dinamicos"
|
32 |
-
},
|
33 |
"type": "library",
|
34 |
"autoload": {
|
35 |
"psr-4": {
|
@@ -52,7 +48,7 @@
|
|
52 |
"pagos internet",
|
53 |
"payment gateway"
|
54 |
],
|
55 |
-
"time": "
|
56 |
}
|
57 |
],
|
58 |
"packages-dev": [],
|
4 |
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
5 |
"This file is @generated automatically"
|
6 |
],
|
7 |
+
"content-hash": "ae186cdd3036400929e939b75b99e5d6",
|
|
|
8 |
"packages": [
|
9 |
{
|
10 |
"name": "compropago/php-sdk",
|
11 |
+
"version": "3.0.1",
|
12 |
"source": {
|
13 |
"type": "git",
|
14 |
"url": "https://github.com/compropago/compropago-php.git",
|
15 |
+
"reference": "5465ea298c2c442ff7c309d4639e0b9a41a4e05a"
|
16 |
},
|
17 |
"dist": {
|
18 |
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/compropago/compropago-php/zipball/5465ea298c2c442ff7c309d4639e0b9a41a4e05a",
|
20 |
+
"reference": "5465ea298c2c442ff7c309d4639e0b9a41a4e05a",
|
21 |
"shasum": ""
|
22 |
},
|
23 |
"require": {
|
26 |
"require-dev": {
|
27 |
"phpunit/phpunit": ">=5.3"
|
28 |
},
|
|
|
|
|
|
|
29 |
"type": "library",
|
30 |
"autoload": {
|
31 |
"psr-4": {
|
48 |
"pagos internet",
|
49 |
"payment gateway"
|
50 |
],
|
51 |
+
"time": "2017-01-10T23:45:26+00:00"
|
52 |
}
|
53 |
],
|
54 |
"packages-dev": [],
|
lib/Compropago/vendor/autoload.php
CHANGED
@@ -2,6 +2,6 @@
|
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
|
5 |
-
require_once __DIR__ . '/composer
|
6 |
|
7 |
-
return
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitd4cd0f315e5eff0f7da018057a772bc8::getLoader();
|
lib/Compropago/vendor/composer/ClassLoader.php
CHANGED
@@ -53,8 +53,9 @@ class ClassLoader
|
|
53 |
|
54 |
private $useIncludePath = false;
|
55 |
private $classMap = array();
|
56 |
-
|
57 |
private $classMapAuthoritative = false;
|
|
|
|
|
58 |
|
59 |
public function getPrefixes()
|
60 |
{
|
@@ -271,6 +272,26 @@ class ClassLoader
|
|
271 |
return $this->classMapAuthoritative;
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
/**
|
275 |
* Registers this instance as an autoloader.
|
276 |
*
|
@@ -313,29 +334,34 @@ class ClassLoader
|
|
313 |
*/
|
314 |
public function findFile($class)
|
315 |
{
|
316 |
-
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
317 |
-
if ('\\' == $class[0]) {
|
318 |
-
$class = substr($class, 1);
|
319 |
-
}
|
320 |
-
|
321 |
// class map lookup
|
322 |
if (isset($this->classMap[$class])) {
|
323 |
return $this->classMap[$class];
|
324 |
}
|
325 |
-
if ($this->classMapAuthoritative) {
|
326 |
return false;
|
327 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
|
329 |
$file = $this->findFileWithExtension($class, '.php');
|
330 |
|
331 |
// Search for Hack files if we are running on HHVM
|
332 |
-
if (
|
333 |
$file = $this->findFileWithExtension($class, '.hh');
|
334 |
}
|
335 |
|
336 |
-
if (
|
|
|
|
|
|
|
|
|
337 |
// Remember that this class does not exist.
|
338 |
-
|
339 |
}
|
340 |
|
341 |
return $file;
|
@@ -399,6 +425,8 @@ class ClassLoader
|
|
399 |
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
400 |
return $file;
|
401 |
}
|
|
|
|
|
402 |
}
|
403 |
}
|
404 |
|
53 |
|
54 |
private $useIncludePath = false;
|
55 |
private $classMap = array();
|
|
|
56 |
private $classMapAuthoritative = false;
|
57 |
+
private $missingClasses = array();
|
58 |
+
private $apcuPrefix;
|
59 |
|
60 |
public function getPrefixes()
|
61 |
{
|
272 |
return $this->classMapAuthoritative;
|
273 |
}
|
274 |
|
275 |
+
/**
|
276 |
+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
277 |
+
*
|
278 |
+
* @param string|null $apcuPrefix
|
279 |
+
*/
|
280 |
+
public function setApcuPrefix($apcuPrefix)
|
281 |
+
{
|
282 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* The APCu prefix in use, or null if APCu caching is not enabled.
|
287 |
+
*
|
288 |
+
* @return string|null
|
289 |
+
*/
|
290 |
+
public function getApcuPrefix()
|
291 |
+
{
|
292 |
+
return $this->apcuPrefix;
|
293 |
+
}
|
294 |
+
|
295 |
/**
|
296 |
* Registers this instance as an autoloader.
|
297 |
*
|
334 |
*/
|
335 |
public function findFile($class)
|
336 |
{
|
|
|
|
|
|
|
|
|
|
|
337 |
// class map lookup
|
338 |
if (isset($this->classMap[$class])) {
|
339 |
return $this->classMap[$class];
|
340 |
}
|
341 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
342 |
return false;
|
343 |
}
|
344 |
+
if (null !== $this->apcuPrefix) {
|
345 |
+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
346 |
+
if ($hit) {
|
347 |
+
return $file;
|
348 |
+
}
|
349 |
+
}
|
350 |
|
351 |
$file = $this->findFileWithExtension($class, '.php');
|
352 |
|
353 |
// Search for Hack files if we are running on HHVM
|
354 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
355 |
$file = $this->findFileWithExtension($class, '.hh');
|
356 |
}
|
357 |
|
358 |
+
if (null !== $this->apcuPrefix) {
|
359 |
+
apcu_add($this->apcuPrefix.$class, $file);
|
360 |
+
}
|
361 |
+
|
362 |
+
if (false === $file) {
|
363 |
// Remember that this class does not exist.
|
364 |
+
$this->missingClasses[$class] = true;
|
365 |
}
|
366 |
|
367 |
return $file;
|
425 |
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
426 |
return $file;
|
427 |
}
|
428 |
+
|
429 |
+
return false;
|
430 |
}
|
431 |
}
|
432 |
|
lib/Compropago/vendor/composer/autoload_classmap.php
CHANGED
@@ -8,45 +8,25 @@ $baseDir = dirname($vendorDir);
|
|
8 |
return array(
|
9 |
'CompropagoSdk\\Client' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Client.php',
|
10 |
'CompropagoSdk\\Extern\\TransactTables' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php',
|
11 |
-
'CompropagoSdk\\Factory\\Abs\\CpOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/CpOrderInfo.php',
|
12 |
-
'CompropagoSdk\\Factory\\Abs\\FeeDetails' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/FeeDetails.php',
|
13 |
-
'CompropagoSdk\\Factory\\Abs\\InstrcutionDetails' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/InstrcutionDetails.php',
|
14 |
-
'CompropagoSdk\\Factory\\Abs\\Instructions' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/Instructions.php',
|
15 |
-
'CompropagoSdk\\Factory\\Abs\\NewOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/NewOrderInfo.php',
|
16 |
-
'CompropagoSdk\\Factory\\Abs\\OrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/OrderInfo.php',
|
17 |
-
'CompropagoSdk\\Factory\\Abs\\SmsInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/SmsInfo.php',
|
18 |
'CompropagoSdk\\Factory\\Factory' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Factory.php',
|
19 |
-
'CompropagoSdk\\Factory\\
|
20 |
-
'CompropagoSdk\\Factory\\
|
21 |
-
'CompropagoSdk\\Factory\\
|
22 |
-
'CompropagoSdk\\Factory\\
|
23 |
-
'CompropagoSdk\\Factory\\
|
24 |
-
'CompropagoSdk\\Factory\\
|
25 |
-
'CompropagoSdk\\Factory\\
|
26 |
-
'CompropagoSdk\\Factory\\
|
27 |
-
'CompropagoSdk\\Factory\\
|
28 |
-
'CompropagoSdk\\Factory\\
|
29 |
-
'CompropagoSdk\\Factory\\
|
30 |
-
'CompropagoSdk\\Factory\\
|
31 |
-
'CompropagoSdk\\Factory\\
|
32 |
-
'CompropagoSdk\\Factory\\
|
33 |
-
'CompropagoSdk\\Factory\\
|
34 |
-
'CompropagoSdk\\Factory\\V11\\InstructionDetails11' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/InstructionDetails11.php',
|
35 |
-
'CompropagoSdk\\Factory\\V11\\Instructions11' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/Instructions11.php',
|
36 |
-
'CompropagoSdk\\Factory\\V11\\NewOrderInfo11' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/NewOrderInfo11.php',
|
37 |
-
'CompropagoSdk\\Factory\\V11\\OrderInfo11' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/OrderInfo11.php',
|
38 |
-
'CompropagoSdk\\Factory\\V11\\SmsData' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsData.php',
|
39 |
-
'CompropagoSdk\\Factory\\V11\\SmsInfo11' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsInfo11.php',
|
40 |
-
'CompropagoSdk\\Factory\\V11\\SmsObject' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsObject.php',
|
41 |
-
'CompropagoSdk\\Models\\Customer' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/Customer.php',
|
42 |
-
'CompropagoSdk\\Models\\EvalAuthInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/EvalAuthInfo.php',
|
43 |
-
'CompropagoSdk\\Models\\PlaceOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/PlaceOrderInfo.php',
|
44 |
-
'CompropagoSdk\\Models\\Provider' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/Provider.php',
|
45 |
-
'CompropagoSdk\\Models\\Webhook' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/Webhook.php',
|
46 |
-
'CompropagoSdk\\Models\\WebhookError' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Models/WebhookError.php',
|
47 |
'CompropagoSdk\\Service' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Service.php',
|
48 |
'CompropagoSdk\\Tools\\Http' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Tools/Http.php',
|
49 |
-
'CompropagoSdk\\Tools\\
|
50 |
'CompropagoSdk\\Tools\\Validations' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Tools/Validations.php',
|
51 |
'CompropagoSdk\\UnitTest\\Test' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php',
|
52 |
);
|
8 |
return array(
|
9 |
'CompropagoSdk\\Client' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Client.php',
|
10 |
'CompropagoSdk\\Extern\\TransactTables' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
'CompropagoSdk\\Factory\\Factory' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Factory.php',
|
12 |
+
'CompropagoSdk\\Factory\\Models\\CpOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/CpOrderInfo.php',
|
13 |
+
'CompropagoSdk\\Factory\\Models\\Customer' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Customer.php',
|
14 |
+
'CompropagoSdk\\Factory\\Models\\EvalAuthInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/EvalAuthInfo.php',
|
15 |
+
'CompropagoSdk\\Factory\\Models\\FeeDetails' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/FeeDetails.php',
|
16 |
+
'CompropagoSdk\\Factory\\Models\\InstructionDetails' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/InstructionDetails.php',
|
17 |
+
'CompropagoSdk\\Factory\\Models\\Instructions' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Instructions.php',
|
18 |
+
'CompropagoSdk\\Factory\\Models\\NewOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/NewOrderInfo.php',
|
19 |
+
'CompropagoSdk\\Factory\\Models\\OrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/OrderInfo.php',
|
20 |
+
'CompropagoSdk\\Factory\\Models\\PlaceOrderInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/PlaceOrderInfo.php',
|
21 |
+
'CompropagoSdk\\Factory\\Models\\Provider' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Provider.php',
|
22 |
+
'CompropagoSdk\\Factory\\Models\\SmsData' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsData.php',
|
23 |
+
'CompropagoSdk\\Factory\\Models\\SmsInfo' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsInfo.php',
|
24 |
+
'CompropagoSdk\\Factory\\Models\\SmsObject' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsObject.php',
|
25 |
+
'CompropagoSdk\\Factory\\Models\\Webhook' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Webhook.php',
|
26 |
+
'CompropagoSdk\\Factory\\Serialize' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Factory/Serialize.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
'CompropagoSdk\\Service' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Service.php',
|
28 |
'CompropagoSdk\\Tools\\Http' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Tools/Http.php',
|
29 |
+
'CompropagoSdk\\Tools\\Request' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Tools/Request.php',
|
30 |
'CompropagoSdk\\Tools\\Validations' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/Tools/Validations.php',
|
31 |
'CompropagoSdk\\UnitTest\\Test' => $vendorDir . '/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php',
|
32 |
);
|
lib/Compropago/vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit8984c941fb941a4b96b713e7ae5b8f62
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
-
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitd4cd0f315e5eff0f7da018057a772bc8
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInitd4cd0f315e5eff0f7da018057a772bc8', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitd4cd0f315e5eff0f7da018057a772bc8', 'loadClassLoader'));
|
25 |
|
26 |
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitd4cd0f315e5eff0f7da018057a772bc8::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
lib/Compropago/vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
@@ -23,45 +23,25 @@ class ComposerStaticInit8984c941fb941a4b96b713e7ae5b8f62
|
|
23 |
public static $classMap = array (
|
24 |
'CompropagoSdk\\Client' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Client.php',
|
25 |
'CompropagoSdk\\Extern\\TransactTables' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php',
|
26 |
-
'CompropagoSdk\\Factory\\Abs\\CpOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/CpOrderInfo.php',
|
27 |
-
'CompropagoSdk\\Factory\\Abs\\FeeDetails' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/FeeDetails.php',
|
28 |
-
'CompropagoSdk\\Factory\\Abs\\InstrcutionDetails' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/InstrcutionDetails.php',
|
29 |
-
'CompropagoSdk\\Factory\\Abs\\Instructions' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/Instructions.php',
|
30 |
-
'CompropagoSdk\\Factory\\Abs\\NewOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/NewOrderInfo.php',
|
31 |
-
'CompropagoSdk\\Factory\\Abs\\OrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/OrderInfo.php',
|
32 |
-
'CompropagoSdk\\Factory\\Abs\\SmsInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Abs/SmsInfo.php',
|
33 |
'CompropagoSdk\\Factory\\Factory' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Factory.php',
|
34 |
-
'CompropagoSdk\\Factory\\
|
35 |
-
'CompropagoSdk\\Factory\\
|
36 |
-
'CompropagoSdk\\Factory\\
|
37 |
-
'CompropagoSdk\\Factory\\
|
38 |
-
'CompropagoSdk\\Factory\\
|
39 |
-
'CompropagoSdk\\Factory\\
|
40 |
-
'CompropagoSdk\\Factory\\
|
41 |
-
'CompropagoSdk\\Factory\\
|
42 |
-
'CompropagoSdk\\Factory\\
|
43 |
-
'CompropagoSdk\\Factory\\
|
44 |
-
'CompropagoSdk\\Factory\\
|
45 |
-
'CompropagoSdk\\Factory\\
|
46 |
-
'CompropagoSdk\\Factory\\
|
47 |
-
'CompropagoSdk\\Factory\\
|
48 |
-
'CompropagoSdk\\Factory\\
|
49 |
-
'CompropagoSdk\\Factory\\V11\\InstructionDetails11' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/InstructionDetails11.php',
|
50 |
-
'CompropagoSdk\\Factory\\V11\\Instructions11' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/Instructions11.php',
|
51 |
-
'CompropagoSdk\\Factory\\V11\\NewOrderInfo11' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/NewOrderInfo11.php',
|
52 |
-
'CompropagoSdk\\Factory\\V11\\OrderInfo11' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/OrderInfo11.php',
|
53 |
-
'CompropagoSdk\\Factory\\V11\\SmsData' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsData.php',
|
54 |
-
'CompropagoSdk\\Factory\\V11\\SmsInfo11' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsInfo11.php',
|
55 |
-
'CompropagoSdk\\Factory\\V11\\SmsObject' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsObject.php',
|
56 |
-
'CompropagoSdk\\Models\\Customer' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/Customer.php',
|
57 |
-
'CompropagoSdk\\Models\\EvalAuthInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/EvalAuthInfo.php',
|
58 |
-
'CompropagoSdk\\Models\\PlaceOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/PlaceOrderInfo.php',
|
59 |
-
'CompropagoSdk\\Models\\Provider' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/Provider.php',
|
60 |
-
'CompropagoSdk\\Models\\Webhook' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/Webhook.php',
|
61 |
-
'CompropagoSdk\\Models\\WebhookError' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Models/WebhookError.php',
|
62 |
'CompropagoSdk\\Service' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Service.php',
|
63 |
'CompropagoSdk\\Tools\\Http' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Tools/Http.php',
|
64 |
-
'CompropagoSdk\\Tools\\
|
65 |
'CompropagoSdk\\Tools\\Validations' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Tools/Validations.php',
|
66 |
'CompropagoSdk\\UnitTest\\Test' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php',
|
67 |
);
|
@@ -69,9 +49,9 @@ class ComposerStaticInit8984c941fb941a4b96b713e7ae5b8f62
|
|
69 |
public static function getInitializer(ClassLoader $loader)
|
70 |
{
|
71 |
return \Closure::bind(function () use ($loader) {
|
72 |
-
$loader->prefixLengthsPsr4 =
|
73 |
-
$loader->prefixDirsPsr4 =
|
74 |
-
$loader->classMap =
|
75 |
|
76 |
}, null, ClassLoader::class);
|
77 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitd4cd0f315e5eff0f7da018057a772bc8
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
23 |
public static $classMap = array (
|
24 |
'CompropagoSdk\\Client' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Client.php',
|
25 |
'CompropagoSdk\\Extern\\TransactTables' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
'CompropagoSdk\\Factory\\Factory' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Factory.php',
|
27 |
+
'CompropagoSdk\\Factory\\Models\\CpOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/CpOrderInfo.php',
|
28 |
+
'CompropagoSdk\\Factory\\Models\\Customer' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Customer.php',
|
29 |
+
'CompropagoSdk\\Factory\\Models\\EvalAuthInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/EvalAuthInfo.php',
|
30 |
+
'CompropagoSdk\\Factory\\Models\\FeeDetails' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/FeeDetails.php',
|
31 |
+
'CompropagoSdk\\Factory\\Models\\InstructionDetails' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/InstructionDetails.php',
|
32 |
+
'CompropagoSdk\\Factory\\Models\\Instructions' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Instructions.php',
|
33 |
+
'CompropagoSdk\\Factory\\Models\\NewOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/NewOrderInfo.php',
|
34 |
+
'CompropagoSdk\\Factory\\Models\\OrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/OrderInfo.php',
|
35 |
+
'CompropagoSdk\\Factory\\Models\\PlaceOrderInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/PlaceOrderInfo.php',
|
36 |
+
'CompropagoSdk\\Factory\\Models\\Provider' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Provider.php',
|
37 |
+
'CompropagoSdk\\Factory\\Models\\SmsData' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsData.php',
|
38 |
+
'CompropagoSdk\\Factory\\Models\\SmsInfo' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsInfo.php',
|
39 |
+
'CompropagoSdk\\Factory\\Models\\SmsObject' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsObject.php',
|
40 |
+
'CompropagoSdk\\Factory\\Models\\Webhook' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Models/Webhook.php',
|
41 |
+
'CompropagoSdk\\Factory\\Serialize' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Factory/Serialize.php',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
'CompropagoSdk\\Service' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Service.php',
|
43 |
'CompropagoSdk\\Tools\\Http' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Tools/Http.php',
|
44 |
+
'CompropagoSdk\\Tools\\Request' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Tools/Request.php',
|
45 |
'CompropagoSdk\\Tools\\Validations' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/Tools/Validations.php',
|
46 |
'CompropagoSdk\\UnitTest\\Test' => __DIR__ . '/..' . '/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php',
|
47 |
);
|
49 |
public static function getInitializer(ClassLoader $loader)
|
50 |
{
|
51 |
return \Closure::bind(function () use ($loader) {
|
52 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitd4cd0f315e5eff0f7da018057a772bc8::$prefixLengthsPsr4;
|
53 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitd4cd0f315e5eff0f7da018057a772bc8::$prefixDirsPsr4;
|
54 |
+
$loader->classMap = ComposerStaticInitd4cd0f315e5eff0f7da018057a772bc8::$classMap;
|
55 |
|
56 |
}, null, ClassLoader::class);
|
57 |
}
|
lib/Compropago/vendor/composer/installed.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
[
|
2 |
{
|
3 |
"name": "compropago/php-sdk",
|
4 |
-
"version": "
|
5 |
-
"version_normalized": "
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/compropago/compropago-php.git",
|
9 |
-
"reference": "
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
-
"url": "https://api.github.com/repos/compropago/compropago-php/zipball/
|
14 |
-
"reference": "
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
@@ -20,10 +20,7 @@
|
|
20 |
"require-dev": {
|
21 |
"phpunit/phpunit": ">=5.3"
|
22 |
},
|
23 |
-
"
|
24 |
-
"compropago/views-sdk": "Permite la manipulacion de Listado de Proveedores, Recibos de compra y botones de pago dinamicos"
|
25 |
-
},
|
26 |
-
"time": "2016-07-20 21:09:58",
|
27 |
"type": "library",
|
28 |
"installation-source": "dist",
|
29 |
"autoload": {
|
1 |
[
|
2 |
{
|
3 |
"name": "compropago/php-sdk",
|
4 |
+
"version": "3.0.1",
|
5 |
+
"version_normalized": "3.0.1.0",
|
6 |
"source": {
|
7 |
"type": "git",
|
8 |
"url": "https://github.com/compropago/compropago-php.git",
|
9 |
+
"reference": "5465ea298c2c442ff7c309d4639e0b9a41a4e05a"
|
10 |
},
|
11 |
"dist": {
|
12 |
"type": "zip",
|
13 |
+
"url": "https://api.github.com/repos/compropago/compropago-php/zipball/5465ea298c2c442ff7c309d4639e0b9a41a4e05a",
|
14 |
+
"reference": "5465ea298c2c442ff7c309d4639e0b9a41a4e05a",
|
15 |
"shasum": ""
|
16 |
},
|
17 |
"require": {
|
20 |
"require-dev": {
|
21 |
"phpunit/phpunit": ">=5.3"
|
22 |
},
|
23 |
+
"time": "2017-01-10T23:45:26+00:00",
|
|
|
|
|
|
|
24 |
"type": "library",
|
25 |
"installation-source": "dist",
|
26 |
"autoload": {
|
lib/Compropago/vendor/compropago/php-sdk/.gitignore
CHANGED
@@ -6,4 +6,5 @@ dev-notes
|
|
6 |
vendor
|
7 |
.DS_Store
|
8 |
phpunit.xml
|
9 |
-
.idea
|
|
6 |
vendor
|
7 |
.DS_Store
|
8 |
phpunit.xml
|
9 |
+
.idea/
|
10 |
+
pruebas.php
|
lib/Compropago/vendor/compropago/php-sdk/CHANGELOG.md
CHANGED
@@ -1,12 +1,22 @@
|
|
1 |
# CHANGELOG
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## 2.0.0 2016-07-20
|
4 |
* Feature: cambio a patron Factory para manejo de versionamiénto API
|
5 |
* Feature: separación de vistas del SDK
|
6 |
* Note: renombrameinto de metodo **getProviders** por **listProviders**
|
7 |
* Note: renombrameinto de metodo **getWebhooks** por **listWebhooks**
|
8 |
|
9 |
-
## 1.2.0 2016-07-12
|
10 |
* Require: PHP >= 5.5
|
11 |
* Feature: CRUD de administracion de Webhooks
|
12 |
* getWebhooks
|
1 |
# CHANGELOG
|
2 |
|
3 |
+
## 2.1.0 2016-10-26
|
4 |
+
* Feature: Cambio Unificación de payloads de instrucciones, para pago referenciado, numeros de tarjeta y convenio bancario
|
5 |
+
* Feature: Mejoras en las unit test
|
6 |
+
* Deleted: CompropagoSdk\Factory\Abs\Instructions
|
7 |
+
* Deleted: CompropagoSdk\Factory\Abs\InstructionDetails
|
8 |
+
* Deleted: CompropagoSdk\Factory\V10\Instructions10
|
9 |
+
* Deleted: CompropagoSdk\Factory\V10\InstructionDetails10
|
10 |
+
* Added: CompropagoSdk\Models\Instructions
|
11 |
+
* Added: CompropagoSdk\Models\InstructionDetails
|
12 |
+
|
13 |
## 2.0.0 2016-07-20
|
14 |
* Feature: cambio a patron Factory para manejo de versionamiénto API
|
15 |
* Feature: separación de vistas del SDK
|
16 |
* Note: renombrameinto de metodo **getProviders** por **listProviders**
|
17 |
* Note: renombrameinto de metodo **getWebhooks** por **listWebhooks**
|
18 |
|
19 |
+
## 1.2.0 (Deprecated) 2016-07-12
|
20 |
* Require: PHP >= 5.5
|
21 |
* Feature: CRUD de administracion de Webhooks
|
22 |
* getWebhooks
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Client.php
CHANGED
@@ -1,103 +1,48 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
|
23 |
namespace CompropagoSdk;
|
24 |
|
25 |
-
/**
|
26 |
-
* Class Client Clase principal que procee acceso a los servicios de API
|
27 |
-
* @package CompropagoSdk
|
28 |
-
*/
|
29 |
class Client
|
30 |
{
|
31 |
-
const VERSION="
|
32 |
-
|
33 |
-
/* Only for ComproPago Developpers */
|
34 |
-
# const API_LIVE_URI='http://api-staging-compropago.herokuapp.com/v1/';
|
35 |
-
# const API_SANDBOX_URI='http://api-staging-compropago.herokuapp.com/v1/';
|
36 |
|
37 |
const API_LIVE_URI='http://api.compropago.com/v1/';
|
38 |
const API_SANDBOX_URI='http://api.compropago.com/v1/';
|
39 |
|
40 |
-
const
|
|
|
41 |
|
42 |
-
public $
|
|
|
|
|
43 |
|
44 |
-
|
45 |
-
private $privatekey;
|
46 |
-
private $live;
|
47 |
-
private $contained;
|
48 |
|
49 |
-
|
50 |
|
51 |
-
public function __construct($publickey, $privatekey, $live
|
52 |
{
|
53 |
$this->publickey = $publickey;
|
54 |
$this->privatekey = $privatekey;
|
55 |
$this->live = $live;
|
56 |
|
57 |
-
$this->contained = !empty($contained) ? $contained : "SDK; phpsdk ".self::VERSION.";";
|
58 |
-
|
59 |
$this->deployUri = ($live === true) ? self::API_LIVE_URI : self::API_SANDBOX_URI;
|
60 |
|
61 |
$this->api = new Service($this);
|
62 |
}
|
63 |
|
64 |
-
|
65 |
-
* @return string
|
66 |
-
*/
|
67 |
-
public function getAuth()
|
68 |
{
|
69 |
-
return $this->privatekey
|
70 |
}
|
71 |
|
72 |
-
|
73 |
-
* @return string
|
74 |
-
*/
|
75 |
-
public function getFullAuth()
|
76 |
{
|
77 |
-
return $this->
|
78 |
}
|
79 |
|
80 |
-
|
81 |
-
* @return bool
|
82 |
-
*/
|
83 |
-
public function getMode()
|
84 |
-
{
|
85 |
-
return $this->live;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @return string
|
90 |
-
*/
|
91 |
-
public function getUri()
|
92 |
-
{
|
93 |
-
return $this->deployUri;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* @return null|string
|
98 |
-
*/
|
99 |
-
public function getContained()
|
100 |
{
|
101 |
-
return $this->
|
102 |
}
|
103 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CompropagoSdk;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
class Client
|
6 |
{
|
7 |
+
const VERSION="3.0.0";
|
|
|
|
|
|
|
|
|
8 |
|
9 |
const API_LIVE_URI='http://api.compropago.com/v1/';
|
10 |
const API_SANDBOX_URI='http://api.compropago.com/v1/';
|
11 |
|
12 |
+
#const API_LIVE_URI='http://api-staging-compropago.herokuapp.com/v1/';
|
13 |
+
#const API_SANDBOX_URI='http://api-staging-compropago.herokuapp.com/v1/';
|
14 |
|
15 |
+
public $publickey;
|
16 |
+
public $privatekey;
|
17 |
+
public $live;
|
18 |
|
19 |
+
public $deployUri;
|
|
|
|
|
|
|
20 |
|
21 |
+
public $api;
|
22 |
|
23 |
+
public function __construct($publickey, $privatekey, $live)
|
24 |
{
|
25 |
$this->publickey = $publickey;
|
26 |
$this->privatekey = $privatekey;
|
27 |
$this->live = $live;
|
28 |
|
|
|
|
|
29 |
$this->deployUri = ($live === true) ? self::API_LIVE_URI : self::API_SANDBOX_URI;
|
30 |
|
31 |
$this->api = new Service($this);
|
32 |
}
|
33 |
|
34 |
+
public function getUser()
|
|
|
|
|
|
|
35 |
{
|
36 |
+
return $this->privatekey;
|
37 |
}
|
38 |
|
39 |
+
public function getPass()
|
|
|
|
|
|
|
40 |
{
|
41 |
+
return $this->publickey;
|
42 |
}
|
43 |
|
44 |
+
public function getFullAuth()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
{
|
46 |
+
return $this->privatekey.':'.$this->publickey;
|
47 |
}
|
48 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Extern/TransactTables.php
CHANGED
@@ -14,14 +14,11 @@
|
|
14 |
* See the License for the specific language governing permissions and
|
15 |
* limitations under the License.
|
16 |
*/
|
17 |
-
|
18 |
/**
|
19 |
* Compropago $Library
|
20 |
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
21 |
*/
|
22 |
-
|
23 |
namespace CompropagoSdk\Extern;
|
24 |
-
|
25 |
class TransactTables
|
26 |
{
|
27 |
/**
|
@@ -37,9 +34,6 @@ class TransactTables
|
|
37 |
'DROP TABLE IF EXISTS `' . $prefix . 'compropago_webhook_transactions`'
|
38 |
);
|
39 |
}
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
/**
|
44 |
* SQL query for Creating ComproPago Tables
|
45 |
* @return string[]
|
@@ -61,8 +55,6 @@ class TransactTables
|
|
61 |
`ioOut` mediumtext,
|
62 |
PRIMARY KEY (`id`), UNIQUE KEY (`compropagoId`)
|
63 |
)ENGINE=MyISAM DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_general_ci AUTO_INCREMENT=1 ;',
|
64 |
-
|
65 |
-
|
66 |
'CREATE TABLE `' . $prefix . 'compropago_transactions` (
|
67 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
68 |
`orderId` int(11) NOT NULL,
|
@@ -74,7 +66,6 @@ class TransactTables
|
|
74 |
`ioOut` mediumtext,
|
75 |
PRIMARY KEY (`id`)
|
76 |
)ENGINE=MyISAM DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_general_ci AUTO_INCREMENT=1 ;',
|
77 |
-
|
78 |
'CREATE TABLE `' . $prefix . 'compropago_webhook_transactions` (
|
79 |
`id` integer not null auto_increment,
|
80 |
`webhookId` varchar(50) not null,
|
14 |
* See the License for the specific language governing permissions and
|
15 |
* limitations under the License.
|
16 |
*/
|
|
|
17 |
/**
|
18 |
* Compropago $Library
|
19 |
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
*/
|
|
|
21 |
namespace CompropagoSdk\Extern;
|
|
|
22 |
class TransactTables
|
23 |
{
|
24 |
/**
|
34 |
'DROP TABLE IF EXISTS `' . $prefix . 'compropago_webhook_transactions`'
|
35 |
);
|
36 |
}
|
|
|
|
|
|
|
37 |
/**
|
38 |
* SQL query for Creating ComproPago Tables
|
39 |
* @return string[]
|
55 |
`ioOut` mediumtext,
|
56 |
PRIMARY KEY (`id`), UNIQUE KEY (`compropagoId`)
|
57 |
)ENGINE=MyISAM DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_general_ci AUTO_INCREMENT=1 ;',
|
|
|
|
|
58 |
'CREATE TABLE `' . $prefix . 'compropago_transactions` (
|
59 |
`id` int(11) NOT NULL AUTO_INCREMENT,
|
60 |
`orderId` int(11) NOT NULL,
|
66 |
`ioOut` mediumtext,
|
67 |
PRIMARY KEY (`id`)
|
68 |
)ENGINE=MyISAM DEFAULT CHARSET=utf8 DEFAULT COLLATE utf8_general_ci AUTO_INCREMENT=1 ;',
|
|
|
69 |
'CREATE TABLE `' . $prefix . 'compropago_webhook_transactions` (
|
70 |
`id` integer not null auto_increment,
|
71 |
`webhookId` varchar(50) not null,
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/CpOrderInfo.php
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class CpOrderInfo
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getId();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getType();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getCreated();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return bool
|
45 |
-
*/
|
46 |
-
public abstract function getPaid();
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public abstract function getAmount();
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public abstract function getCurrency();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @return bool
|
60 |
-
*/
|
61 |
-
public abstract function getRefunded();
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public abstract function getFee();
|
67 |
-
|
68 |
-
/**
|
69 |
-
* @return \CompropagoSdk\Factory\Abs\FeeDetails
|
70 |
-
*/
|
71 |
-
public abstract function getFeeDetails();
|
72 |
-
|
73 |
-
/**
|
74 |
-
* @return \CompropagoSdk\Factory\Abs\OrderInfo
|
75 |
-
*/
|
76 |
-
public abstract function getOrderInfo();
|
77 |
-
|
78 |
-
/**
|
79 |
-
* @return \CompropagoSdk\Models\Customer
|
80 |
-
*/
|
81 |
-
public abstract function getCustomer();
|
82 |
-
|
83 |
-
/**
|
84 |
-
* @return string
|
85 |
-
*/
|
86 |
-
public abstract function getCaptured();
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @return string
|
90 |
-
*/
|
91 |
-
public abstract function getFailureMessage();
|
92 |
-
|
93 |
-
/**
|
94 |
-
* @return string
|
95 |
-
*/
|
96 |
-
public abstract function getFailureCode();
|
97 |
-
|
98 |
-
/**
|
99 |
-
* @return double
|
100 |
-
*/
|
101 |
-
public abstract function getAmountRefunded();
|
102 |
-
|
103 |
-
/**
|
104 |
-
* @return string
|
105 |
-
*/
|
106 |
-
public abstract function getDescription();
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @return string
|
110 |
-
*/
|
111 |
-
public abstract function getDispute();
|
112 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/FeeDetails.php
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class FeeDetails
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getAmount();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getCurrency();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getType();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
public abstract function getDescription();
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public abstract function getApplication();
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return double
|
55 |
-
*/
|
56 |
-
public abstract function getAmountRefunded();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @return string
|
60 |
-
*/
|
61 |
-
public abstract function getTax();
|
62 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/InstrcutionDetails.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class InstrcutionDetails
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getAmount();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getStore();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getBankAccountNumber();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
public abstract function getBankName();
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/Instructions.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class Instructions
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getDescription();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getStep1();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getStep2();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
public abstract function getStep3();
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public abstract function getNoteExtraComition();
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public abstract function getNoteExpirationDate();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @return string
|
60 |
-
*/
|
61 |
-
public abstract function getNoteConfirmation();
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return InstrcutionDetails
|
65 |
-
*/
|
66 |
-
public abstract function getDetails();
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/NewOrderInfo.php
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class NewOrderInfo
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getId();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getShortId();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getStatus();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
public abstract function getCreated();
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public abstract function getExpirationDate();
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return OrderInfo
|
55 |
-
*/
|
56 |
-
public abstract function getOrderInfo();
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @return FeeDetails
|
60 |
-
*/
|
61 |
-
public abstract function getFeeDetails();
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return Instructions
|
65 |
-
*/
|
66 |
-
public abstract function getInstructions();
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/OrderInfo.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Class OrderInfo
|
27 |
-
* @package CompropagoSdk\Factory\Abs
|
28 |
-
*/
|
29 |
-
abstract class OrderInfo
|
30 |
-
{
|
31 |
-
/**
|
32 |
-
* @return string
|
33 |
-
*/
|
34 |
-
public abstract function getOrderId();
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @return string
|
38 |
-
*/
|
39 |
-
public abstract function getOrderPrice();
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @return string
|
43 |
-
*/
|
44 |
-
public abstract function getOrderName();
|
45 |
-
|
46 |
-
/**
|
47 |
-
* @return string
|
48 |
-
*/
|
49 |
-
public abstract function getPaymentMethod();
|
50 |
-
|
51 |
-
/**
|
52 |
-
* @return string
|
53 |
-
*/
|
54 |
-
public abstract function getStore();
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @return string
|
58 |
-
*/
|
59 |
-
public abstract function getCountry();
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public abstract function getImageUrl();
|
65 |
-
|
66 |
-
/**
|
67 |
-
* @return string
|
68 |
-
*/
|
69 |
-
public abstract function getSuccessUrl();
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Abs/SmsInfo.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Abs;
|
24 |
-
|
25 |
-
|
26 |
-
abstract class SmsInfo
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @return string
|
30 |
-
*/
|
31 |
-
public abstract function getType();
|
32 |
-
|
33 |
-
/**
|
34 |
-
* @return string
|
35 |
-
*/
|
36 |
-
public abstract function getObject();
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public abstract function getId();
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @return string
|
45 |
-
*/
|
46 |
-
public abstract function getShortId();
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Factory.php
CHANGED
@@ -1,190 +1,81 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
|
23 |
namespace CompropagoSdk\Factory;
|
24 |
|
25 |
-
use CompropagoSdk\Factory\
|
26 |
-
use CompropagoSdk\Models\
|
27 |
-
use CompropagoSdk\Factory\
|
28 |
-
use CompropagoSdk\Factory\
|
29 |
-
use CompropagoSdk\Models\
|
30 |
-
use CompropagoSdk\Models\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
/**
|
33 |
-
* Class Factory
|
34 |
-
* @package CompropagoSdk\Factory
|
35 |
-
*/
|
36 |
class Factory
|
37 |
{
|
38 |
/**
|
39 |
-
*
|
40 |
-
*
|
41 |
-
* @
|
42 |
-
* @return string
|
43 |
-
*/
|
44 |
-
private static function verifyVersion($source)
|
45 |
-
{
|
46 |
-
$obj = json_decode($source);
|
47 |
-
return isset($obj->api_version) ? $obj->api_version : null;
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Constructor de objetos EvalOutInfo
|
53 |
-
*
|
54 |
-
* @param $source string Cadena Json con el contenido a construir como objeto
|
55 |
-
* @return \CompropagoSdk\Models\EvalAuthInfo
|
56 |
-
* @throws \Exception
|
57 |
-
*/
|
58 |
-
public static function evalAuthInfo($source)
|
59 |
-
{
|
60 |
-
$res = new EvalAuthInfo();
|
61 |
-
$obj = json_decode($source);
|
62 |
-
|
63 |
-
$res->type = $obj->type;
|
64 |
-
$res->livemode = $obj->livemode;
|
65 |
-
$res->mode_key = $obj->mode_key;
|
66 |
-
$res->message = $obj->message;
|
67 |
-
$res->code = $obj->code;
|
68 |
-
|
69 |
-
return $res;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Construye un arreglo de Objetos tipo \CompropagoSdk\Models\Provider
|
74 |
-
*
|
75 |
-
* @param $source string Cadena Json con el contenido a construir
|
76 |
-
* @throws \Exception
|
77 |
-
* @return array
|
78 |
-
*/
|
79 |
-
public static function arrayProviders($source)
|
80 |
-
{
|
81 |
-
$jsonObj= json_decode($source);
|
82 |
-
|
83 |
-
if(isset($jsonObj->type) && $jsonObj->type == "error"){
|
84 |
-
throw new \Exception($jsonObj->message, $jsonObj->code);
|
85 |
-
}
|
86 |
-
|
87 |
-
$res = array();
|
88 |
-
|
89 |
-
foreach($jsonObj as $val){
|
90 |
-
$provider = new Provider();
|
91 |
-
|
92 |
-
$provider->name = $val->name;
|
93 |
-
$provider->store_image = $val->store_image;
|
94 |
-
$provider->is_active = $val->is_active;
|
95 |
-
$provider->image_small = $val->image_small;
|
96 |
-
$provider->image_medium = $val->image_medium;
|
97 |
-
$provider->image_large = $val->image_large;
|
98 |
-
$provider->internal_name = $val->internal_name;
|
99 |
-
$provider->rank = $val->rank;
|
100 |
-
$provider->transaction_limit = isset($val->transaction_limit) ? $val->transaction_limit : null;
|
101 |
-
|
102 |
-
$res[] = $provider;
|
103 |
-
}
|
104 |
-
|
105 |
-
return $res;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @param $source
|
110 |
-
* @return CpOrderInfo
|
111 |
* @throws \Exception
|
112 |
*/
|
113 |
-
public static function
|
114 |
{
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
return Serialize::cpOrderInfo10($source);
|
120 |
}
|
121 |
-
}
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
default:
|
134 |
-
|
135 |
}
|
136 |
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* @param $source
|
140 |
-
* @return Abs\SmsInfo
|
141 |
-
* @throws \Exception
|
142 |
-
*/
|
143 |
-
public static function smsInfo($source)
|
144 |
-
{
|
145 |
-
if(array_key_exists('payment', json_decode($source))){
|
146 |
-
return Serialize::smsInfo10($source);
|
147 |
-
}else{
|
148 |
-
return Serialize::smsInfo11($source);
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
/**
|
153 |
-
* @param $source
|
154 |
-
* @return Webhook
|
155 |
-
* @throws \Exception
|
156 |
-
*/
|
157 |
-
public static function webhook($source)
|
158 |
-
{
|
159 |
-
$json = json_decode($source);
|
160 |
-
|
161 |
-
if(isset($json->type) && $json->type == 'error'){
|
162 |
-
throw new \Exception($json->message, $json->code);
|
163 |
-
}
|
164 |
-
|
165 |
-
$object = new Webhook();
|
166 |
-
|
167 |
-
$object->id = $json->id;
|
168 |
-
$object->url = isset($json->url) ? $json->url : null ;
|
169 |
-
$object->mode = isset($json->mode) ? $json->mode : null ;
|
170 |
-
$object->status = isset($json->status) ? $json->status : null ;
|
171 |
-
|
172 |
-
return $object;
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* @param $source
|
177 |
-
* @return array
|
178 |
-
* @throws \Exception
|
179 |
-
*/
|
180 |
-
public static function listWebhooks($source)
|
181 |
-
{
|
182 |
-
$final = array();
|
183 |
-
|
184 |
-
foreach (json_decode($source,true) as $value){
|
185 |
-
$final[] = self::webhook(json_encode($value));
|
186 |
-
}
|
187 |
-
|
188 |
-
return $final;
|
189 |
-
}
|
190 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CompropagoSdk\Factory;
|
4 |
|
5 |
+
use CompropagoSdk\Factory\Models\CpOrderInfo;
|
6 |
+
use CompropagoSdk\Factory\Models\Customer;
|
7 |
+
use CompropagoSdk\Factory\Models\EvalAuthInfo;
|
8 |
+
use CompropagoSdk\Factory\Models\FeeDetails;
|
9 |
+
use CompropagoSdk\Factory\Models\InstructionDetails;
|
10 |
+
use CompropagoSdk\Factory\Models\Instructions;
|
11 |
+
use CompropagoSdk\Factory\Models\NewOrderInfo;
|
12 |
+
use CompropagoSdk\Factory\Models\OrderInfo;
|
13 |
+
use CompropagoSdk\Factory\Models\PlaceOrderInfo;
|
14 |
+
use CompropagoSdk\Factory\Models\Provider;
|
15 |
+
use CompropagoSdk\Factory\Models\SmsData;
|
16 |
+
use CompropagoSdk\Factory\Models\SmsInfo;
|
17 |
+
use CompropagoSdk\Factory\Models\SmsObject;
|
18 |
+
use CompropagoSdk\Factory\Models\Webhook;
|
19 |
|
|
|
|
|
|
|
|
|
20 |
class Factory
|
21 |
{
|
22 |
/**
|
23 |
+
* @param $class
|
24 |
+
* @param array $data
|
25 |
+
* @return array|CpOrderInfo|Customer|EvalAuthInfo|FeeDetails|InstructionDetails|Instructions|NewOrderInfo|OrderInfo|PlaceOrderInfo|Provider|SmsData|SmsInfo|SmsObject|Webhook
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
* @throws \Exception
|
27 |
*/
|
28 |
+
public static function getInstanceOf($class, $data=array())
|
29 |
{
|
30 |
+
if (is_string($data)) {
|
31 |
+
$data = json_decode($data, true);
|
32 |
+
} else if (!is_array($data)) {
|
33 |
+
throw new \Exception('Data format is not factored');
|
|
|
34 |
}
|
|
|
35 |
|
36 |
+
switch ($class) {
|
37 |
+
case 'CpOrderInfo':
|
38 |
+
return Serialize::cpOrderInfo($data);
|
39 |
+
case 'Customer':
|
40 |
+
return Serialize::customer($data);
|
41 |
+
case 'EvalAuthInfo':
|
42 |
+
return Serialize::evalAuthInfo($data);
|
43 |
+
case 'FeeDetails':
|
44 |
+
return Serialize::feeDetails($data);
|
45 |
+
case 'InstructionDetails':
|
46 |
+
return Serialize::instructionDetails($data);
|
47 |
+
case 'Instructions':
|
48 |
+
return Serialize::instructions($data);
|
49 |
+
case 'NewOrderInfo':
|
50 |
+
return Serialize::newOrderInfo($data);
|
51 |
+
case 'OrderInfo':
|
52 |
+
return Serialize::orderInfo($data);
|
53 |
+
case 'PlaceOrderInfo':
|
54 |
+
return Serialize::placeOrderInfo($data);
|
55 |
+
case 'Provider':
|
56 |
+
return Serialize::provider($data);
|
57 |
+
case 'ListProviders':
|
58 |
+
$aux = [];
|
59 |
+
foreach ($data as $prov) {
|
60 |
+
$aux[] = Serialize::provider($prov);
|
61 |
+
}
|
62 |
+
return $aux;
|
63 |
+
case 'SmsData':
|
64 |
+
return Serialize::smsData($data);
|
65 |
+
case 'SmsInfo':
|
66 |
+
return Serialize::smsInfo($data);
|
67 |
+
case 'SmsObject':
|
68 |
+
return Serialize::smsObject($data);
|
69 |
+
case 'Webhook':
|
70 |
+
return Serialize::webhook($data);
|
71 |
+
case 'ListWebhooks':
|
72 |
+
$aux = [];
|
73 |
+
foreach ($data as $web) {
|
74 |
+
$aux[] = Serialize::webhook($web);
|
75 |
+
}
|
76 |
+
return $aux;
|
77 |
default:
|
78 |
+
throw new \Exception('Object not in factory');
|
79 |
}
|
80 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Json/Serialize.php
DELETED
@@ -1,261 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\Json;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\V10\CpOrderInfo10;
|
27 |
-
use CompropagoSdk\Factory\V10\EvalAuthInfo10;
|
28 |
-
use CompropagoSdk\Factory\V10\NewOrderInfo10;
|
29 |
-
use CompropagoSdk\Factory\V10\SmsInfo10;
|
30 |
-
use CompropagoSdk\Factory\V11\CpOrderInfo11;
|
31 |
-
use CompropagoSdk\Factory\V11\EvalAuthInfo11;
|
32 |
-
use CompropagoSdk\Factory\V11\NewOrderInfo11;
|
33 |
-
use CompropagoSdk\Factory\V11\SmsInfo11;
|
34 |
-
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Class Serialize Clase que convierte estandariza las diferentes respuestas en objetos similares
|
38 |
-
* @package CompropagoSdk\Factory\Json
|
39 |
-
*/
|
40 |
-
class Serialize
|
41 |
-
{
|
42 |
-
|
43 |
-
/**
|
44 |
-
* @param $source
|
45 |
-
* @return CpOrderInfo11
|
46 |
-
*/
|
47 |
-
public static function cpOrderInfo11($source)
|
48 |
-
{
|
49 |
-
$res = new CpOrderInfo11();
|
50 |
-
$obj = json_decode($source);
|
51 |
-
|
52 |
-
$res->id = $obj->id;
|
53 |
-
$res->type = $obj->type;
|
54 |
-
$res->object = $obj->object;
|
55 |
-
$res->created = $obj->created;
|
56 |
-
$res->paid = $obj->paid;
|
57 |
-
$res->amount = $obj->amount;
|
58 |
-
$res->livemode = $obj->livemode;
|
59 |
-
$res->currency = $obj->currency;
|
60 |
-
$res->refunded = $obj->refunded;
|
61 |
-
$res->fee = $obj->fee;
|
62 |
-
|
63 |
-
$res->fee_details->amount = $obj->fee_details->amount;
|
64 |
-
$res->fee_details->currency = $obj->fee_details->currency;
|
65 |
-
$res->fee_details->type = $obj->fee_details->type;
|
66 |
-
$res->fee_details->description = $obj->fee_details->description;
|
67 |
-
$res->fee_details->application = $obj->fee_details->application;
|
68 |
-
$res->fee_details->amount_refunded = $obj->fee_details->amount_refunded;
|
69 |
-
$res->fee_details->tax = $obj->fee_details->tax;
|
70 |
-
|
71 |
-
$res->order_info->order_id = $obj->order_info->order_id;
|
72 |
-
$res->order_info->order_price = $obj->order_info->order_price;
|
73 |
-
$res->order_info->order_name = $obj->order_info->order_name;
|
74 |
-
$res->order_info->payment_method = $obj->order_info->payment_method;
|
75 |
-
$res->order_info->store = $obj->order_info->store;
|
76 |
-
$res->order_info->country = $obj->order_info->country;
|
77 |
-
$res->order_info->image_url = $obj->order_info->image_url;
|
78 |
-
$res->order_info->success_url = $obj->order_info->success_url;
|
79 |
-
|
80 |
-
$res->customer->customer_name = $obj->customer->customer_name;
|
81 |
-
$res->customer->customer_email = $obj->customer->customer_email;
|
82 |
-
$res->customer->customer_phone = $obj->customer->customer_phone;
|
83 |
-
|
84 |
-
$res->captured = $obj->captured;
|
85 |
-
$res->failure_message = $obj->failure_message;
|
86 |
-
$res->failure_code = $obj->failure_code;
|
87 |
-
$res->amount_refunded = $obj->amount_refunded;
|
88 |
-
$res->description = $obj->description;
|
89 |
-
$res->dispute = $obj->dispute;
|
90 |
-
|
91 |
-
return $res;
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* @param $source
|
96 |
-
* @return CpOrderInfo10
|
97 |
-
*/
|
98 |
-
public static function cpOrderInfo10($source)
|
99 |
-
{
|
100 |
-
$res = new CpOrderInfo10();
|
101 |
-
$obj = json_decode($source);
|
102 |
-
|
103 |
-
$res->type = $obj->type;
|
104 |
-
$res->object = $obj->object;
|
105 |
-
|
106 |
-
$res->data->object->id = $obj->data->object->id;
|
107 |
-
$res->data->object->object = $obj->data->object->object;
|
108 |
-
$res->data->object->created_at = $obj->data->object->created_at;
|
109 |
-
$res->data->object->paid = $obj->data->object->paid;
|
110 |
-
$res->data->object->amount = $obj->data->object->amount;
|
111 |
-
$res->data->object->currency = $obj->data->object->currency;
|
112 |
-
$res->data->object->refunded = $obj->data->object->refunded;
|
113 |
-
$res->data->object->fee = $obj->data->object->fee;
|
114 |
-
|
115 |
-
$res->data->object->fee_details->amount = $obj->data->object->fee_details->amount;
|
116 |
-
$res->data->object->fee_details->currency = $obj->data->object->fee_details->currency;
|
117 |
-
$res->data->object->fee_details->type = $obj->data->object->fee_details->type;
|
118 |
-
$res->data->object->fee_details->description = $obj->data->object->fee_details->description;
|
119 |
-
$res->data->object->fee_details->application = $obj->data->object->fee_details->application;
|
120 |
-
$res->data->object->fee_details->amount_refunded = $obj->data->object->fee_details->amount_refunded;
|
121 |
-
|
122 |
-
$res->data->object->payment_details->object = $obj->data->object->payment_details->object;
|
123 |
-
$res->data->object->payment_details->store = $obj->data->object->payment_details->store;
|
124 |
-
$res->data->object->payment_details->country = $obj->data->object->payment_details->country;
|
125 |
-
$res->data->object->payment_details->product_id = $obj->data->object->payment_details->product_id;
|
126 |
-
$res->data->object->payment_details->product_price = $obj->data->object->payment_details->product_price;
|
127 |
-
$res->data->object->payment_details->product_name = $obj->data->object->payment_details->product_name;
|
128 |
-
$res->data->object->payment_details->image_url = $obj->data->object->payment_details->image_url;
|
129 |
-
$res->data->object->payment_details->success_url = $obj->data->object->payment_details->success_url;
|
130 |
-
$res->data->object->payment_details->customer_name = $obj->data->object->payment_details->customer_name;
|
131 |
-
$res->data->object->payment_details->customer_email = $obj->data->object->payment_details->customer_email;
|
132 |
-
$res->data->object->payment_details->customer_phone = $obj->data->object->payment_details->customer_phone;
|
133 |
-
|
134 |
-
$res->data->object->captured = $obj->data->object->captured;
|
135 |
-
$res->data->object->failure_message = $obj->data->object->failure_message;
|
136 |
-
$res->data->object->failure_code = $obj->data->object->failure_code;
|
137 |
-
$res->data->object->amount_refunded = $obj->data->object->amount_refunded;
|
138 |
-
$res->data->object->description = $obj->data->object->description;
|
139 |
-
$res->data->object->dispute = $obj->data->object->dispute;
|
140 |
-
|
141 |
-
return $res;
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* @param $source
|
146 |
-
* @return NewOrderInfo10
|
147 |
-
*/
|
148 |
-
public static function newOrderInfo10($source)
|
149 |
-
{
|
150 |
-
$res = new NewOrderInfo10();
|
151 |
-
$obj = json_decode($source);
|
152 |
-
|
153 |
-
$res->payment_id = $obj->payment_id;
|
154 |
-
$res->short_payment_id = $obj->short_payment_id;
|
155 |
-
$res->payment_status = $obj->payment_status;
|
156 |
-
$res->creation_date = $obj->creation_date;
|
157 |
-
$res->expiration_date = $obj->expiration_date;
|
158 |
-
|
159 |
-
$res->product_information->product_id = $obj->product_information->product_id;
|
160 |
-
$res->product_information->product_name = $obj->product_information->product_name;
|
161 |
-
$res->product_information->product_price = $obj->product_information->product_price;
|
162 |
-
$res->product_information->image_url = $obj->product_information->image_url;
|
163 |
-
|
164 |
-
$res->payment_instructions->description = $obj->payment_instructions->description;
|
165 |
-
$res->payment_instructions->step_1 = $obj->payment_instructions->step_1;
|
166 |
-
$res->payment_instructions->step_2 = $obj->payment_instructions->step_2;
|
167 |
-
$res->payment_instructions->step_3 = $obj->payment_instructions->step_3;
|
168 |
-
$res->payment_instructions->note_extra_comition = $obj->payment_instructions->note_extra_comition;
|
169 |
-
$res->payment_instructions->note_expiration_date = $obj->payment_instructions->note_expiration_date;
|
170 |
-
$res->payment_instructions->note_confirmation = $obj->payment_instructions->note_confirmation;
|
171 |
-
|
172 |
-
$res->payment_instructions->details->payment_amount = $obj->payment_instructions->details->payment_amount;
|
173 |
-
$res->payment_instructions->details->payment_store = $obj->payment_instructions->details->payment_store;
|
174 |
-
$res->payment_instructions->details->bank_account_number = $obj->payment_instructions->details->bank_account_number;
|
175 |
-
$res->payment_instructions->details->bank_name = $obj->payment_instructions->details->bank_name;
|
176 |
-
|
177 |
-
return $res;
|
178 |
-
}
|
179 |
-
|
180 |
-
/**
|
181 |
-
* @param $source
|
182 |
-
* @return NewOrderInfo11
|
183 |
-
*/
|
184 |
-
public static function newOrderInfo11($source)
|
185 |
-
{
|
186 |
-
$res = new NewOrderInfo11();
|
187 |
-
$obj = json_decode($source);
|
188 |
-
|
189 |
-
$res->id = $obj->id;
|
190 |
-
$res->short_id = $obj->short_id;
|
191 |
-
$res->object = $obj->object;
|
192 |
-
$res->status = $obj->status;
|
193 |
-
$res->created = $obj->created;
|
194 |
-
$res->exp_date = $obj->exp_date;
|
195 |
-
$res->live_mode = $obj->live_mode;
|
196 |
-
|
197 |
-
$res->order_info->order_id = $obj->order_info->order_id;
|
198 |
-
$res->order_info->order_name = $obj->order_info->order_name;
|
199 |
-
$res->order_info->order_price = $obj->order_info->order_price;
|
200 |
-
$res->order_info->image_url = $obj->order_info->image_url;
|
201 |
-
|
202 |
-
$res->fee_details->amount = $obj->fee_details->amount;
|
203 |
-
$res->fee_details->tax = $obj->fee_details->tax;
|
204 |
-
$res->fee_details->currency = $obj->fee_details->currency;
|
205 |
-
$res->fee_details->type = isset($obj->fee_details->type) ? $obj->fee_details->type : null;
|
206 |
-
$res->fee_details->description = $obj->fee_details->description;
|
207 |
-
$res->fee_details->amount_refunded = $obj->fee_details->amount_refunded;
|
208 |
-
|
209 |
-
$res->instructions->description = $obj->instructions->description;
|
210 |
-
$res->instructions->step_1 = $obj->instructions->step_1;
|
211 |
-
$res->instructions->step_2 = $obj->instructions->step_2;
|
212 |
-
$res->instructions->step_3 = $obj->instructions->step_3;
|
213 |
-
$res->instructions->note_extra_comition = $obj->instructions->note_extra_comition;
|
214 |
-
$res->instructions->note_expiration_date = $obj->instructions->note_expiration_date;
|
215 |
-
$res->instructions->note_confirmation = $obj->instructions->note_confirmation;
|
216 |
-
|
217 |
-
$res->instructions->details->amount = $obj->instructions->details->amount;
|
218 |
-
$res->instructions->details->store = $obj->instructions->details->store;
|
219 |
-
$res->instructions->details->bank_account_number = $obj->instructions->details->bank_account_number;
|
220 |
-
$res->instructions->details->bank_name = $obj->instructions->details->bank_name;
|
221 |
-
|
222 |
-
return $res;
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* @param $source
|
227 |
-
* @return SmsInfo10
|
228 |
-
*/
|
229 |
-
public static function smsInfo10($source)
|
230 |
-
{
|
231 |
-
$res = new SmsInfo10();
|
232 |
-
$obj = json_decode($source);
|
233 |
-
|
234 |
-
$res->type = $obj->type;
|
235 |
-
$res->object = $obj->object;
|
236 |
-
|
237 |
-
$res->payment->id = $obj->payment->id;
|
238 |
-
$res->payment->short_id = $obj->payment->short_id;
|
239 |
-
|
240 |
-
return $res;
|
241 |
-
}
|
242 |
-
|
243 |
-
/**
|
244 |
-
* @param $source
|
245 |
-
* @return SmsInfo11
|
246 |
-
*/
|
247 |
-
public static function smsInfo11($source)
|
248 |
-
{
|
249 |
-
$res = new SmsInfo11();
|
250 |
-
$obj = json_decode($source);
|
251 |
-
|
252 |
-
$res->type = $obj->type;
|
253 |
-
$res->object = $obj->object;
|
254 |
-
|
255 |
-
$res->data->object->id = $obj->data->object->id;
|
256 |
-
$res->data->object->short_id = $obj->data->object->short_id;
|
257 |
-
$res->data->object->object = $obj->data->object->object;
|
258 |
-
|
259 |
-
return $res;
|
260 |
-
}
|
261 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/CpOrderInfo.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class CpOrderInfo
|
6 |
+
{
|
7 |
+
public $id;
|
8 |
+
public $type;
|
9 |
+
public $object;
|
10 |
+
public $created;
|
11 |
+
public $paid;
|
12 |
+
public $amount;
|
13 |
+
public $livemode;
|
14 |
+
public $currency;
|
15 |
+
public $refunded;
|
16 |
+
public $fee;
|
17 |
+
public $fee_details;
|
18 |
+
public $order_info;
|
19 |
+
public $customer;
|
20 |
+
public $captured;
|
21 |
+
public $failure_message;
|
22 |
+
public $failure_code;
|
23 |
+
public $amount_refunded;
|
24 |
+
public $description;
|
25 |
+
public $dispute;
|
26 |
+
|
27 |
+
public function __construct()
|
28 |
+
{
|
29 |
+
$this->fee_details = new FeeDetails();
|
30 |
+
$this->order_info = new OrderInfo();
|
31 |
+
$this->customer = new Customer();
|
32 |
+
}
|
33 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Customer.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class Customer
|
6 |
+
{
|
7 |
+
public $customer_name;
|
8 |
+
public $customer_email;
|
9 |
+
public $customer_phone;
|
10 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/EvalAuthInfo.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class EvalAuthInfo
|
6 |
+
{
|
7 |
+
public $type;
|
8 |
+
public $livemode;
|
9 |
+
public $mode_key;
|
10 |
+
public $message;
|
11 |
+
public $code;
|
12 |
+
|
13 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/FeeDetails.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class FeeDetails
|
6 |
+
{
|
7 |
+
public $amount;
|
8 |
+
public $currency;
|
9 |
+
public $type;
|
10 |
+
public $description;
|
11 |
+
public $application;
|
12 |
+
public $tax_percent;
|
13 |
+
public $amount_refunded;
|
14 |
+
public $tax;
|
15 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/InstructionDetails.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class InstructionDetails
|
6 |
+
{
|
7 |
+
public $amount;
|
8 |
+
public $store;
|
9 |
+
public $payment_amount;
|
10 |
+
public $payment_store;
|
11 |
+
public $bank_account_holder_name;
|
12 |
+
public $bank_account_number;
|
13 |
+
public $bank_reference;
|
14 |
+
public $company_reference_name;
|
15 |
+
public $company_reference_number;
|
16 |
+
public $company_bank_number;
|
17 |
+
public $order_reference_number;
|
18 |
+
public $bank_name;
|
19 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Instructions.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class Instructions
|
6 |
+
{
|
7 |
+
public $description;
|
8 |
+
public $step_1;
|
9 |
+
public $step_2;
|
10 |
+
public $step_3;
|
11 |
+
public $note_extra_comition;
|
12 |
+
public $note_expiration_date;
|
13 |
+
public $note_confirmation;
|
14 |
+
public $details;
|
15 |
+
|
16 |
+
public function __construct()
|
17 |
+
{
|
18 |
+
$this->details = new InstructionDetails();
|
19 |
+
}
|
20 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/NewOrderInfo.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Created by PhpStorm.
|
4 |
+
* User: Arthur
|
5 |
+
* Date: 27/12/16
|
6 |
+
* Time: 11:38
|
7 |
+
*/
|
8 |
+
|
9 |
+
namespace CompropagoSdk\Factory\Models;
|
10 |
+
|
11 |
+
|
12 |
+
class NewOrderInfo
|
13 |
+
{
|
14 |
+
public $id;
|
15 |
+
public $short_id;
|
16 |
+
public $object;
|
17 |
+
public $status;
|
18 |
+
public $created;
|
19 |
+
public $exp_date;
|
20 |
+
public $live_mode;
|
21 |
+
public $order_info;
|
22 |
+
public $fee_details;
|
23 |
+
public $instructions;
|
24 |
+
|
25 |
+
public function __construct()
|
26 |
+
{
|
27 |
+
$this->order_info = new OrderInfo();
|
28 |
+
$this->fee_details = new FeeDetails();
|
29 |
+
$this->instructions = new Instructions();
|
30 |
+
}
|
31 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/OrderInfo.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class OrderInfo
|
6 |
+
{
|
7 |
+
public $order_id;
|
8 |
+
public $order_price;
|
9 |
+
public $order_name;
|
10 |
+
public $payment_method;
|
11 |
+
public $store;
|
12 |
+
public $country;
|
13 |
+
public $image_url;
|
14 |
+
public $success_url;
|
15 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/PlaceOrderInfo.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
use CompropagoSdk\Client;
|
6 |
+
|
7 |
+
class PlaceOrderInfo
|
8 |
+
{
|
9 |
+
public $order_id;
|
10 |
+
public $order_name;
|
11 |
+
public $order_price;
|
12 |
+
public $customer_name;
|
13 |
+
public $customer_email;
|
14 |
+
public $payment_type;
|
15 |
+
public $currency;
|
16 |
+
public $image_url;
|
17 |
+
public $app_client_name;
|
18 |
+
public $app_client_version;
|
19 |
+
|
20 |
+
public function __construct(
|
21 |
+
$order_id,
|
22 |
+
$order_name,
|
23 |
+
$order_price,
|
24 |
+
$customer_name,
|
25 |
+
$customer_email,
|
26 |
+
$payment_type="OXXO",
|
27 |
+
$currency="MXN",
|
28 |
+
$image_url=null,
|
29 |
+
$app_client_name="phpsdk",
|
30 |
+
$app_client_version=Client::VERSION
|
31 |
+
)
|
32 |
+
{
|
33 |
+
$this->order_id = $order_id;
|
34 |
+
$this->order_name = $order_name;
|
35 |
+
$this->order_price = $order_price;
|
36 |
+
$this->customer_name = $customer_name;
|
37 |
+
$this->customer_email = $customer_email;
|
38 |
+
$this->payment_type = $payment_type;
|
39 |
+
$this->currency = $currency;
|
40 |
+
$this->image_url = $image_url;
|
41 |
+
$this->app_client_name = $app_client_name;
|
42 |
+
$this->app_client_version = $app_client_version;
|
43 |
+
}
|
44 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Provider.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class Provider
|
6 |
+
{
|
7 |
+
public $name;
|
8 |
+
public $store_image;
|
9 |
+
public $is_active;
|
10 |
+
public $internal_name;
|
11 |
+
public $image_small;
|
12 |
+
public $image_medium;
|
13 |
+
public $image_large;
|
14 |
+
public $transaction_limit;
|
15 |
+
public $rank;
|
16 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsData.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class SmsData
|
6 |
+
{
|
7 |
+
public $object;
|
8 |
+
|
9 |
+
public function __construct()
|
10 |
+
{
|
11 |
+
$this->object = new SmsObject();
|
12 |
+
}
|
13 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsInfo.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class SmsInfo
|
6 |
+
{
|
7 |
+
public $type;
|
8 |
+
public $object;
|
9 |
+
public $data;
|
10 |
+
|
11 |
+
public function __construct()
|
12 |
+
{
|
13 |
+
$this->data = new SmsData();
|
14 |
+
}
|
15 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/SmsObject.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class SmsObject
|
6 |
+
{
|
7 |
+
public $id;
|
8 |
+
public $object;
|
9 |
+
public $short_id;
|
10 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Models/Webhook.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory\Models;
|
4 |
+
|
5 |
+
class Webhook
|
6 |
+
{
|
7 |
+
public $id;
|
8 |
+
public $url;
|
9 |
+
public $mode;
|
10 |
+
public $status;
|
11 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/Serialize.php
ADDED
@@ -0,0 +1,291 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Factory;
|
4 |
+
|
5 |
+
use CompropagoSdk\Client;
|
6 |
+
use CompropagoSdk\Factory\Models\CpOrderInfo;
|
7 |
+
use CompropagoSdk\Factory\Models\Customer;
|
8 |
+
use CompropagoSdk\Factory\Models\EvalAuthInfo;
|
9 |
+
use CompropagoSdk\Factory\Models\FeeDetails;
|
10 |
+
use CompropagoSdk\Factory\Models\InstructionDetails;
|
11 |
+
use CompropagoSdk\Factory\Models\Instructions;
|
12 |
+
use CompropagoSdk\Factory\Models\NewOrderInfo;
|
13 |
+
use CompropagoSdk\Factory\Models\OrderInfo;
|
14 |
+
use CompropagoSdk\Factory\Models\PlaceOrderInfo;
|
15 |
+
use CompropagoSdk\Factory\Models\Provider;
|
16 |
+
use CompropagoSdk\Factory\Models\SmsData;
|
17 |
+
use CompropagoSdk\Factory\Models\SmsInfo;
|
18 |
+
use CompropagoSdk\Factory\Models\SmsObject;
|
19 |
+
use CompropagoSdk\Factory\Models\Webhook;
|
20 |
+
|
21 |
+
class Serialize
|
22 |
+
{
|
23 |
+
public static function cpOrderInfo($data=array())
|
24 |
+
{
|
25 |
+
if (empty($data)) {
|
26 |
+
return new CpOrderInfo();
|
27 |
+
} else {
|
28 |
+
$obj = new CpOrderInfo();
|
29 |
+
|
30 |
+
$obj->id = $data['id'];
|
31 |
+
$obj->type = $data['type'];
|
32 |
+
$obj->object = $data['object'];
|
33 |
+
$obj->created = $data['created'];
|
34 |
+
$obj->paid = $data['paid'];
|
35 |
+
$obj->amount = $data['amount'];
|
36 |
+
$obj->livemode = $data['livemode'];
|
37 |
+
$obj->currency = $data['currency'];
|
38 |
+
$obj->refunded = $data['refunded'];
|
39 |
+
$obj->fee = $data['fee'];
|
40 |
+
$obj->fee_details = self::feeDetails($data['fee_details']);
|
41 |
+
$obj->order_info = self::orderInfo($data['order_info']);
|
42 |
+
$obj->customer = self::customer($data['customer']);
|
43 |
+
$obj->captured = $data['captured'];
|
44 |
+
$obj->failure_message = $data['failure_message'];
|
45 |
+
$obj->failure_code = $data['failure_code'];
|
46 |
+
$obj->amount_refunded = $data['amount_refunded'];
|
47 |
+
$obj->description = $data['description'];
|
48 |
+
$obj->dispute = $data['dispute'];
|
49 |
+
|
50 |
+
return $obj;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
public static function customer($data=array())
|
55 |
+
{
|
56 |
+
if (empty($data)) {
|
57 |
+
return new Customer();
|
58 |
+
} else {
|
59 |
+
$obj = new Customer();
|
60 |
+
|
61 |
+
$obj->customer_name = $data['customer_name'];
|
62 |
+
$obj->customer_email = $data['customer_email'];
|
63 |
+
$obj->customer_phone = $data['customer_phone'];
|
64 |
+
|
65 |
+
return $obj;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
public static function evalAuthInfo($data=array())
|
70 |
+
{
|
71 |
+
if (empty($data)) {
|
72 |
+
return new EvalAuthInfo();
|
73 |
+
} else {
|
74 |
+
$obj = new EvalAuthInfo();
|
75 |
+
|
76 |
+
$obj->type = $data['type'];
|
77 |
+
$obj->livemode = $data['livemode'];
|
78 |
+
$obj->mode_key = $data['mode_key'];
|
79 |
+
$obj->message = $data['message'];
|
80 |
+
$obj->code = $data['code'];
|
81 |
+
|
82 |
+
return $obj;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
public static function feeDetails($data=array())
|
87 |
+
{
|
88 |
+
if (empty($data)) {
|
89 |
+
return new FeeDetails();
|
90 |
+
} else {
|
91 |
+
$obj = new FeeDetails();
|
92 |
+
|
93 |
+
$obj->amount = isset($data['amount']) ? $data['amount'] : null;
|
94 |
+
$obj->currency = isset($data['currency']) ? $data['currency'] : null;
|
95 |
+
$obj->type = isset($data['type']) ? $data['type'] : null;
|
96 |
+
$obj->description = isset($data['description']) ? $data['description'] : null;
|
97 |
+
$obj->application = isset($data['application']) ? $data['application'] : null;
|
98 |
+
$obj->tax_percent = isset($data['tax_percent']) ? $data['tax_percent'] : null;
|
99 |
+
$obj->amount_refunded = isset($data['amount_refunded']) ? $data['amount_refunded'] : null;
|
100 |
+
$obj->tax = isset($data['tax']) ? $data['tax'] : null;
|
101 |
+
|
102 |
+
return $obj;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
public static function instructionDetails($data=array())
|
107 |
+
{
|
108 |
+
if (empty($data)) {
|
109 |
+
return new InstructionDetails();
|
110 |
+
} else {
|
111 |
+
$obj = new InstructionDetails();
|
112 |
+
|
113 |
+
$obj->amount = $data['amount'];
|
114 |
+
$obj->store = $data['store'];
|
115 |
+
$obj->payment_amount = $data['payment_amount'];
|
116 |
+
$obj->payment_store = $data['payment_store'];
|
117 |
+
$obj->bank_account_holder_name = $data['bank_account_holder_name'];
|
118 |
+
$obj->bank_account_number = $data['bank_account_number'];
|
119 |
+
$obj->bank_reference = $data['bank_reference'];
|
120 |
+
$obj->company_reference_name = $data['company_reference_name'];
|
121 |
+
$obj->company_reference_number = $data['company_reference_number'];
|
122 |
+
$obj->company_bank_number = $data['company_bank_number'];
|
123 |
+
$obj->order_reference_number = $data['order_reference_number'];
|
124 |
+
$obj->bank_name = $data['bank_name'];
|
125 |
+
|
126 |
+
return $obj;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
public static function instructions($data=array())
|
131 |
+
{
|
132 |
+
if (empty($data)) {
|
133 |
+
return new Instructions();
|
134 |
+
} else {
|
135 |
+
$obj = new Instructions();
|
136 |
+
|
137 |
+
$obj->description = $data['description'];
|
138 |
+
$obj->step_1 = $data['step_1'];
|
139 |
+
$obj->step_2 = $data['step_2'];
|
140 |
+
$obj->step_3 = $data['step_3'];
|
141 |
+
$obj->note_extra_comition = $data['note_extra_comition'];
|
142 |
+
$obj->note_expiration_date = $data['note_expiration_date'];
|
143 |
+
$obj->note_confirmation = $data['note_confirmation'];
|
144 |
+
$obj->details = self::instructionDetails($data['details']);
|
145 |
+
|
146 |
+
return $obj;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
public static function newOrderInfo($data=array())
|
151 |
+
{
|
152 |
+
if (empty($data)) {
|
153 |
+
return new NewOrderInfo();
|
154 |
+
} else {
|
155 |
+
$obj = new NewOrderInfo();
|
156 |
+
|
157 |
+
$obj->id = $data['id'];
|
158 |
+
$obj->short_id = $data['short_id'];
|
159 |
+
$obj->object = $data['object'];
|
160 |
+
$obj->status = $data['status'];
|
161 |
+
$obj->created = $data['created'];
|
162 |
+
$obj->exp_date = $data['exp_date'];
|
163 |
+
$obj->live_mode = $data['live_mode'];
|
164 |
+
$obj->order_info = self::orderInfo($data['order_info']);
|
165 |
+
$obj->fee_details = self::feeDetails($data['fee_details']);
|
166 |
+
$obj->instructions = self::instructions($data['instructions']);
|
167 |
+
|
168 |
+
return $obj;
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
public static function orderInfo($data=array())
|
173 |
+
{
|
174 |
+
if (empty($data)) {
|
175 |
+
return new OrderInfo();
|
176 |
+
} else {
|
177 |
+
$obj = new OrderInfo();
|
178 |
+
|
179 |
+
$obj->order_id = isset($data['order_id']) ? $data['order_id'] : null;
|
180 |
+
$obj->order_price = isset($data['order_price']) ? $data['order_price'] : null;
|
181 |
+
$obj->order_name = isset($data['order_name']) ? $data['order_name'] : null;
|
182 |
+
$obj->payment_method = isset($data['payment_method']) ? $data['payment_method'] : null;
|
183 |
+
$obj->store = isset($data['store']) ? $data['store'] : null;
|
184 |
+
$obj->country = isset($data['country']) ? $data['country'] : null;
|
185 |
+
$obj->image_url = isset($data['image_url']) ? $data['image_url'] : null;
|
186 |
+
$obj->success_url = isset($data['success_url']) ? $data['success_url'] : null;
|
187 |
+
|
188 |
+
return $obj;
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
public static function placeOrderInfo($data=array())
|
193 |
+
{
|
194 |
+
if (empty($data)) {
|
195 |
+
return new PlaceOrderInfo(null, null, null, null, null);
|
196 |
+
} else {
|
197 |
+
return new PlaceOrderInfo(
|
198 |
+
$data['order_id'],
|
199 |
+
$data['order_name'],
|
200 |
+
$data['order_price'],
|
201 |
+
$data['customer_name'],
|
202 |
+
$data['customer_email'],
|
203 |
+
empty($data['payment_type']) ? 'OXXO' : $data['payment_type'],
|
204 |
+
empty($data['currency']) ? 'MXN' : $data['currency'],
|
205 |
+
empty($data['image_url']) ? '': $data['image_url'],
|
206 |
+
empty($data['app_client_name']) ? 'php-sdk' : $data['app_client_name'],
|
207 |
+
empty($data['app_client_version']) ? Client::VERSION : $data['app_client_version']
|
208 |
+
);
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
public static function provider($data=array())
|
213 |
+
{
|
214 |
+
if (empty($data)) {
|
215 |
+
return new Provider();
|
216 |
+
} else {
|
217 |
+
$obj = new Provider();
|
218 |
+
|
219 |
+
$obj->name = $data['name'];
|
220 |
+
$obj->store_image = $data['store_image'];
|
221 |
+
$obj->is_active = $data['is_active'];
|
222 |
+
$obj->internal_name = $data['internal_name'];
|
223 |
+
$obj->image_small = $data['image_small'];
|
224 |
+
$obj->image_medium = $data['image_medium'];
|
225 |
+
$obj->image_large = $data['image_large'];
|
226 |
+
$obj->transaction_limit = $data['transaction_limit'];
|
227 |
+
$obj->rank = $data['rank'];
|
228 |
+
|
229 |
+
return $obj;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
public static function smsData($data=array())
|
234 |
+
{
|
235 |
+
if (empty($data)) {
|
236 |
+
return new SmsData();
|
237 |
+
} else {
|
238 |
+
$obj = new SmsData();
|
239 |
+
|
240 |
+
$obj->object = self::smsObject($data['object']);
|
241 |
+
|
242 |
+
return $obj;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
public static function smsInfo($data=array())
|
247 |
+
{
|
248 |
+
if (empty($data)) {
|
249 |
+
return new SmsInfo();
|
250 |
+
} else {
|
251 |
+
$obj = new SmsInfo();
|
252 |
+
|
253 |
+
$obj->type = $data['type'];
|
254 |
+
$obj->object = $data['object'];
|
255 |
+
$obj->data = self::smsData($data['data']);
|
256 |
+
|
257 |
+
return $obj;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
public static function smsObject($data=array())
|
262 |
+
{
|
263 |
+
if (empty($data)) {
|
264 |
+
return new SmsObject();
|
265 |
+
} else {
|
266 |
+
$obj = new SmsObject();
|
267 |
+
|
268 |
+
$obj->id = $data['id'];
|
269 |
+
$obj->short_id = $data['short_id'];
|
270 |
+
$obj->object = $data['object'];
|
271 |
+
|
272 |
+
return $obj;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
|
276 |
+
public static function webhook($data=array())
|
277 |
+
{
|
278 |
+
if (empty($data)) {
|
279 |
+
return new Webhook();
|
280 |
+
} else {
|
281 |
+
$obj = new Webhook();
|
282 |
+
|
283 |
+
$obj->id = isset($data['id']) ? $data['id'] : null;
|
284 |
+
$obj->url = isset($data['url']) ? $data['url'] : null;
|
285 |
+
$obj->mode = isset($data['mode']) ? $data['mode'] : null;
|
286 |
+
$obj->status = isset($data['status']) ? $data['status'] : null;
|
287 |
+
|
288 |
+
return $obj;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/CpObject.php
DELETED
@@ -1,50 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
class CpObject
|
27 |
-
{
|
28 |
-
public $id;
|
29 |
-
public $object;
|
30 |
-
public $created_at;
|
31 |
-
public $paid;
|
32 |
-
public $amount;
|
33 |
-
public $currency;
|
34 |
-
public $refunded;
|
35 |
-
public $fee;
|
36 |
-
public $fee_details;
|
37 |
-
public $payment_details;
|
38 |
-
public $captured;
|
39 |
-
public $failure_message;
|
40 |
-
public $failure_code;
|
41 |
-
public $amount_refunded;
|
42 |
-
public $description;
|
43 |
-
public $dispute;
|
44 |
-
|
45 |
-
public function __construct()
|
46 |
-
{
|
47 |
-
$this->fee_details = new FeeDetails10();
|
48 |
-
$this->payment_details = new PaymentDetails();
|
49 |
-
}
|
50 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/CpOrderInfo10.php
DELETED
@@ -1,193 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\CpOrderInfo;
|
27 |
-
use CompropagoSdk\Models\Customer;
|
28 |
-
|
29 |
-
class CpOrderInfo10 extends CpOrderInfo
|
30 |
-
{
|
31 |
-
public $type;
|
32 |
-
public $object;
|
33 |
-
public $data;
|
34 |
-
|
35 |
-
public function __construct()
|
36 |
-
{
|
37 |
-
$this->data = new Data();
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* @return string
|
42 |
-
*/
|
43 |
-
public function getId()
|
44 |
-
{
|
45 |
-
return $this->data->object->id;
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public function getType()
|
52 |
-
{
|
53 |
-
return $this->type;
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @return string
|
58 |
-
*/
|
59 |
-
public function getCreated()
|
60 |
-
{
|
61 |
-
return $this->data->object->created_at;
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* @return bool
|
66 |
-
*/
|
67 |
-
public function getPaid()
|
68 |
-
{
|
69 |
-
return $this->data->object->paid;
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* @return string
|
74 |
-
*/
|
75 |
-
public function getAmount()
|
76 |
-
{
|
77 |
-
return $this->data->object->amount;
|
78 |
-
}
|
79 |
-
|
80 |
-
/**
|
81 |
-
* @return string
|
82 |
-
*/
|
83 |
-
public function getCurrency()
|
84 |
-
{
|
85 |
-
return $this->data->object->currency;
|
86 |
-
}
|
87 |
-
|
88 |
-
/**
|
89 |
-
* @return bool
|
90 |
-
*/
|
91 |
-
public function getRefunded()
|
92 |
-
{
|
93 |
-
return $this->data->object->refunded;
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* @return string
|
98 |
-
*/
|
99 |
-
public function getFee()
|
100 |
-
{
|
101 |
-
return $this->data->object->fee;
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
* @return \CompropagoSdk\Factory\Abs\FeeDetails
|
106 |
-
*/
|
107 |
-
public function getFeeDetails()
|
108 |
-
{
|
109 |
-
return $this->data->object->fee_details;
|
110 |
-
}
|
111 |
-
|
112 |
-
/**
|
113 |
-
* @return \CompropagoSdk\Factory\Abs\OrderInfo
|
114 |
-
*/
|
115 |
-
public function getOrderInfo()
|
116 |
-
{
|
117 |
-
$order = new OrderInfo10();
|
118 |
-
|
119 |
-
$order->order_id = $this->data->object->payment_details->product_id;
|
120 |
-
$order->order_price = $this->data->object->payment_details->product_price;
|
121 |
-
$order->order_name = $this->data->object->payment_details->product_name;
|
122 |
-
$order->order_id = $this->data->object->payment_details->product_id;
|
123 |
-
$order->payment_method = $this->data->object->payment_details->object;
|
124 |
-
$order->store = $this->data->object->payment_details->store;
|
125 |
-
$order->country = $this->data->object->payment_details->country;
|
126 |
-
$order->image_url = $this->data->object->payment_details->image_url;
|
127 |
-
$order->success_url = $this->data->object->payment_details->success_url;
|
128 |
-
|
129 |
-
return $order;
|
130 |
-
}
|
131 |
-
|
132 |
-
/**
|
133 |
-
* @return \CompropagoSdk\Models\Customer
|
134 |
-
*/
|
135 |
-
public function getCustomer()
|
136 |
-
{
|
137 |
-
$customer = new Customer();
|
138 |
-
|
139 |
-
$customer->customer_name = $this->data->object->payment_details->customer_name;
|
140 |
-
$customer->customer_email = $this->data->object->payment_details->customer_email;
|
141 |
-
$customer->customer_phone = $this->data->object->payment_details->customer_phone;
|
142 |
-
|
143 |
-
return $customer;
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* @return bool
|
148 |
-
*/
|
149 |
-
public function getCaptured()
|
150 |
-
{
|
151 |
-
return $this->data->object->captured;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* @return string
|
156 |
-
*/
|
157 |
-
public function getFailureMessage()
|
158 |
-
{
|
159 |
-
return $this->data->object->failure_message;
|
160 |
-
}
|
161 |
-
|
162 |
-
/**
|
163 |
-
* @return string
|
164 |
-
*/
|
165 |
-
public function getFailureCode()
|
166 |
-
{
|
167 |
-
return $this->data->object->failure_code;
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* @return double
|
172 |
-
*/
|
173 |
-
public function getAmountRefunded()
|
174 |
-
{
|
175 |
-
return $this->data->object->amount_refunded;
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* @return string
|
180 |
-
*/
|
181 |
-
public function getDescription()
|
182 |
-
{
|
183 |
-
return $this->data->object->description;
|
184 |
-
}
|
185 |
-
|
186 |
-
/**
|
187 |
-
* @return string
|
188 |
-
*/
|
189 |
-
public function getDispute()
|
190 |
-
{
|
191 |
-
return $this->data->object->dispute;
|
192 |
-
}
|
193 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/Data.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
class Data
|
27 |
-
{
|
28 |
-
public $object;
|
29 |
-
|
30 |
-
public function __construct()
|
31 |
-
{
|
32 |
-
$this->object = new CpObject();
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/FeeDetails10.php
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\FeeDetails;
|
27 |
-
|
28 |
-
class FeeDetails10 extends FeeDetails
|
29 |
-
{
|
30 |
-
public $amount;
|
31 |
-
public $currency;
|
32 |
-
public $type;
|
33 |
-
public $description;
|
34 |
-
public $application;
|
35 |
-
public $amount_refunded;
|
36 |
-
|
37 |
-
public function __construct()
|
38 |
-
{
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* @return string
|
43 |
-
*/
|
44 |
-
public function getAmount()
|
45 |
-
{
|
46 |
-
return $this->amount;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
* @return string
|
51 |
-
*/
|
52 |
-
public function getCurrency()
|
53 |
-
{
|
54 |
-
return $this->currency;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* @return string
|
59 |
-
*/
|
60 |
-
public function getType()
|
61 |
-
{
|
62 |
-
return $this->type;
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* @return string
|
67 |
-
*/
|
68 |
-
public function getDescription()
|
69 |
-
{
|
70 |
-
return $this->description;
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* @return string
|
75 |
-
*/
|
76 |
-
public function getApplication()
|
77 |
-
{
|
78 |
-
return $this->application;
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* @return double
|
83 |
-
*/
|
84 |
-
public function getAmountRefunded()
|
85 |
-
{
|
86 |
-
return $this->amount_refunded;
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* @return string
|
91 |
-
*/
|
92 |
-
public function getTax()
|
93 |
-
{
|
94 |
-
return null;
|
95 |
-
}
|
96 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/InstructionDetails10.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\InstrcutionDetails;
|
27 |
-
|
28 |
-
class InstructionDetails10 extends InstrcutionDetails
|
29 |
-
{
|
30 |
-
public $payment_amount;
|
31 |
-
public $payment_store;
|
32 |
-
public $bank_account_number;
|
33 |
-
public $bank_name;
|
34 |
-
|
35 |
-
public function __construct()
|
36 |
-
{
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getAmount()
|
43 |
-
{
|
44 |
-
return $this->payment_amount;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getStore()
|
51 |
-
{
|
52 |
-
return $this->payment_store;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
public function getBankAccountNumber()
|
59 |
-
{
|
60 |
-
return $this->bank_account_number;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public function getBankName()
|
67 |
-
{
|
68 |
-
return $this->bank_name;
|
69 |
-
}
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/Instructions10.php
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\InstrcutionDetails;
|
27 |
-
use CompropagoSdk\Factory\Abs\Instructions;
|
28 |
-
|
29 |
-
class Instructions10 extends Instructions
|
30 |
-
{
|
31 |
-
public $description;
|
32 |
-
public $step_1;
|
33 |
-
public $step_2;
|
34 |
-
public $step_3;
|
35 |
-
public $note_extra_comition;
|
36 |
-
public $note_expiration_date;
|
37 |
-
public $note_confirmation;
|
38 |
-
public $details;
|
39 |
-
|
40 |
-
public function __construct()
|
41 |
-
{
|
42 |
-
$this->details = new InstructionDetails10();
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @return string
|
47 |
-
*/
|
48 |
-
public function getDescription()
|
49 |
-
{
|
50 |
-
return $this->description;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public function getStep1()
|
57 |
-
{
|
58 |
-
return $this->step_1;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public function getStep2()
|
65 |
-
{
|
66 |
-
return $this->step_2;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @return string
|
71 |
-
*/
|
72 |
-
public function getStep3()
|
73 |
-
{
|
74 |
-
return $this->step_3;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* @return string
|
79 |
-
*/
|
80 |
-
public function getNoteExtraComition()
|
81 |
-
{
|
82 |
-
return $this->note_extra_comition;
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @return string
|
87 |
-
*/
|
88 |
-
public function getNoteExpirationDate()
|
89 |
-
{
|
90 |
-
return $this->note_expiration_date;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* @return string
|
95 |
-
*/
|
96 |
-
public function getNoteConfirmation()
|
97 |
-
{
|
98 |
-
return $this->note_confirmation;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* @return InstrcutionDetails
|
103 |
-
*/
|
104 |
-
public function getDetails()
|
105 |
-
{
|
106 |
-
return $this->details;
|
107 |
-
}
|
108 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/NewOrderInfo10.php
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\FeeDetails;
|
27 |
-
use CompropagoSdk\Factory\Abs\Instructions;
|
28 |
-
use CompropagoSdk\Factory\Abs\NewOrderInfo;
|
29 |
-
use CompropagoSdk\Factory\Abs\OrderInfo;
|
30 |
-
|
31 |
-
class NewOrderInfo10 extends NewOrderInfo
|
32 |
-
{
|
33 |
-
public $payment_id;
|
34 |
-
public $short_payment_id;
|
35 |
-
public $payment_status;
|
36 |
-
public $creation_date;
|
37 |
-
public $expiration_date;
|
38 |
-
public $product_information;
|
39 |
-
public $payment_instructions;
|
40 |
-
|
41 |
-
public function __construct()
|
42 |
-
{
|
43 |
-
$this->product_information = new ProductInformation();
|
44 |
-
$this->payment_instructions = new Instructions10();
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getId()
|
51 |
-
{
|
52 |
-
return $this->payment_id;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
public function getShortId()
|
59 |
-
{
|
60 |
-
return $this->short_payment_id;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public function getStatus()
|
67 |
-
{
|
68 |
-
return $this->payment_status;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* @return string
|
73 |
-
*/
|
74 |
-
public function getCreated()
|
75 |
-
{
|
76 |
-
return $this->creation_date;
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* @return string
|
81 |
-
*/
|
82 |
-
public function getExpirationDate()
|
83 |
-
{
|
84 |
-
return $this->expiration_date;
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* @return OrderInfo
|
89 |
-
*/
|
90 |
-
public function getOrderInfo()
|
91 |
-
{
|
92 |
-
$info = new OrderInfo10();
|
93 |
-
|
94 |
-
$info->order_id = $this->product_information->product_id;
|
95 |
-
$info->order_name = $this->product_information->product_name;
|
96 |
-
$info->order_price = $this->product_information->product_price;
|
97 |
-
$info->image_url = $this->product_information->image_url;
|
98 |
-
|
99 |
-
return $info;
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @return FeeDetails
|
104 |
-
*/
|
105 |
-
public function getFeeDetails()
|
106 |
-
{
|
107 |
-
return null;
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* @return Instructions
|
112 |
-
*/
|
113 |
-
public function getInstructions()
|
114 |
-
{
|
115 |
-
return $this->payment_instructions;
|
116 |
-
}
|
117 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/OrderInfo10.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\OrderInfo;
|
27 |
-
|
28 |
-
class OrderInfo10 extends OrderInfo
|
29 |
-
{
|
30 |
-
public $order_id;
|
31 |
-
public $order_price;
|
32 |
-
public $order_name;
|
33 |
-
public $payment_method;
|
34 |
-
public $store;
|
35 |
-
public $country;
|
36 |
-
public $image_url;
|
37 |
-
public $success_url;
|
38 |
-
|
39 |
-
public function __construct()
|
40 |
-
{
|
41 |
-
}
|
42 |
-
|
43 |
-
public function getOrderId()
|
44 |
-
{
|
45 |
-
return $this->order_id;
|
46 |
-
}
|
47 |
-
|
48 |
-
public function getOrderPrice()
|
49 |
-
{
|
50 |
-
return $this->order_price;
|
51 |
-
}
|
52 |
-
|
53 |
-
public function getOrderName()
|
54 |
-
{
|
55 |
-
return $this->order_name;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function getPaymentMethod()
|
59 |
-
{
|
60 |
-
return $this->payment_method;
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getStore()
|
64 |
-
{
|
65 |
-
return $this->store;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function getCountry()
|
69 |
-
{
|
70 |
-
return $this->country;
|
71 |
-
}
|
72 |
-
|
73 |
-
public function getImageUrl()
|
74 |
-
{
|
75 |
-
return $this->image_url;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function getSuccessUrl()
|
79 |
-
{
|
80 |
-
return $this->success_url;
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/PaymentDetails.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
class PaymentDetails
|
27 |
-
{
|
28 |
-
public $object;
|
29 |
-
public $store;
|
30 |
-
public $country;
|
31 |
-
public $product_id;
|
32 |
-
public $product_price;
|
33 |
-
public $product_name;
|
34 |
-
public $image_url;
|
35 |
-
public $success_url;
|
36 |
-
public $customer_name;
|
37 |
-
public $customer_email;
|
38 |
-
public $customer_phone;
|
39 |
-
|
40 |
-
public function __construct()
|
41 |
-
{
|
42 |
-
}
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/ProductInformation.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
class ProductInformation
|
27 |
-
{
|
28 |
-
public $product_id;
|
29 |
-
public $product_name;
|
30 |
-
public $product_price;
|
31 |
-
public $image_url;
|
32 |
-
|
33 |
-
public function __construct()
|
34 |
-
{
|
35 |
-
}
|
36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/SmsInfo10.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\SmsInfo;
|
27 |
-
|
28 |
-
class SmsInfo10 extends SmsInfo
|
29 |
-
{
|
30 |
-
public $type;
|
31 |
-
public $object;
|
32 |
-
public $payment;
|
33 |
-
|
34 |
-
public function __construct()
|
35 |
-
{
|
36 |
-
$this->payment = new SmsPayment();
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getType()
|
43 |
-
{
|
44 |
-
return $this->type;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getObject()
|
51 |
-
{
|
52 |
-
return $this->object;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
public function getId()
|
59 |
-
{
|
60 |
-
return $this->payment->id;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public function getShortId()
|
67 |
-
{
|
68 |
-
return $this->payment->short_id;
|
69 |
-
}
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V10/SmsPayment.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V10;
|
24 |
-
|
25 |
-
|
26 |
-
class SmsPayment
|
27 |
-
{
|
28 |
-
public $id;
|
29 |
-
public $short_id;
|
30 |
-
|
31 |
-
public function __construct()
|
32 |
-
{
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/CpOrderInfo11.php
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\CpOrderInfo;
|
27 |
-
use CompropagoSdk\Models\Customer;
|
28 |
-
|
29 |
-
class CpOrderInfo11 extends CpOrderInfo
|
30 |
-
{
|
31 |
-
public $id;
|
32 |
-
public $type;
|
33 |
-
public $object;
|
34 |
-
public $created;
|
35 |
-
public $paid;
|
36 |
-
public $amount;
|
37 |
-
public $livemode;
|
38 |
-
public $currency;
|
39 |
-
public $refunded;
|
40 |
-
public $fee;
|
41 |
-
public $fee_details;
|
42 |
-
public $order_info;
|
43 |
-
public $customer;
|
44 |
-
public $captured;
|
45 |
-
public $failure_message;
|
46 |
-
public $failure_code;
|
47 |
-
public $amount_refunded;
|
48 |
-
public $description;
|
49 |
-
public $dispute;
|
50 |
-
|
51 |
-
public function __construct()
|
52 |
-
{
|
53 |
-
$this->fee_details = new FeeDetails11();
|
54 |
-
$this->order_info = new OrderInfo11();
|
55 |
-
$this->customer = new Customer();
|
56 |
-
}
|
57 |
-
|
58 |
-
public function getId()
|
59 |
-
{
|
60 |
-
return $this->id;
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getType()
|
64 |
-
{
|
65 |
-
return $this->type;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function getCreated()
|
69 |
-
{
|
70 |
-
return $this->created;
|
71 |
-
}
|
72 |
-
|
73 |
-
public function getPaid()
|
74 |
-
{
|
75 |
-
return $this->paid;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function getAmount()
|
79 |
-
{
|
80 |
-
return $this->amount;
|
81 |
-
}
|
82 |
-
|
83 |
-
public function getCurrency()
|
84 |
-
{
|
85 |
-
return $this->currency;
|
86 |
-
}
|
87 |
-
|
88 |
-
public function getRefunded()
|
89 |
-
{
|
90 |
-
return $this->refunded;
|
91 |
-
}
|
92 |
-
|
93 |
-
public function getFee()
|
94 |
-
{
|
95 |
-
return $this->fee;
|
96 |
-
}
|
97 |
-
|
98 |
-
public function getFeeDetails()
|
99 |
-
{
|
100 |
-
return $this->fee_details;
|
101 |
-
}
|
102 |
-
|
103 |
-
public function getOrderInfo()
|
104 |
-
{
|
105 |
-
return $this->order_info;
|
106 |
-
}
|
107 |
-
|
108 |
-
public function getCustomer()
|
109 |
-
{
|
110 |
-
return $this->customer;
|
111 |
-
}
|
112 |
-
|
113 |
-
public function getCaptured()
|
114 |
-
{
|
115 |
-
return $this->captured;
|
116 |
-
}
|
117 |
-
|
118 |
-
public function getFailureMessage()
|
119 |
-
{
|
120 |
-
return $this->failure_message;
|
121 |
-
}
|
122 |
-
|
123 |
-
public function getFailureCode()
|
124 |
-
{
|
125 |
-
return $this->failure_code;
|
126 |
-
}
|
127 |
-
|
128 |
-
public function getAmountRefunded()
|
129 |
-
{
|
130 |
-
return $this->amount_refunded;
|
131 |
-
}
|
132 |
-
|
133 |
-
public function getDescription()
|
134 |
-
{
|
135 |
-
return $this->description;
|
136 |
-
}
|
137 |
-
|
138 |
-
public function getDispute()
|
139 |
-
{
|
140 |
-
return $this->dispute;
|
141 |
-
}
|
142 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/FeeDetails11.php
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\FeeDetails;
|
27 |
-
|
28 |
-
class FeeDetails11 extends FeeDetails
|
29 |
-
{
|
30 |
-
public $amount;
|
31 |
-
public $currency;
|
32 |
-
public $type;
|
33 |
-
public $description;
|
34 |
-
public $application;
|
35 |
-
public $amount_refunded;
|
36 |
-
public $tax;
|
37 |
-
|
38 |
-
public function __construct()
|
39 |
-
{
|
40 |
-
}
|
41 |
-
|
42 |
-
public function getAmount()
|
43 |
-
{
|
44 |
-
return $this->amount;
|
45 |
-
}
|
46 |
-
|
47 |
-
public function getCurrency()
|
48 |
-
{
|
49 |
-
return $this->currency;
|
50 |
-
}
|
51 |
-
|
52 |
-
public function getType()
|
53 |
-
{
|
54 |
-
return $this->type;
|
55 |
-
}
|
56 |
-
|
57 |
-
public function getDescription()
|
58 |
-
{
|
59 |
-
return $this->description;
|
60 |
-
}
|
61 |
-
|
62 |
-
public function getApplication()
|
63 |
-
{
|
64 |
-
return $this->application;
|
65 |
-
}
|
66 |
-
|
67 |
-
public function getAmountRefunded()
|
68 |
-
{
|
69 |
-
return $this->amount_refunded;
|
70 |
-
}
|
71 |
-
|
72 |
-
public function getTax()
|
73 |
-
{
|
74 |
-
return $this->tax;
|
75 |
-
}
|
76 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/InstructionDetails11.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\InstrcutionDetails;
|
27 |
-
|
28 |
-
class InstructionDetails11 extends InstrcutionDetails
|
29 |
-
{
|
30 |
-
public $amount;
|
31 |
-
public $store;
|
32 |
-
public $bank_account_number;
|
33 |
-
public $bank_name;
|
34 |
-
|
35 |
-
public function __construct()
|
36 |
-
{
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getAmount()
|
43 |
-
{
|
44 |
-
return $this->amount;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getStore()
|
51 |
-
{
|
52 |
-
return $this->store;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
public function getBankAccountNumber()
|
59 |
-
{
|
60 |
-
return $this->bank_account_number;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public function getBankName()
|
67 |
-
{
|
68 |
-
return $this->bank_name;
|
69 |
-
}
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/Instructions11.php
DELETED
@@ -1,108 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\InstrcutionDetails;
|
27 |
-
use CompropagoSdk\Factory\Abs\Instructions;
|
28 |
-
|
29 |
-
class Instructions11 extends Instructions
|
30 |
-
{
|
31 |
-
public $description;
|
32 |
-
public $step_1;
|
33 |
-
public $step_2;
|
34 |
-
public $step_3;
|
35 |
-
public $note_extra_comition;
|
36 |
-
public $note_expiration_date;
|
37 |
-
public $note_confirmation;
|
38 |
-
public $details;
|
39 |
-
|
40 |
-
public function __construct()
|
41 |
-
{
|
42 |
-
$this->details = new InstructionDetails11();
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @return string
|
47 |
-
*/
|
48 |
-
public function getDescription()
|
49 |
-
{
|
50 |
-
return $this->description;
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public function getStep1()
|
57 |
-
{
|
58 |
-
return $this->step_1;
|
59 |
-
}
|
60 |
-
|
61 |
-
/**
|
62 |
-
* @return string
|
63 |
-
*/
|
64 |
-
public function getStep2()
|
65 |
-
{
|
66 |
-
return $this->step_2;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @return string
|
71 |
-
*/
|
72 |
-
public function getStep3()
|
73 |
-
{
|
74 |
-
return $this->step_3;
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* @return string
|
79 |
-
*/
|
80 |
-
public function getNoteExtraComition()
|
81 |
-
{
|
82 |
-
return $this->note_extra_comition;
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @return string
|
87 |
-
*/
|
88 |
-
public function getNoteExpirationDate()
|
89 |
-
{
|
90 |
-
return $this->note_expiration_date;
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* @return string
|
95 |
-
*/
|
96 |
-
public function getNoteConfirmation()
|
97 |
-
{
|
98 |
-
return $this->note_confirmation;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* @return InstrcutionDetails
|
103 |
-
*/
|
104 |
-
public function getDetails()
|
105 |
-
{
|
106 |
-
return $this->details;
|
107 |
-
}
|
108 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/NewOrderInfo11.php
DELETED
@@ -1,114 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\FeeDetails;
|
27 |
-
use CompropagoSdk\Factory\Abs\Instructions;
|
28 |
-
use CompropagoSdk\Factory\Abs\NewOrderInfo;
|
29 |
-
use CompropagoSdk\Factory\Abs\OrderInfo;
|
30 |
-
|
31 |
-
class NewOrderInfo11 extends NewOrderInfo
|
32 |
-
{
|
33 |
-
public $id;
|
34 |
-
public $short_id;
|
35 |
-
public $object;
|
36 |
-
public $status;
|
37 |
-
public $created;
|
38 |
-
public $exp_date;
|
39 |
-
public $live_mode;
|
40 |
-
public $order_info;
|
41 |
-
public $fee_details;
|
42 |
-
public $instructions;
|
43 |
-
|
44 |
-
public function __construct()
|
45 |
-
{
|
46 |
-
$this->order_info = new OrderInfo11();
|
47 |
-
$this->fee_details = new FeeDetails11();
|
48 |
-
$this->instructions = new Instructions11();
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* @return string
|
53 |
-
*/
|
54 |
-
public function getId()
|
55 |
-
{
|
56 |
-
return $this->id;
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* @return string
|
61 |
-
*/
|
62 |
-
public function getShortId()
|
63 |
-
{
|
64 |
-
return $this->short_id;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @return string
|
69 |
-
*/
|
70 |
-
public function getStatus()
|
71 |
-
{
|
72 |
-
return $this->status;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* @return string
|
77 |
-
*/
|
78 |
-
public function getCreated()
|
79 |
-
{
|
80 |
-
return $this->created;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* @return string
|
85 |
-
*/
|
86 |
-
public function getExpirationDate()
|
87 |
-
{
|
88 |
-
return $this->exp_date;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* @return OrderInfo
|
93 |
-
*/
|
94 |
-
public function getOrderInfo()
|
95 |
-
{
|
96 |
-
return $this->order_info;
|
97 |
-
}
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @return FeeDetails
|
101 |
-
*/
|
102 |
-
public function getFeeDetails()
|
103 |
-
{
|
104 |
-
return $this->fee_details;
|
105 |
-
}
|
106 |
-
|
107 |
-
/**
|
108 |
-
* @return Instructions
|
109 |
-
*/
|
110 |
-
public function getInstructions()
|
111 |
-
{
|
112 |
-
return $this->instructions;
|
113 |
-
}
|
114 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/OrderInfo11.php
DELETED
@@ -1,82 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\OrderInfo;
|
27 |
-
|
28 |
-
class OrderInfo11 extends OrderInfo
|
29 |
-
{
|
30 |
-
public $order_id;
|
31 |
-
public $order_price;
|
32 |
-
public $order_name;
|
33 |
-
public $payment_method;
|
34 |
-
public $store;
|
35 |
-
public $country;
|
36 |
-
public $image_url;
|
37 |
-
public $success_url;
|
38 |
-
|
39 |
-
public function __construct()
|
40 |
-
{
|
41 |
-
}
|
42 |
-
|
43 |
-
public function getOrderId()
|
44 |
-
{
|
45 |
-
return $this->order_id;
|
46 |
-
}
|
47 |
-
|
48 |
-
public function getOrderPrice()
|
49 |
-
{
|
50 |
-
return $this->order_price;
|
51 |
-
}
|
52 |
-
|
53 |
-
public function getOrderName()
|
54 |
-
{
|
55 |
-
return $this->order_name;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function getPaymentMethod()
|
59 |
-
{
|
60 |
-
return $this->payment_method;
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getStore()
|
64 |
-
{
|
65 |
-
return $this->store;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function getCountry()
|
69 |
-
{
|
70 |
-
return $this->country;
|
71 |
-
}
|
72 |
-
|
73 |
-
public function getImageUrl()
|
74 |
-
{
|
75 |
-
return $this->image_url;
|
76 |
-
}
|
77 |
-
|
78 |
-
public function getSuccessUrl()
|
79 |
-
{
|
80 |
-
return $this->success_url;
|
81 |
-
}
|
82 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsData.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
class SmsData
|
27 |
-
{
|
28 |
-
public $object;
|
29 |
-
|
30 |
-
public function __construct()
|
31 |
-
{
|
32 |
-
$this->object = new SmsObject();
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsInfo11.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
use CompropagoSdk\Factory\Abs\SmsInfo;
|
27 |
-
|
28 |
-
class SmsInfo11 extends SmsInfo
|
29 |
-
{
|
30 |
-
public $type;
|
31 |
-
public $object;
|
32 |
-
public $data;
|
33 |
-
|
34 |
-
public function __construct()
|
35 |
-
{
|
36 |
-
$this->data = new SmsData();
|
37 |
-
}
|
38 |
-
|
39 |
-
/**
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function getType()
|
43 |
-
{
|
44 |
-
return $this->type;
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* @return string
|
49 |
-
*/
|
50 |
-
public function getObject()
|
51 |
-
{
|
52 |
-
return $this->object;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
public function getId()
|
59 |
-
{
|
60 |
-
return $this->data->object->id;
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* @return string
|
65 |
-
*/
|
66 |
-
public function getShortId()
|
67 |
-
{
|
68 |
-
return $this->data->object->short_id;
|
69 |
-
}
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Factory/V11/SmsObject.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Factory\V11;
|
24 |
-
|
25 |
-
|
26 |
-
class SmsObject
|
27 |
-
{
|
28 |
-
public $id;
|
29 |
-
public $object;
|
30 |
-
public $short_id;
|
31 |
-
|
32 |
-
public function __construct()
|
33 |
-
{
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Customer.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Models;
|
24 |
-
|
25 |
-
|
26 |
-
class Customer
|
27 |
-
{
|
28 |
-
public $customer_name;
|
29 |
-
public $customer_email;
|
30 |
-
public $customer_phone;
|
31 |
-
|
32 |
-
public function __construct()
|
33 |
-
{
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/EvalAuthInfo.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Models;
|
24 |
-
|
25 |
-
|
26 |
-
class EvalAuthInfo
|
27 |
-
{
|
28 |
-
/**
|
29 |
-
* @var string
|
30 |
-
*/
|
31 |
-
public $type;
|
32 |
-
/**
|
33 |
-
* @var bool
|
34 |
-
*/
|
35 |
-
public $livemode;
|
36 |
-
/**
|
37 |
-
* @var bool
|
38 |
-
*/
|
39 |
-
public $mode_key;
|
40 |
-
/**
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
public $message;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @var int
|
47 |
-
*/
|
48 |
-
public $code;
|
49 |
-
|
50 |
-
/**
|
51 |
-
* EvalAuthInfo10 constructor.
|
52 |
-
*/
|
53 |
-
public function __construct()
|
54 |
-
{
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/PlaceOrderInfo.php
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Models;
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Class PlaceOrderInfo informacion de nuevas ordenes
|
27 |
-
* @package CompropagoSdk\Models
|
28 |
-
*/
|
29 |
-
class PlaceOrderInfo
|
30 |
-
{
|
31 |
-
public $order_id;
|
32 |
-
public $order_name;
|
33 |
-
public $order_price;
|
34 |
-
public $customer_name;
|
35 |
-
public $customer_email;
|
36 |
-
public $payment_type;
|
37 |
-
public $image_url;
|
38 |
-
public $app_client_name;
|
39 |
-
public $app_client_version;
|
40 |
-
|
41 |
-
public function __construct($order_id, $order_name, $order_price, $customer_name, $customer_email, $payment_type="OXXO", $image_url=null, $app_client_name="phpsdk", $app_client_version="2.0.0-alfa")
|
42 |
-
{
|
43 |
-
$this->order_id = $order_id;
|
44 |
-
$this->order_name = $order_name;
|
45 |
-
$this->order_price = $order_price;
|
46 |
-
$this->customer_name = $customer_name;
|
47 |
-
$this->customer_email = $customer_email;
|
48 |
-
$this->payment_type = $payment_type;
|
49 |
-
$this->image_url = $image_url;
|
50 |
-
$this->app_client_name = $app_client_name;
|
51 |
-
$this->app_client_version = $app_client_version;
|
52 |
-
}
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/Provider.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago ${LIBRARI}
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Models;
|
24 |
-
|
25 |
-
|
26 |
-
class Provider
|
27 |
-
{
|
28 |
-
public $name;
|
29 |
-
public $store_image;
|
30 |
-
public $is_active;
|
31 |
-
public $internal_name;
|
32 |
-
public $image_small;
|
33 |
-
public $image_medium;
|
34 |
-
public $image_large;
|
35 |
-
public $transaction_limit;
|
36 |
-
public $rank;
|
37 |
-
|
38 |
-
public function __construct()
|
39 |
-
{
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Models/WebhookError.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago $Library
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Models;
|
24 |
-
|
25 |
-
|
26 |
-
class WebhookError
|
27 |
-
{
|
28 |
-
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Service.php
CHANGED
@@ -1,215 +1,173 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
|
23 |
namespace CompropagoSdk;
|
24 |
|
25 |
use CompropagoSdk\Factory\Factory;
|
26 |
-
use CompropagoSdk\Models\
|
27 |
-
use CompropagoSdk\
|
28 |
-
use CompropagoSdk\
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
*/
|
34 |
class Service
|
35 |
{
|
36 |
private $client;
|
37 |
-
|
38 |
-
|
39 |
-
/**
|
40 |
-
* Service constructor.
|
41 |
-
* @param Client $client
|
42 |
-
*/
|
43 |
public function __construct(Client $client)
|
44 |
{
|
45 |
$this->client = $client;
|
46 |
-
$this->headers = array(
|
47 |
-
'useragent: '.$client->getContained()
|
48 |
-
);
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
* @param bool $auth
|
53 |
* @param int $limit
|
54 |
-
* @param
|
55 |
* @return array
|
56 |
-
* @throws \Exception
|
57 |
*/
|
58 |
-
public function listProviders($auth = false, $limit = 0, $
|
59 |
{
|
60 |
-
if($auth){
|
61 |
-
$
|
62 |
-
$keys = $this->client->
|
63 |
-
}else{
|
64 |
-
$
|
65 |
-
$keys =
|
66 |
}
|
67 |
|
68 |
-
if(
|
69 |
-
$
|
70 |
}
|
71 |
|
72 |
-
if(
|
73 |
-
|
74 |
-
$uri .= "&fetch=true";
|
75 |
-
}else{
|
76 |
-
$uri .= "?fetch=true";
|
77 |
-
}
|
78 |
}
|
79 |
|
80 |
-
$response =
|
81 |
-
$providers = Factory::arrayProviders($response);
|
82 |
|
83 |
-
return $
|
84 |
}
|
85 |
|
86 |
/**
|
87 |
* @param $orderId
|
88 |
-
* @return
|
89 |
-
* @throws \Exception
|
90 |
*/
|
91 |
public function verifyOrder( $orderId )
|
92 |
{
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
return $
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
* @param PlaceOrderInfo $neworder
|
103 |
-
* @return
|
104 |
-
* @throws \Exception
|
105 |
*/
|
106 |
public function placeOrder(PlaceOrderInfo $neworder)
|
107 |
{
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
|
|
|
|
|
|
123 |
|
124 |
-
return $
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
* @param $number
|
129 |
* @param $orderId
|
130 |
-
* @return
|
131 |
-
* @throws \Exception
|
132 |
*/
|
133 |
public function sendSmsInstructions($number,$orderId)
|
134 |
{
|
135 |
-
|
136 |
|
137 |
-
$
|
138 |
-
|
139 |
-
|
140 |
-
$this->
|
141 |
-
|
142 |
|
143 |
-
return $
|
144 |
}
|
145 |
|
146 |
/**
|
147 |
* @param $url
|
148 |
-
* @return
|
149 |
-
* @throws \Exception
|
150 |
*/
|
151 |
public function createWebhook($url)
|
152 |
{
|
153 |
-
|
154 |
-
|
155 |
-
$params = "url=".$url;
|
156 |
|
157 |
-
$response =
|
158 |
-
$this->
|
159 |
-
|
|
|
|
|
160 |
|
161 |
-
return $
|
162 |
}
|
163 |
|
164 |
/**
|
165 |
* @return array
|
166 |
-
* @throws \Exception
|
167 |
*/
|
168 |
public function listWebhooks()
|
169 |
{
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
$obj = Factory::listWebhooks($response);
|
175 |
|
176 |
-
return $
|
177 |
}
|
178 |
|
179 |
/**
|
180 |
* @param $webhookId
|
181 |
* @param $url
|
182 |
-
* @return
|
183 |
-
* @throws \Exception
|
184 |
*/
|
185 |
public function updateWebhook($webhookId, $url)
|
186 |
{
|
187 |
-
|
188 |
|
189 |
-
$
|
190 |
-
|
191 |
-
|
192 |
-
$
|
193 |
-
|
194 |
-
$obj = Factory::webhook($response);
|
195 |
|
196 |
-
return $
|
197 |
}
|
198 |
|
199 |
/**
|
200 |
* @param $webhookId
|
201 |
-
* @return
|
202 |
-
* @throws \Exception
|
203 |
*/
|
204 |
public function deleteWebhook($webhookId)
|
205 |
{
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
$obj = Factory::webhook($response);
|
212 |
|
213 |
-
return $
|
214 |
}
|
215 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CompropagoSdk;
|
4 |
|
5 |
use CompropagoSdk\Factory\Factory;
|
6 |
+
use CompropagoSdk\Factory\Models\CpOrderInfo;
|
7 |
+
use CompropagoSdk\Factory\Models\NewOrderInfo;
|
8 |
+
use CompropagoSdk\Factory\Models\PlaceOrderInfo;
|
9 |
+
use CompropagoSdk\Factory\Models\SmsInfo;
|
10 |
+
use CompropagoSdk\Factory\Models\Webhook;
|
11 |
+
use CompropagoSdk\Tools\Request;
|
12 |
+
|
|
|
13 |
class Service
|
14 |
{
|
15 |
private $client;
|
16 |
+
|
|
|
|
|
|
|
|
|
|
|
17 |
public function __construct(Client $client)
|
18 |
{
|
19 |
$this->client = $client;
|
|
|
|
|
|
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
* @param bool $auth
|
24 |
* @param int $limit
|
25 |
+
* @param string $currency
|
26 |
* @return array
|
|
|
27 |
*/
|
28 |
+
public function listProviders($auth = false, $limit = 0, $currency='MXN')
|
29 |
{
|
30 |
+
if ($auth) {
|
31 |
+
$url = $this->client->deployUri.'providers/';
|
32 |
+
$keys = ['user' => $this->client->getUser(), 'pass' => $this->client->getPass()];
|
33 |
+
} else {
|
34 |
+
$url = $this->client->deployUri.'providers/true/';
|
35 |
+
$keys = [];
|
36 |
}
|
37 |
|
38 |
+
if ($limit > 0) {
|
39 |
+
$url .= '?order_total='.$limit;
|
40 |
}
|
41 |
|
42 |
+
if ($limit > 0 && !empty($currency) && $currency != 'MXN') {
|
43 |
+
$url .= '¤cy='.$currency;
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
+
$response = Request::get($url, $keys);
|
|
|
47 |
|
48 |
+
return Factory::getInstanceOf('ListProviders', $response);
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
* @param $orderId
|
53 |
+
* @return CpOrderInfo
|
|
|
54 |
*/
|
55 |
public function verifyOrder( $orderId )
|
56 |
{
|
57 |
+
$response = Request::get(
|
58 |
+
$this->client->deployUri.'charges/'.$orderId.'/',
|
59 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
60 |
+
);
|
61 |
|
62 |
+
return Factory::getInstanceOf('CpOrderInfo', $response);
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
* @param PlaceOrderInfo $neworder
|
67 |
+
* @return NewOrderInfo
|
|
|
68 |
*/
|
69 |
public function placeOrder(PlaceOrderInfo $neworder)
|
70 |
{
|
71 |
+
$params = [
|
72 |
+
'order_id' => $neworder->order_id,
|
73 |
+
'order_name' => $neworder->order_name,
|
74 |
+
'order_price' => $neworder->order_price,
|
75 |
+
'customer_name' => $neworder->customer_name,
|
76 |
+
'customer_email' => $neworder->customer_email,
|
77 |
+
'payment_type' => $neworder->payment_type,
|
78 |
+
'currency' => $neworder->currency,
|
79 |
+
'image_url' => $neworder->image_url,
|
80 |
+
'app_client_name' => $neworder->app_client_name,
|
81 |
+
'app_client_version' => $neworder->app_client_version
|
82 |
+
];
|
83 |
+
|
84 |
+
$response = Request::post(
|
85 |
+
$this->client->deployUri.'charges/',
|
86 |
+
$params,
|
87 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
88 |
+
);
|
89 |
|
90 |
+
return Factory::getInstanceOf('NewOrderInfo', $response);
|
91 |
}
|
92 |
|
93 |
/**
|
94 |
* @param $number
|
95 |
* @param $orderId
|
96 |
+
* @return SmsInfo
|
|
|
97 |
*/
|
98 |
public function sendSmsInstructions($number,$orderId)
|
99 |
{
|
100 |
+
$params = ['customer_phone' => $number];
|
101 |
|
102 |
+
$response = Request::post(
|
103 |
+
$this->client->deployUri.'charges/'.$orderId.'/sms/',
|
104 |
+
$params,
|
105 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
106 |
+
);
|
107 |
|
108 |
+
return Factory::getInstanceOf('SmsInfo', $response);
|
109 |
}
|
110 |
|
111 |
/**
|
112 |
* @param $url
|
113 |
+
* @return Webhook
|
|
|
114 |
*/
|
115 |
public function createWebhook($url)
|
116 |
{
|
117 |
+
$params = ['url' => $url];
|
|
|
|
|
118 |
|
119 |
+
$response = Request::post(
|
120 |
+
$this->client->deployUri.'webhooks/stores/',
|
121 |
+
$params,
|
122 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
123 |
+
);
|
124 |
|
125 |
+
return Factory::getInstanceOf('Webhook', $response);
|
126 |
}
|
127 |
|
128 |
/**
|
129 |
* @return array
|
|
|
130 |
*/
|
131 |
public function listWebhooks()
|
132 |
{
|
133 |
+
$response = Request::get(
|
134 |
+
$this->client->deployUri.'webhooks/stores/',
|
135 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
136 |
+
);
|
|
|
137 |
|
138 |
+
return Factory::getInstanceOf('ListWebhooks', $response);
|
139 |
}
|
140 |
|
141 |
/**
|
142 |
* @param $webhookId
|
143 |
* @param $url
|
144 |
+
* @return Webhook
|
|
|
145 |
*/
|
146 |
public function updateWebhook($webhookId, $url)
|
147 |
{
|
148 |
+
$params = ['url' => $url];
|
149 |
|
150 |
+
$response = Request::put(
|
151 |
+
$this->client->deployUri.'webhooks/stores/'.$webhookId.'/',
|
152 |
+
$params,
|
153 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
154 |
+
);
|
|
|
155 |
|
156 |
+
return Factory::getInstanceOf('Webhook', $response);
|
157 |
}
|
158 |
|
159 |
/**
|
160 |
* @param $webhookId
|
161 |
+
* @return Webhook
|
|
|
162 |
*/
|
163 |
public function deleteWebhook($webhookId)
|
164 |
{
|
165 |
+
$response = Request::delete(
|
166 |
+
$this->client->deployUri.'webhooks/stores/'.$webhookId.'/',
|
167 |
+
null,
|
168 |
+
['user' => $this->client->getUser(), 'pass' => $this->client->getPass()]
|
169 |
+
);
|
|
|
170 |
|
171 |
+
return Factory::getInstanceOf('Webhook', $response);
|
172 |
}
|
173 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Http.php
CHANGED
@@ -1,115 +1,91 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
|
23 |
namespace CompropagoSdk\Tools;
|
24 |
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Class Http Crea llamas Http para el consumo de servicios
|
28 |
-
* @package CompropagoSdk\Tools
|
29 |
-
*/
|
30 |
class Http
|
31 |
{
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
public
|
39 |
{
|
40 |
-
$
|
41 |
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
42 |
-
return $ch;
|
43 |
}
|
44 |
|
45 |
-
|
46 |
-
* Define el metodo que ejecutara en la peticion
|
47 |
-
*
|
48 |
-
* @param $ch resource Instancia del Objeto Http
|
49 |
-
* @param $method string Tipo de peticion a ejecutar
|
50 |
-
* @throws \Exception
|
51 |
-
*/
|
52 |
-
public static function setMethod(&$ch,$method)
|
53 |
{
|
54 |
-
switch($method){
|
55 |
case 'GET':
|
56 |
case 'POST':
|
57 |
case 'PUT':
|
58 |
case 'DELETE':
|
59 |
-
|
60 |
break;
|
61 |
default:
|
62 |
-
throw new \Exception(
|
63 |
-
break;
|
64 |
}
|
65 |
}
|
66 |
|
67 |
-
|
68 |
-
* Estable las claves de autentificacion a usar
|
69 |
-
*
|
70 |
-
* @param $ch resource Instancia del Objeto Http
|
71 |
-
* @param $auth string Cadena de autentificacion del cliente
|
72 |
-
*/
|
73 |
-
public static function setAuth(&$ch, $auth)
|
74 |
{
|
75 |
-
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
|
78 |
-
|
79 |
-
* Carga los campos que se enviaran dentro de la peticion
|
80 |
-
* El formato de envio es el sieguinte:
|
81 |
-
* campo1=valor1&campo2=valor2&.....campox=valorx
|
82 |
-
*
|
83 |
-
* @param $ch resource Instancia del Objeto Http
|
84 |
-
* @param string $fields Campos a incluir en la peticion
|
85 |
-
*/
|
86 |
-
public static function setPostFields(&$ch, $fields="")
|
87 |
{
|
88 |
-
if(!empty($
|
89 |
-
|
90 |
}
|
91 |
}
|
92 |
|
93 |
-
|
94 |
-
* Carga los headers que se enviaran en la peticion http
|
95 |
-
*
|
96 |
-
* @param $ch
|
97 |
-
* @param array $headers
|
98 |
-
*/
|
99 |
-
public static function setHeaders(&$ch, array $headers)
|
100 |
{
|
101 |
-
|
|
|
|
|
102 |
}
|
103 |
|
104 |
-
|
105 |
-
* Ejecuta la peticion Http que se le especifique
|
106 |
-
*
|
107 |
-
* @param $ch
|
108 |
-
* @return mixed
|
109 |
-
* @throws \Exception
|
110 |
-
*/
|
111 |
-
public static function execHttp(&$ch)
|
112 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
$response = curl_exec($ch);
|
114 |
|
115 |
if(empty($response)){
|
@@ -127,6 +103,9 @@ class Http
|
|
127 |
}
|
128 |
}
|
129 |
|
|
|
|
|
130 |
return $response;
|
131 |
}
|
|
|
132 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CompropagoSdk\Tools;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
5 |
class Http
|
6 |
{
|
7 |
+
private $url;
|
8 |
+
private $data;
|
9 |
+
private $auth;
|
10 |
+
private $method;
|
11 |
+
private $extra_headers;
|
12 |
+
|
13 |
+
public function __construct($url)
|
14 |
{
|
15 |
+
$this->url = $url;
|
|
|
|
|
16 |
}
|
17 |
|
18 |
+
public function setMethod($method)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
{
|
20 |
+
switch ($method) {
|
21 |
case 'GET':
|
22 |
case 'POST':
|
23 |
case 'PUT':
|
24 |
case 'DELETE':
|
25 |
+
$this->method = $method;
|
26 |
break;
|
27 |
default:
|
28 |
+
throw new \Exception('Not supported method.');
|
|
|
29 |
}
|
30 |
}
|
31 |
|
32 |
+
public function setAuth(array $auth)
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
{
|
34 |
+
if (array_key_exists('user', $auth) && array_key_exists('pass', $auth)) {
|
35 |
+
$this->auth = $auth['user'].':'.$auth['pass'];
|
36 |
+
}else{
|
37 |
+
$this->auth = array();
|
38 |
+
}
|
39 |
}
|
40 |
|
41 |
+
public function setData(array $data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
{
|
43 |
+
if (!empty($data)) {
|
44 |
+
$this->data = json_encode($data);
|
45 |
}
|
46 |
}
|
47 |
|
48 |
+
public function setExtraHeaders(array $headers)
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
{
|
50 |
+
if (!empty($headers)) {
|
51 |
+
$this->extra_headers = $headers;
|
52 |
+
}
|
53 |
}
|
54 |
|
55 |
+
public function executeRequest()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
{
|
57 |
+
$ch = curl_init($this->url);
|
58 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
59 |
+
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->method);
|
60 |
+
|
61 |
+
if (!empty($this->auth)) {
|
62 |
+
curl_setopt($ch, CURLOPT_USERPWD, $this->auth);
|
63 |
+
}
|
64 |
+
|
65 |
+
if (!empty($this->data)) {
|
66 |
+
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data);
|
67 |
+
}
|
68 |
+
|
69 |
+
$headers = [
|
70 |
+
'Content-Type' => 'application/json',
|
71 |
+
'Cache-Control' => 'no-cache',
|
72 |
+
'Content-Length' => strlen($this->data)
|
73 |
+
];
|
74 |
+
|
75 |
+
$final_headers = [];
|
76 |
+
|
77 |
+
if (!empty($this->extra_headers)) {
|
78 |
+
foreach ($this->extra_headers as $key => $value) {
|
79 |
+
$headers[$key] = $value;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
foreach ($headers as $key => $value) {
|
84 |
+
$final_headers[] = $key.': '.$value;
|
85 |
+
}
|
86 |
+
|
87 |
+
curl_setopt($ch, CURLOPT_HTTPHEADER, $final_headers);
|
88 |
+
|
89 |
$response = curl_exec($ch);
|
90 |
|
91 |
if(empty($response)){
|
103 |
}
|
104 |
}
|
105 |
|
106 |
+
curl_close($ch);
|
107 |
+
|
108 |
return $response;
|
109 |
}
|
110 |
+
|
111 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Request.php
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace CompropagoSdk\Tools;
|
4 |
+
|
5 |
+
class Request
|
6 |
+
{
|
7 |
+
private static function validateResponse($response)
|
8 |
+
{
|
9 |
+
if (!empty($response)) {
|
10 |
+
$aux = json_decode($response, true);
|
11 |
+
|
12 |
+
if (isset($aux['type']) && $aux['type'] == 'error') {
|
13 |
+
throw new \Exception('Error: '.$aux['message']);
|
14 |
+
} else {
|
15 |
+
return true;
|
16 |
+
}
|
17 |
+
} else {
|
18 |
+
throw new \Exception('Empty response');
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public static function get($url, $auth=array(), $headers=array())
|
23 |
+
{
|
24 |
+
$http = new Http($url);
|
25 |
+
$http->setAuth($auth);
|
26 |
+
$http->setMethod('GET');
|
27 |
+
$http->setExtraHeaders($headers);
|
28 |
+
$res = $http->executeRequest();
|
29 |
+
|
30 |
+
self::validateResponse($res);
|
31 |
+
|
32 |
+
return $res;
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
public static function post($url, $data=array(), $auth=array(), $headers=array())
|
37 |
+
{
|
38 |
+
$http = new Http($url);
|
39 |
+
$http->setAuth($auth);
|
40 |
+
if (!empty($data)) : $http->setData($data); endif;
|
41 |
+
$http->setMethod('POST');
|
42 |
+
$http->setExtraHeaders($headers);
|
43 |
+
$res = $http->executeRequest();
|
44 |
+
|
45 |
+
self::validateResponse($res);
|
46 |
+
|
47 |
+
return $res;
|
48 |
+
}
|
49 |
+
|
50 |
+
public static function put($url, $data=array(), $auth=array(), $headers=array())
|
51 |
+
{
|
52 |
+
$http = new Http($url);
|
53 |
+
$http->setAuth($auth);
|
54 |
+
if (!empty($data)) : $http->setData($data); endif;
|
55 |
+
$http->setMethod('PUT');
|
56 |
+
$http->setExtraHeaders($headers);
|
57 |
+
$res = $http->executeRequest();
|
58 |
+
|
59 |
+
self::validateResponse($res);
|
60 |
+
|
61 |
+
return $res;
|
62 |
+
}
|
63 |
+
|
64 |
+
public static function delete($url, $data=array(), $auth=array(), $headers=array())
|
65 |
+
{
|
66 |
+
$http = new Http($url);
|
67 |
+
$http->setAuth($auth);
|
68 |
+
if (!empty($data)) : $http->setData($data); endif;
|
69 |
+
$http->setMethod('DELETE');
|
70 |
+
$http->setExtraHeaders($headers);
|
71 |
+
$res = $http->executeRequest();
|
72 |
+
|
73 |
+
self::validateResponse($res);
|
74 |
+
|
75 |
+
return $res;
|
76 |
+
}
|
77 |
+
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Rest.php
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
-
|
23 |
-
namespace CompropagoSdk\Tools;
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Class Rest Proporciona los metodos de conexion
|
28 |
-
* @package CompropagoSdk\Tools
|
29 |
-
*/
|
30 |
-
class Rest
|
31 |
-
{
|
32 |
-
/**
|
33 |
-
* Ejecuta peticiones Get al API
|
34 |
-
*
|
35 |
-
* @param string $url Url a la cual se generara la peticion
|
36 |
-
* @param string $auth Cadena de autentificacion
|
37 |
-
* @param array $headers Arreglo de headers http
|
38 |
-
* @return mixed
|
39 |
-
* @throws \Exception
|
40 |
-
*/
|
41 |
-
public static function get($url, $auth="", $headers = array())
|
42 |
-
{
|
43 |
-
$ch = Http::initHttp($url);
|
44 |
-
Http::setMethod($ch,'GET');
|
45 |
-
Http::setAuth($ch,$auth);
|
46 |
-
Http::setHeaders($ch, $headers);
|
47 |
-
|
48 |
-
$response = Http::execHttp($ch);
|
49 |
-
|
50 |
-
if(empty($response)){
|
51 |
-
throw new \Exception("Respuesta vacia");
|
52 |
-
}else{
|
53 |
-
return $response;
|
54 |
-
}
|
55 |
-
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @param $url string Url a la cual se generara la peticion
|
60 |
-
* @param $auth string Cadena de autentificacion
|
61 |
-
* @param $data string Parametros a enviar
|
62 |
-
* @param array $headers Arreglo de headers http
|
63 |
-
* @return mixed
|
64 |
-
* @throws \Exception
|
65 |
-
*/
|
66 |
-
public static function post($url, $auth, $data, $headers = array())
|
67 |
-
{
|
68 |
-
$ch = Http::initHttp($url);
|
69 |
-
Http::setMethod($ch, 'POST');
|
70 |
-
Http::setAuth($ch, $auth);
|
71 |
-
Http::setPostFields($ch, $data);
|
72 |
-
Http::setHeaders($ch, $headers);
|
73 |
-
|
74 |
-
$response = Http::execHttp($ch);
|
75 |
-
|
76 |
-
if(empty($response)){
|
77 |
-
throw new \Exception("Respuesta vacia");
|
78 |
-
}else{
|
79 |
-
return $response;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* @param $url string Url a la cual se generara la peticion
|
85 |
-
* @param $auth string Cadena de autentificacion
|
86 |
-
* @param $data string Parametros a enviar
|
87 |
-
* @param array $headers Arreglo de headers http
|
88 |
-
* @return mixed
|
89 |
-
* @throws \Exception
|
90 |
-
*/
|
91 |
-
public static function put($url, $auth, $data, $headers = array())
|
92 |
-
{
|
93 |
-
$ch = Http::initHttp($url);
|
94 |
-
Http::setMethod($ch, 'PUT');
|
95 |
-
Http::setAuth($ch, $auth);
|
96 |
-
Http::setPostFields($ch, $data);
|
97 |
-
Http::setHeaders($ch, $headers);
|
98 |
-
|
99 |
-
$response = Http::execHttp($ch);
|
100 |
-
|
101 |
-
if(empty($response)){
|
102 |
-
throw new \Exception("Respuesta vacia");
|
103 |
-
}else{
|
104 |
-
return $response;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @param $url string Url a la cual se generara la peticion
|
110 |
-
* @param $auth string Cadena de autentificacion
|
111 |
-
* @param $data string Parametros a enviar
|
112 |
-
* @param array $headers Arreglo de headers http
|
113 |
-
* @return mixed
|
114 |
-
* @throws \Exception
|
115 |
-
*/
|
116 |
-
public static function delete($url, $auth, $data = null, $headers = array())
|
117 |
-
{
|
118 |
-
$ch = Http::initHttp($url);
|
119 |
-
Http::setMethod($ch, 'DELETE');
|
120 |
-
Http::setAuth($ch, $auth);
|
121 |
-
|
122 |
-
if(!empty($data)) {
|
123 |
-
Http::setPostFields($ch, $data);
|
124 |
-
}
|
125 |
-
|
126 |
-
Http::setHeaders($ch, $headers);
|
127 |
-
|
128 |
-
$response = Http::execHttp($ch);
|
129 |
-
|
130 |
-
if(empty($response)){
|
131 |
-
throw new \Exception("Respuesta vacia");
|
132 |
-
}else{
|
133 |
-
return $response;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/Tools/Validations.php
CHANGED
@@ -1,89 +1,52 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* Copyright 2015 Compropago.
|
4 |
-
*
|
5 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6 |
-
* you may not use this file except in compliance with the License.
|
7 |
-
* You may obtain a copy of the License at
|
8 |
-
*
|
9 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10 |
-
*
|
11 |
-
* Unless required by applicable law or agreed to in writing, software
|
12 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14 |
-
* See the License for the specific language governing permissions and
|
15 |
-
* limitations under the License.
|
16 |
-
*/
|
17 |
-
/**
|
18 |
-
* Compropago php-sdk
|
19 |
-
* @author Eduardo Aguilar <eduardo.aguilar@compropago.com>
|
20 |
-
*/
|
21 |
-
|
22 |
|
23 |
namespace CompropagoSdk\Tools;
|
24 |
|
25 |
-
|
26 |
use CompropagoSdk\Client;
|
27 |
use CompropagoSdk\Factory\Factory;
|
28 |
|
29 |
|
30 |
-
/**
|
31 |
-
* Class Validations Contiene las validaciones generales para el uso de los servicios
|
32 |
-
* @package CompropagoSdk\Tools
|
33 |
-
*/
|
34 |
class Validations
|
35 |
{
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Evalua que el cliente pueda autentificarse correctamente
|
39 |
-
*
|
40 |
-
* @param Client $client
|
41 |
-
* @return \CompropagoSdk\Models\EvalAuthInfo
|
42 |
-
* @throws \Exception
|
43 |
-
*/
|
44 |
public static function evalAuth( Client $client )
|
45 |
{
|
46 |
-
$response =
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
|
49 |
switch($info->code){
|
50 |
case '200':
|
51 |
return $info;
|
52 |
default:
|
53 |
-
throw new \Exception(
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
/**
|
58 |
-
* Valida que el cliente pueda realizar transacciones
|
59 |
-
*
|
60 |
-
* @param Client $client
|
61 |
-
* @return bool
|
62 |
-
* @throws \Exception
|
63 |
-
*/
|
64 |
public static function validateGateway( Client $client )
|
65 |
{
|
66 |
if(empty($client)){
|
67 |
-
throw new \Exception("
|
68 |
}
|
69 |
|
70 |
-
$clientMode = $client->
|
71 |
|
72 |
$authinfo = self::evalAuth($client);
|
73 |
|
74 |
if($authinfo->mode_key != $authinfo->livemode){
|
75 |
-
throw new \Exception("
|
76 |
}
|
77 |
|
78 |
if($clientMode != $authinfo->livemode){
|
79 |
-
throw new \Exception("
|
80 |
}
|
81 |
|
82 |
if($clientMode != $authinfo->mode_key){
|
83 |
-
throw new \Exception("
|
84 |
}
|
85 |
|
86 |
return true;
|
87 |
}
|
88 |
-
|
89 |
}
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
namespace CompropagoSdk\Tools;
|
4 |
|
|
|
5 |
use CompropagoSdk\Client;
|
6 |
use CompropagoSdk\Factory\Factory;
|
7 |
|
8 |
|
|
|
|
|
|
|
|
|
9 |
class Validations
|
10 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
public static function evalAuth( Client $client )
|
12 |
{
|
13 |
+
$response = Request::get(
|
14 |
+
$client->deployUri."users/auth/",
|
15 |
+
['user' => $client->getUser(), 'pass' => $client->getPass()]
|
16 |
+
);
|
17 |
+
|
18 |
+
$info = Factory::getInstanceOf('EvalAuthInfo', $response);
|
19 |
|
20 |
switch($info->code){
|
21 |
case '200':
|
22 |
return $info;
|
23 |
default:
|
24 |
+
throw new \Exception('Error :'.$info->message);
|
25 |
}
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
public static function validateGateway( Client $client )
|
29 |
{
|
30 |
if(empty($client)){
|
31 |
+
throw new \Exception("Client object is not valid");
|
32 |
}
|
33 |
|
34 |
+
$clientMode = $client->live;
|
35 |
|
36 |
$authinfo = self::evalAuth($client);
|
37 |
|
38 |
if($authinfo->mode_key != $authinfo->livemode){
|
39 |
+
throw new \Exception("Keys are diferent of store mode.");
|
40 |
}
|
41 |
|
42 |
if($clientMode != $authinfo->livemode){
|
43 |
+
throw new \Exception("Client mode is diferent of store mode");
|
44 |
}
|
45 |
|
46 |
if($clientMode != $authinfo->mode_key){
|
47 |
+
throw new \Exception("Client mode is diferent of keys mode");
|
48 |
}
|
49 |
|
50 |
return true;
|
51 |
}
|
|
|
52 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/UnitTest/Test.php
CHANGED
@@ -21,24 +21,28 @@
|
|
21 |
|
22 |
namespace CompropagoSdk\UnitTest;
|
23 |
|
24 |
-
require_once
|
25 |
|
26 |
use CompropagoSdk\Client;
|
27 |
-
use CompropagoSdk\Factory\
|
28 |
-
use CompropagoSdk\Factory\Abs\NewOrderInfo;
|
29 |
-
use CompropagoSdk\Factory\Abs\SmsInfo;
|
30 |
-
use CompropagoSdk\Models\PlaceOrderInfo;
|
31 |
-
use CompropagoSdk\Models\Webhook;
|
32 |
use CompropagoSdk\Tools\Validations;
|
33 |
|
34 |
class Test extends \PHPUnit_Framework_TestCase
|
35 |
{
|
36 |
-
private $publickey
|
37 |
-
private $privatekey = "
|
38 |
private $mode = false;
|
39 |
|
40 |
private $phonenumber = "5561463627";
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
public function testCreateClient()
|
43 |
{
|
44 |
$client = null;
|
@@ -51,72 +55,57 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
51 |
$this->assertTrue(!empty($client));
|
52 |
}catch(\Exception $e){
|
53 |
$this->assertTrue(!empty($client));
|
54 |
-
echo "
|
55 |
}
|
56 |
|
57 |
return $client;
|
58 |
}
|
59 |
|
60 |
-
|
61 |
-
* @depends testCreateClient
|
62 |
-
* @param Client $client
|
63 |
-
* @return \CompropagoSdk\Models\EvalAuthInfo|null
|
64 |
-
*/
|
65 |
-
public function testEvalAuth(Client $client)
|
66 |
{
|
67 |
$res = null;
|
68 |
try{
|
|
|
|
|
|
|
|
|
|
|
69 |
$res = Validations::evalAuth($client);
|
70 |
}catch(\Exception $e){
|
71 |
-
echo "
|
72 |
}
|
73 |
|
74 |
$this->assertTrue(!empty($res));
|
75 |
-
|
76 |
-
return $res;
|
77 |
}
|
78 |
|
79 |
-
|
80 |
-
* @depends testEvalAuth
|
81 |
-
* @param $info
|
82 |
-
*/
|
83 |
-
public function testEvalAuthClass($info)
|
84 |
-
{
|
85 |
-
$this->assertTrue(
|
86 |
-
(get_class($info) == "CompropagoSdk\\Models\\EvalAuthInfo")
|
87 |
-
);
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
/**
|
92 |
-
* @depends testCreateClient
|
93 |
-
* @param Client $client
|
94 |
-
* @return array
|
95 |
-
*/
|
96 |
-
public function testServiceProviders(Client $client)
|
97 |
{
|
98 |
try{
|
|
|
|
|
|
|
|
|
|
|
99 |
$res = $client->api->listProviders();
|
100 |
}catch(\Exception $e){
|
101 |
$res = array();
|
102 |
-
echo "
|
103 |
}
|
104 |
|
105 |
$this->assertTrue(is_array($res) && !empty($res));
|
106 |
-
|
107 |
-
return $res;
|
108 |
}
|
109 |
|
110 |
-
|
111 |
-
* @depends testCreateClient
|
112 |
-
* @param Client $client
|
113 |
-
*/
|
114 |
-
public function testServiceProvidersLimit(Client $client)
|
115 |
{
|
|
|
116 |
try{
|
|
|
|
|
|
|
|
|
|
|
117 |
$res = $client->api->listProviders(false, 15000);
|
118 |
|
119 |
-
$flag = true;
|
120 |
foreach ($res as $provider){
|
121 |
if($provider->transaction_limit < 15000){
|
122 |
$flag = false;
|
@@ -124,63 +113,66 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
124 |
}
|
125 |
}
|
126 |
}catch(\Exception $e){
|
127 |
-
echo "
|
|
|
128 |
}
|
129 |
|
130 |
-
$this->assertTrue(
|
131 |
}
|
132 |
|
133 |
-
|
134 |
-
* @depends testCreateClient
|
135 |
-
* @param Client $client
|
136 |
-
*/
|
137 |
-
public function testServiceProviderAuth(Client $client)
|
138 |
{
|
139 |
-
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
-
|
143 |
-
$
|
|
|
|
|
|
|
144 |
}
|
145 |
-
}catch(\Exception $e){
|
146 |
-
echo "
|
|
|
147 |
}
|
148 |
-
|
149 |
-
$this->assertTrue(isset($res) && is_array($res) && !empty($res));
|
150 |
}
|
151 |
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @depends testCreateClient
|
155 |
-
* @param Client $client
|
156 |
-
*/
|
157 |
-
public function testServiceProviderAuthLimit(Client $client)
|
158 |
{
|
159 |
try{
|
160 |
-
$
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
-
$
|
163 |
-
|
164 |
-
if($provider->transaction_limit < 15000){
|
165 |
-
$flag = false;
|
166 |
-
break;
|
167 |
-
}
|
168 |
}
|
169 |
}catch(\Exception $e){
|
170 |
-
echo "
|
171 |
}
|
172 |
|
173 |
-
$this->assertTrue(isset($
|
174 |
}
|
175 |
|
176 |
-
|
177 |
-
* @depends testCreateClient
|
178 |
-
* @param Client $client
|
179 |
-
*/
|
180 |
-
public function testServiceProvidersAuthFetch(Client $client)
|
181 |
{
|
182 |
try{
|
183 |
-
$
|
|
|
|
|
|
|
|
|
|
|
184 |
|
185 |
$flag = true;
|
186 |
foreach ($res as $provider){
|
@@ -190,75 +182,30 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
190 |
}
|
191 |
}
|
192 |
}catch(\Exception $e){
|
193 |
-
echo "
|
194 |
}
|
195 |
|
196 |
$this->assertTrue(isset($flag) && $flag);
|
197 |
}
|
198 |
-
|
199 |
-
|
200 |
-
/**
|
201 |
-
* @depends testServiceProviders
|
202 |
-
* @param array $providers
|
203 |
-
* @return array
|
204 |
-
*/
|
205 |
-
public function testEmptyArrayProviders(array $providers)
|
206 |
-
{
|
207 |
-
$this->assertTrue(!empty($providers));
|
208 |
-
return $providers;
|
209 |
-
}
|
210 |
|
211 |
-
|
212 |
-
* @depends testEmptyArrayProviders
|
213 |
-
* @param array $providers
|
214 |
-
*/
|
215 |
-
public function testTypeArrayProviders(array $providers)
|
216 |
-
{
|
217 |
-
$flag = true;
|
218 |
-
foreach($providers as $key => $value){
|
219 |
-
$flag = (get_class($value) == "CompropagoSdk\\Models\\Provider") ? $flag : false;
|
220 |
-
if(!$flag)
|
221 |
-
break;
|
222 |
-
}
|
223 |
-
|
224 |
-
$this->assertTrue($flag);
|
225 |
-
}
|
226 |
-
|
227 |
-
/**
|
228 |
-
* @depends testCreateClient
|
229 |
-
* @param Client $client
|
230 |
-
* @return NewOrderInfo
|
231 |
-
*/
|
232 |
-
public function testServicePlaceOrder(Client $client)
|
233 |
{
|
234 |
try{
|
235 |
-
$
|
|
|
|
|
|
|
|
|
|
|
236 |
$res = $client->api->placeOrder($order);
|
237 |
}catch(\Exception $e){
|
238 |
-
|
239 |
-
echo "\n".$e->getMessage()."\n";
|
240 |
}
|
241 |
|
242 |
$this->assertTrue(!empty($res));
|
243 |
-
|
244 |
-
return $res;
|
245 |
-
}
|
246 |
-
|
247 |
-
/**
|
248 |
-
* @depends testServicePlaceOrder
|
249 |
-
* @param $neworder
|
250 |
-
*/
|
251 |
-
public function testTypeServicePlaceOrder($neworder)
|
252 |
-
{
|
253 |
-
$this->assertTrue((get_parent_class($neworder) == "CompropagoSdk\\Factory\\Abs\\NewOrderInfo"));
|
254 |
}
|
255 |
|
256 |
-
|
257 |
-
* @depends testServicePlaceOrder
|
258 |
-
* @param NewOrderInfo $order
|
259 |
-
* @return CpOrderInfo
|
260 |
-
*/
|
261 |
-
public function testServiceVerifyOrder(NewOrderInfo $order)
|
262 |
{
|
263 |
try {
|
264 |
$client = new Client(
|
@@ -266,31 +213,19 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
266 |
$this->privatekey,
|
267 |
$this->mode
|
268 |
);
|
269 |
-
|
|
|
|
|
|
|
|
|
270 |
} catch (\Exception $e) {
|
271 |
-
|
272 |
-
echo "\n".$e->getMessage()."\n";
|
273 |
}
|
274 |
|
275 |
$this->assertTrue(!empty($res));
|
276 |
-
return $res;
|
277 |
}
|
278 |
|
279 |
-
|
280 |
-
* @depends testServiceVerifyOrder
|
281 |
-
* @param CpOrderInfo $order
|
282 |
-
*/
|
283 |
-
public function testTypeServiceVerifyOrder(CpOrderInfo $order)
|
284 |
-
{
|
285 |
-
$this->assertTrue((get_parent_class($order) == "CompropagoSdk\\Factory\\Abs\\CpOrderInfo"));
|
286 |
-
}
|
287 |
-
|
288 |
-
/**
|
289 |
-
* @depends testServicePlaceOrder
|
290 |
-
* @param NewOrderInfo $order
|
291 |
-
* @return SmsInfo
|
292 |
-
*/
|
293 |
-
public function testServiceSms(NewOrderInfo $order)
|
294 |
{
|
295 |
try{
|
296 |
$client = new Client(
|
@@ -299,35 +234,28 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
299 |
$this->mode
|
300 |
);
|
301 |
|
302 |
-
$
|
|
|
|
|
|
|
303 |
}catch(\Exception $e){
|
304 |
-
|
305 |
-
echo "\n".$e->getMessage()."\n";
|
306 |
}
|
307 |
|
308 |
$this->assertTrue(!empty($res));
|
309 |
-
return $res;
|
310 |
-
}
|
311 |
-
|
312 |
-
/**
|
313 |
-
* @depends testServiceSms
|
314 |
-
* @param SmsInfo $info
|
315 |
-
*/
|
316 |
-
public function testTypeServiceSms(SmsInfo $info)
|
317 |
-
{
|
318 |
-
$this->assertTrue((get_parent_class($info) == "CompropagoSdk\\Factory\\Abs\\SmsInfo"));
|
319 |
}
|
320 |
|
321 |
-
|
322 |
-
* @depends testCreateClient
|
323 |
-
* @param Client $client
|
324 |
-
*/
|
325 |
-
public function testGetWebhooks(Client $client)
|
326 |
{
|
327 |
try{
|
|
|
|
|
|
|
|
|
|
|
328 |
$res = $client->api->listWebhooks();
|
329 |
if(is_array($res)){
|
330 |
-
if(count($res) > 0 && get_class($res[0]) == "CompropagoSdk\\Models\\Webhook"){
|
331 |
$flag = true;
|
332 |
}else{
|
333 |
$flag = false;
|
@@ -336,44 +264,35 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
336 |
$flag = false;
|
337 |
}
|
338 |
}catch(\Exception $e){
|
339 |
-
echo "
|
340 |
$flag = false;
|
341 |
}
|
342 |
|
343 |
$this->assertTrue($flag);
|
344 |
}
|
345 |
|
346 |
-
|
347 |
-
* @depends testCreateClient
|
348 |
-
* @param Client $client
|
349 |
-
* @return Webhook | null
|
350 |
-
*/
|
351 |
-
public function testCreateWebhook(Client $client)
|
352 |
{
|
353 |
$flag = false;
|
354 |
-
$res = null;
|
355 |
try{
|
|
|
|
|
|
|
|
|
|
|
356 |
$res = $client->api->createWebhook("http://prueba.com");
|
357 |
-
|
358 |
-
|
359 |
-
$flag = true;
|
360 |
-
}
|
361 |
}catch(\Exception $e){
|
362 |
-
echo "
|
363 |
}
|
364 |
|
365 |
$this->assertTrue($flag);
|
366 |
-
return $res;
|
367 |
}
|
368 |
|
369 |
-
|
370 |
-
* @depends testCreateWebhook
|
371 |
-
* @param Webhook $webhook
|
372 |
-
*/
|
373 |
-
public function testUpdateWebhook(Webhook $webhook)
|
374 |
{
|
375 |
$flag = false;
|
376 |
-
$res = null;
|
377 |
try{
|
378 |
$client = new Client(
|
379 |
$this->publickey,
|
@@ -381,23 +300,19 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
381 |
$this->mode
|
382 |
);
|
383 |
|
384 |
-
$
|
385 |
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
}catch(\Exception $e){
|
390 |
-
echo "
|
391 |
}
|
392 |
|
393 |
$this->assertTrue($flag);
|
394 |
}
|
395 |
|
396 |
-
|
397 |
-
* @depends testCreateWebhook
|
398 |
-
* @param Webhook $webhook
|
399 |
-
*/
|
400 |
-
public function testDeleteWebhook(Webhook $webhook)
|
401 |
{
|
402 |
$flag = false;
|
403 |
$res = null;
|
@@ -408,11 +323,10 @@ class Test extends \PHPUnit_Framework_TestCase
|
|
408 |
$this->mode
|
409 |
);
|
410 |
|
|
|
411 |
$res = $client->api->deleteWebhook($webhook->id);
|
412 |
|
413 |
-
|
414 |
-
$flag = true;
|
415 |
-
}
|
416 |
}catch(\Exception $e){
|
417 |
echo "\n".$e->getMessage()."\n";
|
418 |
}
|
21 |
|
22 |
namespace CompropagoSdk\UnitTest;
|
23 |
|
24 |
+
require_once 'autoload.php';
|
25 |
|
26 |
use CompropagoSdk\Client;
|
27 |
+
use CompropagoSdk\Factory\Factory;
|
|
|
|
|
|
|
|
|
28 |
use CompropagoSdk\Tools\Validations;
|
29 |
|
30 |
class Test extends \PHPUnit_Framework_TestCase
|
31 |
{
|
32 |
+
private $publickey = "pk_test_638e8b14112423a086";
|
33 |
+
private $privatekey = "sk_test_9c95e149614142822f";
|
34 |
private $mode = false;
|
35 |
|
36 |
private $phonenumber = "5561463627";
|
37 |
|
38 |
+
private $order_info = [
|
39 |
+
'order_id' => 12,
|
40 |
+
'order_name' => "M4 sdk php",
|
41 |
+
'order_price' => 123.45,
|
42 |
+
'customer_name' => "Eduardo Aguilar",
|
43 |
+
'customer_email' => "asdr@compropago.com"
|
44 |
+
];
|
45 |
+
|
46 |
public function testCreateClient()
|
47 |
{
|
48 |
$client = null;
|
55 |
$this->assertTrue(!empty($client));
|
56 |
}catch(\Exception $e){
|
57 |
$this->assertTrue(!empty($client));
|
58 |
+
echo "====>>".$e->getMessage()."\n";
|
59 |
}
|
60 |
|
61 |
return $client;
|
62 |
}
|
63 |
|
64 |
+
public function testEvalAuth()
|
|
|
|
|
|
|
|
|
|
|
65 |
{
|
66 |
$res = null;
|
67 |
try{
|
68 |
+
$client = new Client(
|
69 |
+
$this->publickey,
|
70 |
+
$this->privatekey,
|
71 |
+
$this->mode
|
72 |
+
);
|
73 |
$res = Validations::evalAuth($client);
|
74 |
}catch(\Exception $e){
|
75 |
+
echo "====>>".$e->getMessage()."\n";
|
76 |
}
|
77 |
|
78 |
$this->assertTrue(!empty($res));
|
|
|
|
|
79 |
}
|
80 |
|
81 |
+
public function testServiceProviders()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
{
|
83 |
try{
|
84 |
+
$client = new Client(
|
85 |
+
$this->publickey,
|
86 |
+
$this->privatekey,
|
87 |
+
$this->mode
|
88 |
+
);
|
89 |
$res = $client->api->listProviders();
|
90 |
}catch(\Exception $e){
|
91 |
$res = array();
|
92 |
+
echo "====>>".$e->getMessage()."\n";
|
93 |
}
|
94 |
|
95 |
$this->assertTrue(is_array($res) && !empty($res));
|
|
|
|
|
96 |
}
|
97 |
|
98 |
+
public function testServiceProvidersLimit()
|
|
|
|
|
|
|
|
|
99 |
{
|
100 |
+
$flag = true;
|
101 |
try{
|
102 |
+
$client = new Client(
|
103 |
+
$this->publickey,
|
104 |
+
$this->privatekey,
|
105 |
+
$this->mode
|
106 |
+
);
|
107 |
$res = $client->api->listProviders(false, 15000);
|
108 |
|
|
|
109 |
foreach ($res as $provider){
|
110 |
if($provider->transaction_limit < 15000){
|
111 |
$flag = false;
|
113 |
}
|
114 |
}
|
115 |
}catch(\Exception $e){
|
116 |
+
echo "====>>".$e->getMessage()."\n";
|
117 |
+
$flag = false;
|
118 |
}
|
119 |
|
120 |
+
$this->assertTrue($flag);
|
121 |
}
|
122 |
|
123 |
+
public function testServiceProvidersCurrency()
|
|
|
|
|
|
|
|
|
124 |
{
|
125 |
+
$flag = true;
|
126 |
+
try {
|
127 |
+
$client = new Client(
|
128 |
+
$this->publickey,
|
129 |
+
$this->privatekey,
|
130 |
+
$this->mode
|
131 |
+
);
|
132 |
+
$provs = $client->api->listProviders(true, 700, 'USD');
|
133 |
|
134 |
+
foreach ($provs as $prov) {
|
135 |
+
if ($prov->transaction_limit < 15000) {
|
136 |
+
$flag = false;
|
137 |
+
break;
|
138 |
+
}
|
139 |
}
|
140 |
+
} catch(\Exception $e) {
|
141 |
+
echo "====>>".$e->getMessage()."\n";
|
142 |
+
$flag = false;
|
143 |
}
|
144 |
+
$this->assertTrue($flag);
|
|
|
145 |
}
|
146 |
|
147 |
+
public function testServiceProviderAuth()
|
|
|
|
|
|
|
|
|
|
|
148 |
{
|
149 |
try{
|
150 |
+
$client = new Client(
|
151 |
+
$this->publickey,
|
152 |
+
$this->privatekey,
|
153 |
+
$this->mode
|
154 |
+
);
|
155 |
+
$res = $client->api->listProviders(true);
|
156 |
|
157 |
+
if($res){
|
158 |
+
$res = $client->api->listProviders(true);
|
|
|
|
|
|
|
|
|
159 |
}
|
160 |
}catch(\Exception $e){
|
161 |
+
echo "====>>".$e->getMessage()."\n";
|
162 |
}
|
163 |
|
164 |
+
$this->assertTrue(isset($res) && is_array($res) && !empty($res));
|
165 |
}
|
166 |
|
167 |
+
public function testServiceProviderAuthLimit()
|
|
|
|
|
|
|
|
|
168 |
{
|
169 |
try{
|
170 |
+
$client = new Client(
|
171 |
+
$this->publickey,
|
172 |
+
$this->privatekey,
|
173 |
+
$this->mode
|
174 |
+
);
|
175 |
+
$res = $client->api->listProviders(true, 15000);
|
176 |
|
177 |
$flag = true;
|
178 |
foreach ($res as $provider){
|
182 |
}
|
183 |
}
|
184 |
}catch(\Exception $e){
|
185 |
+
echo "====>>".$e->getMessage()."\n";
|
186 |
}
|
187 |
|
188 |
$this->assertTrue(isset($flag) && $flag);
|
189 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
+
public function testServicePlaceOrder()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
{
|
193 |
try{
|
194 |
+
$client = new Client(
|
195 |
+
$this->publickey,
|
196 |
+
$this->privatekey,
|
197 |
+
$this->mode
|
198 |
+
);
|
199 |
+
$order = Factory::getInstanceOf('PlaceOrderInfo', $this->order_info);
|
200 |
$res = $client->api->placeOrder($order);
|
201 |
}catch(\Exception $e){
|
202 |
+
echo "====>>".$e->getMessage()."\n";
|
|
|
203 |
}
|
204 |
|
205 |
$this->assertTrue(!empty($res));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
+
public function testServiceVerifyOrder()
|
|
|
|
|
|
|
|
|
|
|
209 |
{
|
210 |
try {
|
211 |
$client = new Client(
|
213 |
$this->privatekey,
|
214 |
$this->mode
|
215 |
);
|
216 |
+
|
217 |
+
$order = Factory::getInstanceOf('PlaceOrderInfo', $this->order_info);
|
218 |
+
$order_aux = $client->api->placeOrder($order);
|
219 |
+
|
220 |
+
$res = $client->api->verifyOrder($order_aux->id);
|
221 |
} catch (\Exception $e) {
|
222 |
+
echo "====>>".$e->getMessage()."\n";
|
|
|
223 |
}
|
224 |
|
225 |
$this->assertTrue(!empty($res));
|
|
|
226 |
}
|
227 |
|
228 |
+
public function testServiceSms()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
{
|
230 |
try{
|
231 |
$client = new Client(
|
234 |
$this->mode
|
235 |
);
|
236 |
|
237 |
+
$order = Factory::getInstanceOf('PlaceOrderInfo', $this->order_info);
|
238 |
+
$order_aux = $client->api->placeOrder($order);
|
239 |
+
|
240 |
+
$res = $client->api->sendSmsInstructions($this->phonenumber, $order_aux->id);
|
241 |
}catch(\Exception $e){
|
242 |
+
echo "====>>".$e->getMessage()."\n";
|
|
|
243 |
}
|
244 |
|
245 |
$this->assertTrue(!empty($res));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
|
248 |
+
public function testListWebhooks()
|
|
|
|
|
|
|
|
|
249 |
{
|
250 |
try{
|
251 |
+
$client = new Client(
|
252 |
+
$this->publickey,
|
253 |
+
$this->privatekey,
|
254 |
+
$this->mode
|
255 |
+
);
|
256 |
$res = $client->api->listWebhooks();
|
257 |
if(is_array($res)){
|
258 |
+
if(count($res) > 0 && get_class($res[0]) == "CompropagoSdk\\Factory\\Models\\Webhook"){
|
259 |
$flag = true;
|
260 |
}else{
|
261 |
$flag = false;
|
264 |
$flag = false;
|
265 |
}
|
266 |
}catch(\Exception $e){
|
267 |
+
echo "====>>".$e->getMessage()."\n";
|
268 |
$flag = false;
|
269 |
}
|
270 |
|
271 |
$this->assertTrue($flag);
|
272 |
}
|
273 |
|
274 |
+
public function testCreateWebhook()
|
|
|
|
|
|
|
|
|
|
|
275 |
{
|
276 |
$flag = false;
|
|
|
277 |
try{
|
278 |
+
$client = new Client(
|
279 |
+
$this->publickey,
|
280 |
+
$this->privatekey,
|
281 |
+
$this->mode
|
282 |
+
);
|
283 |
$res = $client->api->createWebhook("http://prueba.com");
|
284 |
+
|
285 |
+
$flag = (get_class($res) == "CompropagoSdk\\Factory\\Models\\Webhook");
|
|
|
|
|
286 |
}catch(\Exception $e){
|
287 |
+
echo "====>>".$e->getMessage()."\n";
|
288 |
}
|
289 |
|
290 |
$this->assertTrue($flag);
|
|
|
291 |
}
|
292 |
|
293 |
+
public function testUpdateWebhook()
|
|
|
|
|
|
|
|
|
294 |
{
|
295 |
$flag = false;
|
|
|
296 |
try{
|
297 |
$client = new Client(
|
298 |
$this->publickey,
|
300 |
$this->mode
|
301 |
);
|
302 |
|
303 |
+
$webhook = $client->api->createWebhook("http://prueba.com");
|
304 |
|
305 |
+
$res = $client->api->updateWebhook($webhook->id, "http://prueba2.com");
|
306 |
+
|
307 |
+
$flag = (get_class($res) == "CompropagoSdk\\Factory\\Models\\Webhook");
|
308 |
}catch(\Exception $e){
|
309 |
+
echo "====>>".$e->getMessage()."\n";
|
310 |
}
|
311 |
|
312 |
$this->assertTrue($flag);
|
313 |
}
|
314 |
|
315 |
+
public function testDeleteWebhook()
|
|
|
|
|
|
|
|
|
316 |
{
|
317 |
$flag = false;
|
318 |
$res = null;
|
323 |
$this->mode
|
324 |
);
|
325 |
|
326 |
+
$webhook = $client->api->createWebhook("http://prueba2.com");
|
327 |
$res = $client->api->deleteWebhook($webhook->id);
|
328 |
|
329 |
+
$flag = (get_class($res) == "CompropagoSdk\\Factory\\Models\\Webhook");
|
|
|
|
|
330 |
}catch(\Exception $e){
|
331 |
echo "\n".$e->getMessage()."\n";
|
332 |
}
|
lib/Compropago/vendor/compropago/php-sdk/CompropagoSdk/UnitTest/autoload.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once __DIR__ .'/../Client.php';
|
4 |
+
require_once __DIR__ .'/../Service.php';
|
5 |
+
require_once __DIR__ .'/../Tools/Http.php';
|
6 |
+
require_once __DIR__ .'/../Tools/Request.php';
|
7 |
+
require_once __DIR__ .'/../Tools/Validations.php';
|
8 |
+
require_once __DIR__ .'/../Factory/Serialize.php';
|
9 |
+
require_once __DIR__ .'/../Factory/Factory.php';
|
10 |
+
require_once __DIR__ .'/../Factory/Models/CpOrderInfo.php';
|
11 |
+
require_once __DIR__ .'/../Factory/Models/Customer.php';
|
12 |
+
require_once __DIR__ .'/../Factory/Models/EvalAuthInfo.php';
|
13 |
+
require_once __DIR__ .'/../Factory/Models/FeeDetails.php';
|
14 |
+
require_once __DIR__ .'/../Factory/Models/InstructionDetails.php';
|
15 |
+
require_once __DIR__ .'/../Factory/Models/Instructions.php';
|
16 |
+
require_once __DIR__ .'/../Factory/Models/NewOrderInfo.php';
|
17 |
+
require_once __DIR__ .'/../Factory/Models/OrderInfo.php';
|
18 |
+
require_once __DIR__ .'/../Factory/Models/PlaceOrderInfo.php';
|
19 |
+
require_once __DIR__ .'/../Factory/Models/Provider.php';
|
20 |
+
require_once __DIR__ .'/../Factory/Models/SmsData.php';
|
21 |
+
require_once __DIR__ .'/../Factory/Models/SmsInfo.php';
|
22 |
+
require_once __DIR__ .'/../Factory/Models/SmsObject.php';
|
23 |
+
require_once __DIR__ .'/../Factory/Models/Webhook.php';
|
24 |
+
|
lib/Compropago/vendor/compropago/php-sdk/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# ComproPago PHP SDK
|
2 |
|
3 |
## Descripción
|
4 |
|
@@ -50,6 +50,29 @@ O si o lo desea puede obtener el repositorio
|
|
50 |
git clone https://github.com/compropago/compropago-php.git
|
51 |
```
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
## Documentación
|
55 |
|
@@ -101,19 +124,18 @@ un instancia de Client.
|
|
101 |
# @param string publickey Llave publica correspondiente al modo de la tienda
|
102 |
# @param string privatekey Llave privada correspondiente al modo de la tienda
|
103 |
# @param bool live Modo de la tienda (false = Test | true = Live)
|
104 |
-
# @param string contained (optional) App User agent
|
105 |
|
106 |
$client = new Client(
|
107 |
'pk_test_5989d8209974e2d62', # publickey
|
108 |
'sk_test_6ff4e982253c44c42', # privatekey
|
109 |
-
false
|
110 |
-
null # contaiden
|
111 |
);
|
112 |
```
|
113 |
|
114 |
-
### Uso Básico de la
|
115 |
|
116 |
-
> Consulte la documentación de la librería PHP de ComproPago para conocer más de sus capacidades, configuraciones y
|
|
|
117 |
|
118 |
|
119 |
#### Llamados al los servicios por SDK
|
@@ -129,23 +151,19 @@ de la variable **client** como se muestra a continuación.
|
|
129 |
|
130 |
```php
|
131 |
<?php
|
132 |
-
|
133 |
-
#
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
'
|
142 |
-
'
|
143 |
-
|
144 |
-
|
145 |
-
'eduardo.aguilar@compropago.com', # customer_email
|
146 |
-
'OXXO', # payment_type
|
147 |
-
null # image_url
|
148 |
-
);
|
149 |
|
150 |
|
151 |
# Llamada al metodo 'place_order' del API para generar la orden
|
@@ -160,19 +178,19 @@ $neworder = $client->api->placeOrder($order);
|
|
160 |
```php
|
161 |
<?php
|
162 |
/**
|
163 |
-
* @param
|
164 |
-
* @return \CompropagoSdk\Factory\
|
165 |
* @throws \Exception
|
166 |
*/
|
167 |
-
public function placeOrder(
|
168 |
```
|
169 |
|
170 |
##### Verificar el Estatus de una orden
|
171 |
|
172 |
Para verificar el estatus de una orden generada es necesario llamar al metodo **verifyOrder** que provee el atributo
|
173 |
**api** del objeto **Client** y el cual regresa una instancia **CpOrderInfo**. este metodo recibe como parametro el ID
|
174 |
-
generado por ComproPago para cada orden. Tambien puede obtener este ID desde un objeto **NewOrderInfo** accediendo al
|
175 |
-
|
176 |
|
177 |
```php
|
178 |
<?php
|
@@ -180,7 +198,7 @@ metodo **getId**.
|
|
180 |
$order_id = "ch_xxxx_xxx_xxx_xxxx";
|
181 |
|
182 |
# U obtenerlo de un objetdo NewOrderInfo
|
183 |
-
$order_id = $neworder->
|
184 |
|
185 |
|
186 |
# Se manda llamar al metodo del API para recuperar la informacion de la orden
|
@@ -193,7 +211,7 @@ $info = $client->api->verifyOrder($order_id);
|
|
193 |
<?php
|
194 |
/**
|
195 |
* @param $orderId
|
196 |
-
* @return \CompropagoSdk\Factory\
|
197 |
* @throws \Exception
|
198 |
*/
|
199 |
public function verifyOrder( $orderId ){}
|
@@ -222,7 +240,7 @@ $providers = $client->api->listProviders();
|
|
222 |
* @return array
|
223 |
* @throws \Exception
|
224 |
*/
|
225 |
-
public function listProviders($auth = false, $limit = 0
|
226 |
```
|
227 |
|
228 |
##### Envio de instrucciones SMS
|
@@ -249,7 +267,7 @@ $smsinfo = $client->api->sendSmsInstructions($phone_number , $order_id);
|
|
249 |
/**
|
250 |
* @param $number
|
251 |
* @param $orderId
|
252 |
-
* @return \CompropagoSdk\Factory\
|
253 |
* @throws \Exception
|
254 |
*/
|
255 |
public function sendSmsInstructions($number,$orderId){}
|
@@ -269,7 +287,7 @@ logica de aprobacion en su tienda en linea. El proceso que siguenes el siguiente
|
|
269 |
```php
|
270 |
<?php
|
271 |
# $cadena_obtenida es un String
|
272 |
-
$info = Factory::
|
273 |
```
|
274 |
|
275 |
3. Generar la logica de aprovacion correspondiente al estatus de la orden.
|
@@ -291,7 +309,7 @@ $webhook = $client->api->createWebhook('http://sitio.com/webhook');
|
|
291 |
<?php
|
292 |
/**
|
293 |
* @param $url
|
294 |
-
* @return \CompropagoSdk\Models\Webhook
|
295 |
* @throws \Exception
|
296 |
*/
|
297 |
public function createWebhook($url){}
|
@@ -314,7 +332,7 @@ $updated_webhook = $client->api->updateWebhook($webhook->getId(), 'http://sitio.
|
|
314 |
/**
|
315 |
* @param $webhookId
|
316 |
* @param $url
|
317 |
-
* @return \CompropagoSdk\Models\Webhook
|
318 |
* @throws \Exception
|
319 |
*/
|
320 |
public function updateWebhook($webhookId, $url){}
|
@@ -336,7 +354,7 @@ $deleted_webhook = $client->api->deleteWebhook( $webhook->getId() );
|
|
336 |
<?php
|
337 |
/**
|
338 |
* @param $webhookId
|
339 |
-
* @return \CompropagoSdk\Models\Webhook
|
340 |
* @throws \Exception
|
341 |
*/
|
342 |
public function deleteWebhook($webhookId){}
|
@@ -363,19 +381,3 @@ $all_webhooks = $client->api->listWebhooks();
|
|
363 |
*/
|
364 |
public function listWebhooks(){}
|
365 |
```
|
366 |
-
|
367 |
-
|
368 |
-
## Guía de Versiones
|
369 |
-
|
370 |
-
| Version | Status | Packagist | Namespace | PHP | Repo | Docs |
|
371 |
-
|---------|-------------|----------------------|------------------|-------|---------------------------------|-------------------------|
|
372 |
-
| 1.0.x | Deprecated | `compropago/php-sdk` | `Compropago` | 5.3 + | v1.0.x | [v1][compropago-1-docs] |
|
373 |
-
| 1.1.x | Deprecated | `compropago/php-sdk` | `Compropago\Sdk` | 5.5 + | v1.1.x | [v1][compropago-1-docs] |
|
374 |
-
| 1.1.1 | Deprecated | `compropago/php-sdk` | `Compropago\Sdk` | 5.5 + | v1.1.x | [v1][compropago-1-docs] |
|
375 |
-
| 1.2.0 | Maintained | `compropago/php-sdk` | `Compropago\Sdk` | 5.5 + | v1.2.0 | [v1][compropago-1-docs] |
|
376 |
-
| 2.0.0 | Latest | `compropago/php-sdk` | `CompropagoSdk` | 5.5 + | [v2.0.0][latest-repo] | [v1][compropago-1-docs] |
|
377 |
-
|
378 |
-
|
379 |
-
[compropago-1-docs]: https://compropago.com/documentacion/api
|
380 |
-
|
381 |
-
[latest-repo]: http://github.com/compropago/compropago-php
|
1 |
+
# ComproPago PHP SDK
|
2 |
|
3 |
## Descripción
|
4 |
|
50 |
git clone https://github.com/compropago/compropago-php.git
|
51 |
```
|
52 |
|
53 |
+
Despues debara de incluir en su proyecto el archivo `CompropagoSdk\UnitTest\autoload.php`, el cual le proporcionara
|
54 |
+
el acceso a todas las clases del SDK.
|
55 |
+
|
56 |
+
```php
|
57 |
+
<?php
|
58 |
+
require_once 'CompropagoSdk/UnitTest/autoload.php';
|
59 |
+
```
|
60 |
+
|
61 |
+
### Instalación pro Composer
|
62 |
+
|
63 |
+
Puede descargar el SDK directamente desde el repositorio de composer con el siguiente comando:
|
64 |
+
```bash
|
65 |
+
composer require compropago/php-sdk
|
66 |
+
```
|
67 |
+
|
68 |
+
O si lo prefiere puede incluirlo directamente en su archivo composer.json
|
69 |
+
```json
|
70 |
+
{
|
71 |
+
"require": {
|
72 |
+
"compropago/php-sdk": "3.0.0"
|
73 |
+
}
|
74 |
+
}
|
75 |
+
```
|
76 |
|
77 |
## Documentación
|
78 |
|
124 |
# @param string publickey Llave publica correspondiente al modo de la tienda
|
125 |
# @param string privatekey Llave privada correspondiente al modo de la tienda
|
126 |
# @param bool live Modo de la tienda (false = Test | true = Live)
|
|
|
127 |
|
128 |
$client = new Client(
|
129 |
'pk_test_5989d8209974e2d62', # publickey
|
130 |
'sk_test_6ff4e982253c44c42', # privatekey
|
131 |
+
false # live
|
|
|
132 |
);
|
133 |
```
|
134 |
|
135 |
+
### Uso Básico de la Libreria
|
136 |
|
137 |
+
> Consulte la documentación de la librería PHP de ComproPago para conocer más de sus capacidades, configuraciones y
|
138 |
+
métodos.
|
139 |
|
140 |
|
141 |
#### Llamados al los servicios por SDK
|
151 |
|
152 |
```php
|
153 |
<?php
|
154 |
+
|
155 |
+
# Se genera el objeto con la informacion de la orden
|
156 |
+
|
157 |
+
$order_info = [
|
158 |
+
'order_id' => 12,
|
159 |
+
'order_name' => 'M4 php sdk',
|
160 |
+
'order_price' => 123.45,
|
161 |
+
'customer_name' => 'Eduardo',
|
162 |
+
'customer_email' => 'asd@asd.com',
|
163 |
+
'payment_type' => 'OXXO',
|
164 |
+
'currency' => 'MXN'
|
165 |
+
];
|
166 |
+
$order = \CompropagoSdk\Factory\Factory::getInstanceOf('PlaceOrderInfo', $order_info);
|
|
|
|
|
|
|
|
|
167 |
|
168 |
|
169 |
# Llamada al metodo 'place_order' del API para generar la orden
|
178 |
```php
|
179 |
<?php
|
180 |
/**
|
181 |
+
* @param $neworder
|
182 |
+
* @return \CompropagoSdk\Factory\Models\NewOrderInfo
|
183 |
* @throws \Exception
|
184 |
*/
|
185 |
+
public function placeOrder($neworder){}
|
186 |
```
|
187 |
|
188 |
##### Verificar el Estatus de una orden
|
189 |
|
190 |
Para verificar el estatus de una orden generada es necesario llamar al metodo **verifyOrder** que provee el atributo
|
191 |
**api** del objeto **Client** y el cual regresa una instancia **CpOrderInfo**. este metodo recibe como parametro el ID
|
192 |
+
generado por ComproPago para cada orden. Tambien puede obtener este ID desde un objeto **NewOrderInfo** accediendo al
|
193 |
+
atributo **id**.
|
194 |
|
195 |
```php
|
196 |
<?php
|
198 |
$order_id = "ch_xxxx_xxx_xxx_xxxx";
|
199 |
|
200 |
# U obtenerlo de un objetdo NewOrderInfo
|
201 |
+
$order_id = $neworder->id;
|
202 |
|
203 |
|
204 |
# Se manda llamar al metodo del API para recuperar la informacion de la orden
|
211 |
<?php
|
212 |
/**
|
213 |
* @param $orderId
|
214 |
+
* @return \CompropagoSdk\Factory\Models\CpOrderInfo
|
215 |
* @throws \Exception
|
216 |
*/
|
217 |
public function verifyOrder( $orderId ){}
|
240 |
* @return array
|
241 |
* @throws \Exception
|
242 |
*/
|
243 |
+
public function listProviders($auth = false, $limit = 0){}
|
244 |
```
|
245 |
|
246 |
##### Envio de instrucciones SMS
|
267 |
/**
|
268 |
* @param $number
|
269 |
* @param $orderId
|
270 |
+
* @return \CompropagoSdk\Factory\Models\SmsInfo
|
271 |
* @throws \Exception
|
272 |
*/
|
273 |
public function sendSmsInstructions($number,$orderId){}
|
287 |
```php
|
288 |
<?php
|
289 |
# $cadena_obtenida es un String
|
290 |
+
$info = \CompropagoSdk\Factory\Factory::getInstanceOf('CpOrderInfo', $cadena_obtenida);
|
291 |
```
|
292 |
|
293 |
3. Generar la logica de aprovacion correspondiente al estatus de la orden.
|
309 |
<?php
|
310 |
/**
|
311 |
* @param $url
|
312 |
+
* @return \CompropagoSdk\Factory\Models\Webhook
|
313 |
* @throws \Exception
|
314 |
*/
|
315 |
public function createWebhook($url){}
|
332 |
/**
|
333 |
* @param $webhookId
|
334 |
* @param $url
|
335 |
+
* @return \CompropagoSdk\Factory\Models\Webhook
|
336 |
* @throws \Exception
|
337 |
*/
|
338 |
public function updateWebhook($webhookId, $url){}
|
354 |
<?php
|
355 |
/**
|
356 |
* @param $webhookId
|
357 |
+
* @return \CompropagoSdk\Factory\Models\Webhook
|
358 |
* @throws \Exception
|
359 |
*/
|
360 |
public function deleteWebhook($webhookId){}
|
381 |
*/
|
382 |
public function listWebhooks(){}
|
383 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Compropago/vendor/compropago/php-sdk/composer.json
CHANGED
@@ -17,9 +17,6 @@
|
|
17 |
"require-dev":{
|
18 |
"phpunit/phpunit": ">=5.3"
|
19 |
},
|
20 |
-
"suggest":{
|
21 |
-
"compropago/views-sdk": "Permite la manipulacion de Listado de Proveedores, Recibos de compra y botones de pago dinamicos"
|
22 |
-
},
|
23 |
"autoload": {
|
24 |
"psr-4": {
|
25 |
"CompropagoSdk\\": "CompropagoSdk"
|
17 |
"require-dev":{
|
18 |
"phpunit/phpunit": ">=5.3"
|
19 |
},
|
|
|
|
|
|
|
20 |
"autoload": {
|
21 |
"psr-4": {
|
22 |
"CompropagoSdk\\": "CompropagoSdk"
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Compropago_Payment_Extension</name>
|
4 |
-
<version>2.0
|
5 |
<stability>stable</stability>
|
6 |
-
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>
|
11 |
-
<notes>*
|
|
|
|
|
12 |
<authors><author><name>Eduardo Aguilar</name><user>eduardoay</user><email>eduardo.aguilar@compropago.com</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Compropago_CpPayment.xml" hash="39b519aeecb171cb993e0ee4e064f29a"/></dir></target><target name="magecommunity"><dir name="Compropago"><dir name="CpPayment"><dir name="Block"><file name="Form.php" hash="fedfa50d8860395445eec7e4def4df7d"/><file name="Info.php" hash="d34706306b26afc91b7b0190edbe73a0"/></dir><dir name="Helper"><file name="Data.php" hash="0ae647f79d66d82cc976408c120fcbb6"/></dir><dir name="Model"><file name="Observer.php" hash="240cb5799b8ed42ff62f7f43e14c648f"/><file name="Providers.php" hash="57bbb11a08f26afa92a98ca0dd9f940b"/><file name="Standard.php" hash="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Compropago_Payment_Extension</name>
|
4 |
+
<version>2.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Se agrego currency Exchange</summary>
|
10 |
+
<description>ComproPago Payment Gateway in Magento</description>
|
11 |
+
<notes>* Feature: Currency Exchange for USD EUR GBP
|
12 |
+
* Bug-Fix: Conflic resolution in providers selector
|
13 |
+
</notes>
|
14 |
<authors><author><name>Eduardo Aguilar</name><user>eduardoay</user><email>eduardo.aguilar@compropago.com</email></author></authors>
|
15 |
+
<date>2017-01-18</date>
|
16 |
+
<time>00:19:23</time>
|
17 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Compropago_CpPayment.xml" hash="39b519aeecb171cb993e0ee4e064f29a"/></dir></target><target name="magecommunity"><dir name="Compropago"><dir name="CpPayment"><dir name="Block"><file name="Form.php" hash="fedfa50d8860395445eec7e4def4df7d"/><file name="Info.php" hash="d34706306b26afc91b7b0190edbe73a0"/></dir><dir name="Helper"><file name="Data.php" hash="0ae647f79d66d82cc976408c120fcbb6"/></dir><dir name="Model"><file name="Observer.php" hash="240cb5799b8ed42ff62f7f43e14c648f"/><file name="Providers.php" hash="57bbb11a08f26afa92a98ca0dd9f940b"/><file name="Standard.php" hash="b6a47c44819519b8aa3764295741646a"/></dir><dir name="controllers"><file name="IndexController.php" hash="e3605b92059940ec96a4bcf5a7b16bb6"/></dir><dir name="etc"><file name="config.xml" hash="4aec58a07b59df2fbbc60d43c575539f"/><file name="system.xml" hash="8a96aa67ae243dfb980fefb94066143a"/></dir><dir name="sql"><dir name="cppayment_setup"><file name="install-2.0.0.php" hash="3a1215b9adb72418e27ee6fffd604d73"/><file name="install-2.1.0.php" hash="3a1215b9adb72418e27ee6fffd604d73"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cppayment.xml" hash="aadfc4eed58b61274c257d022363e0bb"/></dir><dir name="template"><dir name="compropago"><dir name="cppayment"><file name="cash.phtml" hash="1b226a7e6f65bd591f49345b11b03fac"/><file name="info.phtml" hash="717385b1db73eed01c81e64e8dafb0a6"/><file name="mark.phtml" hash="4eb1668734994184ea2a2f10c9bf8e13"/><file name="success.phtml" hash="1292183b370d80bddf50b67b9b8f13f0"/><file name=".DS_Store" hash="6d26a77bb0aa1f0b0471ffbeb4126011"/></dir></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Compropago"><file name="composer.json" hash="bf6638c9ddfed8bcdb7596a5e64d1aca"/><file name="composer.lock" hash="e687ae6c45f73765aa985b4743dfba64"/><dir name="vendor"><file name="autoload.php" hash="4595cb94f03a113906186bff4a8b575b"/><dir name="composer"><file name="ClassLoader.php" hash="d925befc389a2a2d5ecb76b81899d775"/><file name="LICENSE" hash="9b01fc9e0129adc080344653fbcbbc0f"/><file name="autoload_classmap.php" hash="57a1800204f81c8bae5e08dd69479854"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="94c7252625076c04000283666cfd7cc0"/><file name="autoload_real.php" hash="26c81866f019e3fbca597a361e5bd03b"/><file name="autoload_static.php" hash="8d8f3c1b1b7eb4061be818b8be979820"/><file name="installed.json" hash="3c8dab59a5f4c01e4407209e82ff2ef7"/></dir><dir name="compropago"><dir name="php-sdk"><file name="CHANGELOG.md" hash="bbaebfede967523edfa97b0afc17e6c9"/><dir name="CompropagoSdk"><file name="Client.php" hash="f6ca9200cb74dd4e6b0eec21fd7a1d73"/><dir name="Extern"><file name="TransactTables.php" hash="15176b9e3da1da264c8ed3b25bc95b89"/></dir><dir name="Factory"><file name="Factory.php" hash="7b3ee12649eac6fab670d89b6f3ad124"/><dir name="Models"><file name="CpOrderInfo.php" hash="467a5b7234e392046c042d30ca7c887c"/><file name="Customer.php" hash="063820ab5593af6ca1f5651faefd1f7d"/><file name="EvalAuthInfo.php" hash="f20efd78c8444de1319ffcdff6fe17a6"/><file name="FeeDetails.php" hash="abb7dd814c9406c8b3c3140b49603594"/><file name="InstructionDetails.php" hash="f62a708998cb78b5fadf3ba06c7ff499"/><file name="Instructions.php" hash="d791bb0c351ba5527d2c42052d264d49"/><file name="NewOrderInfo.php" hash="e8e7bea0a47c288cf9e1fd50ff1b789b"/><file name="OrderInfo.php" hash="fd9a05922bcdab2e176cd1058688514e"/><file name="PlaceOrderInfo.php" hash="02a127b6f4ae1f5ee193fedfdafca1e3"/><file name="Provider.php" hash="c45d8402bfcc3b67d7767b597ad6bafb"/><file name="SmsData.php" hash="79485fd7121b5220df4ccc913fe1e8d2"/><file name="SmsInfo.php" hash="53b5d46bc67e9ff9e3e0fb6154bd5b12"/><file name="SmsObject.php" hash="ac4a5eb8cf4c22850e89491544b4506d"/><file name="Webhook.php" hash="8e8f101d6ffe2493e3bdfc4cd2290bec"/></dir><file name="Serialize.php" hash="41e68aa6ba77c60adf5c5e373cdd1cc4"/></dir><file name="Service.php" hash="2b5d7a9c62c70d561662e163b0dc5202"/><dir name="Tools"><file name="Http.php" hash="ae5f0911464eedbb3708d26a8ee04fcf"/><file name="Request.php" hash="6f1942e3fae6fc6ca9821b7c693e35d9"/><file name="Validations.php" hash="db3d42e0abc7855012c52126c69d67ff"/><file name="cacerts.pem" hash="a527b93e71b94759d99643641ff3b531"/></dir><dir name="UnitTest"><file name="Test.php" hash="d8ac1827e879ae5b6bb8c9c87c4b5ba1"/><file name="autoload.php" hash="c43ead2675f0fee011d0a56affd871b5"/></dir></dir><file name="LICENSE" hash="abac77493634e3d1c15493847c602b03"/><file name="README.md" hash="8482e8e4fd34ef47c24bfc6f36ff7796"/><file name="composer.json" hash="19cd4efb372eaca1997cefc9b310545c"/><file name=".gitignore" hash="34ac7e14eb103b0316bf4efc1ddb8bc0"/></dir></dir></dir></dir></target><target name="magemedia"><dir name="cppayment"><file name="compropago-logo.png" hash="2a3e98095b5c9df0669b7dc70f0682cd"/><file name="gitmerge.gif" hash="31c57faf2960d93d98e9d39bd71df00b"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="compropago"><file name="compropago.css" hash="5a4b5271ef09e42b63eaeabb73d7d9e8"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="compropago"><file name="compropago.js" hash="ffdf6e940b91554944656fff2cbdb6c5"/></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.5.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|