Version Notes
* Adapt plugin to use Conekta API 2.0.0.
Download this release
Release Info
Developer | Mauricio Murga |
Extension | Conekta_Payment_Extension |
Version | 0.7.0 |
Comparing to | |
See all releases |
Code changes from version 0.6.0 to 0.7.0
- app/code/community/Conekta/.DS_Store +0 -0
- app/code/community/Conekta/Bank/.DS_Store +0 -0
- app/code/community/Conekta/Bank/Model/.DS_Store +0 -0
- app/code/community/Conekta/Bank/Model/Observer.php +143 -120
- app/code/community/Conekta/Bank/etc/config.xml +1 -1
- app/code/community/Conekta/Bank/sql/.DS_Store +0 -0
- app/code/community/Conekta/Bank/sql/bank_setup/.DS_Store +0 -0
- app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.1.0-0.3.3.php → Bank/sql/bank_setup/mysql4-upgrade-0.6.0-0.7.0.php} +0 -0
- app/code/community/Conekta/Card/.DS_Store +0 -0
- app/code/community/Conekta/Card/Model/Observer.php +149 -119
- app/code/community/Conekta/Card/etc/config.xml +1 -1
- app/code/community/Conekta/Card/sql/.DS_Store +0 -0
- app/code/community/Conekta/Card/sql/card_setup/.DS_Store +0 -0
- app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.3-0.3.7.php → Card/sql/card_setup/mysql4-upgrade-0.6.0-0.7.0.php} +0 -0
- app/code/community/Conekta/Oxxo/.DS_Store +0 -0
- app/code/community/Conekta/Oxxo/Model/Observer.php +146 -125
- app/code/community/Conekta/Oxxo/etc/config.xml +1 -1
- app/code/community/Conekta/Oxxo/sql/.DS_Store +0 -0
- app/code/community/Conekta/Oxxo/sql/oxxo_setup/.DS_Store +0 -0
- app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.7-0.3.8.php → Oxxo/sql/oxxo_setup/mysql4-upgrade-0.6.0-0.7.0.php} +0 -0
- app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Date.php.back +0 -21
- app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Days.php +0 -37
- app/code/community/Conekta/Realtime/Block/Form/Realtime.php +0 -9
- app/code/community/Conekta/Realtime/Block/Info/Realtime.php +0 -27
- app/code/community/Conekta/Realtime/Helper/Data.php +0 -6
- app/code/community/Conekta/Realtime/Model/Observer.php +0 -156
- app/code/community/Conekta/Realtime/Model/Realtime.php +0 -23
- app/code/community/Conekta/Realtime/etc/config.xml +0 -134
- app/code/community/Conekta/Realtime/etc/system.xml +0 -73
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-install-0.1.0.php +0 -60
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.9-0.4.0.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.0-0.4.1.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.1-0.4.2.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.2-0.4.3.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.3-0.4.4.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.4-0.4.5.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.5-0.4.6.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.6-0.4.7.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.7-0.4.8.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.8-0.4.9.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.9-0.5.0.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.0-0.5.1.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.1-0.5.2.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.2-0.5.3.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.3-0.5.4.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.4-0.5.5.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.5-0.5.6.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.6-0.5.7.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.7-0.5.8.php +0 -5
- app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.8-0.5.9.php +0 -5
- app/code/community/Conekta/Spei/.DS_Store +0 -0
- app/code/community/Conekta/Spei/Model/Observer.php +147 -122
- app/code/community/Conekta/Spei/etc/config.xml +1 -1
- app/code/community/Conekta/Spei/sql/.DS_Store +0 -0
- app/code/community/Conekta/Spei/sql/spei_setup/.DS_Store +0 -0
- app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.8-0.3.9.php → Spei/sql/spei_setup/mysql4-upgrade-0.6.0-0.7.0.php} +0 -0
- app/code/community/Conekta/Webhook/.DS_Store +0 -0
- app/code/community/Conekta/Webhook/Block/Adminhtml/Sales/Order/View/Tab/Info.php +2 -0
- app/code/community/Conekta/Webhook/Block/Adminhtml/System/Config/Url.php +9 -8
- app/code/community/Conekta/Webhook/controllers/AjaxController.php +19 -0
- app/code/community/Conekta/Webhook/etc/config.xml +1 -1
- app/code/community/Conekta/Webhook/etc/system.xml +8 -0
- app/design/frontend/base/default/template/card/form/card.phtml +6 -3
- app/design/frontend/base/default/template/oxxo/info/oxxo.phtml +1 -3
- app/design/frontend/default/default/template/card/form/card.phtml +6 -3
- app/design/frontend/default/default/template/checkout/success.phtml +0 -148
- app/design/frontend/default/default/template/oxxo/info/oxxo.phtml +1 -3
- lib/Conekta/CHANGELOG +26 -3
- lib/Conekta/README.md +44 -46
- lib/Conekta/composer.json +2 -2
- lib/Conekta/lib/Conekta.php +34 -23
- lib/Conekta/lib/Conekta/Address.php +26 -2
- lib/Conekta/lib/Conekta/Card.php +45 -7
- lib/Conekta/lib/Conekta/Charge.php +43 -9
- lib/Conekta/lib/Conekta/Conekta.php +9 -4
- lib/Conekta/lib/Conekta/ConektaList.php +84 -0
- lib/Conekta/lib/Conekta/Customer.php +91 -15
- lib/Conekta/lib/Conekta/DiscountLine.php +64 -0
- lib/Conekta/lib/Conekta/Error.php +49 -34
- lib/Conekta/lib/Conekta/ErrorList.php +42 -0
- lib/Conekta/lib/Conekta/Event.php +26 -4
- lib/Conekta/lib/Conekta/FiscalEntity.php +57 -0
- lib/Conekta/lib/Conekta/Lang.php +56 -0
- lib/Conekta/lib/Conekta/LineItem.php +60 -0
- lib/Conekta/lib/Conekta/Log.php +45 -0
- lib/Conekta/lib/Conekta/Method.php +6 -2
- lib/Conekta/lib/Conekta/Object.php +27 -6
- lib/Conekta/lib/Conekta/Order.php +128 -0
- lib/Conekta/lib/Conekta/OrderReturn.php +46 -0
- lib/Conekta/lib/Conekta/Payee.php +31 -8
- lib/Conekta/lib/Conekta/PaymentMethod.php +5 -1
- lib/Conekta/lib/Conekta/PaymentSource.php +34 -0
- lib/Conekta/lib/Conekta/Payout.php +9 -5
- lib/Conekta/lib/Conekta/PayoutMethod.php +16 -8
- lib/Conekta/lib/Conekta/Plan.php +13 -9
- lib/Conekta/lib/Conekta/Requestor.php +61 -53
- lib/Conekta/lib/Conekta/Resource.php +84 -28
- lib/Conekta/lib/Conekta/ShippingContact.php +58 -0
- lib/Conekta/lib/Conekta/ShippingLine.php +35 -0
- lib/Conekta/lib/Conekta/Source.php +47 -0
- lib/Conekta/lib/Conekta/Subscription.php +17 -10
- lib/Conekta/lib/Conekta/TaxLine.php +36 -0
- lib/Conekta/lib/Conekta/Token.php +10 -6
- lib/Conekta/lib/Conekta/Util.php +38 -20
- lib/Conekta/lib/Conekta/Webhook.php +11 -7
- lib/Conekta/lib/Conekta/WebhookLog.php +6 -2
- lib/Conekta/test/Conekta-1.0.php +67 -0
- lib/Conekta/test/Conekta-1.0/ChargeTest.php +126 -0
- lib/Conekta/test/Conekta-1.0/ConektaTest.php +19 -0
- lib/Conekta/test/Conekta-1.0/CustomerTest.php +162 -0
- lib/Conekta/test/Conekta-1.0/ErrorTest.php +96 -0
- lib/Conekta/test/Conekta-1.0/EventTest.php +13 -0
- lib/Conekta/test/Conekta-1.0/LangTest.php +19 -0
- lib/Conekta/test/Conekta-1.0/LogTest.php +22 -0
- lib/Conekta/test/Conekta-1.0/PayoutTest.php +60 -0
- lib/Conekta/test/Conekta-1.0/PlanTest.php +61 -0
- lib/Conekta/test/Conekta-1.0/WebhookTest.php +32 -0
- lib/Conekta/test/Conekta-2.0.php +72 -0
- lib/Conekta/test/Conekta-2.0/ChargeTest.php +121 -0
- lib/Conekta/test/Conekta-2.0/ConektaListTest.php +36 -0
- lib/Conekta/test/Conekta-2.0/ConektaTest.php +19 -0
- lib/Conekta/test/Conekta-2.0/CustomerTest.php +103 -0
- lib/Conekta/test/Conekta-2.0/DiscountLineTest.php +66 -0
- lib/Conekta/test/Conekta-2.0/ErrorListTest.php +52 -0
- lib/Conekta/test/Conekta-2.0/FiscalEntityTest.php +61 -0
- lib/Conekta/test/Conekta-2.0/LangTest.php +19 -0
- lib/Conekta/test/Conekta-2.0/LineItemTest.php +60 -0
- lib/Conekta/test/Conekta-2.0/OrderTest.php +302 -0
- lib/Conekta/test/Conekta-2.0/ShippingContactTest.php +66 -0
- lib/Conekta/test/Conekta-2.0/ShippingLineTest.php +69 -0
- lib/Conekta/test/Conekta-2.0/SourceTest.php +44 -0
- lib/Conekta/test/Conekta-2.0/TaxLineTest.php +63 -0
- lib/Conekta/test/Conekta-2.0/WebhookTest.php +31 -0
- lib/Conekta/test/Conekta.php +26 -2
- lib/Conekta/test/Conekta/ChargeTest.php +55 -57
- lib/Conekta/test/Conekta/ConektaListTest.php +58 -0
- lib/Conekta/test/Conekta/ConektaTest.php +19 -0
- lib/Conekta/test/Conekta/CustomerTest.php +103 -42
- lib/Conekta/test/Conekta/DiscountLineTest.php +69 -0
- lib/Conekta/test/Conekta/ErrorListTest.php +56 -0
- lib/Conekta/test/Conekta/ErrorTest.php +22 -18
- lib/Conekta/test/Conekta/EventTest.php +5 -4
- lib/Conekta/test/Conekta/FiscalEntityTest.php +64 -0
- lib/Conekta/test/Conekta/LangTest.php +19 -0
- lib/Conekta/test/Conekta/LineItemTest.php +63 -0
- lib/Conekta/test/Conekta/LogTest.php +20 -0
- lib/Conekta/test/Conekta/OrderTest.php +234 -0
- lib/Conekta/test/Conekta/PayoutTest.php +5 -5
- lib/Conekta/test/Conekta/PlanTest.php +12 -12
- lib/Conekta/test/Conekta/ShippingContactTest.php +66 -0
- lib/Conekta/test/Conekta/ShippingLineTest.php +72 -0
- lib/Conekta/test/Conekta/SourceTest.php +45 -0
- lib/Conekta/test/Conekta/TaxLineTest.php +66 -0
- lib/Conekta/test/Conekta/WebhookTest.php +6 -6
- lib/Conekta/test/support/fixtures/orders.json +2394 -0
- package.xml +6 -7
app/code/community/Conekta/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/Model/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/Model/Observer.php
CHANGED
@@ -2,135 +2,50 @@
|
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Bank_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
-
if (!class_exists('Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Bank_Model_Bank')->getCode()){
|
10 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
-
Conekta::
|
|
|
|
|
12 |
|
13 |
$order = $event->payment->getOrder();
|
14 |
-
$
|
15 |
-
$shipping_address = $order->getShippingAddress();
|
16 |
-
|
17 |
-
$billing = $order->getBillingAddress()->getData();
|
18 |
-
// $email = $event->payment->getOrder()->getEmail();
|
19 |
-
|
20 |
-
$quote = $event->payment->getOrder()->getQuote();
|
21 |
-
$email = $quote->getBillingAddress()->getEmail();
|
22 |
-
if (!$email) $email = $quote->getCustomerEmail();
|
23 |
-
|
24 |
-
if ($shipping_address) {
|
25 |
-
$shipping_data = $shipping_address->getData();
|
26 |
-
}
|
27 |
-
$items = $order->getAllVisibleItems();
|
28 |
-
$line_items = array();
|
29 |
-
$i = 0;
|
30 |
-
foreach ($items as $itemId => $item){
|
31 |
-
$name = $item->getName();
|
32 |
-
$sku = $item->getSku();
|
33 |
-
$price = $item->getPrice();
|
34 |
-
$description = $item->getDescription();
|
35 |
-
$product_type = $item->getProductType();
|
36 |
-
$line_items = array_merge($line_items, array(array(
|
37 |
-
'name' => $name,
|
38 |
-
'sku' => $sku,
|
39 |
-
'unit_price' => $price,
|
40 |
-
'description' =>$description,
|
41 |
-
'quantity' => 1,
|
42 |
-
'type' => $product_type
|
43 |
-
))
|
44 |
-
);
|
45 |
-
$i = $i + 1;
|
46 |
-
}
|
47 |
-
$shipp = array();
|
48 |
-
if (empty($shipping_data) != true) {
|
49 |
-
$shipp = array(
|
50 |
-
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
51 |
-
'service' => $order->getShippingMethod(),
|
52 |
-
'carrier' => $order->getShippingDescription(),
|
53 |
-
'address' => array(
|
54 |
-
'street1' => $shipping_data['street'],
|
55 |
-
'city' => $shipping_data['city'],
|
56 |
-
'state' => $shipping_data['region'],
|
57 |
-
'country' => $shipping_data['country_id'],
|
58 |
-
'zip' => $shipping_data['postcode'],
|
59 |
-
'phone' =>$shipping_data['telephone'],
|
60 |
-
'email' =>$email
|
61 |
-
)
|
62 |
-
);
|
63 |
-
}
|
64 |
-
$shipping_amount = null;
|
65 |
-
$shipping_description = null;
|
66 |
-
$shipping_method = null;
|
67 |
-
if (empty($shipping_address) != true) {
|
68 |
-
$shipping_amount = $shipping_address->getShippingAmount();
|
69 |
-
$shipping_description = $shipping_address->getShippingDescription();
|
70 |
-
$shipping_method = $shipping_address->getShippingMethod();
|
71 |
-
}
|
72 |
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
73 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
try {
|
75 |
-
$
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
'state' =>$billing['region'],
|
93 |
-
'country' =>$billing['country_id'],
|
94 |
-
'zip' =>$billing['postcode'],
|
95 |
-
'phone' =>$billing['telephone'],
|
96 |
-
'email' =>$email
|
97 |
-
),
|
98 |
-
'line_items' => $line_items,
|
99 |
-
'shipment' => $shipp
|
100 |
-
),
|
101 |
-
'coupon_code' => $order->getCouponCode(),
|
102 |
-
'custom_fields' => array(
|
103 |
-
'customer' => array(
|
104 |
-
'website_id' => $customer->getWebsiteId(),
|
105 |
-
'entity_id' => $customer->getEntityId(),
|
106 |
-
'entity_type_id' => $customer->getEntityTypeId(),
|
107 |
-
'attribute_set_id' => $customer->getAttributeSetId(),
|
108 |
-
'email' => $customer->getEmail(),
|
109 |
-
'group_id' => $customer->getGroupId(),
|
110 |
-
'store_id' => $customer->getStoreId(),
|
111 |
-
'created_at' => $customer->getCreatedAt(),
|
112 |
-
'updated_at' => $customer->getUpdatedAt(),
|
113 |
-
'is_active' => $customer->getIsActive(),
|
114 |
-
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
115 |
-
'get_tax_vat' => $customer->getTaxvat(),
|
116 |
-
'created_in' => $customer->getCreatedIn(),
|
117 |
-
'gender' => $customer->getGender(),
|
118 |
-
'default_billing' => $customer->getDefaultBilling(),
|
119 |
-
'default_shipping' => $customer->getDefaultShipping(),
|
120 |
-
'dob' => $customer->getDob(),
|
121 |
-
'tax_class_id' => $customer->getTaxClassId()
|
122 |
-
),
|
123 |
-
'discount_description' => $order->getDiscountDescription(),
|
124 |
-
'discount_amount' => $order->getDiscountAmount(),
|
125 |
-
'shipping_amount' => $shipping_amount,
|
126 |
-
'shipping_description' => $shipping_description,
|
127 |
-
'shipping_method' => $shipping_method
|
128 |
-
)
|
129 |
-
)
|
130 |
-
);
|
131 |
-
} catch (Conekta_Error $e){
|
132 |
-
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
133 |
}
|
|
|
|
|
134 |
$event->payment->setBankExpiryDate($expiry_date);
|
135 |
$event->payment->setBankServiceName($charge->payment_method->service_name);
|
136 |
$event->payment->setBankServiceNumber($charge->payment_method->service_number);
|
@@ -155,4 +70,112 @@ class Conekta_Bank_Model_Observer{
|
|
155 |
}
|
156 |
return $event;
|
157 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Bank_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta\Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Bank_Model_Bank')->getCode()){
|
10 |
+
\Conekta\Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
\Conekta\Conekta::setApiVersion("2.0.0");
|
12 |
+
\Conekta\Conekta::setPlugin("Magento 1");
|
13 |
+
\Conekta\Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
14 |
|
15 |
$order = $event->payment->getOrder();
|
16 |
+
$order_params = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
18 |
+
$order_params["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
19 |
+
$order_params["line_items"] = self::getLineItems($order);
|
20 |
+
$order_params["shipping_lines"] = self::getShippingLines($order);
|
21 |
+
$order_params["discount_lines"] = self::getDiscountLines($order);
|
22 |
+
$order_params["tax_lines"] = self::getTaxLines($order);
|
23 |
+
$order_params["customer_info"] = self::getCustomerInfo($order);
|
24 |
+
$order_params["shipping_contact"] = self::getShippingContact($order);
|
25 |
+
$order_params["metadata"] = array("checkout_id" => $order->getIncrementId());
|
26 |
+
$charge_params = self::getCharge(intval(((float) $order->grandTotal) * 100), strtotime("+".$days." days"));
|
27 |
+
|
28 |
try {
|
29 |
+
$create_order = true;
|
30 |
+
|
31 |
+
$conekta_order_id = Mage::getSingleton('core/session')->getConektaOrderID();
|
32 |
+
if (!empty($conekta_order_id)) {
|
33 |
+
$conekta_order = \Conekta\Order::find($conekta_order_id);
|
34 |
+
$create_order = ($conekta_order->metadata->checkout_id != $order_params["metadata"]["checkout_id"]);
|
35 |
+
}
|
36 |
+
|
37 |
+
if ($create_order) {
|
38 |
+
$conekta_order = \Conekta\Order::create($order_params);
|
39 |
+
$conekta_order_id = Mage::getSingleton('core/session')->setConektaOrderID($conekta_order->id);
|
40 |
+
}
|
41 |
+
|
42 |
+
$conekta_order->createCharge($charge_params);
|
43 |
+
$charge = $conekta_order->charges[0];
|
44 |
+
} catch (\Conekta\ErrorList $e){
|
45 |
+
throw new Mage_Payment_Model_Info_Exception($e->details[0]->getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
+
|
48 |
+
Mage::getSingleton('core/session')->unsConektaOrderID();
|
49 |
$event->payment->setBankExpiryDate($expiry_date);
|
50 |
$event->payment->setBankServiceName($charge->payment_method->service_name);
|
51 |
$event->payment->setBankServiceNumber($charge->payment_method->service_number);
|
70 |
}
|
71 |
return $event;
|
72 |
}
|
73 |
+
|
74 |
+
public function getCharge($amount, $expiry_date) {
|
75 |
+
$charge = array(
|
76 |
+
'payment_source' => array(
|
77 |
+
'type' => 'banorte',
|
78 |
+
'expires_at' => $expiry_date
|
79 |
+
),
|
80 |
+
'amount' => $amount
|
81 |
+
);
|
82 |
+
return $charge;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function getLineItems($order) {
|
86 |
+
$items = $order->getAllVisibleItems();
|
87 |
+
$line_items = array();
|
88 |
+
$i = 0;
|
89 |
+
foreach ($items as $itemId => $item){
|
90 |
+
$name = $item->getName();
|
91 |
+
$sku = $item->getSku();
|
92 |
+
$price = intval($item->getPrice() * 100) * $item->getQtyOrdered();
|
93 |
+
$description = $item->getDescription();
|
94 |
+
if (!$description) $description = $name;
|
95 |
+
$product_type = $item->getProductType();
|
96 |
+
$line_items = array_merge($line_items, array(array(
|
97 |
+
'name' => $name,
|
98 |
+
'description' => $description,
|
99 |
+
'unit_price' => $price,
|
100 |
+
'quantity' => 1,
|
101 |
+
'sku' => $sku,
|
102 |
+
'type' => "physical",
|
103 |
+
'tags' => [$product_type]
|
104 |
+
))
|
105 |
+
);
|
106 |
+
$i = $i + 1;
|
107 |
+
}
|
108 |
+
return $line_items;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function getShippingContact($order) {
|
112 |
+
$shipping_contact = array();
|
113 |
+
$quote = $order->getQuote();
|
114 |
+
$email = $quote->getBillingAddress()->getEmail();
|
115 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
116 |
+
$billing = $order->getBillingAddress()->getData();
|
117 |
+
$shipping_address = $order->getShippingAddress();
|
118 |
+
$shipping_data = $shipping_address->getData();
|
119 |
+
|
120 |
+
$shipping_contact["email"] = $email;
|
121 |
+
$shipping_contact["phone"] = $billing['telephone'];
|
122 |
+
$shipping_contact["receiver"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
123 |
+
$address = array();
|
124 |
+
$address["street1"] = $shipping_data['street'];
|
125 |
+
$address["city"] = $shipping_data['city'];
|
126 |
+
$address["state"] = $shipping_data['region'];
|
127 |
+
$address["country"] = $shipping_data['country_id'];
|
128 |
+
$address["postal_code"] = $shipping_data['postcode'];
|
129 |
+
$shipping_contact["address"] = $address;
|
130 |
+
return $shipping_contact;
|
131 |
+
}
|
132 |
+
|
133 |
+
public function getShippingLines($order) {
|
134 |
+
$shipping_lines = array();
|
135 |
+
if ($order->getShippingAmount() > 0) {
|
136 |
+
$shipping_line = array();
|
137 |
+
$shipping_line["amount"] = intval(($order->getShippingAmount()+$order->getShippingTaxAmount()) * 100);
|
138 |
+
$shipping_line["description"] = "Shipping total amount";
|
139 |
+
$shipping_line["method"] = "custom";
|
140 |
+
$shipping_line["carrier"] = "custom";
|
141 |
+
$shipping_lines = array_merge($shipping_lines, array($shipping_line));
|
142 |
+
}
|
143 |
+
return $shipping_lines;
|
144 |
+
}
|
145 |
+
|
146 |
+
public function getDiscountLines($order) {
|
147 |
+
$discount_lines = array();
|
148 |
+
if ($order->getDiscountAmount() > 0) {
|
149 |
+
$discount_line = array();
|
150 |
+
$discount_line["description"] = $order->getDiscountDescription();
|
151 |
+
$discount_line["kind"] = $order->getCouponCode();
|
152 |
+
$discount_line["amount"] = $order->getDiscountAmount();
|
153 |
+
$discount_lines = array_merge($discount_lines, $discount_line);
|
154 |
+
}
|
155 |
+
return $discount_lines;
|
156 |
+
}
|
157 |
+
|
158 |
+
public function getTaxLines($order) {
|
159 |
+
$customer = $order->getCustomer();
|
160 |
+
$tax_lines = array();
|
161 |
+
if ($customer->getTaxvat() > 0) {
|
162 |
+
$tax_line = array();
|
163 |
+
$tax_line["description"] = $customer->getTaxClassId();
|
164 |
+
$tax_line["amount"] = $customer->getTaxvat();
|
165 |
+
$tax_lines = array_merge($tax_lines, $tax_line);
|
166 |
+
}
|
167 |
+
return $tax_lines;
|
168 |
+
}
|
169 |
+
|
170 |
+
public function getCustomerInfo($order) {
|
171 |
+
$quote = $order->getQuote();
|
172 |
+
$email = $quote->getBillingAddress()->getEmail();
|
173 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
174 |
+
$billing = $order->getBillingAddress()->getData();
|
175 |
+
$customer_info = array();
|
176 |
+
$customer_info["name"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
177 |
+
$customer_info["email"] = $email;
|
178 |
+
$customer_info["phone"] = $billing['telephone'];
|
179 |
+
return $customer_info;
|
180 |
+
}
|
181 |
}
|
app/code/community/Conekta/Bank/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Bank>
|
5 |
-
<version>0.
|
6 |
</Conekta_Bank>
|
7 |
</modules>
|
8 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Bank>
|
5 |
+
<version>0.7.0</version>
|
6 |
</Conekta_Bank>
|
7 |
</modules>
|
8 |
<adminhtml>
|
app/code/community/Conekta/Bank/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Bank/sql/bank_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.1.0-0.3.3.php → Bank/sql/bank_setup/mysql4-upgrade-0.6.0-0.7.0.php}
RENAMED
File without changes
|
app/code/community/Conekta/Card/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Card/Model/Observer.php
CHANGED
@@ -2,134 +2,53 @@
|
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Card_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
-
if (!class_exists('Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Card_Model_Card')->getCode()){
|
10 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
-
Conekta::setApiVersion("
|
12 |
-
Conekta::
|
13 |
-
|
|
|
14 |
$order = $event->payment->getOrder();
|
15 |
-
$
|
16 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
$billing = $order->getBillingAddress()->getData();
|
19 |
-
// $email = $event->payment->getOrder()->getEmail();
|
20 |
-
|
21 |
-
$quote = $event->payment->getOrder()->getQuote();
|
22 |
-
$email = $quote->getBillingAddress()->getEmail();
|
23 |
-
if (!$email) $email = $quote->getCustomerEmail();
|
24 |
-
|
25 |
-
if ($shipping_address) {
|
26 |
-
$shipping_data = $shipping_address->getData();
|
27 |
-
}
|
28 |
-
$items = $order->getAllVisibleItems();
|
29 |
-
$line_items = array();
|
30 |
-
$i = 0;
|
31 |
-
foreach ($items as $itemId => $item){
|
32 |
-
$name = $item->getName();
|
33 |
-
$sku = $item->getSku();
|
34 |
-
$price = $item->getPrice();
|
35 |
-
$description = Mage::getModel('catalog/product')->load($item->getProductId())->getDescription();
|
36 |
-
$product_type = $item->getProductType();
|
37 |
-
$line_items = array_merge($line_items, array(array(
|
38 |
-
'name' => $name,
|
39 |
-
'sku' => $sku,
|
40 |
-
'unit_price' => $price,
|
41 |
-
'description' =>$description,
|
42 |
-
'quantity' => 1,
|
43 |
-
'type' => $product_type
|
44 |
-
))
|
45 |
-
);
|
46 |
-
$i = $i + 1;
|
47 |
-
}
|
48 |
-
$shipp = array();
|
49 |
-
if (empty($shipping_data) != true) {
|
50 |
-
$shipp = array(
|
51 |
-
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
52 |
-
'service' => $order->getShippingMethod(),
|
53 |
-
'carrier' => $order->getShippingDescription(),
|
54 |
-
'address' => array(
|
55 |
-
'street1' => $shipping_data['street'],
|
56 |
-
'city' => $shipping_data['city'],
|
57 |
-
'state' => $shipping_data['region'],
|
58 |
-
'country' => $shipping_data['country_id'],
|
59 |
-
'zip' => $shipping_data['postcode'],
|
60 |
-
'phone' =>$shipping_data['telephone'],
|
61 |
-
'email' =>$email
|
62 |
-
)
|
63 |
-
);
|
64 |
-
}
|
65 |
-
$shipping_amount = null;
|
66 |
-
$shipping_description = null;
|
67 |
-
$shipping_method = null;
|
68 |
-
if (empty($shipping_address) != true) {
|
69 |
-
$shipping_amount = $shipping_address->getShippingAmount();
|
70 |
-
$shipping_description = $shipping_address->getShippingDescription();
|
71 |
-
$shipping_method = $shipping_address->getShippingMethod();
|
72 |
-
}
|
73 |
try {
|
74 |
-
$
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
'company_name' => $billing['company'],
|
86 |
-
'street1' => $billing['street'],
|
87 |
-
'city' =>$billing['city'],
|
88 |
-
'state' =>$billing['region'],
|
89 |
-
'country' =>$billing['country_id'],
|
90 |
-
'zip' =>$billing['postcode'],
|
91 |
-
'phone' =>$billing['telephone'],
|
92 |
-
'email' =>$email
|
93 |
-
),
|
94 |
-
'line_items' => $line_items,
|
95 |
-
'shipment' => $shipp
|
96 |
-
),
|
97 |
-
'coupon_code' => $order->getCouponCode(),
|
98 |
-
'custom_fields' => array(
|
99 |
-
'customer' => array(
|
100 |
-
'website_id' => $customer->getWebsiteId(),
|
101 |
-
'entity_id' => $customer->getEntityId(),
|
102 |
-
'entity_type_id' => $customer->getEntityTypeId(),
|
103 |
-
'attribute_set_id' => $customer->getAttributeSetId(),
|
104 |
-
'email' => $customer->getEmail(),
|
105 |
-
'group_id' => $customer->getGroupId(),
|
106 |
-
'store_id' => $customer->getStoreId(),
|
107 |
-
'created_at' => $customer->getCreatedAt(),
|
108 |
-
'updated_at' => $customer->getUpdatedAt(),
|
109 |
-
'is_active' => $customer->getIsActive(),
|
110 |
-
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
111 |
-
'get_tax_vat' => $customer->getTaxvat(),
|
112 |
-
'created_in' => $customer->getCreatedIn(),
|
113 |
-
'gender' => $customer->getGender(),
|
114 |
-
'default_billing' => $customer->getDefaultBilling(),
|
115 |
-
'default_shipping' => $customer->getDefaultShipping(),
|
116 |
-
'dob' => $customer->getDob(),
|
117 |
-
'tax_class_id' => $customer->getTaxClassId()
|
118 |
-
),
|
119 |
-
'discount_description' => $order->getDiscountDescription(),
|
120 |
-
'discount_amount' => $order->getDiscountAmount(),
|
121 |
-
'shipping_amount' => $shipping_amount,
|
122 |
-
'shipping_description' => $shipping_description,
|
123 |
-
'shipping_method' => $shipping_method
|
124 |
-
)
|
125 |
-
);
|
126 |
-
if ($_POST['payment']['monthly_installments'] != 0) {
|
127 |
-
$params['monthly_installments'] = $_POST['payment']['monthly_installments'];
|
128 |
}
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
132 |
}
|
|
|
|
|
133 |
$event->payment->setCardToken($_POST['payment']['conekta_token']);
|
134 |
$event->payment->setCardMonthlyInstallments($charge->monthly_installments);
|
135 |
$event->payment->setChargeAuthorization($charge->payment_method->auth_code);
|
@@ -159,4 +78,115 @@ class Conekta_Card_Model_Observer{
|
|
159 |
}
|
160 |
return $event;
|
161 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
}
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Card_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta\Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Card_Model_Card')->getCode()){
|
10 |
+
\Conekta\Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
\Conekta\Conekta::setApiVersion("2.0.0");
|
12 |
+
\Conekta\Conekta::setPlugin("Magento 1");
|
13 |
+
\Conekta\Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
14 |
+
|
15 |
$order = $event->payment->getOrder();
|
16 |
+
$order_params = array();
|
17 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
18 |
+
$order_params["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
19 |
+
$order_params["line_items"] = self::getLineItems($order);
|
20 |
+
$order_params["shipping_lines"] = self::getShippingLines($order);
|
21 |
+
$order_params["discount_lines"] = self::getDiscountLines($order);
|
22 |
+
$order_params["tax_lines"] = self::getTaxLines($order);
|
23 |
+
$order_params["customer_info"] = self::getCustomerInfo($order);
|
24 |
+
$order_params["shipping_contact"] = self::getShippingContact($order);
|
25 |
+
$order_params["metadata"] = array("checkout_id" => $order->getIncrementId());
|
26 |
+
$charge_params = self::getCharge(
|
27 |
+
intval(((float) $order->grandTotal) * 100),
|
28 |
+
$_POST['payment']['conekta_token'],
|
29 |
+
$_POST['payment']['monthly_installments']);
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
try {
|
32 |
+
$create_order = true;
|
33 |
+
|
34 |
+
$conekta_order_id = Mage::getSingleton('core/session')->getConektaOrderID();
|
35 |
+
if (!empty($conekta_order_id)) {
|
36 |
+
$conekta_order = \Conekta\Order::find($conekta_order_id);
|
37 |
+
$create_order = ($conekta_order->metadata->checkout_id != $order_params["metadata"]["checkout_id"]);
|
38 |
+
}
|
39 |
+
|
40 |
+
if ($create_order) {
|
41 |
+
$conekta_order = \Conekta\Order::create($order_params);
|
42 |
+
$conekta_order_id = Mage::getSingleton('core/session')->setConektaOrderID($conekta_order->id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
+
|
45 |
+
$conekta_order->createCharge($charge_params);
|
46 |
+
$charge = $conekta_order->charges[0];
|
47 |
+
} catch (\Conekta\ErrorList $e){
|
48 |
+
throw new Mage_Payment_Model_Info_Exception($e->details[0]->getMessage());
|
49 |
}
|
50 |
+
|
51 |
+
Mage::getSingleton('core/session')->unsConektaOrderID();
|
52 |
$event->payment->setCardToken($_POST['payment']['conekta_token']);
|
53 |
$event->payment->setCardMonthlyInstallments($charge->monthly_installments);
|
54 |
$event->payment->setChargeAuthorization($charge->payment_method->auth_code);
|
78 |
}
|
79 |
return $event;
|
80 |
}
|
81 |
+
|
82 |
+
public function getCharge($amount, $token_id) {
|
83 |
+
$charge = array(
|
84 |
+
'payment_source' => array(
|
85 |
+
'type' => 'card',
|
86 |
+
'token_id' => $token_id
|
87 |
+
),
|
88 |
+
'amount' => $amount
|
89 |
+
);
|
90 |
+
if ($_POST['payment']['monthly_installments'] != 0) {
|
91 |
+
$charge["payment_source"]["monthly_installments"] = $_POST['payment']['monthly_installments'];
|
92 |
+
}
|
93 |
+
return $charge;
|
94 |
+
}
|
95 |
+
|
96 |
+
public function getLineItems($order) {
|
97 |
+
$items = $order->getAllVisibleItems();
|
98 |
+
$line_items = array();
|
99 |
+
$i = 0;
|
100 |
+
foreach ($items as $itemId => $item){
|
101 |
+
$name = $item->getName();
|
102 |
+
$sku = $item->getSku();
|
103 |
+
$price = intval($item->getPrice() * 100) * $item->getQtyOrdered();
|
104 |
+
$description = $item->getDescription();
|
105 |
+
if (!$description) $description = $name;
|
106 |
+
$product_type = $item->getProductType();
|
107 |
+
$line_items = array_merge($line_items, array(array(
|
108 |
+
'name' => $name,
|
109 |
+
'description' => $description,
|
110 |
+
'unit_price' => $price,
|
111 |
+
'quantity' => 1,
|
112 |
+
'sku' => $sku,
|
113 |
+
'type' => "physical",
|
114 |
+
'tags' => [$product_type]
|
115 |
+
))
|
116 |
+
);
|
117 |
+
$i = $i + 1;
|
118 |
+
}
|
119 |
+
return $line_items;
|
120 |
+
}
|
121 |
+
|
122 |
+
public function getShippingContact($order) {
|
123 |
+
$shipping_contact = array();
|
124 |
+
$quote = $order->getQuote();
|
125 |
+
$email = $quote->getBillingAddress()->getEmail();
|
126 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
127 |
+
$billing = $order->getBillingAddress()->getData();
|
128 |
+
$shipping_address = $order->getShippingAddress();
|
129 |
+
$shipping_data = $shipping_address->getData();
|
130 |
+
|
131 |
+
$shipping_contact["email"] = $email;
|
132 |
+
$shipping_contact["phone"] = $billing['telephone'];
|
133 |
+
$shipping_contact["receiver"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
134 |
+
$address = array();
|
135 |
+
$address["street1"] = $shipping_data['street'];
|
136 |
+
$address["city"] = $shipping_data['city'];
|
137 |
+
$address["state"] = $shipping_data['region'];
|
138 |
+
$address["country"] = $shipping_data['country_id'];
|
139 |
+
$address["postal_code"] = $shipping_data['postcode'];
|
140 |
+
$shipping_contact["address"] = $address;
|
141 |
+
return $shipping_contact;
|
142 |
+
}
|
143 |
+
|
144 |
+
public function getShippingLines($order) {
|
145 |
+
$shipping_lines = array();
|
146 |
+
if ($order->getShippingAmount() > 0) {
|
147 |
+
$shipping_line = array();
|
148 |
+
$shipping_line["amount"] = intval(($order->getShippingAmount()+$order->getShippingTaxAmount()) * 100);
|
149 |
+
$shipping_line["description"] = "Shipping total amount";
|
150 |
+
$shipping_line["method"] = "custom";
|
151 |
+
$shipping_line["carrier"] = "custom";
|
152 |
+
$shipping_lines = array_merge($shipping_lines, array($shipping_line));
|
153 |
+
}
|
154 |
+
return $shipping_lines;
|
155 |
+
}
|
156 |
+
|
157 |
+
public function getDiscountLines($order) {
|
158 |
+
$discount_lines = array();
|
159 |
+
if ($order->getDiscountAmount() > 0) {
|
160 |
+
$discount_line = array();
|
161 |
+
$discount_line["description"] = $order->getDiscountDescription();
|
162 |
+
$discount_line["kind"] = $order->getCouponCode();
|
163 |
+
$discount_line["amount"] = $order->getDiscountAmount();
|
164 |
+
$discount_lines = array_merge($discount_lines, $discount_line);
|
165 |
+
}
|
166 |
+
return $discount_lines;
|
167 |
+
}
|
168 |
+
|
169 |
+
public function getTaxLines($order) {
|
170 |
+
$customer = $order->getCustomer();
|
171 |
+
$tax_lines = array();
|
172 |
+
if ($customer->getTaxvat() > 0) {
|
173 |
+
$tax_line = array();
|
174 |
+
$tax_line["description"] = $customer->getTaxClassId();
|
175 |
+
$tax_line["amount"] = $customer->getTaxvat();
|
176 |
+
$tax_lines = array_merge($tax_lines, $tax_line);
|
177 |
+
}
|
178 |
+
return $tax_lines;
|
179 |
+
}
|
180 |
+
|
181 |
+
public function getCustomerInfo($order) {
|
182 |
+
$quote = $order->getQuote();
|
183 |
+
$email = $quote->getBillingAddress()->getEmail();
|
184 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
185 |
+
$billing = $order->getBillingAddress()->getData();
|
186 |
+
$customer_info = array();
|
187 |
+
$customer_info["name"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
188 |
+
$customer_info["email"] = $email;
|
189 |
+
$customer_info["phone"] = $billing['telephone'];
|
190 |
+
return $customer_info;
|
191 |
+
}
|
192 |
}
|
app/code/community/Conekta/Card/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Card>
|
5 |
-
<version>0.
|
6 |
</Conekta_Card>
|
7 |
</modules>
|
8 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Card>
|
5 |
+
<version>0.7.0</version>
|
6 |
</Conekta_Card>
|
7 |
</modules>
|
8 |
<adminhtml>
|
app/code/community/Conekta/Card/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Card/sql/card_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.3-0.3.7.php → Card/sql/card_setup/mysql4-upgrade-0.6.0-0.7.0.php}
RENAMED
File without changes
|
app/code/community/Conekta/Oxxo/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Oxxo/Model/Observer.php
CHANGED
@@ -2,146 +2,59 @@
|
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Oxxo_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
-
if (!class_exists('Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Oxxo_Model_Oxxo')->getCode()){
|
10 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
-
Conekta::
|
12 |
-
|
|
|
|
|
13 |
$order = $event->payment->getOrder();
|
14 |
-
$
|
15 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
$
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
$i = 0;
|
30 |
-
foreach ($items as $itemId => $item){
|
31 |
-
$name = $item->getName();
|
32 |
-
$sku = $item->getSku();
|
33 |
-
$price = $item->getPrice();
|
34 |
-
$description = $item->getDescription();
|
35 |
-
$product_type = $item->getProductType();
|
36 |
-
$line_items = array_merge($line_items, array(array(
|
37 |
-
'name' => $name,
|
38 |
-
'sku' => $sku,
|
39 |
-
'unit_price' => $price,
|
40 |
-
'description' =>$description,
|
41 |
-
'quantity' => 1,
|
42 |
-
'type' => $product_type
|
43 |
-
))
|
44 |
-
);
|
45 |
-
$i = $i + 1;
|
46 |
-
}
|
47 |
-
$shipp = array();
|
48 |
-
if (empty($shipping_data) != true) {
|
49 |
-
$shipp = array(
|
50 |
-
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
51 |
-
'service' => $order->getShippingMethod(),
|
52 |
-
'carrier' => $order->getShippingDescription(),
|
53 |
-
'address' => array(
|
54 |
-
'street1' => $shipping_data['street'],
|
55 |
-
'city' => $shipping_data['city'],
|
56 |
-
'state' => $shipping_data['region'],
|
57 |
-
'country' => $shipping_data['country_id'],
|
58 |
-
'zip' => $shipping_data['postcode'],
|
59 |
-
'phone' =>$shipping_data['telephone'],
|
60 |
-
'email' =>$email
|
61 |
-
)
|
62 |
-
);
|
63 |
-
}
|
64 |
-
$shipping_amount = null;
|
65 |
-
$shipping_description = null;
|
66 |
-
$shipping_method = null;
|
67 |
-
if (empty($shipping_address) != true) {
|
68 |
-
$shipping_amount = $shipping_address->getShippingAmount();
|
69 |
-
$shipping_description = $shipping_address->getShippingDescription();
|
70 |
-
$shipping_method = $shipping_address->getShippingMethod();
|
71 |
}
|
72 |
-
|
73 |
-
|
74 |
-
try {
|
75 |
-
$charge = Conekta_Charge::create(array(
|
76 |
-
'cash'=>array(
|
77 |
-
'type'=>'oxxo',
|
78 |
-
'expires_at'=>$expiry_date
|
79 |
-
),
|
80 |
-
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
81 |
-
'amount' => intval(((float) $order->grandTotal) * 100),
|
82 |
-
'description' => 'Compra en Magento',
|
83 |
-
'reference_id' => $order->getIncrementId(),
|
84 |
-
'details' => array(
|
85 |
-
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']),
|
86 |
-
'email' => $email,
|
87 |
-
'phone' => $billing['telephone'],
|
88 |
-
'billing_address' => array(
|
89 |
-
'company_name' => $billing['company'],
|
90 |
-
'street1' => $billing['street'],
|
91 |
-
'city' =>$billing['city'],
|
92 |
-
'state' =>$billing['region'],
|
93 |
-
'country' =>$billing['country_id'],
|
94 |
-
'zip' =>$billing['postcode'],
|
95 |
-
'phone' =>$billing['telephone'],
|
96 |
-
'email' =>$email
|
97 |
-
),
|
98 |
-
'line_items' => $line_items,
|
99 |
-
'shipment' => $shipp
|
100 |
-
),
|
101 |
-
'coupon_code' => $order->getCouponCode(),
|
102 |
-
'custom_fields' => array(
|
103 |
-
'customer' => array(
|
104 |
-
'website_id' => $customer->getWebsiteId(),
|
105 |
-
'entity_id' => $customer->getEntityId(),
|
106 |
-
'entity_type_id' => $customer->getEntityTypeId(),
|
107 |
-
'attribute_set_id' => $customer->getAttributeSetId(),
|
108 |
-
'email' => $customer->getEmail(),
|
109 |
-
'group_id' => $customer->getGroupId(),
|
110 |
-
'store_id' => $customer->getStoreId(),
|
111 |
-
'created_at' => $customer->getCreatedAt(),
|
112 |
-
'updated_at' => $customer->getUpdatedAt(),
|
113 |
-
'is_active' => $customer->getIsActive(),
|
114 |
-
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
115 |
-
'get_tax_vat' => $customer->getTaxvat(),
|
116 |
-
'created_in' => $customer->getCreatedIn(),
|
117 |
-
'gender' => $customer->getGender(),
|
118 |
-
'default_billing' => $customer->getDefaultBilling(),
|
119 |
-
'default_shipping' => $customer->getDefaultShipping(),
|
120 |
-
'dob' => $customer->getDob(),
|
121 |
-
'tax_class_id' => $customer->getTaxClassId()
|
122 |
-
),
|
123 |
-
'discount_description' => $order->getDiscountDescription(),
|
124 |
-
'discount_amount' => $order->getDiscountAmount(),
|
125 |
-
'shipping_amount' => $shipping_amount,
|
126 |
-
'shipping_description' => $shipping_description,
|
127 |
-
'shipping_method' => $shipping_method
|
128 |
-
)
|
129 |
-
)
|
130 |
-
);
|
131 |
-
} catch (Conekta_Error $e){
|
132 |
-
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
133 |
-
}
|
134 |
$event->payment->setOxxoExpiryDate($expiry_date);
|
135 |
-
$event->payment->
|
136 |
-
$event->payment->setOxxoBarcode($charge->payment_method->barcode);
|
137 |
$event->payment->setChargeId($charge->id);
|
138 |
//Update Quote
|
139 |
$order = $order;
|
140 |
$quote = $order->getQuote();
|
141 |
$payment = $quote->getPayment();
|
142 |
$payment->setOxxoExpiryDate($expiry_date);
|
143 |
-
$payment->
|
144 |
-
$payment->setOxxoBarcode($charge->payment_method->barcode);
|
145 |
$payment->setChargeId($charge->id);
|
146 |
$quote->collectTotals();
|
147 |
$quote->save();
|
@@ -150,4 +63,112 @@ class Conekta_Oxxo_Model_Observer{
|
|
150 |
}
|
151 |
return $event;
|
152 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Oxxo_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta\Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Oxxo_Model_Oxxo')->getCode()){
|
10 |
+
\Conekta\Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
\Conekta\Conekta::setApiVersion("2.0.0");
|
12 |
+
\Conekta\Conekta::setPlugin("Magento 1");
|
13 |
+
\Conekta\Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
14 |
+
|
15 |
$order = $event->payment->getOrder();
|
16 |
+
$order_params = array();
|
17 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
18 |
+
$order_params["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
19 |
+
$order_params["line_items"] = self::getLineItems($order);
|
20 |
+
$order_params["shipping_lines"] = self::getShippingLines($order);
|
21 |
+
$order_params["discount_lines"] = self::getDiscountLines($order);
|
22 |
+
$order_params["tax_lines"] = self::getTaxLines($order);
|
23 |
+
$order_params["customer_info"] = self::getCustomerInfo($order);
|
24 |
+
$order_params["shipping_contact"] = self::getShippingContact($order);
|
25 |
+
$order_params["metadata"] = array("checkout_id" => $order->getIncrementId());
|
26 |
+
$charge_params = self::getCharge(intval(((float) $order->grandTotal) * 100), strtotime("+".$days." days"));
|
27 |
|
28 |
+
try {
|
29 |
+
$create_order = true;
|
30 |
+
|
31 |
+
$conekta_order_id = Mage::getSingleton('core/session')->getConektaOrderID();
|
32 |
+
if (!empty($conekta_order_id)) {
|
33 |
+
$conekta_order = \Conekta\Order::find($conekta_order_id);
|
34 |
+
$create_order = ($conekta_order->metadata->checkout_id != $order_params["metadata"]["checkout_id"]);
|
35 |
+
}
|
36 |
|
37 |
+
if ($create_order) {
|
38 |
+
$conekta_order = \Conekta\Order::create($order_params);
|
39 |
+
$conekta_order_id = Mage::getSingleton('core/session')->setConektaOrderID($conekta_order->id);
|
40 |
+
}
|
41 |
+
|
42 |
+
$conekta_order->createCharge($charge_params);
|
43 |
+
$charge = $conekta_order->charges[0];
|
44 |
+
} catch (\Conekta\ErrorList $e){
|
45 |
+
throw new Mage_Payment_Model_Info_Exception($e->details[0]->getMessage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
+
|
48 |
+
Mage::getSingleton('core/session')->unsConektaOrderID();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
$event->payment->setOxxoExpiryDate($expiry_date);
|
50 |
+
$event->payment->setOxxoBarcode($charge->payment_method->reference);
|
|
|
51 |
$event->payment->setChargeId($charge->id);
|
52 |
//Update Quote
|
53 |
$order = $order;
|
54 |
$quote = $order->getQuote();
|
55 |
$payment = $quote->getPayment();
|
56 |
$payment->setOxxoExpiryDate($expiry_date);
|
57 |
+
$payment->setOxxoBarcode($charge->payment_method->reference);
|
|
|
58 |
$payment->setChargeId($charge->id);
|
59 |
$quote->collectTotals();
|
60 |
$quote->save();
|
63 |
}
|
64 |
return $event;
|
65 |
}
|
66 |
+
|
67 |
+
public function getCharge($amount, $expiry_date) {
|
68 |
+
$charge = array(
|
69 |
+
'payment_source' => array(
|
70 |
+
'type' => 'oxxo_cash',
|
71 |
+
'expires_at' => $expiry_date
|
72 |
+
),
|
73 |
+
'amount' => $amount
|
74 |
+
);
|
75 |
+
return $charge;
|
76 |
+
}
|
77 |
+
|
78 |
+
public function getLineItems($order) {
|
79 |
+
$items = $order->getAllVisibleItems();
|
80 |
+
$line_items = array();
|
81 |
+
$i = 0;
|
82 |
+
foreach ($items as $itemId => $item){
|
83 |
+
$name = $item->getName();
|
84 |
+
$sku = $item->getSku();
|
85 |
+
$price = intval($item->getPrice() * 100) * $item->getQtyOrdered();
|
86 |
+
$description = $item->getDescription();
|
87 |
+
if (!$description) $description = $name;
|
88 |
+
$product_type = $item->getProductType();
|
89 |
+
$line_items = array_merge($line_items, array(array(
|
90 |
+
'name' => $name,
|
91 |
+
'description' => $description,
|
92 |
+
'unit_price' => $price,
|
93 |
+
'quantity' => 1,
|
94 |
+
'sku' => $sku,
|
95 |
+
'type' => "physical",
|
96 |
+
'tags' => [$product_type]
|
97 |
+
))
|
98 |
+
);
|
99 |
+
$i = $i + 1;
|
100 |
+
}
|
101 |
+
return $line_items;
|
102 |
+
}
|
103 |
+
|
104 |
+
public function getShippingContact($order) {
|
105 |
+
$shipping_contact = array();
|
106 |
+
$quote = $order->getQuote();
|
107 |
+
$email = $quote->getBillingAddress()->getEmail();
|
108 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
109 |
+
$billing = $order->getBillingAddress()->getData();
|
110 |
+
$shipping_address = $order->getShippingAddress();
|
111 |
+
$shipping_data = $shipping_address->getData();
|
112 |
+
|
113 |
+
$shipping_contact["email"] = $email;
|
114 |
+
$shipping_contact["phone"] = $billing['telephone'];
|
115 |
+
$shipping_contact["receiver"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
116 |
+
$address = array();
|
117 |
+
$address["street1"] = $shipping_data['street'];
|
118 |
+
$address["city"] = $shipping_data['city'];
|
119 |
+
$address["state"] = $shipping_data['region'];
|
120 |
+
$address["country"] = $shipping_data['country_id'];
|
121 |
+
$address["postal_code"] = $shipping_data['postcode'];
|
122 |
+
$shipping_contact["address"] = $address;
|
123 |
+
return $shipping_contact;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function getShippingLines($order) {
|
127 |
+
$shipping_lines = array();
|
128 |
+
if ($order->getShippingAmount() > 0) {
|
129 |
+
$shipping_line = array();
|
130 |
+
$shipping_line["amount"] = intval(($order->getShippingAmount()+$order->getShippingTaxAmount()) * 100);
|
131 |
+
$shipping_line["description"] = "Shipping total amount";
|
132 |
+
$shipping_line["method"] = "custom";
|
133 |
+
$shipping_line["carrier"] = "custom";
|
134 |
+
$shipping_lines = array_merge($shipping_lines, array($shipping_line));
|
135 |
+
}
|
136 |
+
return $shipping_lines;
|
137 |
+
}
|
138 |
+
|
139 |
+
public function getDiscountLines($order) {
|
140 |
+
$discount_lines = array();
|
141 |
+
if ($order->getDiscountAmount() > 0) {
|
142 |
+
$discount_line = array();
|
143 |
+
$discount_line["description"] = $order->getDiscountDescription();
|
144 |
+
$discount_line["kind"] = $order->getCouponCode();
|
145 |
+
$discount_line["amount"] = $order->getDiscountAmount();
|
146 |
+
$discount_lines = array_merge($discount_lines, $discount_line);
|
147 |
+
}
|
148 |
+
return $discount_lines;
|
149 |
+
}
|
150 |
+
|
151 |
+
public function getTaxLines($order) {
|
152 |
+
$customer = $order->getCustomer();
|
153 |
+
$tax_lines = array();
|
154 |
+
if ($customer->getTaxvat() > 0) {
|
155 |
+
$tax_line = array();
|
156 |
+
$tax_line["description"] = $customer->getTaxClassId();
|
157 |
+
$tax_line["amount"] = $customer->getTaxvat();
|
158 |
+
$tax_lines = array_merge($tax_lines, $tax_line);
|
159 |
+
}
|
160 |
+
return $tax_lines;
|
161 |
+
}
|
162 |
+
|
163 |
+
public function getCustomerInfo($order) {
|
164 |
+
$quote = $order->getQuote();
|
165 |
+
$email = $quote->getBillingAddress()->getEmail();
|
166 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
167 |
+
$billing = $order->getBillingAddress()->getData();
|
168 |
+
$customer_info = array();
|
169 |
+
$customer_info["name"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
170 |
+
$customer_info["email"] = $email;
|
171 |
+
$customer_info["phone"] = $billing['telephone'];
|
172 |
+
return $customer_info;
|
173 |
+
}
|
174 |
}
|
app/code/community/Conekta/Oxxo/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Oxxo>
|
5 |
-
<version>0.
|
6 |
</Conekta_Oxxo>
|
7 |
</modules>
|
8 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Oxxo>
|
5 |
+
<version>0.7.0</version>
|
6 |
</Conekta_Oxxo>
|
7 |
</modules>
|
8 |
<adminhtml>
|
app/code/community/Conekta/Oxxo/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Oxxo/sql/oxxo_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.7-0.3.8.php → Oxxo/sql/oxxo_setup/mysql4-upgrade-0.6.0-0.7.0.php}
RENAMED
File without changes
|
app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Date.php.back
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Conekta_Realtime_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
-
{
|
4 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
-
{
|
6 |
-
$date = new Varien_Data_Form_Element_Date;
|
7 |
-
$format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
|
8 |
-
|
9 |
-
$data = array(
|
10 |
-
'name' => $element->getName(),
|
11 |
-
'html_id' => $element->getId(),
|
12 |
-
'image' => $this->getSkinUrl('images/grid-cal.gif'),
|
13 |
-
);
|
14 |
-
$date->setData($data);
|
15 |
-
$date->setValue($element->getValue(), $format);
|
16 |
-
$date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
|
17 |
-
$date->setForm($element->getForm());
|
18 |
-
|
19 |
-
return $date->getElementHtml();
|
20 |
-
}
|
21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Block/Adminhtml/System/Config/Days.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Conekta_Realtime_Block_Adminhtml_System_Config_Days extends Mage_Adminhtml_Block_System_Config_Form_Field
|
3 |
-
{
|
4 |
-
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
5 |
-
{
|
6 |
-
$days = new Varien_Data_Form_Element_Text;
|
7 |
-
$data = array(
|
8 |
-
'name' => $element->getName(),
|
9 |
-
'html_id' => $element->getId()
|
10 |
-
);
|
11 |
-
$days->setData($data);
|
12 |
-
if (is_numeric($element->getValue())) {
|
13 |
-
$days->setValue($element->getValue());
|
14 |
-
} else {
|
15 |
-
$days->setValue(30);
|
16 |
-
}
|
17 |
-
$days->setForm($element->getForm());
|
18 |
-
$html = $days->getElementHtml();
|
19 |
-
$javaScript = "
|
20 |
-
<script type=\"text/javascript\">
|
21 |
-
Event.observe(window, 'load', function() {
|
22 |
-
days=$('{$element->getHtmlId()}').value;
|
23 |
-
if (isNaN(days)) {
|
24 |
-
$('{$element->getHtmlId()}').value = '';
|
25 |
-
}
|
26 |
-
});
|
27 |
-
Event.observe('{$element->getHtmlId()}', 'change', function(){
|
28 |
-
days=$('{$element->getHtmlId()}').value;
|
29 |
-
if (isNaN(days)) {
|
30 |
-
$('{$element->getHtmlId()}').value = '';
|
31 |
-
}
|
32 |
-
});
|
33 |
-
</script>";
|
34 |
-
$html .= $javaScript;
|
35 |
-
return $html;
|
36 |
-
}
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Block/Form/Realtime.php
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Conekta_Realtime_Block_Form_Realtime extends Mage_Payment_Block_Form
|
3 |
-
{
|
4 |
-
protected function _construct()
|
5 |
-
{
|
6 |
-
parent::_construct();
|
7 |
-
$this->setTemplate('realtime/form/realtime.phtml');
|
8 |
-
}
|
9 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Block/Info/Realtime.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Conekta_Realtime_Block_Info_Realtime extends Mage_Payment_Block_Info
|
3 |
-
{
|
4 |
-
|
5 |
-
protected function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->setTemplate('realtime/info/realtime.phtml');
|
9 |
-
}
|
10 |
-
|
11 |
-
protected function _prepareSpecificInformation($transport = null)
|
12 |
-
{
|
13 |
-
if (null !== $this->_paymentSpecificInformation) {
|
14 |
-
return $this->_paymentSpecificInformation;
|
15 |
-
}
|
16 |
-
$info = $this->getInfo();
|
17 |
-
$transport = new Varien_Object();
|
18 |
-
$transport = parent::_prepareSpecificInformation($transport);
|
19 |
-
$data = array();
|
20 |
-
$data[Mage::helper('payment')->__('Barcode Url')] = $info->getRealtimeBarcodeUrl();
|
21 |
-
//$transport->addData(array(
|
22 |
-
//Mage::helper('payment')->__('Expiry Date') => $info->getRealtimeExpiryDate(),
|
23 |
-
//Mage::helper('payment')->__('Barcode Url') => $info->getRealtimeBarcodeUrl()
|
24 |
-
//));
|
25 |
-
return $transport->setData(array_merge($data, $transport->getData()));
|
26 |
-
}
|
27 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Helper/Data.php
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Conekta_Realtime_Helper_Data extends Mage_Core_Helper_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Model/Observer.php
DELETED
@@ -1,156 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
-
class Conekta_Realtime_Model_Observer{
|
4 |
-
public function processPayment($event){
|
5 |
-
if (!class_exists('Conekta')) {
|
6 |
-
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
-
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
-
}
|
9 |
-
if($event->payment->getMethod() == Mage::getModel('Conekta_Realtime_Model_Realtime')->getCode()){
|
10 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
-
Conekta::setApiVersion("1.0.0");
|
12 |
-
Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
13 |
-
|
14 |
-
$order = $event->payment->getOrder();
|
15 |
-
$customer = $order->getCustomer();
|
16 |
-
$shipping_address = $order->getShippingAddress();
|
17 |
-
|
18 |
-
$billing = $order->getBillingAddress()->getData();
|
19 |
-
// $email = $event->payment->getOrder()->getEmail();
|
20 |
-
|
21 |
-
$quote = $event->payment->getOrder()->getQuote();
|
22 |
-
$email = $quote->getBillingAddress()->getEmail();
|
23 |
-
if (!$email) $email = $quote->getCustomerEmail();
|
24 |
-
|
25 |
-
if ($shipping_address) {
|
26 |
-
$shipping_data = $order->getShippingAddress()->getData();
|
27 |
-
}
|
28 |
-
$items = $order->getAllVisibleItems();
|
29 |
-
$line_items = array();
|
30 |
-
$i = 0;
|
31 |
-
foreach ($items as $itemId => $item){
|
32 |
-
$name = $item->getName();
|
33 |
-
$sku = $item->getSku();
|
34 |
-
$price = $item->getPrice();
|
35 |
-
$description = $item->getDescription();
|
36 |
-
$product_type = $item->getProductType();
|
37 |
-
$line_items = array_merge($line_items, array(array(
|
38 |
-
'name' => $name,
|
39 |
-
'sku' => $sku,
|
40 |
-
'unit_price' => $price,
|
41 |
-
'description' =>$description,
|
42 |
-
'quantity' => 1,
|
43 |
-
'type' => $product_type
|
44 |
-
))
|
45 |
-
);
|
46 |
-
$i = $i + 1;
|
47 |
-
}
|
48 |
-
$shipp = array();
|
49 |
-
if (empty($shipping_data) != true) {
|
50 |
-
$shipp = array(
|
51 |
-
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
52 |
-
'service' => $order->getShippingMethod(),
|
53 |
-
'carrier' => $order->getShippingDescription(),
|
54 |
-
'address' => array(
|
55 |
-
'street1' => $shipping_data['street'],
|
56 |
-
'city' => $shipping_data['city'],
|
57 |
-
'state' => $shipping_data['region'],
|
58 |
-
'country' => $shipping_data['country_id'],
|
59 |
-
'zip' => $shipping_data['postcode'],
|
60 |
-
'phone' =>$shipping_data['telephone'],
|
61 |
-
'email' =>$email
|
62 |
-
)
|
63 |
-
);
|
64 |
-
}
|
65 |
-
$shipping_amount = null;
|
66 |
-
$shipping_description = null;
|
67 |
-
$shipping_method = null;
|
68 |
-
if (empty($shipping_address) != true) {
|
69 |
-
$shipping_amount = $shipping_address->getShippingAmount();
|
70 |
-
$shipping_description = $shipping_address->getShippingDescription();
|
71 |
-
$shipping_method = $shipping_address->getShippingMethod();
|
72 |
-
}
|
73 |
-
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
74 |
-
$expiry_date=Date('Y-m-d', strtotime("+".$days." days"));
|
75 |
-
try {
|
76 |
-
$charge = Conekta_Charge::create(array(
|
77 |
-
'cash'=>array(
|
78 |
-
'type'=>'real_time',
|
79 |
-
'expires_at'=>$expiry_date
|
80 |
-
),
|
81 |
-
'currency' => Mage::app()->getStore()->getCurrentCurrencyCode(),
|
82 |
-
'amount' => intval(((float) $order->grandTotal) * 100),
|
83 |
-
'description' => 'Compra en Magento',
|
84 |
-
'reference_id' => $order->getIncrementId(),
|
85 |
-
'details' => array(
|
86 |
-
'name' => preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']),
|
87 |
-
'email' => $email,
|
88 |
-
'phone' => $billing['telephone'],
|
89 |
-
'billing_address' => array(
|
90 |
-
'company_name' => $billing['company'],
|
91 |
-
'street1' => $billing['street'],
|
92 |
-
'city' =>$billing['city'],
|
93 |
-
'state' =>$billing['region'],
|
94 |
-
'country' =>$billing['country_id'],
|
95 |
-
'zip' =>$billing['postcode'],
|
96 |
-
'phone' =>$billing['telephone'],
|
97 |
-
'email' =>$email
|
98 |
-
),
|
99 |
-
'line_items' => $line_items,
|
100 |
-
'shipment' => $shipp
|
101 |
-
),
|
102 |
-
'coupon_code' => $order->getCouponCode(),
|
103 |
-
'custom_fields' => array(
|
104 |
-
'customer' => array(
|
105 |
-
'website_id' => $customer->getWebsiteId(),
|
106 |
-
'entity_id' => $customer->getEntityId(),
|
107 |
-
'entity_type_id' => $customer->getEntityTypeId(),
|
108 |
-
'attribute_set_id' => $customer->getAttributeSetId(),
|
109 |
-
'email' => $customer->getEmail(),
|
110 |
-
'group_id' => $customer->getGroupId(),
|
111 |
-
'store_id' => $customer->getStoreId(),
|
112 |
-
'created_at' => $customer->getCreatedAt(),
|
113 |
-
'updated_at' => $customer->getUpdatedAt(),
|
114 |
-
'is_active' => $customer->getIsActive(),
|
115 |
-
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
116 |
-
'get_tax_vat' => $customer->getTaxvat(),
|
117 |
-
'created_in' => $customer->getCreatedIn(),
|
118 |
-
'gender' => $customer->getGender(),
|
119 |
-
'default_billing' => $customer->getDefaultBilling(),
|
120 |
-
'default_shipping' => $customer->getDefaultShipping(),
|
121 |
-
'dob' => $customer->getDob(),
|
122 |
-
'tax_class_id' => $customer->getTaxClassId()
|
123 |
-
),
|
124 |
-
'discount_description' => $order->getDiscountDescription(),
|
125 |
-
'discount_amount' => $order->getDiscountAmount(),
|
126 |
-
'shipping_amount' => $shipping_amount,
|
127 |
-
'shipping_description' => $shipping_description,
|
128 |
-
'shipping_method' => $shipping_method
|
129 |
-
)
|
130 |
-
)
|
131 |
-
);
|
132 |
-
} catch (Conekta_Error $e){
|
133 |
-
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
134 |
-
}
|
135 |
-
$event->payment->setRealtimeExpiryDate($expiry_date);
|
136 |
-
$event->payment->setRealtimeBarcodeUrl($charge->payment_method->barcode_url);
|
137 |
-
$event->payment->setRealtimeBarcode($charge->payment_method->barcode);
|
138 |
-
$event->payment->setRealtimeStoreName($charge->payment_method->store_name);
|
139 |
-
$event->payment->setChargeId($charge->id);
|
140 |
-
//Update Quote
|
141 |
-
$order = $order;
|
142 |
-
$quote = $order->getQuote();
|
143 |
-
$payment = $quote->getPayment();
|
144 |
-
$payment->setRealtimeExpiryDate($expiry_date);
|
145 |
-
$payment->setRealtimeBarcodeUrl($charge->payment_method->barcode_url);
|
146 |
-
$payment->setRealtimeBarcode($charge->payment_method->barcode);
|
147 |
-
$payment->setRealtimeStoreName($charge->payment_method->store_name);
|
148 |
-
$payment->setChargeId($charge->id);
|
149 |
-
$quote->collectTotals();
|
150 |
-
$quote->save();
|
151 |
-
$order->setQuote($quote);
|
152 |
-
$order->save();
|
153 |
-
}
|
154 |
-
return $event;
|
155 |
-
}
|
156 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/Model/Realtime.php
DELETED
@@ -1,23 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Conekta_Realtime_Model_Realtime extends Mage_Payment_Model_Method_Abstract
|
3 |
-
{
|
4 |
-
protected $_code = 'realtime';
|
5 |
-
protected $_formBlockType = 'realtime/form_realtime';
|
6 |
-
protected $_infoBlockType = 'realtime/info_realtime';
|
7 |
-
|
8 |
-
public function assignData($data)
|
9 |
-
{
|
10 |
-
if (!($data instanceof Varien_Object)) {
|
11 |
-
$data = new Varien_Object($data);
|
12 |
-
}
|
13 |
-
$info = $this->getInfoInstance();
|
14 |
-
$info->setRealtimeExpiryDate($data->getRealtimeExpiryDate())
|
15 |
-
->setRealtimeBarcodeUrl($data->getRealtimeBarcodeUrl())
|
16 |
-
->setRealtimeBarcode($data->getRealtimeBarcode())
|
17 |
-
->setRealtimeStoreName($data->getRealtimeStoreName())
|
18 |
-
;
|
19 |
-
return $this;
|
20 |
-
}
|
21 |
-
|
22 |
-
}
|
23 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/etc/config.xml
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<config>
|
3 |
-
<modules>
|
4 |
-
<Conekta_Realtime>
|
5 |
-
<version>0.5.9</version>
|
6 |
-
</Conekta_Realtime>
|
7 |
-
</modules>
|
8 |
-
<adminhtml>
|
9 |
-
<translate>
|
10 |
-
<modules>
|
11 |
-
<Conekta_Card>
|
12 |
-
<files>
|
13 |
-
<default>Conekta_Card.csv</default>
|
14 |
-
</files>
|
15 |
-
</Conekta_Card>
|
16 |
-
</modules>
|
17 |
-
</translate>
|
18 |
-
</adminhtml>
|
19 |
-
<frontend>
|
20 |
-
<translate>
|
21 |
-
<modules>
|
22 |
-
<Conekta_Card>
|
23 |
-
<files>
|
24 |
-
<default>Conekta_Realtime.csv</default>
|
25 |
-
</files>
|
26 |
-
</Conekta_Card>
|
27 |
-
</modules>
|
28 |
-
</translate>
|
29 |
-
<routers>
|
30 |
-
<realtime>
|
31 |
-
<use>standard</use>
|
32 |
-
<args>
|
33 |
-
<module>Conekta_Realtime</module>
|
34 |
-
<frontName>realtime</frontName>
|
35 |
-
</args>
|
36 |
-
</realtime>
|
37 |
-
</routers>
|
38 |
-
<layout>
|
39 |
-
<updates>
|
40 |
-
<realtime>
|
41 |
-
<file>realtime.xml</file>
|
42 |
-
</realtime>
|
43 |
-
</updates>
|
44 |
-
</layout>
|
45 |
-
</frontend>
|
46 |
-
<global>
|
47 |
-
<events>
|
48 |
-
<sales_order_payment_place_start>
|
49 |
-
<observers>
|
50 |
-
<realtime>
|
51 |
-
<class>realtime/observer</class>
|
52 |
-
<method>processPayment</method>
|
53 |
-
</realtime>
|
54 |
-
</observers>
|
55 |
-
</sales_order_payment_place_start>
|
56 |
-
</events>
|
57 |
-
<fieldsets>
|
58 |
-
<sales_convert_quote_payment>
|
59 |
-
<realtime_barcode_url>
|
60 |
-
<to_order_payment>*</to_order_payment>
|
61 |
-
</realtime_barcode_url>
|
62 |
-
<realtime_barcode>
|
63 |
-
<to_order_payment>*</to_order_payment>
|
64 |
-
</realtime_barcode>
|
65 |
-
<realtime_store_name>
|
66 |
-
<to_order_payment>*</to_order_payment>
|
67 |
-
</realtime_store_name>
|
68 |
-
<realtime_expiry_date>
|
69 |
-
<to_order_payment>*</to_order_payment>
|
70 |
-
</realtime_expiry_date>
|
71 |
-
<charge_id>
|
72 |
-
<to_order_payment>*</to_order_payment>
|
73 |
-
</charge_id>
|
74 |
-
</sales_convert_quote_payment>
|
75 |
-
</fieldsets>
|
76 |
-
<models>
|
77 |
-
<realtime>
|
78 |
-
<class>Conekta_Realtime_Model</class>
|
79 |
-
<resourceModel>realtime_mysql4</resourceModel>
|
80 |
-
</realtime>
|
81 |
-
<realtime_mysql4>
|
82 |
-
<class>Conekta_Realtime_Model_Mysql4</class>
|
83 |
-
<entities>
|
84 |
-
<realtime>
|
85 |
-
<table>realtime</table>
|
86 |
-
</realtime>
|
87 |
-
</entities>
|
88 |
-
</realtime_mysql4>
|
89 |
-
</models>
|
90 |
-
<resources>
|
91 |
-
<realtime_setup>
|
92 |
-
<setup>
|
93 |
-
<module>Conekta_Realtime</module>
|
94 |
-
</setup>
|
95 |
-
<connection>
|
96 |
-
<use>core_setup</use>
|
97 |
-
</connection>
|
98 |
-
</realtime_setup>
|
99 |
-
<realtime_write>
|
100 |
-
<connection>
|
101 |
-
<use>core_write</use>
|
102 |
-
</connection>
|
103 |
-
</realtime_write>
|
104 |
-
<realtime_read>
|
105 |
-
<connection>
|
106 |
-
<use>core_read</use>
|
107 |
-
</connection>
|
108 |
-
</realtime_read>
|
109 |
-
</resources>
|
110 |
-
<blocks>
|
111 |
-
<realtime>
|
112 |
-
<class>Conekta_Realtime_Block</class>
|
113 |
-
</realtime>
|
114 |
-
</blocks>
|
115 |
-
<helpers>
|
116 |
-
<realtime>
|
117 |
-
<class>Conekta_Realtime_Helper</class>
|
118 |
-
</realtime>
|
119 |
-
</helpers>
|
120 |
-
</global>
|
121 |
-
<default>
|
122 |
-
<payment>
|
123 |
-
<realtime>
|
124 |
-
<active>1</active>
|
125 |
-
<model>realtime/realtime</model>
|
126 |
-
<order_status>pending</order_status>
|
127 |
-
<webhook_notification_order_status>processing</webhook_notification_order_status>
|
128 |
-
<expiry_date></expiry_date>
|
129 |
-
<title>Realtime Payment Method</title>
|
130 |
-
<sort_order>0</sort_order>
|
131 |
-
</realtime>
|
132 |
-
</payment>
|
133 |
-
</default>
|
134 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/etc/system.xml
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<config>
|
3 |
-
<sections>
|
4 |
-
<payment>
|
5 |
-
<groups>
|
6 |
-
<realtime translate="label" module="realtime">
|
7 |
-
<label>Conekta Realtime Payment Module</label>
|
8 |
-
<frontend_type>text</frontend_type>
|
9 |
-
<sort_order>4</sort_order>
|
10 |
-
<show_in_default>1</show_in_default>
|
11 |
-
<show_in_website>1</show_in_website>
|
12 |
-
<show_in_store>1</show_in_store>
|
13 |
-
<fields>
|
14 |
-
<sort_order translate="label">
|
15 |
-
<label>Sort Order</label>
|
16 |
-
<frontend_type>text</frontend_type>
|
17 |
-
<sort_order>0</sort_order>
|
18 |
-
<show_in_default>1</show_in_default>
|
19 |
-
<show_in_website>1</show_in_website>
|
20 |
-
<show_in_store>1</show_in_store>
|
21 |
-
<frontend_class>validate-number</frontend_class>
|
22 |
-
</sort_order>
|
23 |
-
<active translate="label">
|
24 |
-
<label>Enabled</label>
|
25 |
-
<frontend_type>select</frontend_type>
|
26 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
27 |
-
<sort_order>1</sort_order>
|
28 |
-
<show_in_default>1</show_in_default>
|
29 |
-
<show_in_website>1</show_in_website>
|
30 |
-
<show_in_store>0</show_in_store>
|
31 |
-
</active>
|
32 |
-
<order_status translate="label">
|
33 |
-
<label>New order status</label>
|
34 |
-
<frontend_type>select</frontend_type>
|
35 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
36 |
-
<sort_order>2</sort_order>
|
37 |
-
<show_in_default>1</show_in_default>
|
38 |
-
<show_in_website>1</show_in_website>
|
39 |
-
<show_in_store>0</show_in_store>
|
40 |
-
</order_status>
|
41 |
-
<webhook_notification_order_status translate="label">
|
42 |
-
<label>Order status when Conekta sends payment notification</label>
|
43 |
-
<frontend_type>select</frontend_type>
|
44 |
-
<source_model>adminhtml/system_config_source_order_status</source_model>
|
45 |
-
<sort_order>3</sort_order>
|
46 |
-
<show_in_default>1</show_in_default>
|
47 |
-
<show_in_website>1</show_in_website>
|
48 |
-
<show_in_store>0</show_in_store>
|
49 |
-
</webhook_notification_order_status>
|
50 |
-
<my_date translate="label comment">
|
51 |
-
<label>Expiry (# days)</label>
|
52 |
-
<frontend_type>text</frontend_type> <!-- Set the frontend type as Text -->
|
53 |
-
<frontend_model>realtime/adminhtml_system_config_days</frontend_model> <!-- Specify our custom model -->
|
54 |
-
<sort_order>4</sort_order>
|
55 |
-
<show_in_default>1</show_in_default>
|
56 |
-
<show_in_website>1</show_in_website>
|
57 |
-
<show_in_store>1</show_in_store>
|
58 |
-
<comment>Set the expiry of this offline payment</comment>
|
59 |
-
</my_date>
|
60 |
-
<title translate="label">
|
61 |
-
<label>Title</label>
|
62 |
-
<frontend_type>text</frontend_type>
|
63 |
-
<sort_order>5</sort_order>
|
64 |
-
<show_in_default>1</show_in_default>
|
65 |
-
<show_in_website>1</show_in_website>
|
66 |
-
<show_in_store>0</show_in_store>
|
67 |
-
</title>
|
68 |
-
</fields>
|
69 |
-
</realtime>
|
70 |
-
</groups>
|
71 |
-
</payment>
|
72 |
-
</sections>
|
73 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-install-0.1.0.php
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
|
5 |
-
$installer->startSetup();
|
6 |
-
|
7 |
-
$connection = $installer->getConnection();
|
8 |
-
|
9 |
-
$connection->addColumn($installer->getTable('sales/quote_payment'), 'charge_id', array(
|
10 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
11 |
-
'length' => '255',
|
12 |
-
'comment' => 'Charge Id'
|
13 |
-
));
|
14 |
-
$connection->addColumn($installer->getTable('sales/order_payment'), 'charge_id', array(
|
15 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
16 |
-
'length' => '255',
|
17 |
-
'comment' => 'Card Id'
|
18 |
-
));
|
19 |
-
|
20 |
-
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_expiry_date', array(
|
21 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
22 |
-
'comment' => 'Realtime Expiry Date'
|
23 |
-
));
|
24 |
-
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_expiry_date', array(
|
25 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP,
|
26 |
-
'comment' => 'Realtime Expiry Date'
|
27 |
-
));
|
28 |
-
|
29 |
-
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_barcode_url', array(
|
30 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
31 |
-
'length' => '255',
|
32 |
-
'comment' => 'Realtime Barcode URL'
|
33 |
-
));
|
34 |
-
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_barcode_url', array(
|
35 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
36 |
-
'length' => '255',
|
37 |
-
'comment' => 'Realtime Barcode URL'
|
38 |
-
));
|
39 |
-
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_barcode', array(
|
40 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
41 |
-
'length' => '255',
|
42 |
-
'comment' => 'Realtime Reference'
|
43 |
-
));
|
44 |
-
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_barcode', array(
|
45 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
46 |
-
'length' => '255',
|
47 |
-
'comment' => 'Realtime Reference'
|
48 |
-
));
|
49 |
-
|
50 |
-
$connection->addColumn($installer->getTable('sales/quote_payment'), 'realtime_store_name', array(
|
51 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
52 |
-
'length' => '255',
|
53 |
-
'comment' => 'Realtime Store Name'
|
54 |
-
));
|
55 |
-
$connection->addColumn($installer->getTable('sales/order_payment'), 'realtime_store_name', array(
|
56 |
-
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
|
57 |
-
'length' => '255',
|
58 |
-
'comment' => 'Realtime Store Name'
|
59 |
-
));
|
60 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.3.9-0.4.0.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.0-0.4.1.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.1-0.4.2.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.2-0.4.3.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.3-0.4.4.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.4-0.4.5.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.5-0.4.6.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.6-0.4.7.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.7-0.4.8.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.8-0.4.9.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.4.9-0.5.0.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.0-0.5.1.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.1-0.5.2.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.2-0.5.3.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.3-0.5.4.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.4-0.5.5.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.5-0.5.6.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.6-0.5.7.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.7-0.5.8.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Realtime/sql/realtime_setup/mysql4-upgrade-0.5.8-0.5.9.php
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$installer = $this;
|
3 |
-
/* @var $installer Mage_Customer_Model_Entity_Setup */
|
4 |
-
$installer->startSetup();
|
5 |
-
$installer->endSetup();
|
|
|
|
|
|
|
|
|
|
app/code/community/Conekta/Spei/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Spei/Model/Observer.php
CHANGED
@@ -2,142 +2,59 @@
|
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Spei_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
-
if (!class_exists('Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Spei_Model_Spei')->getCode()){
|
10 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
-
Conekta::setApiVersion("
|
12 |
-
Conekta::
|
13 |
-
|
|
|
14 |
$order = $event->payment->getOrder();
|
15 |
-
$
|
16 |
-
$
|
17 |
-
|
18 |
-
$
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
$quote = $event->payment->getOrder()->getQuote();
|
22 |
-
$email = $quote->getBillingAddress()->getEmail();
|
23 |
-
if (!$email) $email = $quote->getCustomerEmail();
|
24 |
|
25 |
-
if ($shipping_address) {
|
26 |
-
$shipping_data = $shipping_address->getData();
|
27 |
-
}
|
28 |
-
$items = $order->getAllVisibleItems();
|
29 |
-
$line_items = array();
|
30 |
-
$i = 0;
|
31 |
-
foreach ($items as $itemId => $item){
|
32 |
-
$name = $item->getName();
|
33 |
-
$sku = $item->getSku();
|
34 |
-
$price = $item->getPrice();
|
35 |
-
$description = $item->getDescription();
|
36 |
-
$product_type = $item->getProductType();
|
37 |
-
$line_items = array_merge($line_items, array(array(
|
38 |
-
'name' => $name,
|
39 |
-
'sku' => $sku,
|
40 |
-
'unit_price' => $price,
|
41 |
-
'description' =>$description,
|
42 |
-
'quantity' => 1,
|
43 |
-
'type' => $product_type
|
44 |
-
))
|
45 |
-
);
|
46 |
-
$i = $i + 1;
|
47 |
-
}
|
48 |
-
$shipp = array();
|
49 |
-
if (empty($shipping_data) != true) {
|
50 |
-
$shipp = array(
|
51 |
-
'price' => intval(((float) $order->getShippingAmount()) * 100),
|
52 |
-
'service' => $order->getShippingMethod(),
|
53 |
-
'carrier' => $order->getShippingDescription(),
|
54 |
-
'address' => array(
|
55 |
-
'street1' => $shipping_data['street'],
|
56 |
-
'city' => $shipping_data['city'],
|
57 |
-
'state' => $shipping_data['region'],
|
58 |
-
'country' => $shipping_data['country_id'],
|
59 |
-
'zip' => $shipping_data['postcode'],
|
60 |
-
'phone' =>$shipping_data['telephone'],
|
61 |
-
'email' =>$email
|
62 |
-
)
|
63 |
-
);
|
64 |
-
}
|
65 |
-
$shipping_amount = null;
|
66 |
-
$shipping_description = null;
|
67 |
-
$shipping_method = null;
|
68 |
-
if (empty($shipping_address) != true) {
|
69 |
-
$shipping_amount = $shipping_address->getShippingAmount();
|
70 |
-
$shipping_description = $shipping_address->getShippingDescription();
|
71 |
-
$shipping_method = $shipping_address->getShippingMethod();
|
72 |
-
}
|
73 |
-
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
74 |
try {
|
75 |
-
$
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
),
|
97 |
-
'line_items' => $line_items,
|
98 |
-
'shipment' => $shipp
|
99 |
-
),
|
100 |
-
'coupon_code' => $order->getCouponCode(),
|
101 |
-
'custom_fields' => array(
|
102 |
-
'customer' => array(
|
103 |
-
'website_id' => $customer->getWebsiteId(),
|
104 |
-
'entity_id' => $customer->getEntityId(),
|
105 |
-
'entity_type_id' => $customer->getEntityTypeId(),
|
106 |
-
'attribute_set_id' => $customer->getAttributeSetId(),
|
107 |
-
'email' => $customer->getEmail(),
|
108 |
-
'group_id' => $customer->getGroupId(),
|
109 |
-
'store_id' => $customer->getStoreId(),
|
110 |
-
'created_at' => $customer->getCreatedAt(),
|
111 |
-
'updated_at' => $customer->getUpdatedAt(),
|
112 |
-
'is_active' => $customer->getIsActive(),
|
113 |
-
'disable_auto_group_change' => $customer->getDisableAutoGroupChange(),
|
114 |
-
'get_tax_vat' => $customer->getTaxvat(),
|
115 |
-
'created_in' => $customer->getCreatedIn(),
|
116 |
-
'gender' => $customer->getGender(),
|
117 |
-
'default_billing' => $customer->getDefaultBilling(),
|
118 |
-
'default_shipping' => $customer->getDefaultShipping(),
|
119 |
-
'dob' => $customer->getDob(),
|
120 |
-
'tax_class_id' => $customer->getTaxClassId()
|
121 |
-
),
|
122 |
-
'discount_description' => $order->getDiscountDescription(),
|
123 |
-
'discount_amount' => $order->getDiscountAmount(),
|
124 |
-
'shipping_amount' => $shipping_amount,
|
125 |
-
'shipping_description' => $shipping_description,
|
126 |
-
'shipping_method' => $shipping_method
|
127 |
-
)
|
128 |
-
)
|
129 |
-
);
|
130 |
-
} catch (Conekta_Error $e){
|
131 |
-
throw new Mage_Payment_Model_Info_Exception($e->message_to_purchaser);
|
132 |
-
}
|
133 |
-
$event->payment->setSpeiClabe($charge->payment_method->clabe);
|
134 |
$event->payment->setSpeiBank($charge->payment_method->bank);
|
135 |
$event->payment->setChargeId($charge->id);
|
136 |
//Update Quote
|
137 |
$order = $order;
|
138 |
$quote = $order->getQuote();
|
139 |
$payment = $quote->getPayment();
|
140 |
-
$payment->setSpeiClabe($charge->payment_method->
|
141 |
$payment->setSpeiBank($charge->payment_method->bank);
|
142 |
$payment->setChargeId($charge->id);
|
143 |
$quote->collectTotals();
|
@@ -147,4 +64,112 @@ class Conekta_Spei_Model_Observer{
|
|
147 |
}
|
148 |
return $event;
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
2 |
include_once(Mage::getBaseDir('lib') . DS . 'Conekta' . DS . 'lib' . DS . 'Conekta.php');
|
3 |
class Conekta_Spei_Model_Observer{
|
4 |
public function processPayment($event){
|
5 |
+
if (!class_exists('Conekta\Conekta')) {
|
6 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
7 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
8 |
}
|
9 |
if($event->payment->getMethod() == Mage::getModel('Conekta_Spei_Model_Spei')->getCode()){
|
10 |
+
\Conekta\Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
11 |
+
\Conekta\Conekta::setApiVersion("2.0.0");
|
12 |
+
\Conekta\Conekta::setPlugin("Magento 1");
|
13 |
+
\Conekta\Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
14 |
+
|
15 |
$order = $event->payment->getOrder();
|
16 |
+
$order_params = array();
|
17 |
+
$days = $event->payment->getMethodInstance()->getConfigData('my_date');
|
18 |
+
$order_params["currency"] = Mage::app()->getStore()->getCurrentCurrencyCode();
|
19 |
+
$order_params["line_items"] = self::getLineItems($order);
|
20 |
+
$order_params["shipping_lines"] = self::getShippingLines($order);
|
21 |
+
$order_params["discount_lines"] = self::getDiscountLines($order);
|
22 |
+
$order_params["tax_lines"] = self::getTaxLines($order);
|
23 |
+
$order_params["customer_info"] = self::getCustomerInfo($order);
|
24 |
+
$order_params["shipping_contact"] = self::getShippingContact($order);
|
25 |
+
$order_params["metadata"] = array("checkout_id" => $order->getIncrementId());
|
26 |
+
$charge_params = self::getCharge(intval(((float) $order->grandTotal) * 100), strtotime("+".$days." days"));
|
27 |
|
|
|
|
|
|
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
try {
|
30 |
+
$create_order = true;
|
31 |
+
|
32 |
+
$conekta_order_id = Mage::getSingleton('core/session')->getConektaOrderID();
|
33 |
+
if (!empty($conekta_order_id)) {
|
34 |
+
$conekta_order = \Conekta\Order::find($conekta_order_id);
|
35 |
+
$create_order = ($conekta_order->metadata->checkout_id != $order_params["metadata"]["checkout_id"]);
|
36 |
+
}
|
37 |
+
|
38 |
+
if ($create_order) {
|
39 |
+
$conekta_order = \Conekta\Order::create($order_params);
|
40 |
+
$conekta_order_id = Mage::getSingleton('core/session')->setConektaOrderID($conekta_order->id);
|
41 |
+
}
|
42 |
+
|
43 |
+
$conekta_order->createCharge($charge_params);
|
44 |
+
$charge = $conekta_order->charges[0];
|
45 |
+
} catch (\Conekta\ErrorList $e){
|
46 |
+
throw new Mage_Payment_Model_Info_Exception($e->details[0]->getMessage());
|
47 |
+
}
|
48 |
+
|
49 |
+
Mage::getSingleton('core/session')->unsConektaOrderID();
|
50 |
+
$event->payment->setSpeiClabe($charge->payment_method->reference);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
$event->payment->setSpeiBank($charge->payment_method->bank);
|
52 |
$event->payment->setChargeId($charge->id);
|
53 |
//Update Quote
|
54 |
$order = $order;
|
55 |
$quote = $order->getQuote();
|
56 |
$payment = $quote->getPayment();
|
57 |
+
$payment->setSpeiClabe($charge->payment_method->reference);
|
58 |
$payment->setSpeiBank($charge->payment_method->bank);
|
59 |
$payment->setChargeId($charge->id);
|
60 |
$quote->collectTotals();
|
64 |
}
|
65 |
return $event;
|
66 |
}
|
67 |
+
|
68 |
+
public function getCharge($amount, $expiry_date) {
|
69 |
+
$charge = array(
|
70 |
+
'payment_source' => array(
|
71 |
+
'type' => 'spei',
|
72 |
+
'expires_at' => $expiry_date
|
73 |
+
),
|
74 |
+
'amount' => $amount
|
75 |
+
);
|
76 |
+
return $charge;
|
77 |
+
}
|
78 |
+
|
79 |
+
public function getLineItems($order) {
|
80 |
+
$items = $order->getAllVisibleItems();
|
81 |
+
$line_items = array();
|
82 |
+
$i = 0;
|
83 |
+
foreach ($items as $itemId => $item){
|
84 |
+
$name = $item->getName();
|
85 |
+
$sku = $item->getSku();
|
86 |
+
$price = intval($item->getPrice() * 100) * $item->getQtyOrdered();
|
87 |
+
$description = $item->getDescription();
|
88 |
+
if (!$description) $description = $name;
|
89 |
+
$product_type = $item->getProductType();
|
90 |
+
$line_items = array_merge($line_items, array(array(
|
91 |
+
'name' => $name,
|
92 |
+
'description' => $description,
|
93 |
+
'unit_price' => $price,
|
94 |
+
'quantity' => 1,
|
95 |
+
'sku' => $sku,
|
96 |
+
'type' => "physical",
|
97 |
+
'tags' => [$product_type]
|
98 |
+
))
|
99 |
+
);
|
100 |
+
$i = $i + 1;
|
101 |
+
}
|
102 |
+
return $line_items;
|
103 |
+
}
|
104 |
+
|
105 |
+
public function getShippingContact($order) {
|
106 |
+
$shipping_contact = array();
|
107 |
+
$quote = $order->getQuote();
|
108 |
+
$email = $quote->getBillingAddress()->getEmail();
|
109 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
110 |
+
$billing = $order->getBillingAddress()->getData();
|
111 |
+
$shipping_address = $order->getShippingAddress();
|
112 |
+
$shipping_data = $shipping_address->getData();
|
113 |
+
|
114 |
+
$shipping_contact["email"] = $email;
|
115 |
+
$shipping_contact["phone"] = $billing['telephone'];
|
116 |
+
$shipping_contact["receiver"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
117 |
+
$address = array();
|
118 |
+
$address["street1"] = $shipping_data['street'];
|
119 |
+
$address["city"] = $shipping_data['city'];
|
120 |
+
$address["state"] = $shipping_data['region'];
|
121 |
+
$address["country"] = $shipping_data['country_id'];
|
122 |
+
$address["postal_code"] = $shipping_data['postcode'];
|
123 |
+
$shipping_contact["address"] = $address;
|
124 |
+
return $shipping_contact;
|
125 |
+
}
|
126 |
+
|
127 |
+
public function getShippingLines($order) {
|
128 |
+
$shipping_lines = array();
|
129 |
+
if ($order->getShippingAmount() > 0) {
|
130 |
+
$shipping_line = array();
|
131 |
+
$shipping_line["amount"] = intval(($order->getShippingAmount()+$order->getShippingTaxAmount()) * 100);
|
132 |
+
$shipping_line["description"] = "Shipping total amount";
|
133 |
+
$shipping_line["method"] = "custom";
|
134 |
+
$shipping_line["carrier"] = "custom";
|
135 |
+
$shipping_lines = array_merge($shipping_lines, array($shipping_line));
|
136 |
+
}
|
137 |
+
return $shipping_lines;
|
138 |
+
}
|
139 |
+
|
140 |
+
public function getDiscountLines($order) {
|
141 |
+
$discount_lines = array();
|
142 |
+
if ($order->getDiscountAmount() > 0) {
|
143 |
+
$discount_line = array();
|
144 |
+
$discount_line["description"] = $order->getDiscountDescription();
|
145 |
+
$discount_line["kind"] = $order->getCouponCode();
|
146 |
+
$discount_line["amount"] = $order->getDiscountAmount();
|
147 |
+
$discount_lines = array_merge($discount_lines, $discount_line);
|
148 |
+
}
|
149 |
+
return $discount_lines;
|
150 |
+
}
|
151 |
+
|
152 |
+
public function getTaxLines($order) {
|
153 |
+
$customer = $order->getCustomer();
|
154 |
+
$tax_lines = array();
|
155 |
+
if ($customer->getTaxvat() > 0) {
|
156 |
+
$tax_line = array();
|
157 |
+
$tax_line["description"] = $customer->getTaxClassId();
|
158 |
+
$tax_line["amount"] = $customer->getTaxvat();
|
159 |
+
$tax_lines = array_merge($tax_lines, $tax_line);
|
160 |
+
}
|
161 |
+
return $tax_lines;
|
162 |
+
}
|
163 |
+
|
164 |
+
public function getCustomerInfo($order) {
|
165 |
+
$quote = $order->getQuote();
|
166 |
+
$email = $quote->getBillingAddress()->getEmail();
|
167 |
+
if (!$email) $email = $quote->getCustomerEmail();
|
168 |
+
$billing = $order->getBillingAddress()->getData();
|
169 |
+
$customer_info = array();
|
170 |
+
$customer_info["name"] = preg_replace('!\s+!', ' ', $billing['firstname'] . ' ' . $billing['middlename'] . ' ' . $billing['lastname']);
|
171 |
+
$customer_info["email"] = $email;
|
172 |
+
$customer_info["phone"] = $billing['telephone'];
|
173 |
+
return $customer_info;
|
174 |
+
}
|
175 |
}
|
app/code/community/Conekta/Spei/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Spei>
|
5 |
-
<version>0.
|
6 |
</Conekta_Spei>
|
7 |
</modules>
|
8 |
<adminhtml>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Spei>
|
5 |
+
<version>0.7.0</version>
|
6 |
</Conekta_Spei>
|
7 |
</modules>
|
8 |
<adminhtml>
|
app/code/community/Conekta/Spei/sql/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Spei/sql/spei_setup/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/{Realtime/sql/realtime_setup/mysql4-upgrade-0.3.8-0.3.9.php → Spei/sql/spei_setup/mysql4-upgrade-0.6.0-0.7.0.php}
RENAMED
File without changes
|
app/code/community/Conekta/Webhook/.DS_Store
ADDED
Binary file
|
app/code/community/Conekta/Webhook/Block/Adminhtml/Sales/Order/View/Tab/Info.php
CHANGED
@@ -13,6 +13,8 @@ class Conekta_Webhook_Block_Adminhtml_Sales_Order_View_Tab_Info extends Mage_Adm
|
|
13 |
"<p>". $this->__("Order amount %s", $grandTotal) ."</p>" .
|
14 |
"<p>". $this->__("Conekta Id %s", $charge_id) ."</p>";
|
15 |
return $html;
|
|
|
|
|
16 |
}
|
17 |
}
|
18 |
}
|
13 |
"<p>". $this->__("Order amount %s", $grandTotal) ."</p>" .
|
14 |
"<p>". $this->__("Conekta Id %s", $charge_id) ."</p>";
|
15 |
return $html;
|
16 |
+
} else {
|
17 |
+
return parent::getPaymentHtml();
|
18 |
}
|
19 |
}
|
20 |
}
|
app/code/community/Conekta/Webhook/Block/Adminhtml/System/Config/Url.php
CHANGED
@@ -4,13 +4,14 @@ class Conekta_Webhook_Block_Adminhtml_System_Config_Url extends Mage_Adminhtml_B
|
|
4 |
{
|
5 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
6 |
{
|
7 |
-
if (!class_exists('Conekta')) {
|
8 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
9 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
10 |
}
|
11 |
-
Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
12 |
-
Conekta::setApiVersion("
|
13 |
-
Conekta::
|
|
|
14 |
|
15 |
$url = new Varien_Data_Form_Element_Text;
|
16 |
$data = array(
|
@@ -35,7 +36,7 @@ class Conekta_Webhook_Block_Adminhtml_System_Config_Url extends Mage_Adminhtml_B
|
|
35 |
if (!empty(Mage::getStoreConfig('payment/webhook/privatekey'))) {
|
36 |
try {
|
37 |
$different = true;
|
38 |
-
$webhooks =
|
39 |
$urls = array();
|
40 |
|
41 |
foreach ($webhooks as $webhook) {
|
@@ -43,11 +44,11 @@ class Conekta_Webhook_Block_Adminhtml_System_Config_Url extends Mage_Adminhtml_B
|
|
43 |
}
|
44 |
|
45 |
if (!in_array($url_string, $urls)){
|
46 |
-
$webhook =
|
47 |
}
|
48 |
-
} catch(
|
49 |
$error = true;
|
50 |
-
$error_message = $e->
|
51 |
}
|
52 |
}
|
53 |
|
4 |
{
|
5 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
6 |
{
|
7 |
+
if (!class_exists('Conekta\Conekta')) {
|
8 |
error_log("Plugin miss Conekta PHP lib dependency. Clone the repository using 'git clone --recursive git@github.com:conekta/conekta-magento.git'", 0);
|
9 |
throw new Mage_Payment_Model_Info_Exception("Payment module unavailable. Please contact system administrator.");
|
10 |
}
|
11 |
+
\Conekta\Conekta::setApiKey(Mage::getStoreConfig('payment/webhook/privatekey'));
|
12 |
+
\Conekta\Conekta::setApiVersion("2.0.0");
|
13 |
+
\Conekta\Conekta::setPlugin("Magento 1");
|
14 |
+
\Conekta\Conekta::setLocale(Mage::app()->getLocale()->getLocaleCode());
|
15 |
|
16 |
$url = new Varien_Data_Form_Element_Text;
|
17 |
$data = array(
|
36 |
if (!empty(Mage::getStoreConfig('payment/webhook/privatekey'))) {
|
37 |
try {
|
38 |
$different = true;
|
39 |
+
$webhooks = \Conekta\Webhook::where();
|
40 |
$urls = array();
|
41 |
|
42 |
foreach ($webhooks as $webhook) {
|
44 |
}
|
45 |
|
46 |
if (!in_array($url_string, $urls)){
|
47 |
+
$webhook = \Conekta\Webhook::create(array_merge(array("url"=>$url_string), $events));
|
48 |
}
|
49 |
+
} catch (\Conekta\ErrorList $e){
|
50 |
$error = true;
|
51 |
+
$error_message = $e->details[0]->message;
|
52 |
}
|
53 |
}
|
54 |
|
app/code/community/Conekta/Webhook/controllers/AjaxController.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
class Conekta_Webhook_AjaxController extends Mage_Core_Controller_Front_Action {
|
3 |
public function listenerAction() {
|
4 |
$body = @file_get_contents('php://input');
|
|
|
5 |
$event = json_decode($body);
|
6 |
$charge = $event->data->object;
|
7 |
$line_items = $charge->details->line_items;
|
@@ -52,5 +53,23 @@ class Conekta_Webhook_AjaxController extends Mage_Core_Controller_Front_Action {
|
|
52 |
}
|
53 |
}
|
54 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
56 |
?>
|
2 |
class Conekta_Webhook_AjaxController extends Mage_Core_Controller_Front_Action {
|
3 |
public function listenerAction() {
|
4 |
$body = @file_get_contents('php://input');
|
5 |
+
self::authenticateEvent($body, $_SERVER['HTTP_DIGEST']);
|
6 |
$event = json_decode($body);
|
7 |
$charge = $event->data->object;
|
8 |
$line_items = $charge->details->line_items;
|
53 |
}
|
54 |
}
|
55 |
}
|
56 |
+
|
57 |
+
public function authenticateEvent($body, $digest) {
|
58 |
+
$private_key_string = Mage::getStoreConfig('payment/webhook/signature_key');
|
59 |
+
if (!empty($private_key_string) && !empty($body)) {
|
60 |
+
if (!empty($digest)) {
|
61 |
+
$private_key = openssl_pkey_get_private($private_key_string);
|
62 |
+
$encrypted_message = base64_decode($digest);
|
63 |
+
$sha256_message = "";
|
64 |
+
$bool = openssl_private_decrypt($encrypted_message, $sha256_message, $private_key);
|
65 |
+
if (hash("sha256", $body) != $sha256_message) {
|
66 |
+
throw new Exception("Event not authenticated");
|
67 |
+
}
|
68 |
+
} else {
|
69 |
+
// this should not happen!
|
70 |
+
throw new Exception("Empty digest!!");
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
}
|
75 |
?>
|
app/code/community/Conekta/Webhook/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Webhook>
|
5 |
-
<version>0.
|
6 |
</Conekta_Webhook>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Conekta_Webhook>
|
5 |
+
<version>0.7.0</version>
|
6 |
</Conekta_Webhook>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/Conekta/Webhook/etc/system.xml
CHANGED
@@ -36,6 +36,14 @@
|
|
36 |
<show_in_website>1</show_in_website>
|
37 |
<show_in_store>1</show_in_store>
|
38 |
</publickey>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
</fields>
|
40 |
</webhook>
|
41 |
</groups>
|
36 |
<show_in_website>1</show_in_website>
|
37 |
<show_in_store>1</show_in_store>
|
38 |
</publickey>
|
39 |
+
<signature_key translate="label">
|
40 |
+
<label>Signature Key</label>
|
41 |
+
<frontend_type>textarea</frontend_type>
|
42 |
+
<sort_order>8</sort_order>
|
43 |
+
<show_in_default>1</show_in_default>
|
44 |
+
<show_in_website>1</show_in_website>
|
45 |
+
<show_in_store>1</show_in_store>
|
46 |
+
</signature_key>
|
47 |
</fields>
|
48 |
</webhook>
|
49 |
</groups>
|
app/design/frontend/base/default/template/card/form/card.phtml
CHANGED
@@ -98,9 +98,6 @@
|
|
98 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
101 |
-
<option value="2014">2014</option>
|
102 |
-
<option value="2015">2015</option>
|
103 |
-
<option value="2016">2016</option>
|
104 |
<option value="2017">2017</option>
|
105 |
<option value="2018">2018</option>
|
106 |
<option value="2019">2019</option>
|
@@ -110,6 +107,12 @@
|
|
110 |
<option value="2023">2023</option>
|
111 |
<option value="2024">2024</option>
|
112 |
<option value="2025">2025</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
</select>
|
114 |
</div>
|
115 |
</div>
|
98 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
|
|
|
|
|
|
101 |
<option value="2017">2017</option>
|
102 |
<option value="2018">2018</option>
|
103 |
<option value="2019">2019</option>
|
107 |
<option value="2023">2023</option>
|
108 |
<option value="2024">2024</option>
|
109 |
<option value="2025">2025</option>
|
110 |
+
<option value="2026">2026</option>
|
111 |
+
<option value="2027">2027</option>
|
112 |
+
<option value="2028">2028</option>
|
113 |
+
<option value="2029">2029</option>
|
114 |
+
<option value="2030">2030</option>
|
115 |
+
<option value="2031">2031</option>
|
116 |
</select>
|
117 |
</div>
|
118 |
</div>
|
app/design/frontend/base/default/template/oxxo/info/oxxo.phtml
CHANGED
@@ -30,7 +30,6 @@
|
|
30 |
<?php endif;?>
|
31 |
|
32 |
<?php
|
33 |
-
$barcode = $this->getInfo()->getOxxoBarcodeUrl();
|
34 |
$reference = $this->getInfo()->getOxxoBarcode();
|
35 |
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
36 |
?>
|
@@ -41,8 +40,7 @@ $expiry = $this->getInfo()->getOxxoExpiryDate();
|
|
41 |
<table class="info-table">
|
42 |
<tbody>
|
43 |
<tr>
|
44 |
-
<?php if (empty($
|
45 |
-
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
46 |
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
47 |
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
48 |
<?php } else { ?>
|
30 |
<?php endif;?>
|
31 |
|
32 |
<?php
|
|
|
33 |
$reference = $this->getInfo()->getOxxoBarcode();
|
34 |
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
35 |
?>
|
40 |
<table class="info-table">
|
41 |
<tbody>
|
42 |
<tr>
|
43 |
+
<?php if (empty($reference) != true) {?>
|
|
|
44 |
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
45 |
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
46 |
<?php } else { ?>
|
app/design/frontend/default/default/template/card/form/card.phtml
CHANGED
@@ -98,9 +98,6 @@
|
|
98 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
101 |
-
<option value="2014">2014</option>
|
102 |
-
<option value="2015">2015</option>
|
103 |
-
<option value="2016">2016</option>
|
104 |
<option value="2017">2017</option>
|
105 |
<option value="2018">2018</option>
|
106 |
<option value="2019">2019</option>
|
@@ -110,6 +107,12 @@
|
|
110 |
<option value="2023">2023</option>
|
111 |
<option value="2024">2024</option>
|
112 |
<option value="2025">2025</option>
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
</select>
|
114 |
</div>
|
115 |
</div>
|
98 |
<?php $_ccExpYear = $this->getInfoData('cc_exp_year') ?>
|
99 |
<select id="<?php echo $_code ?>_expiration_yr" data-conekta="card[exp_year]" class="year required-entry">
|
100 |
<option selected="selected" value=""><?php echo $this->__('Year') ?></option>
|
|
|
|
|
|
|
101 |
<option value="2017">2017</option>
|
102 |
<option value="2018">2018</option>
|
103 |
<option value="2019">2019</option>
|
107 |
<option value="2023">2023</option>
|
108 |
<option value="2024">2024</option>
|
109 |
<option value="2025">2025</option>
|
110 |
+
<option value="2026">2026</option>
|
111 |
+
<option value="2027">2027</option>
|
112 |
+
<option value="2028">2028</option>
|
113 |
+
<option value="2029">2029</option>
|
114 |
+
<option value="2030">2030</option>
|
115 |
+
<option value="2031">2031</option>
|
116 |
</select>
|
117 |
</div>
|
118 |
</div>
|
app/design/frontend/default/default/template/checkout/success.phtml
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Magento
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
-
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://opensource.org/licenses/afl-3.0.php
|
11 |
-
* If you did not receive a copy of the license and are unable to
|
12 |
-
* obtain it through the world-wide-web, please send an email
|
13 |
-
* to license@magento.com so we can send you a copy immediately.
|
14 |
-
*
|
15 |
-
* DISCLAIMER
|
16 |
-
*
|
17 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
-
* versions in the future. If you wish to customize Magento for your
|
19 |
-
* needs please refer to http://www.magento.com for more information.
|
20 |
-
*
|
21 |
-
* @category design
|
22 |
-
* @package base_default
|
23 |
-
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
|
24 |
-
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
-
*/
|
26 |
-
?>
|
27 |
-
<?php
|
28 |
-
$_order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
|
29 |
-
$_payment = $_order->getPayment();
|
30 |
-
$_method = $_payment->getMethod();
|
31 |
-
|
32 |
-
if ($_method == "card") {
|
33 |
-
$authNumber = $_payment->getChargeAuthorization();
|
34 |
-
$owner = $_payment->getCcOwner();
|
35 |
-
$card = $_payment->getCcLast4();
|
36 |
-
} else if ($_method == "bank") {
|
37 |
-
$service_number = $_payment->getBankServiceNumber();
|
38 |
-
$service_name = $_payment->getBankServiceName();
|
39 |
-
$bank_name = $_payment->getBankName();
|
40 |
-
$reference = $_payment->getBankReference();
|
41 |
-
$expiry = $_payment->getBankExpiryDate();
|
42 |
-
} else if ($_method == "spei") {
|
43 |
-
$clabe = $_payment->getSpeiClabe();
|
44 |
-
$bank = $_payment->getSpeiBank();
|
45 |
-
} else if ($_method == "oxxo") {
|
46 |
-
$reference = $_payment->getOxxoBarcode();
|
47 |
-
$barcode = $_payment->getOxxoBarcodeUrl();
|
48 |
-
$expiry = $_payment->getOxxoExpiryDate();
|
49 |
-
}
|
50 |
-
|
51 |
-
?>
|
52 |
-
<div class="page-title">
|
53 |
-
<h1><?php echo $this->__('Your order has been received.') ?></h1>
|
54 |
-
</div>
|
55 |
-
<?php echo $this->getMessagesBlock()->toHtml() ?>
|
56 |
-
<h2 class="sub-title"><?php echo $this->__('Thank you for your purchase!') ?></h2>
|
57 |
-
|
58 |
-
<?php if ($this->getOrderId()):?>
|
59 |
-
<?php if ($this->getCanViewOrder()) :?>
|
60 |
-
<p><?php echo $this->__('Your order # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getViewOrderUrl()), $this->escapeHtml($this->getOrderId()))) ?></p>
|
61 |
-
<?php else :?>
|
62 |
-
<p><?php echo $this->__('Your order # is: %s.', $this->escapeHtml($this->getOrderId())) ?></p>
|
63 |
-
<?php endif;?>
|
64 |
-
<p><?php echo $this->__('You will receive an order confirmation email with details of your order and a link to track its progress.') ?></p>
|
65 |
-
<p>
|
66 |
-
<dl>
|
67 |
-
<dt></dt>
|
68 |
-
<dd>
|
69 |
-
<table>
|
70 |
-
<tbody>
|
71 |
-
<tr>
|
72 |
-
<th><?php echo $this->__('Order details') ?></th>
|
73 |
-
</tr>
|
74 |
-
<tr>
|
75 |
-
<?php if ($_method == "card") {?>
|
76 |
-
<tr>
|
77 |
-
<td><?php echo $this->__('Cardholder Name: %s', $owner) ?></td>
|
78 |
-
</tr>
|
79 |
-
<tr>
|
80 |
-
<td><?php echo $this->__('Card Last 4: %s', $card) ?></td>
|
81 |
-
</tr>
|
82 |
-
<tr>
|
83 |
-
<td><?php echo $this->__('Authorization Number: %s', $authNumber) ?></td>
|
84 |
-
</tr>
|
85 |
-
<?php } else if ($_method == "oxxo") { ?>
|
86 |
-
<tr>
|
87 |
-
<td><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></td>
|
88 |
-
</tr>
|
89 |
-
<tr>
|
90 |
-
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
91 |
-
</tr>
|
92 |
-
<tr>
|
93 |
-
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
94 |
-
</tr>
|
95 |
-
<?php } else if ($_method == "bank") { ?>
|
96 |
-
<tr>
|
97 |
-
<td><?php echo $this->__('Service Name: %s', $service_name) ?></td>
|
98 |
-
</tr>
|
99 |
-
<tr>
|
100 |
-
<td><?php echo $this->__('Service Number: %s', $service_number) ?></td>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<td><?php echo $this->__('Bank Name: %s', $bank_name) ?></td>
|
104 |
-
</tr>
|
105 |
-
<tr>
|
106 |
-
<td><?php echo $this->__('Reference Number: %s', $reference) ?></td>
|
107 |
-
</tr>
|
108 |
-
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></td>
|
109 |
-
</tr>
|
110 |
-
<?php } else if ($_method == "spei") { ?>
|
111 |
-
<tr>
|
112 |
-
<td><?php echo $this->__('CLABE: %s', $clabe) ?></td>
|
113 |
-
</tr>
|
114 |
-
<tr>
|
115 |
-
<td><?php echo $this->__('Bank Name: %s', $bank) ?></td>
|
116 |
-
</tr>
|
117 |
-
<?php } ?>
|
118 |
-
</tr>
|
119 |
-
</tbody>
|
120 |
-
</table>
|
121 |
-
</dd>
|
122 |
-
</dl>
|
123 |
-
</p>
|
124 |
-
<?php if ($this->getCanViewOrder() && $this->getCanPrintOrder()) :?>
|
125 |
-
<p>
|
126 |
-
<?php echo $this->__('Click <a href="%s" onclick="this.target=\'_blank\'">here to print</a> a copy of your order confirmation.', $this->getPrintUrl()) ?>
|
127 |
-
<?php echo $this->getChildHtml() ?>
|
128 |
-
</p>
|
129 |
-
<?php endif;?>
|
130 |
-
<?php endif;?>
|
131 |
-
|
132 |
-
<?php if ($this->getAgreementRefId()): ?>
|
133 |
-
<p><?php echo $this->__('Your billing agreement # is: %s.', sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getAgreementUrl()), $this->escapeHtml($this->getAgreementRefId())))?></p>
|
134 |
-
<?php endif;?>
|
135 |
-
|
136 |
-
<?php if ($profiles = $this->getRecurringProfiles()):?>
|
137 |
-
<p><?php echo $this->__('Your recurring payment profiles:'); ?></p>
|
138 |
-
<ul class="disc">
|
139 |
-
<?php foreach($profiles as $profile):?>
|
140 |
-
<?php $profileIdHtml = ($this->getCanViewProfiles() ? sprintf('<a href="%s">%s</a>', $this->escapeHtml($this->getProfileUrl($profile)), $this->escapeHtml($this->getObjectData($profile, 'reference_id'))) : $this->escapeHtml($this->getObjectData($profile, 'reference_id')));?>
|
141 |
-
<li><?php echo $this->__('Payment profile # %s: "%s".', $profileIdHtml, $this->escapeHtml($this->getObjectData($profile, 'schedule_description')))?></li>
|
142 |
-
<?php endforeach;?>
|
143 |
-
</ul>
|
144 |
-
<?php endif;?>
|
145 |
-
|
146 |
-
<div class="buttons-set">
|
147 |
-
<button type="button" class="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Continue Shopping')) ?>" onclick="window.location='<?php echo $this->getUrl() ?>'"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button>
|
148 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/oxxo/info/oxxo.phtml
CHANGED
@@ -30,7 +30,6 @@
|
|
30 |
<?php endif;?>
|
31 |
|
32 |
<?php
|
33 |
-
$barcode = $this->getInfo()->getOxxoBarcodeUrl();
|
34 |
$reference = $this->getInfo()->getOxxoBarcode();
|
35 |
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
36 |
?>
|
@@ -41,8 +40,7 @@ $expiry = $this->getInfo()->getOxxoExpiryDate();
|
|
41 |
<table class="info-table">
|
42 |
<tbody>
|
43 |
<tr>
|
44 |
-
<?php if (empty($
|
45 |
-
<th><img width="270" height="55" style="width:220px;height:50px;" src='<?php echo $barcode ?>'/></th>
|
46 |
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
47 |
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
48 |
<?php } else { ?>
|
30 |
<?php endif;?>
|
31 |
|
32 |
<?php
|
|
|
33 |
$reference = $this->getInfo()->getOxxoBarcode();
|
34 |
$expiry = $this->getInfo()->getOxxoExpiryDate();
|
35 |
?>
|
40 |
<table class="info-table">
|
41 |
<tbody>
|
42 |
<tr>
|
43 |
+
<?php if (empty($reference) != true) {?>
|
|
|
44 |
<th><?php echo $this->__('Reference Number: %s', $reference) ?></th>
|
45 |
<th><?php echo $this->__('Expiry Date: %s', $expiry) ?></th>
|
46 |
<?php } else { ?>
|
lib/Conekta/CHANGELOG
CHANGED
@@ -29,7 +29,7 @@
|
|
29 |
|
30 |
=== 1.9.6 2014-05-12
|
31 |
|
32 |
-
* Return empty
|
33 |
|
34 |
=== 1.9.7 2014-05-22
|
35 |
|
@@ -43,15 +43,38 @@
|
|
43 |
|
44 |
* Remove simpletest.
|
45 |
* Change YAML to arrays.
|
46 |
-
* Add support for namespaces.
|
47 |
* (Thanks to https://github.com/joecohens)
|
48 |
|
|
|
49 |
=== 2.0.0 2016-01-25
|
50 |
|
|
|
51 |
* Add Webhook and WebhookLog models.
|
52 |
* Fix Charge specs.
|
53 |
|
54 |
=== 2.0.1 2016-01-26
|
55 |
|
56 |
* Fix Util.php for 'url' field name replacement.
|
57 |
-
* Complete specs for offline payments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
=== 1.9.6 2014-05-12
|
31 |
|
32 |
+
* Return empty Object instead of empty array in Util.php
|
33 |
|
34 |
=== 1.9.7 2014-05-22
|
35 |
|
43 |
|
44 |
* Remove simpletest.
|
45 |
* Change YAML to arrays.
|
|
|
46 |
* (Thanks to https://github.com/joecohens)
|
47 |
|
48 |
+
|
49 |
=== 2.0.0 2016-01-25
|
50 |
|
51 |
+
* Remove strpos warning in Object class.
|
52 |
* Add Webhook and WebhookLog models.
|
53 |
* Fix Charge specs.
|
54 |
|
55 |
=== 2.0.1 2016-01-26
|
56 |
|
57 |
* Fix Util.php for 'url' field name replacement.
|
58 |
+
* Complete specs for offline payments.
|
59 |
+
|
60 |
+
=== 2.0.3 2016-02-23
|
61 |
+
|
62 |
+
* Change Language module to Conekta_Language.
|
63 |
+
|
64 |
+
=== 2.0.4 2016-02-23
|
65 |
+
|
66 |
+
* Move Conekta_Language to Conekta folder.
|
67 |
+
|
68 |
+
=== 2.0.5 2016-07-05
|
69 |
+
|
70 |
+
* Add Log model.
|
71 |
+
|
72 |
+
=== 3.0.0 2016-11-16
|
73 |
+
|
74 |
+
* Add namespaces to master.
|
75 |
+
|
76 |
+
=== 3.1.0 2017-01-25
|
77 |
+
|
78 |
+
* Order's submodels added. New Order flow
|
79 |
+
* Supporting now API 2.0
|
80 |
+
* Check https://www.conekta.io/es/docs/api v1.1 for further information
|
lib/Conekta/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
|
2 |
![alt tag](https://raw.github.com/conekta/conekta-php/master/readme_files/cover.png)
|
3 |
|
4 |
-
# Conekta PHP v.
|
5 |
|
6 |
This is a php library that allows interaction with https://api.conekta.io API.
|
7 |
|
@@ -17,54 +17,45 @@ To get started, add the following to your PHP script:
|
|
17 |
|
18 |
You can also install this library with composer:
|
19 |
|
20 |
-
require: "conekta/conekta-php": "
|
21 |
|
22 |
## Usage
|
23 |
```php
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
"brand": "visa"
|
60 |
-
},
|
61 |
-
"details": {
|
62 |
-
"name": null,
|
63 |
-
"phone": null,
|
64 |
-
"email": null,
|
65 |
-
"line_items": []
|
66 |
-
}
|
67 |
-
}
|
68 |
```
|
69 |
|
70 |
## Documentation
|
@@ -84,3 +75,10 @@ Run test suite:
|
|
84 |
License
|
85 |
-------
|
86 |
Developed by [Conekta](https://www.conekta.io). Available with [MIT License](LICENSE).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
![alt tag](https://raw.github.com/conekta/conekta-php/master/readme_files/cover.png)
|
3 |
|
4 |
+
# Conekta PHP v.3.1.0
|
5 |
|
6 |
This is a php library that allows interaction with https://api.conekta.io API.
|
7 |
|
17 |
|
18 |
You can also install this library with composer:
|
19 |
|
20 |
+
require: "conekta/conekta-php": "3.1.0"
|
21 |
|
22 |
## Usage
|
23 |
```php
|
24 |
+
setApiKey();
|
25 |
+
$valid_order =
|
26 |
+
array(
|
27 |
+
'line_items'=> array(
|
28 |
+
array(
|
29 |
+
'name' => 'Box of Cohiba S1s',
|
30 |
+
'description' => 'Imported From Mex.',
|
31 |
+
'unit_price' => 20000,
|
32 |
+
'quantity' => 1,
|
33 |
+
'sku' => 'cohb_s1',
|
34 |
+
'category' => 'food',
|
35 |
+
'type' => 'physical',
|
36 |
+
'tags' => array('food', 'mexican food')
|
37 |
+
)
|
38 |
+
),
|
39 |
+
'currency' => 'mxn',
|
40 |
+
'metadata' => array('test' => 'extra info'),
|
41 |
+
'charges' => array(
|
42 |
+
array(
|
43 |
+
'payment_source' => array(
|
44 |
+
'type' => 'oxxo_cash',
|
45 |
+
'expires_at' => strtotime(date("Y-m-d H:i:s")) + "36000"
|
46 |
+
),
|
47 |
+
'amount' => 20000
|
48 |
+
)
|
49 |
+
),
|
50 |
+
'currency' => 'mxn',
|
51 |
+
'customer_info' => array(
|
52 |
+
'name' => 'John Constantine',
|
53 |
+
'phone' => '+5213353319758',
|
54 |
+
'email' => 'hola@hola.com'
|
55 |
+
)
|
56 |
+
);
|
57 |
+
|
58 |
+
$order = \Conekta\Order::create($valid_order);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
```
|
60 |
|
61 |
## Documentation
|
75 |
License
|
76 |
-------
|
77 |
Developed by [Conekta](https://www.conekta.io). Available with [MIT License](LICENSE).
|
78 |
+
|
79 |
+
We are hiring
|
80 |
+
-------------
|
81 |
+
|
82 |
+
If you are a comfortable working with a range of backend languages (Java, Python, Ruby, PHP, etc) and frameworks, you have solid foundation in data structures, algorithms and software design with strong analytical and debugging skills.
|
83 |
+
Send your CV, github to quieroser@conekta.io
|
84 |
+
|
lib/Conekta/composer.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
{
|
2 |
"name": "conekta/conekta-php",
|
3 |
-
"description": "PHP
|
4 |
"keywords": [
|
5 |
"conekta",
|
6 |
"payment processing",
|
@@ -15,7 +15,7 @@
|
|
15 |
}
|
16 |
],
|
17 |
"require": {
|
18 |
-
"php": ">=5.
|
19 |
"ext-curl": "*",
|
20 |
"ext-json": "*",
|
21 |
"ext-mbstring": "*"
|
1 |
{
|
2 |
"name": "conekta/conekta-php",
|
3 |
+
"description": "Conekta PHP Library",
|
4 |
"keywords": [
|
5 |
"conekta",
|
6 |
"payment processing",
|
15 |
}
|
16 |
],
|
17 |
"require": {
|
18 |
+
"php": ">=5.3",
|
19 |
"ext-curl": "*",
|
20 |
"ext-json": "*",
|
21 |
"ext-mbstring": "*"
|
lib/Conekta/lib/Conekta.php
CHANGED
@@ -12,26 +12,37 @@ if (!function_exists('mb_detect_encoding')) {
|
|
12 |
if (!function_exists('get_called_class')) {
|
13 |
throw new Exception('Conekta needs to be run on PHP >= 5.3.0.');
|
14 |
}
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
if (!function_exists('get_called_class')) {
|
13 |
throw new Exception('Conekta needs to be run on PHP >= 5.3.0.');
|
14 |
}
|
15 |
+
require_once dirname(__FILE__).'/Conekta/Lang.php';
|
16 |
+
require_once dirname(__FILE__).'/Conekta/Conekta.php';
|
17 |
+
require_once dirname(__FILE__).'/Conekta/Util.php';
|
18 |
+
require_once dirname(__FILE__).'/Conekta/Requestor.php';
|
19 |
+
require_once dirname(__FILE__).'/Conekta/Object.php';
|
20 |
+
require_once dirname(__FILE__).'/Conekta/Resource.php';
|
21 |
+
require_once dirname(__FILE__).'/Conekta/Charge.php';
|
22 |
+
require_once dirname(__FILE__).'/Conekta/PaymentMethod.php';
|
23 |
+
require_once dirname(__FILE__).'/Conekta/Customer.php';
|
24 |
+
require_once dirname(__FILE__).'/Conekta/Card.php';
|
25 |
+
require_once dirname(__FILE__).'/Conekta/Plan.php';
|
26 |
+
require_once dirname(__FILE__).'/Conekta/Subscription.php';
|
27 |
+
require_once dirname(__FILE__).'/Conekta/Token.php';
|
28 |
+
require_once dirname(__FILE__).'/Conekta/Event.php';
|
29 |
+
require_once dirname(__FILE__).'/Conekta/Error.php';
|
30 |
+
require_once dirname(__FILE__).'/Conekta/Payout.php';
|
31 |
+
require_once dirname(__FILE__).'/Conekta/Payee.php';
|
32 |
+
require_once dirname(__FILE__).'/Conekta/PayoutMethod.php';
|
33 |
+
require_once dirname(__FILE__).'/Conekta/Method.php';
|
34 |
+
require_once dirname(__FILE__).'/Conekta/Address.php';
|
35 |
+
require_once dirname(__FILE__).'/Conekta/Webhook.php';
|
36 |
+
require_once dirname(__FILE__).'/Conekta/WebhookLog.php';
|
37 |
+
require_once dirname(__FILE__).'/Conekta/Log.php';
|
38 |
+
require_once dirname(__FILE__).'/Conekta/Order.php';
|
39 |
+
require_once dirname(__FILE__).'/Conekta/PaymentSource.php';
|
40 |
+
require_once dirname(__FILE__).'/Conekta/TaxLine.php';
|
41 |
+
require_once dirname(__FILE__).'/Conekta/DiscountLine.php';
|
42 |
+
require_once dirname(__FILE__).'/Conekta/ShippingLine.php';
|
43 |
+
require_once dirname(__FILE__).'/Conekta/LineItem.php';
|
44 |
+
require_once dirname(__FILE__).'/Conekta/ErrorList.php';
|
45 |
+
require_once dirname(__FILE__).'/Conekta/ConektaList.php';
|
46 |
+
require_once dirname(__FILE__).'/Conekta/ShippingContact.php';
|
47 |
+
require_once dirname(__FILE__).'/Conekta/FiscalEntity.php';
|
48 |
+
require_once dirname(__FILE__).'/Conekta/OrderReturn.php';
|
lib/Conekta/lib/Conekta/Address.php
CHANGED
@@ -1,5 +1,29 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Address extends Resource
|
8 |
{
|
9 |
+
var $street1 = "";
|
10 |
+
var $street2 = "";
|
11 |
+
var $street3 = "";
|
12 |
+
var $city = "";
|
13 |
+
var $state = "";
|
14 |
+
var $zip = "";
|
15 |
+
var $country = "";
|
16 |
+
|
17 |
+
public function __get($property)
|
18 |
+
{
|
19 |
+
if (property_exists($this, $property)) {
|
20 |
+
return $this->$property;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
public function __isset($property)
|
25 |
+
{
|
26 |
+
return isset($this->$property);
|
27 |
+
}
|
28 |
+
|
29 |
}
|
lib/Conekta/lib/Conekta/Card.php
CHANGED
@@ -1,31 +1,69 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function instanceUrl()
|
6 |
{
|
7 |
$id = $this->id;
|
8 |
if (!$id) {
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
|
|
14 |
$class = get_class($this);
|
15 |
$base = $this->classUrl($class);
|
16 |
$extn = urlencode($id);
|
17 |
$customerUrl = $this->customer->instanceUrl();
|
18 |
|
19 |
-
return
|
20 |
}
|
21 |
|
22 |
public function update($params = null)
|
23 |
{
|
24 |
-
return
|
25 |
}
|
26 |
|
27 |
public function delete()
|
28 |
{
|
29 |
-
return
|
30 |
}
|
31 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class Card extends Resource
|
11 |
{
|
12 |
+
var $created_at = "";
|
13 |
+
var $last4 = "";
|
14 |
+
var $bin = "";
|
15 |
+
var $name = "";
|
16 |
+
var $exp_month = "";
|
17 |
+
var $exp_year = "";
|
18 |
+
var $brand = "";
|
19 |
+
var $parent_id = "";
|
20 |
+
var $default = "";
|
21 |
+
|
22 |
+
public function __get($property)
|
23 |
+
{
|
24 |
+
if (property_exists($this, $property)) {
|
25 |
+
return $this->$property;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
public function __isset($property)
|
30 |
+
{
|
31 |
+
return isset($this->$property);
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
public function instanceUrl()
|
36 |
{
|
37 |
$id = $this->id;
|
38 |
if (!$id) {
|
39 |
+
$error = new Error(
|
40 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
41 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
42 |
);
|
43 |
+
|
44 |
+
if($this->apiVersion = '2.0.0'){
|
45 |
+
$errorList = new ErrorList();
|
46 |
+
array_push($errorList->details, $error);
|
47 |
+
throw $errorList;
|
48 |
+
}
|
49 |
+
throw $error;
|
50 |
}
|
51 |
+
|
52 |
$class = get_class($this);
|
53 |
$base = $this->classUrl($class);
|
54 |
$extn = urlencode($id);
|
55 |
$customerUrl = $this->customer->instanceUrl();
|
56 |
|
57 |
+
return $customerUrl . $base . "/{$extn}";
|
58 |
}
|
59 |
|
60 |
public function update($params = null)
|
61 |
{
|
62 |
+
return parent::_update($params);
|
63 |
}
|
64 |
|
65 |
public function delete()
|
66 |
{
|
67 |
+
return parent::_delete('customer', 'cards');
|
68 |
}
|
69 |
}
|
lib/Conekta/lib/Conekta/Charge.php
CHANGED
@@ -1,31 +1,65 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public static function find($id)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
public static function where($params = null)
|
13 |
{
|
14 |
$class = get_called_class();
|
15 |
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
public static function create($params = null)
|
20 |
{
|
21 |
$class = get_called_class();
|
22 |
|
23 |
-
return
|
24 |
}
|
25 |
|
26 |
public function capture()
|
27 |
{
|
28 |
-
return
|
29 |
}
|
30 |
|
31 |
public function refund($amount = null)
|
@@ -35,7 +69,7 @@ class Conekta_Charge extends Conekta_Resource
|
|
35 |
$params = array('amount' => $amount);
|
36 |
}
|
37 |
|
38 |
-
return
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -45,13 +79,13 @@ class Conekta_Charge extends Conekta_Resource
|
|
45 |
{
|
46 |
$class = get_called_class();
|
47 |
|
48 |
-
return
|
49 |
}
|
50 |
|
51 |
public static function all($params = null)
|
52 |
{
|
53 |
$class = get_called_class();
|
54 |
|
55 |
-
return
|
56 |
}
|
57 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Charge extends Resource
|
8 |
{
|
9 |
+
var $livemode = "";
|
10 |
+
var $amount = "";
|
11 |
+
var $created_at = "";
|
12 |
+
var $currency = "";
|
13 |
+
var $description = "";
|
14 |
+
var $reference_id = "";
|
15 |
+
var $failure_code = "";
|
16 |
+
var $failure_message = "";
|
17 |
+
var $fee = "";
|
18 |
+
var $monthly_installments = "";
|
19 |
+
var $device_fingerprint = "";
|
20 |
+
var $status = "";
|
21 |
+
var $exchange_rate = "";
|
22 |
+
var $foreign_currency = "";
|
23 |
+
var $amount_in_foreign_currency = "";
|
24 |
+
var $checkout_id = "";
|
25 |
+
var $checkout_order_count = "";
|
26 |
+
|
27 |
+
public function __get($property)
|
28 |
+
{
|
29 |
+
if (property_exists($this, $property)) {
|
30 |
+
return $this->$property;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
public function __isset($property)
|
35 |
+
{
|
36 |
+
return isset($this->$property);
|
37 |
+
}
|
38 |
+
|
39 |
public static function find($id)
|
40 |
{
|
41 |
$class = get_called_class();
|
42 |
|
43 |
+
return parent::_scpFind($class, $id);
|
44 |
}
|
45 |
|
46 |
public static function where($params = null)
|
47 |
{
|
48 |
$class = get_called_class();
|
49 |
|
50 |
+
return parent::_scpWhere($class, $params);
|
51 |
}
|
52 |
|
53 |
public static function create($params = null)
|
54 |
{
|
55 |
$class = get_called_class();
|
56 |
|
57 |
+
return parent::_scpCreate($class, $params);
|
58 |
}
|
59 |
|
60 |
public function capture()
|
61 |
{
|
62 |
+
return parent::_customAction('post', 'capture', null);
|
63 |
}
|
64 |
|
65 |
public function refund($amount = null)
|
69 |
$params = array('amount' => $amount);
|
70 |
}
|
71 |
|
72 |
+
return parent::_customAction('post', 'refund', $params);
|
73 |
}
|
74 |
|
75 |
/**
|
79 |
{
|
80 |
$class = get_called_class();
|
81 |
|
82 |
+
return parent::_scpFind($class, $id);
|
83 |
}
|
84 |
|
85 |
public static function all($params = null)
|
86 |
{
|
87 |
$class = get_called_class();
|
88 |
|
89 |
+
return parent::_scpWhere($class, $params);
|
90 |
}
|
91 |
}
|
lib/Conekta/lib/Conekta/Conekta.php
CHANGED
@@ -1,25 +1,30 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
3 |
abstract class Conekta
|
4 |
{
|
5 |
public static $apiKey;
|
6 |
public static $apiBase = 'https://api.conekta.io';
|
7 |
-
public static $apiVersion = '
|
8 |
public static $locale = 'es';
|
9 |
-
|
|
|
10 |
|
11 |
public static function setApiKey($apiKey)
|
12 |
{
|
13 |
self::$apiKey = $apiKey;
|
14 |
}
|
15 |
-
|
16 |
public static function setApiVersion($version)
|
17 |
{
|
18 |
self::$apiVersion = $version;
|
19 |
}
|
20 |
-
|
21 |
public static function setLocale($locale)
|
22 |
{
|
23 |
self::$locale = $locale;
|
24 |
}
|
|
|
|
|
|
|
|
|
25 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
abstract class Conekta
|
6 |
{
|
7 |
public static $apiKey;
|
8 |
public static $apiBase = 'https://api.conekta.io';
|
9 |
+
public static $apiVersion = '2.0.0';
|
10 |
public static $locale = 'es';
|
11 |
+
public static $plugin = '';
|
12 |
+
const VERSION = '3.1.0';
|
13 |
|
14 |
public static function setApiKey($apiKey)
|
15 |
{
|
16 |
self::$apiKey = $apiKey;
|
17 |
}
|
|
|
18 |
public static function setApiVersion($version)
|
19 |
{
|
20 |
self::$apiVersion = $version;
|
21 |
}
|
|
|
22 |
public static function setLocale($locale)
|
23 |
{
|
24 |
self::$locale = $locale;
|
25 |
}
|
26 |
+
public static function setPlugin($plugin)
|
27 |
+
{
|
28 |
+
self::$plugin = $plugin;
|
29 |
+
}
|
30 |
}
|
lib/Conekta/lib/Conekta/ConektaList.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Requestor;
|
7 |
+
use \Conekta\Util;
|
8 |
+
use \Conekta\Error;
|
9 |
+
use \Conekta\Conekta;
|
10 |
+
|
11 |
+
class ConektaList extends Object
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
public function __construct($elements_type, $params = array())
|
16 |
+
{
|
17 |
+
parent::__construct();
|
18 |
+
$this->elements_type = $elements_type;
|
19 |
+
$this->params = $params;
|
20 |
+
$this->total = 0;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function addElement($element)
|
24 |
+
{
|
25 |
+
$element = Util::convertToConektaObject($element);
|
26 |
+
$this[$this->total] = $element;
|
27 |
+
$this->_values[$this->total] = $element;
|
28 |
+
$this->total = $this->total + 1;
|
29 |
+
|
30 |
+
return $this;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function loadFromArray($values = null)
|
34 |
+
{
|
35 |
+
if (isset($values)) {
|
36 |
+
$this->has_more = $values['has_more'];
|
37 |
+
$this->total = $values['total'];
|
38 |
+
|
39 |
+
foreach ($this as $key => $value) {
|
40 |
+
$this->_unsetKey($key);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
if (isset($values['data'])) {
|
45 |
+
return parent::loadFromArray($values['data']);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
public function next($options = array())
|
50 |
+
{
|
51 |
+
if (sizeOf($this) > 0) {
|
52 |
+
$this->params['next'] = end($this)->id;
|
53 |
+
}
|
54 |
+
|
55 |
+
$this->params['previous'] = null;
|
56 |
+
|
57 |
+
return $this->_moveCursor($options['limit']);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function previous($options = array())
|
61 |
+
{
|
62 |
+
if (sizeOf($this) > 0) {
|
63 |
+
$this->params['previous'] = $this[0]->id;
|
64 |
+
}
|
65 |
+
|
66 |
+
$this->params['next'] = null;
|
67 |
+
|
68 |
+
return $this->_moveCursor($options['limit']);
|
69 |
+
}
|
70 |
+
|
71 |
+
protected function _moveCursor($limit)
|
72 |
+
{
|
73 |
+
if (isset($limit)) {
|
74 |
+
$this->params['limit'] = $limit;
|
75 |
+
}
|
76 |
+
|
77 |
+
$class = Util::$types[strtolower($this->elements_type)];
|
78 |
+
$url = Resource::classUrl($class);
|
79 |
+
$requestor = new Requestor();
|
80 |
+
$response = $requestor->request('get', $url, $this->params);
|
81 |
+
|
82 |
+
return $this->loadFromArray($response);
|
83 |
+
}
|
84 |
+
}
|
lib/Conekta/lib/Conekta/Customer.php
CHANGED
@@ -1,63 +1,139 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function loadFromArray($values = null)
|
6 |
{
|
7 |
if (isset($values)) {
|
8 |
parent::loadFromArray($values);
|
9 |
}
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
if (isset($this->subscription)) {
|
18 |
-
$this->subscription->customer =
|
19 |
}
|
20 |
}
|
21 |
|
|
|
22 |
public static function find($id)
|
23 |
{
|
24 |
$class = get_called_class();
|
25 |
|
26 |
-
return
|
27 |
}
|
28 |
|
29 |
public static function where($params = null)
|
30 |
{
|
31 |
$class = get_called_class();
|
32 |
|
33 |
-
return
|
34 |
}
|
35 |
|
36 |
public static function create($params = null)
|
37 |
{
|
38 |
$class = get_called_class();
|
39 |
|
40 |
-
return
|
41 |
}
|
42 |
|
43 |
public function delete()
|
44 |
{
|
45 |
-
return
|
46 |
}
|
47 |
|
48 |
public function update($params = null)
|
49 |
{
|
50 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
}
|
52 |
|
53 |
public function createCard($params = null)
|
54 |
{
|
55 |
-
return
|
56 |
}
|
57 |
|
58 |
public function createSubscription($params = null)
|
59 |
{
|
60 |
-
return
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
|
63 |
/**
|
@@ -67,13 +143,13 @@ class Conekta_Customer extends Conekta_Resource
|
|
67 |
{
|
68 |
$class = get_called_class();
|
69 |
|
70 |
-
return
|
71 |
}
|
72 |
|
73 |
public static function all($params = null)
|
74 |
{
|
75 |
$class = get_called_class();
|
76 |
|
77 |
-
return
|
78 |
}
|
79 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Customer extends Resource
|
8 |
{
|
9 |
+
var $livemode = "";
|
10 |
+
var $name = "";
|
11 |
+
var $email = "";
|
12 |
+
var $phone = "";
|
13 |
+
var $default_shipping_contact_id = "";
|
14 |
+
var $default_fiscal_entity_id = "";
|
15 |
+
var $default_payment_source_id = "";
|
16 |
+
var $referrer = "";
|
17 |
+
var $account_age = "";
|
18 |
+
var $paid_transactions = "";
|
19 |
+
var $first_paid_at = "";
|
20 |
+
var $corporate = "";
|
21 |
+
|
22 |
+
public function __get($property)
|
23 |
+
{
|
24 |
+
if (property_exists($this, $property)) {
|
25 |
+
return $this->$property;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
public function __isset($property)
|
30 |
+
{
|
31 |
+
return isset($this->$property);
|
32 |
+
}
|
33 |
+
|
34 |
public function loadFromArray($values = null)
|
35 |
{
|
36 |
if (isset($values)) {
|
37 |
parent::loadFromArray($values);
|
38 |
}
|
39 |
+
|
40 |
+
if(Conekta::$apiVersion == '2.0.0'){
|
41 |
+
$submodels = array(
|
42 |
+
'payment_sources', 'fiscal_entities', 'shipping_contacts'
|
43 |
+
);
|
44 |
+
foreach ($submodels as $submodel) {
|
45 |
+
if (isset($values[$submodel])){
|
46 |
+
$submodel_list = new ConektaList($submodel, $values[$submodel]);
|
47 |
+
$submodel_list->loadFromArray($values[$submodel]);
|
48 |
+
$this->$submodel->_values = $submodel_list;
|
49 |
+
} else {
|
50 |
+
$submodel_list = new ConektaList($submodel, array());
|
51 |
+
}
|
52 |
+
$this->$submodel = $submodel_list;
|
53 |
+
|
54 |
+
foreach ($this->$submodel as $k => $v) {
|
55 |
+
$v->customer = $this;
|
56 |
+
}
|
57 |
}
|
58 |
}
|
59 |
+
else{
|
60 |
+
$submodels = array(
|
61 |
+
'cards'
|
62 |
+
);
|
63 |
+
foreach ($submodels as $submodel) {
|
64 |
+
if(isset($this->$submodel)) {
|
65 |
+
$submodel_list = $this->$submodel;
|
66 |
+
|
67 |
+
foreach ($submodel_list as $k => $v){
|
68 |
+
if (isset($v->deleted) != true) {
|
69 |
+
$v->customer = $this;
|
70 |
+
$this->$submodel->_setVal($k,$v);
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
|
77 |
if (isset($this->subscription)) {
|
78 |
+
$this->subscription->customer = $this;
|
79 |
}
|
80 |
}
|
81 |
|
82 |
+
|
83 |
public static function find($id)
|
84 |
{
|
85 |
$class = get_called_class();
|
86 |
|
87 |
+
return parent::_scpFind($class, $id);
|
88 |
}
|
89 |
|
90 |
public static function where($params = null)
|
91 |
{
|
92 |
$class = get_called_class();
|
93 |
|
94 |
+
return parent::_scpWhere($class, $params);
|
95 |
}
|
96 |
|
97 |
public static function create($params = null)
|
98 |
{
|
99 |
$class = get_called_class();
|
100 |
|
101 |
+
return parent::_scpCreate($class, $params);
|
102 |
}
|
103 |
|
104 |
public function delete()
|
105 |
{
|
106 |
+
return parent::_delete();
|
107 |
}
|
108 |
|
109 |
public function update($params = null)
|
110 |
{
|
111 |
+
return parent::_update($params);
|
112 |
+
}
|
113 |
+
|
114 |
+
public function createPaymentSource($params = null)
|
115 |
+
{
|
116 |
+
return parent::_createMemberWithRelation('payment_sources', $params, $this);
|
117 |
+
}
|
118 |
+
|
119 |
+
public function createFiscalEntity($params = null)
|
120 |
+
{
|
121 |
+
return parent::_createMemberWithRelation('fiscal_entities', $params, $this);
|
122 |
}
|
123 |
|
124 |
public function createCard($params = null)
|
125 |
{
|
126 |
+
return parent::_createMemberWithRelation('cards', $params, $this);
|
127 |
}
|
128 |
|
129 |
public function createSubscription($params = null)
|
130 |
{
|
131 |
+
return parent::_createMember('subscription', $params);
|
132 |
+
}
|
133 |
+
|
134 |
+
public function createShippingContact($params = null)
|
135 |
+
{
|
136 |
+
return parent::_createMemberWithRelation('shipping_contacts', $params, $this);
|
137 |
}
|
138 |
|
139 |
/**
|
143 |
{
|
144 |
$class = get_called_class();
|
145 |
|
146 |
+
return parent::_scpFind($class, $id);
|
147 |
}
|
148 |
|
149 |
public static function all($params = null)
|
150 |
{
|
151 |
$class = get_called_class();
|
152 |
|
153 |
+
return parent::_scpWhere($class, $params);
|
154 |
}
|
155 |
}
|
lib/Conekta/lib/Conekta/DiscountLine.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class DiscountLine extends Resource
|
11 |
+
{
|
12 |
+
var $code = "";
|
13 |
+
var $amount = "";
|
14 |
+
var $type = "";
|
15 |
+
var $parent_id = "";
|
16 |
+
|
17 |
+
public function __get($property)
|
18 |
+
{
|
19 |
+
if (property_exists($this, $property)) {
|
20 |
+
return $this->$property;
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
public function __isset($property)
|
25 |
+
{
|
26 |
+
return isset($this->$property);
|
27 |
+
}
|
28 |
+
|
29 |
+
public function instanceUrl()
|
30 |
+
{
|
31 |
+
$this->apiVersion = Conekta::$apiVersion;
|
32 |
+
$id = $this->id;
|
33 |
+
if (!$id) {
|
34 |
+
$error = new Error(
|
35 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
36 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
37 |
+
);
|
38 |
+
|
39 |
+
if($this->apiVersion = '2.0.0'){
|
40 |
+
$errorList = new ErrorList();
|
41 |
+
array_push($errorList->details, $error);
|
42 |
+
throw $errorList;
|
43 |
+
}
|
44 |
+
throw $error;
|
45 |
+
}
|
46 |
+
|
47 |
+
$class = get_class($this);
|
48 |
+
$base = $this->classUrl($class);
|
49 |
+
$extn = urlencode($id);
|
50 |
+
$orderUrl = $this->order->instanceUrl();
|
51 |
+
|
52 |
+
return $orderUrl . $base . "/{$extn}";
|
53 |
+
}
|
54 |
+
|
55 |
+
public function update($params = null)
|
56 |
+
{
|
57 |
+
return parent::_update($params);
|
58 |
+
}
|
59 |
+
|
60 |
+
public function delete()
|
61 |
+
{
|
62 |
+
return parent::_delete('order', 'discount_lines');
|
63 |
+
}
|
64 |
+
}
|
lib/Conekta/lib/Conekta/Error.php
CHANGED
@@ -1,73 +1,88 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
$this->message = $message;
|
9 |
-
$this->message_to_purchaser = $message_to_purchaser;
|
10 |
-
$this->type = $type;
|
11 |
-
$this->code = $code;
|
12 |
-
$this->params = $params;
|
13 |
-
}
|
14 |
|
15 |
-
|
|
|
|
|
16 |
{
|
17 |
-
$resp = json_decode($resp, true);
|
18 |
$message = isset($resp['message']) ? $resp['message'] : null;
|
19 |
$message_to_purchaser = isset($resp['message_to_purchaser']) ? $resp['message_to_purchaser'] : null;
|
20 |
$type = isset($resp['type']) ? $resp['type'] : null;
|
21 |
$params = isset($resp['param']) ? $resp['param'] : null;
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
-
|
|
|
29 |
case 400:
|
30 |
-
|
31 |
case 401:
|
32 |
-
|
33 |
case 402:
|
34 |
-
|
35 |
case 404:
|
36 |
-
|
37 |
case 422:
|
38 |
-
|
39 |
case 500:
|
40 |
-
|
41 |
default:
|
42 |
-
|
43 |
}
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
-
class
|
48 |
{
|
49 |
}
|
50 |
|
51 |
-
class
|
52 |
{
|
53 |
}
|
54 |
|
55 |
-
class
|
56 |
{
|
57 |
}
|
58 |
|
59 |
-
class
|
60 |
{
|
61 |
}
|
62 |
|
63 |
-
class
|
64 |
{
|
65 |
}
|
66 |
|
67 |
-
class
|
68 |
{
|
69 |
}
|
70 |
|
71 |
-
class
|
72 |
{
|
73 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Lang;
|
6 |
+
use \Conekta\Conekta;
|
7 |
+
use \Exception;
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
+
class Error extends Exception
|
10 |
+
{
|
11 |
+
public static function build($resp, $http_code)
|
12 |
{
|
|
|
13 |
$message = isset($resp['message']) ? $resp['message'] : null;
|
14 |
$message_to_purchaser = isset($resp['message_to_purchaser']) ? $resp['message_to_purchaser'] : null;
|
15 |
$type = isset($resp['type']) ? $resp['type'] : null;
|
16 |
$params = isset($resp['param']) ? $resp['param'] : null;
|
17 |
+
|
18 |
+
$debug_message = isset($resp['debug_message']) ? $resp['debug_message'] : null;
|
19 |
+
$code = isset($resp['code']) ? $resp['code'] : null;
|
20 |
+
|
21 |
+
if (isset($http_code) != true || $http_code == 0) {
|
22 |
+
return new NoConnectionError(
|
23 |
+
Lang::translate('error.requestor.connection', Lang::EN, array('BASE' => Conekta::$apiBase)),
|
24 |
+
Lang::translate('error.requestor.connection_purchaser', Conekta::$locale),
|
25 |
+
$type, $http_code, $params);
|
26 |
}
|
27 |
+
|
28 |
+
switch ($http_code) {
|
29 |
case 400:
|
30 |
+
return new MalformedRequestError($message, $message_to_purchaser, $type, $code, $params);
|
31 |
case 401:
|
32 |
+
return new AuthenticationError($message, $message_to_purchaser, $type, $code, $params);
|
33 |
case 402:
|
34 |
+
return new ProcessingError($message, $message_to_purchaser, $type, $code, $params);
|
35 |
case 404:
|
36 |
+
return new ResourceNotFoundError($message, $message_to_purchaser, $type, $code, $params);
|
37 |
case 422:
|
38 |
+
return new ParameterValidationError($message, $message_to_purchaser, $type, $code, $params);
|
39 |
case 500:
|
40 |
+
return new ApiError($message, $message_to_purchaser, $type, $code, $params);
|
41 |
default:
|
42 |
+
return new self($message, $message_to_purchaser, $type, $code, $params);
|
43 |
}
|
44 |
}
|
45 |
+
|
46 |
+
public function __construct($message = null, $message_to_purchaser = null, $type = null, $code = null, $params = null)
|
47 |
+
{
|
48 |
+
parent::__construct($message);
|
49 |
+
$this->message = $message;
|
50 |
+
$this->message_to_purchaser = $message_to_purchaser;
|
51 |
+
$this->type = $type;
|
52 |
+
$this->code = $code;
|
53 |
+
$this->params = $params;
|
54 |
+
}
|
55 |
+
|
56 |
+
public static function errorHandler($resp, $http_code)
|
57 |
+
{
|
58 |
+
throw self::build($resp, $http_code);
|
59 |
+
}
|
60 |
}
|
61 |
|
62 |
+
class ApiError extends Error
|
63 |
{
|
64 |
}
|
65 |
|
66 |
+
class NoConnectionError extends Error
|
67 |
{
|
68 |
}
|
69 |
|
70 |
+
class AuthenticationError extends Error
|
71 |
{
|
72 |
}
|
73 |
|
74 |
+
class ParameterValidationError extends Error
|
75 |
{
|
76 |
}
|
77 |
|
78 |
+
class ProcessingError extends Error
|
79 |
{
|
80 |
}
|
81 |
|
82 |
+
class ResourceNotFoundError extends Error
|
83 |
{
|
84 |
}
|
85 |
|
86 |
+
class MalformedRequestError extends Error
|
87 |
{
|
88 |
}
|
lib/Conekta/lib/Conekta/ErrorList.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Conekta;
|
6 |
+
use \Exception;
|
7 |
+
|
8 |
+
class ErrorList extends Exception
|
9 |
+
{
|
10 |
+
public $details = [];
|
11 |
+
|
12 |
+
public function __construct()
|
13 |
+
{
|
14 |
+
$this->details = [];
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function errorHandler($response = null, $http_status = null)
|
18 |
+
{
|
19 |
+
$exception = null;
|
20 |
+
$error_list = new ErrorList;
|
21 |
+
if(isset($response['details'])){
|
22 |
+
$error_list->message .= $response['details'][0]['message'];
|
23 |
+
foreach ($response['details'] as $error) {
|
24 |
+
array_push($error_list->details, self::buildError($error, $http_status));
|
25 |
+
}
|
26 |
+
if (count($error_list->details) == 0) {
|
27 |
+
array_push($error_list->details, self::buildError(null, null));
|
28 |
+
}
|
29 |
+
$exception = $error_list;
|
30 |
+
}
|
31 |
+
if(is_null($exception)) {
|
32 |
+
array_push($error_list->details, self::buildError(null, null));
|
33 |
+
$exception = $error_list;
|
34 |
+
}
|
35 |
+
return $exception;
|
36 |
+
}
|
37 |
+
|
38 |
+
private static function buildError($response, $http_status)
|
39 |
+
{
|
40 |
+
return Error::build($response, $http_status);
|
41 |
+
}
|
42 |
+
}
|
lib/Conekta/lib/Conekta/Event.php
CHANGED
@@ -1,12 +1,34 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public static function where($params = null)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
/**
|
@@ -16,6 +38,6 @@ class Conekta_Event extends Conekta_Resource
|
|
16 |
{
|
17 |
$class = get_called_class();
|
18 |
|
19 |
-
return
|
20 |
}
|
21 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Event extends Resource
|
8 |
{
|
9 |
+
var $data = "";
|
10 |
+
var $livemode = "";
|
11 |
+
var $webhook_status = "";
|
12 |
+
var $created_at = "";
|
13 |
+
var $type = "";
|
14 |
+
|
15 |
+
public function __get($property)
|
16 |
+
{
|
17 |
+
if (property_exists($this, $property)) {
|
18 |
+
return $this->$property;
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public function __isset($property)
|
23 |
+
{
|
24 |
+
return isset($this->$property);
|
25 |
+
}
|
26 |
+
|
27 |
public static function where($params = null)
|
28 |
{
|
29 |
$class = get_called_class();
|
30 |
|
31 |
+
return parent::_scpWhere($class, $params);
|
32 |
}
|
33 |
|
34 |
/**
|
38 |
{
|
39 |
$class = get_called_class();
|
40 |
|
41 |
+
return parent::_scpWhere($class, $params);
|
42 |
}
|
43 |
}
|
lib/Conekta/lib/Conekta/FiscalEntity.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class FiscalEntity extends Resource
|
11 |
+
{
|
12 |
+
var $tax_id = "";
|
13 |
+
var $company_name = "";
|
14 |
+
var $phone = "";
|
15 |
+
var $email = "";
|
16 |
+
var $created_at = "";
|
17 |
+
var $parent_id = "";
|
18 |
+
var $default = "";
|
19 |
+
|
20 |
+
public function __get($property)
|
21 |
+
{
|
22 |
+
if (property_exists($this, $property)) {
|
23 |
+
return $this->$property;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function __isset($property)
|
28 |
+
{
|
29 |
+
return isset($this->$property);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function instanceUrl()
|
33 |
+
{
|
34 |
+
$id = $this->id;
|
35 |
+
if (!$id) {
|
36 |
+
throw new Error(
|
37 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
38 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
39 |
+
);
|
40 |
+
}
|
41 |
+
|
42 |
+
$class = get_class($this);
|
43 |
+
$base = '/fiscal_entities';
|
44 |
+
$extn = urlencode($id);
|
45 |
+
$customerUrl = $this->customer->instanceUrl();
|
46 |
+
|
47 |
+
return $customerUrl . $base . "/{$extn}";
|
48 |
+
}
|
49 |
+
|
50 |
+
public function delete() {
|
51 |
+
return parent::_delete('customer', 'fiscal_entities');
|
52 |
+
}
|
53 |
+
|
54 |
+
public function update($params = null) {
|
55 |
+
return parent::_update($params);
|
56 |
+
}
|
57 |
+
}
|
lib/Conekta/lib/Conekta/Lang.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
class Lang
|
6 |
+
{
|
7 |
+
const EN = 'en';
|
8 |
+
const ES = 'es';
|
9 |
+
|
10 |
+
protected static $cache = array();
|
11 |
+
|
12 |
+
public static function translate($key, $locale, $parameters = null)
|
13 |
+
{
|
14 |
+
$parameters = str_replace("Conekta\\", "", $parameters);
|
15 |
+
|
16 |
+
$langs = self::readDirectory(dirname(__FILE__) . '/../locales/messages');
|
17 |
+
|
18 |
+
$keys = explode('.', $locale.'.'.$key);
|
19 |
+
$result = $langs[array_shift($keys)];
|
20 |
+
|
21 |
+
foreach ($keys as $v) {
|
22 |
+
$result = $result[$v];
|
23 |
+
}
|
24 |
+
|
25 |
+
if (is_array($parameters) && !empty($parameters)) {
|
26 |
+
foreach ($parameters as $k => $v) {
|
27 |
+
$result = str_replace($k, $v, $result);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
return $result;
|
32 |
+
}
|
33 |
+
|
34 |
+
protected static function readDirectory($directory)
|
35 |
+
{
|
36 |
+
if (!empty(self::$cache)) {
|
37 |
+
return self::$cache;
|
38 |
+
}
|
39 |
+
|
40 |
+
$langs = array();
|
41 |
+
if ($handle = opendir($directory)) {
|
42 |
+
while ($lang = readdir($handle)) {
|
43 |
+
if (strpos($lang, '.php') !== false) {
|
44 |
+
$langKey = str_replace('.php', '', $lang);
|
45 |
+
$langs[$langKey] = include $directory.'/'.$lang;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
closedir($handle);
|
50 |
+
}
|
51 |
+
|
52 |
+
self::$cache = $langs;
|
53 |
+
|
54 |
+
return $langs;
|
55 |
+
}
|
56 |
+
}
|
lib/Conekta/lib/Conekta/LineItem.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class LineItem extends Resource
|
11 |
+
{
|
12 |
+
var $name = "";
|
13 |
+
var $description = "";
|
14 |
+
var $unit_price = "";
|
15 |
+
var $quantity = "";
|
16 |
+
var $sku = "";
|
17 |
+
var $shippable = "";
|
18 |
+
var $tags = "";
|
19 |
+
var $brand = "";
|
20 |
+
var $type = "";
|
21 |
+
var $parent_id = "";
|
22 |
+
|
23 |
+
public function __get($property)
|
24 |
+
{
|
25 |
+
if (property_exists($this, $property)) {
|
26 |
+
return $this->$property;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
public function __isset($property)
|
31 |
+
{
|
32 |
+
return isset($this->$property);
|
33 |
+
}
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
public function instanceUrl()
|
38 |
+
{
|
39 |
+
$this->apiVersion = Conekta::$apiVersion;
|
40 |
+
$id = $this->id;
|
41 |
+
parent::idValidator($id);
|
42 |
+
|
43 |
+
$class = get_class($this);
|
44 |
+
$base = $this->classUrl($class);
|
45 |
+
$extn = urlencode($id);
|
46 |
+
$orderUrl = $this->order->instanceUrl();
|
47 |
+
|
48 |
+
return $orderUrl . $base . "/{$extn}";
|
49 |
+
}
|
50 |
+
|
51 |
+
public function update($params = null)
|
52 |
+
{
|
53 |
+
return parent::_update($params);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function delete()
|
57 |
+
{
|
58 |
+
return parent::_delete('order', 'line_items');
|
59 |
+
}
|
60 |
+
}
|
lib/Conekta/lib/Conekta/Log.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Log extends Resource
|
8 |
+
{
|
9 |
+
var $method = "";
|
10 |
+
var $url = "";
|
11 |
+
var $status = "";
|
12 |
+
var $version = "";
|
13 |
+
var $ip_address = "";
|
14 |
+
var $related = "";
|
15 |
+
var $request_body = "";
|
16 |
+
var $request_headers = "";
|
17 |
+
var $created_at = "";
|
18 |
+
var $query_string = "";
|
19 |
+
|
20 |
+
public function __get($property)
|
21 |
+
{
|
22 |
+
if (property_exists($this, $property)) {
|
23 |
+
return $this->$property;
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function __isset($property)
|
28 |
+
{
|
29 |
+
return isset($this->$property);
|
30 |
+
}
|
31 |
+
|
32 |
+
public static function find($id)
|
33 |
+
{
|
34 |
+
$class = get_called_class();
|
35 |
+
|
36 |
+
return parent::_scpFind($class, $id);
|
37 |
+
}
|
38 |
+
|
39 |
+
public static function where($params = null)
|
40 |
+
{
|
41 |
+
$class = get_called_class();
|
42 |
+
|
43 |
+
return parent::_scpWhere($class, $params);
|
44 |
+
}
|
45 |
+
}
|
lib/Conekta/lib/Conekta/Method.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Method extends Resource
|
8 |
{
|
9 |
}
|
lib/Conekta/lib/Conekta/Object.php
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
protected $_values;
|
6 |
|
@@ -13,26 +18,37 @@ class Conekta_Object extends ArrayObject
|
|
13 |
public function _setVal($k, $v)
|
14 |
{
|
15 |
$this->_values[$k] = $v;
|
|
|
16 |
}
|
17 |
|
18 |
public function _unsetKey($k)
|
19 |
{
|
20 |
unset($this->_values[$k]);
|
|
|
21 |
}
|
22 |
|
23 |
public function loadFromArray($values)
|
24 |
{
|
25 |
foreach ($values as $k => $v) {
|
26 |
if (is_array($v)) {
|
27 |
-
$v =
|
28 |
}
|
29 |
-
if (strpos(get_class($this), '
|
30 |
$this[$k] = $v;
|
31 |
} else {
|
32 |
-
if (strpos($k, 'url') !== false && strpos(get_class($this), '
|
33 |
$k = "webhook_url";
|
34 |
}
|
35 |
$this->$k = $v;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
}
|
37 |
$this->_setVal($k, $v);
|
38 |
}
|
@@ -51,7 +67,7 @@ class Conekta_Object extends ArrayObject
|
|
51 |
{
|
52 |
$array = array();
|
53 |
foreach ($this->_values as $k => $v) {
|
54 |
-
if (is_object($v) == true &&
|
55 |
if (empty($v->_values) != true) {
|
56 |
$array[$k] = $v->_toArray();
|
57 |
}
|
@@ -67,4 +83,9 @@ class Conekta_Object extends ArrayObject
|
|
67 |
{
|
68 |
return $this->__toJSON();
|
69 |
}
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \ArrayObject;
|
6 |
+
use \Conekta\Util;
|
7 |
+
|
8 |
+
class Object extends ArrayObject
|
9 |
{
|
10 |
protected $_values;
|
11 |
|
18 |
public function _setVal($k, $v)
|
19 |
{
|
20 |
$this->_values[$k] = $v;
|
21 |
+
$this[$k] = $v;
|
22 |
}
|
23 |
|
24 |
public function _unsetKey($k)
|
25 |
{
|
26 |
unset($this->_values[$k]);
|
27 |
+
unset($k);
|
28 |
}
|
29 |
|
30 |
public function loadFromArray($values)
|
31 |
{
|
32 |
foreach ($values as $k => $v) {
|
33 |
if (is_array($v)) {
|
34 |
+
$v = Util::convertToConektaObject($v);
|
35 |
}
|
36 |
+
if (strpos(get_class($this), 'Object') !== false) {
|
37 |
$this[$k] = $v;
|
38 |
} else {
|
39 |
+
if (strpos($k, 'url') !== false && strpos(get_class($this), 'Webhook') !== false) {
|
40 |
$k = "webhook_url";
|
41 |
}
|
42 |
$this->$k = $v;
|
43 |
+
if ($k == "metadata") {
|
44 |
+
$this->metadata = new Object();
|
45 |
+
if (is_array($v) || is_object($v)) {
|
46 |
+
foreach ($v as $k2 => $v2) {
|
47 |
+
$this->metadata->$k2 = $v2;
|
48 |
+
$this->metadata->_setVal($k2, $v2);
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
}
|
53 |
$this->_setVal($k, $v);
|
54 |
}
|
67 |
{
|
68 |
$array = array();
|
69 |
foreach ($this->_values as $k => $v) {
|
70 |
+
if (is_object($v) == true && get_class($v) != '') {
|
71 |
if (empty($v->_values) != true) {
|
72 |
$array[$k] = $v->_toArray();
|
73 |
}
|
83 |
{
|
84 |
return $this->__toJSON();
|
85 |
}
|
86 |
+
|
87 |
+
public function offsetGet($offset)
|
88 |
+
{
|
89 |
+
return isset($this->_values[$offset]) ? $this->_values[$offset] : null;
|
90 |
+
}
|
91 |
}
|
lib/Conekta/lib/Conekta/Order.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Order extends Resource
|
8 |
+
{
|
9 |
+
var $livemode = "";
|
10 |
+
var $amount = "";
|
11 |
+
var $status = "";
|
12 |
+
var $customer_id = "";
|
13 |
+
var $currency = "";
|
14 |
+
var $capture = "";
|
15 |
+
var $metadata = "";
|
16 |
+
var $created_at = "";
|
17 |
+
var $updated_at = "";
|
18 |
+
|
19 |
+
public function __get($property)
|
20 |
+
{
|
21 |
+
if (property_exists($this, $property)) {
|
22 |
+
return $this->$property;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
public function __isset($property)
|
27 |
+
{
|
28 |
+
return isset($this->$property);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function loadFromArray($values = null)
|
32 |
+
{
|
33 |
+
if (isset($values)) {
|
34 |
+
parent::loadFromArray($values);
|
35 |
+
}
|
36 |
+
|
37 |
+
$submodels = array(
|
38 |
+
'tax_lines', 'shipping_lines', 'discount_lines', 'line_items', 'charges', 'returns'
|
39 |
+
);
|
40 |
+
|
41 |
+
foreach ($submodels as $submodel) {
|
42 |
+
if(isset($values[$submodel])){
|
43 |
+
$submodel_list = new ConektaList($submodel);
|
44 |
+
$submodel_list->loadFromArray($values[$submodel]);
|
45 |
+
$this->$submodel->_values = $submodel_list;
|
46 |
+
$this->$submodel = $submodel_list;
|
47 |
+
|
48 |
+
foreach ($this->$submodel as $k => $v) {
|
49 |
+
$v->order = $this;
|
50 |
+
}
|
51 |
+
}else{
|
52 |
+
$this->$submodel = new ConektaList($submodel, array());
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if (isset($this->fiscal_entity)) {
|
57 |
+
$this->fiscal_entity->order = $this;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
public static function where($params = null)
|
62 |
+
{
|
63 |
+
$class = get_called_class();
|
64 |
+
|
65 |
+
return parent::_scpWhere($class, $params);
|
66 |
+
}
|
67 |
+
|
68 |
+
public function update($params = null)
|
69 |
+
{
|
70 |
+
return parent::_update($params);
|
71 |
+
}
|
72 |
+
|
73 |
+
public static function create($params = null)
|
74 |
+
{
|
75 |
+
$class = get_called_class();
|
76 |
+
|
77 |
+
return parent::_scpCreate($class, $params);
|
78 |
+
}
|
79 |
+
|
80 |
+
public static function find($id)
|
81 |
+
{
|
82 |
+
$class = get_called_class();
|
83 |
+
|
84 |
+
return parent::_scpFind($class, $id);
|
85 |
+
}
|
86 |
+
|
87 |
+
public function capture()
|
88 |
+
{
|
89 |
+
return parent::_customAction('put', 'capture', null);
|
90 |
+
}
|
91 |
+
|
92 |
+
public function createTaxLine($params = null)
|
93 |
+
{
|
94 |
+
return parent::_createMemberWithRelation('tax_lines', $params, $this);
|
95 |
+
}
|
96 |
+
|
97 |
+
public function createShippingLine($params = null)
|
98 |
+
{
|
99 |
+
return parent::_createMemberWithRelation('shipping_lines', $params, $this);
|
100 |
+
}
|
101 |
+
|
102 |
+
public function createDiscountLine($params = null)
|
103 |
+
{
|
104 |
+
return parent::_createMemberWithRelation('discount_lines', $params, $this);
|
105 |
+
}
|
106 |
+
|
107 |
+
public function createLineItem($params = null)
|
108 |
+
{
|
109 |
+
return parent::_createMemberWithRelation('line_items', $params, $this);
|
110 |
+
}
|
111 |
+
|
112 |
+
public function createFiscalEntity($params = null)
|
113 |
+
{
|
114 |
+
$order = parent::_update(array('fiscal_entity' => $params));
|
115 |
+
|
116 |
+
return $order->fiscal_entity;
|
117 |
+
}
|
118 |
+
|
119 |
+
public function createCharge($params = null)
|
120 |
+
{
|
121 |
+
return parent::_createMember('charges', $params);
|
122 |
+
}
|
123 |
+
|
124 |
+
public function createReturn($params = null)
|
125 |
+
{
|
126 |
+
return parent::_createMember('returns', $params);
|
127 |
+
}
|
128 |
+
}
|
lib/Conekta/lib/Conekta/OrderReturn.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
use \Conekta\ErrorList;
|
10 |
+
|
11 |
+
class OrderReturn extends Resource
|
12 |
+
{
|
13 |
+
var $livemode = "";
|
14 |
+
var $amount = "";
|
15 |
+
var $currency = "";
|
16 |
+
var $charge_id = "";
|
17 |
+
var $reason = "";
|
18 |
+
var $created_at = "";
|
19 |
+
var $parent_id = "";
|
20 |
+
|
21 |
+
public function __get($property)
|
22 |
+
{
|
23 |
+
if (property_exists($this, $property)) {
|
24 |
+
return $this->$property;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
|
28 |
+
public function __isset($property)
|
29 |
+
{
|
30 |
+
return isset($this->$property);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function instanceUrl()
|
34 |
+
{
|
35 |
+
$this->apiVersion = Conekta::$apiVersion;
|
36 |
+
$id = $this->id;
|
37 |
+
parent::idValidator($id);
|
38 |
+
|
39 |
+
$class = get_class($this);
|
40 |
+
$base = $this->classUrl($class);
|
41 |
+
$extn = urlencode($id);
|
42 |
+
$orderUrl = $this->order->instanceUrl();
|
43 |
+
|
44 |
+
return $orderUrl . $base . "/{$extn}";
|
45 |
+
}
|
46 |
+
}
|
lib/Conekta/lib/Conekta/Payee.php
CHANGED
@@ -1,7 +1,30 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function loadFromArray($values = null)
|
6 |
{
|
7 |
if (isset($values)) {
|
@@ -23,35 +46,35 @@ class Conekta_Payee extends Conekta_Resource
|
|
23 |
{
|
24 |
$class = get_called_class();
|
25 |
|
26 |
-
return
|
27 |
}
|
28 |
|
29 |
public static function where($params = null)
|
30 |
{
|
31 |
$class = get_called_class();
|
32 |
|
33 |
-
return
|
34 |
}
|
35 |
|
36 |
public static function create($params = null)
|
37 |
{
|
38 |
$class = get_called_class();
|
39 |
|
40 |
-
return
|
41 |
}
|
42 |
|
43 |
public function delete()
|
44 |
{
|
45 |
-
return
|
46 |
}
|
47 |
|
48 |
public function update($params = null)
|
49 |
{
|
50 |
-
return
|
51 |
}
|
52 |
|
53 |
public function createPayoutMethod($params = null)
|
54 |
{
|
55 |
-
return
|
56 |
}
|
57 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Payee extends Resource
|
8 |
{
|
9 |
+
var $email = "";
|
10 |
+
var $name = "";
|
11 |
+
var $phone = "";
|
12 |
+
var $livemode = "";
|
13 |
+
var $default_destination_id = "";
|
14 |
+
var $created_at = "";
|
15 |
+
|
16 |
+
public function __get($property)
|
17 |
+
{
|
18 |
+
if (property_exists($this, $property)) {
|
19 |
+
return $this->$property;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function __isset($property)
|
24 |
+
{
|
25 |
+
return isset($this->$property);
|
26 |
+
}
|
27 |
+
|
28 |
public function loadFromArray($values = null)
|
29 |
{
|
30 |
if (isset($values)) {
|
46 |
{
|
47 |
$class = get_called_class();
|
48 |
|
49 |
+
return parent::_scpFind($class, $id);
|
50 |
}
|
51 |
|
52 |
public static function where($params = null)
|
53 |
{
|
54 |
$class = get_called_class();
|
55 |
|
56 |
+
return parent::_scpWhere($class, $params);
|
57 |
}
|
58 |
|
59 |
public static function create($params = null)
|
60 |
{
|
61 |
$class = get_called_class();
|
62 |
|
63 |
+
return parent::_scpCreate($class, $params);
|
64 |
}
|
65 |
|
66 |
public function delete()
|
67 |
{
|
68 |
+
return parent::_delete();
|
69 |
}
|
70 |
|
71 |
public function update($params = null)
|
72 |
{
|
73 |
+
return parent::_update($params);
|
74 |
}
|
75 |
|
76 |
public function createPayoutMethod($params = null)
|
77 |
{
|
78 |
+
return parent::_createMember('payout_methods', $params);
|
79 |
}
|
80 |
}
|
lib/Conekta/lib/Conekta/PaymentMethod.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class PaymentMethod extends Resource
|
8 |
{
|
9 |
}
|
lib/Conekta/lib/Conekta/PaymentSource.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class PaymentSource extends Resource
|
11 |
+
{
|
12 |
+
public function instanceUrl()
|
13 |
+
{
|
14 |
+
$this->apiVersion = Conekta::$apiVersion;
|
15 |
+
$id = $this->id;
|
16 |
+
parent::idValidator($id);
|
17 |
+
|
18 |
+
$class = get_class($this);
|
19 |
+
$base = "/payment_sources";
|
20 |
+
$extn = urlencode($id);
|
21 |
+
$customerUrl = $this->customer->instanceUrl();
|
22 |
+
return $customerUrl . $base . "/{$extn}";
|
23 |
+
}
|
24 |
+
|
25 |
+
public function update($params = null)
|
26 |
+
{
|
27 |
+
return parent::_update($params);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function delete()
|
31 |
+
{
|
32 |
+
return parent::_delete('customer', 'payment_sources');
|
33 |
+
}
|
34 |
+
}
|
lib/Conekta/lib/Conekta/Payout.php
CHANGED
@@ -1,25 +1,29 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static function find($id)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
public static function where($params = null)
|
13 |
{
|
14 |
$class = get_called_class();
|
15 |
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
public static function create($params = null)
|
20 |
{
|
21 |
$class = get_called_class();
|
22 |
|
23 |
-
return
|
24 |
}
|
25 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Payout extends Resource
|
8 |
{
|
9 |
public static function find($id)
|
10 |
{
|
11 |
$class = get_called_class();
|
12 |
|
13 |
+
return parent::_scpFind($class, $id);
|
14 |
}
|
15 |
|
16 |
public static function where($params = null)
|
17 |
{
|
18 |
$class = get_called_class();
|
19 |
|
20 |
+
return parent::_scpWhere($class, $params);
|
21 |
}
|
22 |
|
23 |
public static function create($params = null)
|
24 |
{
|
25 |
$class = get_called_class();
|
26 |
|
27 |
+
return parent::_scpCreate($class, $params);
|
28 |
}
|
29 |
}
|
lib/Conekta/lib/Conekta/PayoutMethod.php
CHANGED
@@ -1,31 +1,39 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public function instanceUrl()
|
6 |
{
|
7 |
$id = $this->id;
|
8 |
if (!$id) {
|
9 |
-
throw new
|
10 |
-
|
11 |
-
|
12 |
);
|
13 |
}
|
|
|
14 |
$class = get_class($this);
|
15 |
$base = $this->classUrl($class);
|
16 |
$extn = urlencode($id);
|
17 |
$payeeUrl = $this->payee->instanceUrl();
|
18 |
|
19 |
-
return
|
20 |
}
|
21 |
|
22 |
public function update($params = null)
|
23 |
{
|
24 |
-
return
|
25 |
}
|
26 |
|
27 |
public function delete()
|
28 |
{
|
29 |
-
return
|
30 |
}
|
31 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class PayoutMethod extends Resource
|
11 |
{
|
12 |
public function instanceUrl()
|
13 |
{
|
14 |
$id = $this->id;
|
15 |
if (!$id) {
|
16 |
+
throw new Error(
|
17 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
18 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
19 |
);
|
20 |
}
|
21 |
+
|
22 |
$class = get_class($this);
|
23 |
$base = $this->classUrl($class);
|
24 |
$extn = urlencode($id);
|
25 |
$payeeUrl = $this->payee->instanceUrl();
|
26 |
|
27 |
+
return $payeeUrl . $base . "/{$extn}";
|
28 |
}
|
29 |
|
30 |
public function update($params = null)
|
31 |
{
|
32 |
+
return parent::_update($params);
|
33 |
}
|
34 |
|
35 |
public function delete()
|
36 |
{
|
37 |
+
return parent::_delete('payee', 'payout_methods');
|
38 |
}
|
39 |
}
|
lib/Conekta/lib/Conekta/Plan.php
CHANGED
@@ -1,36 +1,40 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static function find($id)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
public static function create($params = null)
|
13 |
{
|
14 |
$class = get_called_class();
|
15 |
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
public static function where($params = null)
|
20 |
{
|
21 |
$class = get_called_class();
|
22 |
|
23 |
-
return
|
24 |
}
|
25 |
|
26 |
public function delete()
|
27 |
{
|
28 |
-
return
|
29 |
}
|
30 |
|
31 |
public function update($params = null)
|
32 |
{
|
33 |
-
return
|
34 |
}
|
35 |
|
36 |
/**
|
@@ -40,13 +44,13 @@ class Conekta_Plan extends Conekta_Resource
|
|
40 |
{
|
41 |
$class = get_called_class();
|
42 |
|
43 |
-
return
|
44 |
}
|
45 |
|
46 |
public static function all($params = null)
|
47 |
{
|
48 |
$class = get_called_class();
|
49 |
|
50 |
-
return
|
51 |
}
|
52 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Plan extends Resource
|
8 |
{
|
9 |
public static function find($id)
|
10 |
{
|
11 |
$class = get_called_class();
|
12 |
|
13 |
+
return parent::_scpFind($class, $id);
|
14 |
}
|
15 |
|
16 |
public static function create($params = null)
|
17 |
{
|
18 |
$class = get_called_class();
|
19 |
|
20 |
+
return parent::_scpCreate($class, $params);
|
21 |
}
|
22 |
|
23 |
public static function where($params = null)
|
24 |
{
|
25 |
$class = get_called_class();
|
26 |
|
27 |
+
return parent::_scpWhere($class, $params);
|
28 |
}
|
29 |
|
30 |
public function delete()
|
31 |
{
|
32 |
+
return parent::_delete();
|
33 |
}
|
34 |
|
35 |
public function update($params = null)
|
36 |
{
|
37 |
+
return parent::_update($params);
|
38 |
}
|
39 |
|
40 |
/**
|
44 |
{
|
45 |
$class = get_called_class();
|
46 |
|
47 |
+
return parent::_scpFind($class, $id);
|
48 |
}
|
49 |
|
50 |
public static function all($params = null)
|
51 |
{
|
52 |
$class = get_called_class();
|
53 |
|
54 |
+
return parent::_scpWhere($class, $params);
|
55 |
}
|
56 |
}
|
lib/Conekta/lib/Conekta/Requestor.php
CHANGED
@@ -1,19 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public $apiKey;
|
6 |
|
7 |
public function __construct()
|
8 |
{
|
9 |
$this->apiKey = Conekta::$apiKey;
|
|
|
|
|
10 |
}
|
11 |
|
12 |
public static function apiUrl($url = '')
|
13 |
{
|
14 |
$apiBase = Conekta::$apiBase;
|
15 |
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
private function setHeaders()
|
@@ -26,49 +34,52 @@ class Conekta_Requestor
|
|
26 |
'uname' => php_uname(),
|
27 |
);
|
28 |
|
|
|
|
|
|
|
|
|
29 |
$headers = array(
|
30 |
'Accept: application/vnd.conekta-v'.Conekta::$apiVersion.'+json',
|
31 |
'Accept-Language: '.Conekta::$locale,
|
32 |
'X-Conekta-Client-User-Agent: '.json_encode($user_agent),
|
33 |
'User-Agent: Conekta/v1 PhpBindings/'.Conekta::VERSION,
|
34 |
'Authorization: Basic '.base64_encode($this->apiKey.':'),
|
|
|
35 |
);
|
36 |
|
37 |
return $headers;
|
38 |
}
|
39 |
|
40 |
-
public function request($
|
41 |
{
|
42 |
-
$
|
43 |
$headers = $this->setHeaders();
|
44 |
$curl = curl_init();
|
45 |
-
$
|
46 |
$opts = array();
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
break;
|
69 |
-
default:
|
70 |
-
throw new Exception('Wrong method');
|
71 |
}
|
|
|
72 |
$url = $this->apiUrl($url);
|
73 |
$opts[CURLOPT_URL] = $url;
|
74 |
$opts[CURLOPT_RETURNTRANSFER] = true;
|
@@ -81,40 +92,37 @@ class Conekta_Requestor
|
|
81 |
$response = curl_exec($curl);
|
82 |
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
83 |
curl_close($curl);
|
|
|
|
|
|
|
84 |
if ($response_code != 200) {
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
-
return
|
89 |
}
|
90 |
|
91 |
-
|
92 |
{
|
93 |
-
if
|
94 |
-
|
|
|
95 |
}
|
96 |
-
$r = array();
|
97 |
-
foreach ($arr as $k => $v) {
|
98 |
-
if (is_null($v)) {
|
99 |
-
continue;
|
100 |
-
}
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
} elseif ($prefix) {
|
105 |
-
$k = $prefix.'[]';
|
106 |
-
}
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
$v = $v ? 'true' : 'false';
|
113 |
-
}
|
114 |
-
$r[] = urlencode($k).'='.urlencode($v);
|
115 |
-
}
|
116 |
}
|
117 |
|
118 |
-
return
|
119 |
}
|
120 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Conekta;
|
6 |
+
use \Conekta\Error;
|
7 |
+
use \Conekta\ErrorList;
|
8 |
+
|
9 |
+
class Requestor
|
10 |
{
|
11 |
public $apiKey;
|
12 |
|
13 |
public function __construct()
|
14 |
{
|
15 |
$this->apiKey = Conekta::$apiKey;
|
16 |
+
$this->apiVersion = Conekta::$apiVersion;
|
17 |
+
$this->plugin = Conekta::$plugin;
|
18 |
}
|
19 |
|
20 |
public static function apiUrl($url = '')
|
21 |
{
|
22 |
$apiBase = Conekta::$apiBase;
|
23 |
|
24 |
+
return $apiBase . $url;
|
25 |
}
|
26 |
|
27 |
private function setHeaders()
|
34 |
'uname' => php_uname(),
|
35 |
);
|
36 |
|
37 |
+
if(strlen($this->plugin) > 0){
|
38 |
+
$user_agent = array_merge($user_agent, array('plugin' => $this->plugin));
|
39 |
+
}
|
40 |
+
|
41 |
$headers = array(
|
42 |
'Accept: application/vnd.conekta-v'.Conekta::$apiVersion.'+json',
|
43 |
'Accept-Language: '.Conekta::$locale,
|
44 |
'X-Conekta-Client-User-Agent: '.json_encode($user_agent),
|
45 |
'User-Agent: Conekta/v1 PhpBindings/'.Conekta::VERSION,
|
46 |
'Authorization: Basic '.base64_encode($this->apiKey.':'),
|
47 |
+
'Content-Type: application/json'
|
48 |
);
|
49 |
|
50 |
return $headers;
|
51 |
}
|
52 |
|
53 |
+
public function request($method, $url, $params = null)
|
54 |
{
|
55 |
+
$json_params = json_encode($params);
|
56 |
$headers = $this->setHeaders();
|
57 |
$curl = curl_init();
|
58 |
+
$method = strtolower($method);
|
59 |
$opts = array();
|
60 |
+
|
61 |
+
switch ($method) {
|
62 |
+
case 'get':
|
63 |
+
$opts[CURLOPT_HTTPGET] = 1;
|
64 |
+
$url = $this->buildQueryParamsUrl($url, $params);
|
65 |
+
break;
|
66 |
+
case 'post':
|
67 |
+
$opts[CURLOPT_POST] = 1;
|
68 |
+
$opts[CURLOPT_POSTFIELDS] = $json_params;
|
69 |
+
break;
|
70 |
+
case 'put':
|
71 |
+
$opts[CURLOPT_RETURNTRANSFER] = 1;
|
72 |
+
$opts[CURLOPT_CUSTOMREQUEST] = 'PUT';
|
73 |
+
$opts[CURLOPT_POSTFIELDS] = $json_params;
|
74 |
+
break;
|
75 |
+
case 'delete':
|
76 |
+
$opts[CURLOPT_CUSTOMREQUEST] = 'DELETE';
|
77 |
+
$url = $this->buildSegementParamsUrl($url, $params);
|
78 |
+
break;
|
79 |
+
default:
|
80 |
+
throw new Exception('Wrong method');
|
|
|
|
|
|
|
81 |
}
|
82 |
+
|
83 |
$url = $this->apiUrl($url);
|
84 |
$opts[CURLOPT_URL] = $url;
|
85 |
$opts[CURLOPT_RETURNTRANSFER] = true;
|
92 |
$response = curl_exec($curl);
|
93 |
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
94 |
curl_close($curl);
|
95 |
+
|
96 |
+
$json_response = json_decode($response, true);
|
97 |
+
|
98 |
if ($response_code != 200) {
|
99 |
+
if($this->apiVersion == '2.0.0'){
|
100 |
+
throw ErrorList::errorHandler($json_response , $response_code);
|
101 |
+
}else{
|
102 |
+
throw Error::errorHandler($json_response, $response_code);
|
103 |
+
}
|
104 |
+
|
105 |
}
|
106 |
|
107 |
+
return $json_response;
|
108 |
}
|
109 |
|
110 |
+
private function buildQueryParamsUrl($url, $params)
|
111 |
{
|
112 |
+
if(!is_null($params)){
|
113 |
+
$params = http_build_query($params);
|
114 |
+
$url = $url.'?'.$params;
|
115 |
}
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
return $url;
|
118 |
+
}
|
|
|
|
|
|
|
119 |
|
120 |
+
private function buildSegementParamsUrl($url, $params)
|
121 |
+
{
|
122 |
+
if(!is_array($params)){
|
123 |
+
$url = $url.urlencode($params);
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
|
126 |
+
return $url;
|
127 |
}
|
128 |
}
|
lib/Conekta/lib/Conekta/Resource.php
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static function className($class)
|
6 |
{
|
7 |
-
// Useful for namespaces: Foo\
|
8 |
if ($postfix = strrchr($class, '\\')) {
|
9 |
$class = substr($postfix, 1);
|
10 |
}
|
@@ -13,7 +22,7 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
13 |
}
|
14 |
$class = str_replace('_', '', $class);
|
15 |
$name = urlencode($class);
|
16 |
-
$name = strtolower($name);
|
17 |
|
18 |
return $name;
|
19 |
}
|
@@ -27,18 +36,25 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
27 |
|
28 |
public static function classUrl($class = null)
|
29 |
{
|
30 |
-
if (
|
31 |
-
|
|
|
|
|
|
|
32 |
}
|
33 |
$base = self::_getBase($class, 'className', $class);
|
34 |
-
|
35 |
-
return "/${base}s";
|
36 |
}
|
37 |
|
38 |
protected static function _scpWhere($class, $params)
|
39 |
{
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
42 |
$url = self::classUrl($class);
|
43 |
$response = $requestor->request('get', $url, $params);
|
44 |
$instance->loadFromArray($response);
|
@@ -49,7 +65,7 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
49 |
protected static function _scpFind($class, $id)
|
50 |
{
|
51 |
$instance = new $class($id);
|
52 |
-
$requestor = new
|
53 |
$url = $instance->instanceUrl();
|
54 |
$response = $requestor->request('get', $url);
|
55 |
$instance->loadFromArray($response);
|
@@ -59,7 +75,7 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
59 |
|
60 |
protected static function _scpCreate($class, $params)
|
61 |
{
|
62 |
-
$requestor = new
|
63 |
$url = self::classUrl($class);
|
64 |
$response = $requestor->request('post', $url, $params);
|
65 |
$instance = new $class();
|
@@ -71,17 +87,29 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
71 |
public function instanceUrl()
|
72 |
{
|
73 |
$id = $this->id;
|
74 |
-
|
75 |
-
throw new Conekta_Error(
|
76 |
-
LANG::translate('error.resource.id', array('RESOURCE' => get_class()), LANG::EN),
|
77 |
-
LANG::translate('error.resource.id_purchaser', null, Conekta::$locale)
|
78 |
-
);
|
79 |
-
}
|
80 |
$class = get_class($this);
|
81 |
$base = $this->classUrl($class);
|
82 |
$extn = urlencode($id);
|
83 |
|
84 |
-
return "$base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
protected function _delete($parent = null, $member = null)
|
@@ -89,10 +117,10 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
89 |
self::_customAction('delete', null, null);
|
90 |
if (isset($parent) && isset($member)) {
|
91 |
$obj = $this->$parent->$member;
|
92 |
-
if (strpos(get_class($obj), '
|
93 |
foreach ($this->$parent->$member as $k => $v) {
|
94 |
if (strpos($v->id, $this->id) !== false) {
|
95 |
-
$this->$parent->$member->_values =
|
96 |
$this->$parent->$member->loadFromArray($this->$parent->$member->_values);
|
97 |
$this->$parent->$member->offsetUnset(count($this->$parent->$member) - 1);
|
98 |
break;
|
@@ -108,7 +136,7 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
108 |
|
109 |
protected function _update($params)
|
110 |
{
|
111 |
-
$requestor = new
|
112 |
$url = $this->instanceUrl();
|
113 |
$response = $requestor->request('put', $url, $params);
|
114 |
$this->loadFromArray($response);
|
@@ -118,19 +146,38 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
118 |
|
119 |
protected function _createMember($member, $params)
|
120 |
{
|
121 |
-
$requestor = new
|
122 |
$url = $this->instanceUrl().'/'.$member;
|
123 |
$response = $requestor->request('post', $url, $params);
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
125 |
if (empty($this->$member)) {
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
-
$this->$member->loadFromArray(array_merge($this->$member->_toArray(), array($response)));
|
129 |
-
$this->loadFromArray();
|
130 |
$instances = $this->$member;
|
131 |
$instance = end($instances);
|
132 |
} else {
|
133 |
-
$class = '
|
|
|
134 |
$instance = new $class();
|
135 |
$instance->loadFromArray($response);
|
136 |
$this->$member = $instance;
|
@@ -143,15 +190,24 @@ abstract class Conekta_Resource extends Conekta_Object
|
|
143 |
|
144 |
protected function _customAction($method = 'post', $action = null, $params = null)
|
145 |
{
|
146 |
-
$requestor = new
|
147 |
if (isset($action)) {
|
148 |
$url = $this->instanceUrl().'/'.$action;
|
149 |
} else {
|
150 |
$url = $this->instanceUrl();
|
151 |
}
|
|
|
152 |
$response = $requestor->request($method, $url, $params);
|
153 |
$this->loadFromArray($response);
|
154 |
|
155 |
return $this;
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Object;
|
6 |
+
use \Conekta\Requestor;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Lang;
|
9 |
+
use \Conekta\Util;
|
10 |
+
use \Conekta\Conekta;
|
11 |
+
|
12 |
+
abstract class Resource extends Object
|
13 |
{
|
14 |
public static function className($class)
|
15 |
{
|
16 |
+
// Useful for namespaces: Foo\Charge
|
17 |
if ($postfix = strrchr($class, '\\')) {
|
18 |
$class = substr($postfix, 1);
|
19 |
}
|
22 |
}
|
23 |
$class = str_replace('_', '', $class);
|
24 |
$name = urlencode($class);
|
25 |
+
$name = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name));
|
26 |
|
27 |
return $name;
|
28 |
}
|
36 |
|
37 |
public static function classUrl($class = null)
|
38 |
{
|
39 |
+
if (empty($class)) {
|
40 |
+
throw new NoConnectionError(
|
41 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => "NULL")),
|
42 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
43 |
+
);
|
44 |
}
|
45 |
$base = self::_getBase($class, 'className', $class);
|
46 |
+
return "/{$base}s";
|
|
|
47 |
}
|
48 |
|
49 |
protected static function _scpWhere($class, $params)
|
50 |
{
|
51 |
+
if (Conekta::$apiVersion == "2.0.0") {
|
52 |
+
$path = explode('\\', $class);
|
53 |
+
$instance = new ConektaList(array_pop($path));
|
54 |
+
} else {
|
55 |
+
$instance = new Object();
|
56 |
+
}
|
57 |
+
$requestor = new Requestor();
|
58 |
$url = self::classUrl($class);
|
59 |
$response = $requestor->request('get', $url, $params);
|
60 |
$instance->loadFromArray($response);
|
65 |
protected static function _scpFind($class, $id)
|
66 |
{
|
67 |
$instance = new $class($id);
|
68 |
+
$requestor = new Requestor();
|
69 |
$url = $instance->instanceUrl();
|
70 |
$response = $requestor->request('get', $url);
|
71 |
$instance->loadFromArray($response);
|
75 |
|
76 |
protected static function _scpCreate($class, $params)
|
77 |
{
|
78 |
+
$requestor = new Requestor();
|
79 |
$url = self::classUrl($class);
|
80 |
$response = $requestor->request('post', $url, $params);
|
81 |
$instance = new $class();
|
87 |
public function instanceUrl()
|
88 |
{
|
89 |
$id = $this->id;
|
90 |
+
$this->idValidator($id);
|
|
|
|
|
|
|
|
|
|
|
91 |
$class = get_class($this);
|
92 |
$base = $this->classUrl($class);
|
93 |
$extn = urlencode($id);
|
94 |
|
95 |
+
return "{$base}/{$extn}";
|
96 |
+
}
|
97 |
+
|
98 |
+
protected function idValidator($id)
|
99 |
+
{
|
100 |
+
if (!$id) {
|
101 |
+
$error = new Error(
|
102 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
103 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
104 |
+
);
|
105 |
+
|
106 |
+
if(Conekta::$apiVersion == "2.0.0"){
|
107 |
+
$errorList = new ErrorList();
|
108 |
+
$errorList->details[] = $error;
|
109 |
+
throw $errorList;
|
110 |
+
}
|
111 |
+
throw $error;
|
112 |
+
}
|
113 |
}
|
114 |
|
115 |
protected function _delete($parent = null, $member = null)
|
117 |
self::_customAction('delete', null, null);
|
118 |
if (isset($parent) && isset($member)) {
|
119 |
$obj = $this->$parent->$member;
|
120 |
+
if (strpos(get_class($obj), 'Object') !== false) {
|
121 |
foreach ($this->$parent->$member as $k => $v) {
|
122 |
if (strpos($v->id, $this->id) !== false) {
|
123 |
+
$this->$parent->$member->_values = Util::shiftArray($this->$parent->$member->_values, $k);
|
124 |
$this->$parent->$member->loadFromArray($this->$parent->$member->_values);
|
125 |
$this->$parent->$member->offsetUnset(count($this->$parent->$member) - 1);
|
126 |
break;
|
136 |
|
137 |
protected function _update($params)
|
138 |
{
|
139 |
+
$requestor = new Requestor();
|
140 |
$url = $this->instanceUrl();
|
141 |
$response = $requestor->request('put', $url, $params);
|
142 |
$this->loadFromArray($response);
|
146 |
|
147 |
protected function _createMember($member, $params)
|
148 |
{
|
149 |
+
$requestor = new Requestor();
|
150 |
$url = $this->instanceUrl().'/'.$member;
|
151 |
$response = $requestor->request('post', $url, $params);
|
152 |
+
|
153 |
+
if (strpos(get_class($this->$member), 'ConektaList') !== false ||
|
154 |
+
strpos(get_class($this->$member), 'Object') !== false ||
|
155 |
+
strpos($member, 'cards') !== false ||
|
156 |
+
strpos($member, 'payout_methods') !== false) {
|
157 |
+
|
158 |
if (empty($this->$member)) {
|
159 |
+
if (Conekta::$apiVersion == '2.0.0') {
|
160 |
+
$this->$member = new ConektaList($member);
|
161 |
+
} else {
|
162 |
+
$this->$member = new Object();
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
if (strpos(get_class($this->$member), 'ConektaList') !== false) {
|
167 |
+
$this->$member->addElement($response);
|
168 |
+
} else {
|
169 |
+
$this->$member->loadFromArray(array_merge(
|
170 |
+
$this->$member->_toArray(),
|
171 |
+
array($response)
|
172 |
+
));
|
173 |
+
|
174 |
+
$this->loadFromArray();
|
175 |
}
|
|
|
|
|
176 |
$instances = $this->$member;
|
177 |
$instance = end($instances);
|
178 |
} else {
|
179 |
+
$class = '\\Conekta\\' . ucfirst($member);
|
180 |
+
|
181 |
$instance = new $class();
|
182 |
$instance->loadFromArray($response);
|
183 |
$this->$member = $instance;
|
190 |
|
191 |
protected function _customAction($method = 'post', $action = null, $params = null)
|
192 |
{
|
193 |
+
$requestor = new Requestor();
|
194 |
if (isset($action)) {
|
195 |
$url = $this->instanceUrl().'/'.$action;
|
196 |
} else {
|
197 |
$url = $this->instanceUrl();
|
198 |
}
|
199 |
+
|
200 |
$response = $requestor->request($method, $url, $params);
|
201 |
$this->loadFromArray($response);
|
202 |
|
203 |
return $this;
|
204 |
}
|
205 |
+
|
206 |
+
protected function _createMemberWithRelation($member, $params, $parent)
|
207 |
+
{
|
208 |
+
$parent_class = strtolower((new \ReflectionClass($parent))->getShortName());
|
209 |
+
$child = self::_createMember($member, $params);
|
210 |
+
$child->$parent_class = $parent;
|
211 |
+
return $child;
|
212 |
+
}
|
213 |
}
|
lib/Conekta/lib/Conekta/ShippingContact.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class ShippingContact extends Resource
|
11 |
+
{
|
12 |
+
var $receiver = "";
|
13 |
+
var $phone = "";
|
14 |
+
var $between_streets = "";
|
15 |
+
var $parent_id = "";
|
16 |
+
var $default = "";
|
17 |
+
|
18 |
+
public function __get($property)
|
19 |
+
{
|
20 |
+
if (property_exists($this, $property)) {
|
21 |
+
return $this->$property;
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
public function __isset($property)
|
26 |
+
{
|
27 |
+
return isset($this->$property);
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
public function instanceUrl()
|
32 |
+
{
|
33 |
+
$id = $this->id;
|
34 |
+
if (!$id) {
|
35 |
+
throw new Error(
|
36 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
37 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
$class = get_class($this);
|
42 |
+
$base = $this->classUrl($class);
|
43 |
+
$extn = urlencode($id);
|
44 |
+
$customerUrl = $this->customer->instanceUrl();
|
45 |
+
|
46 |
+
return $customerUrl . $base . "/{$extn}";
|
47 |
+
}
|
48 |
+
|
49 |
+
public function update($params = null)
|
50 |
+
{
|
51 |
+
return parent::_update($params);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function delete()
|
55 |
+
{
|
56 |
+
return parent::_delete('customer', 'shipping_contacts');
|
57 |
+
}
|
58 |
+
}
|
lib/Conekta/lib/Conekta/ShippingLine.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class ShippingLine extends Resource
|
11 |
+
{
|
12 |
+
public function instanceUrl()
|
13 |
+
{
|
14 |
+
$this->apiVersion = Conekta::$apiVersion;
|
15 |
+
$id = $this->id;
|
16 |
+
parent::idValidator($id);
|
17 |
+
|
18 |
+
$class = get_class($this);
|
19 |
+
$base = $this->classUrl($class);
|
20 |
+
$extn = urlencode($id);
|
21 |
+
$orderUrl = $this->order->instanceUrl();
|
22 |
+
|
23 |
+
return $orderUrl . $base . "/{$extn}";
|
24 |
+
}
|
25 |
+
|
26 |
+
public function update($params = null)
|
27 |
+
{
|
28 |
+
return parent::_update($params);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function delete()
|
32 |
+
{
|
33 |
+
return parent::_delete('order', 'shipping_lines');
|
34 |
+
}
|
35 |
+
}
|
lib/Conekta/lib/Conekta/Source.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
|
10 |
+
class Source extends Resource
|
11 |
+
{
|
12 |
+
public function instanceUrl()
|
13 |
+
{
|
14 |
+
$this->apiVersion = Conekta::$apiVersion;
|
15 |
+
$id = $this->id;
|
16 |
+
if (!$id) {
|
17 |
+
$error = new Error(
|
18 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
19 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
20 |
+
);
|
21 |
+
|
22 |
+
if($this->apiVersion = '1.1.0'){
|
23 |
+
$errorList = new ErrorList();
|
24 |
+
$errorList->details = $error;
|
25 |
+
throw $errorList;
|
26 |
+
}
|
27 |
+
throw $error;
|
28 |
+
}
|
29 |
+
|
30 |
+
$class = get_class($this);
|
31 |
+
$base = $this->classUrl($class);
|
32 |
+
$extn = urlencode($id);
|
33 |
+
$customerUrl = $this->customer->instanceUrl();
|
34 |
+
|
35 |
+
return $customerUrl . $base . "/{$extn}";
|
36 |
+
}
|
37 |
+
|
38 |
+
public function update($params = null)
|
39 |
+
{
|
40 |
+
return parent::_update($params);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function delete()
|
44 |
+
{
|
45 |
+
return parent::_delete('customer', 'sources');
|
46 |
+
}
|
47 |
+
}
|
lib/Conekta/lib/Conekta/Subscription.php
CHANGED
@@ -1,40 +1,47 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public function instanceUrl()
|
6 |
{
|
7 |
$id = $this->id;
|
8 |
if (!$id) {
|
9 |
-
throw new
|
10 |
-
|
11 |
-
|
12 |
);
|
13 |
}
|
14 |
$class = get_class($this);
|
15 |
$base = '/subscription';
|
16 |
$customerUrl = $this->customer->instanceUrl();
|
17 |
|
18 |
-
return
|
19 |
}
|
20 |
|
21 |
public function update($params = null)
|
22 |
{
|
23 |
-
return
|
24 |
}
|
25 |
|
26 |
public function cancel()
|
27 |
{
|
28 |
-
return
|
29 |
}
|
30 |
|
31 |
public function pause()
|
32 |
{
|
33 |
-
return
|
34 |
}
|
35 |
|
36 |
public function resume()
|
37 |
{
|
38 |
-
return
|
39 |
}
|
40 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Conekta;
|
8 |
+
use \Conekta\Error;
|
9 |
+
|
10 |
+
class Subscription extends Resource
|
11 |
{
|
12 |
public function instanceUrl()
|
13 |
{
|
14 |
$id = $this->id;
|
15 |
if (!$id) {
|
16 |
+
throw new Error(
|
17 |
+
Lang::translate('error.resource.id', Lang::EN, array('RESOURCE' => get_class())),
|
18 |
+
Lang::translate('error.resource.id_purchaser', Conekta::$locale)
|
19 |
);
|
20 |
}
|
21 |
$class = get_class($this);
|
22 |
$base = '/subscription';
|
23 |
$customerUrl = $this->customer->instanceUrl();
|
24 |
|
25 |
+
return $customerUrl . $base;
|
26 |
}
|
27 |
|
28 |
public function update($params = null)
|
29 |
{
|
30 |
+
return parent::_update($params);
|
31 |
}
|
32 |
|
33 |
public function cancel()
|
34 |
{
|
35 |
+
return parent::_customAction('post', 'cancel');
|
36 |
}
|
37 |
|
38 |
public function pause()
|
39 |
{
|
40 |
+
return parent::_customAction('post', 'pause');
|
41 |
}
|
42 |
|
43 |
public function resume()
|
44 |
{
|
45 |
+
return parent::_customAction('post', 'resume');
|
46 |
}
|
47 |
}
|
lib/Conekta/lib/Conekta/TaxLine.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
use \Conekta\Lang;
|
7 |
+
use \Conekta\Error;
|
8 |
+
use \Conekta\Conekta;
|
9 |
+
use \Conekta\ErrorList;
|
10 |
+
|
11 |
+
class TaxLine extends Resource
|
12 |
+
{
|
13 |
+
public function instanceUrl()
|
14 |
+
{
|
15 |
+
$this->apiVersion = Conekta::$apiVersion;
|
16 |
+
$id = $this->id;
|
17 |
+
parent::idValidator($id);
|
18 |
+
|
19 |
+
$class = get_class($this);
|
20 |
+
$base = $this->classUrl($class);
|
21 |
+
$extn = urlencode($id);
|
22 |
+
$orderUrl = $this->order->instanceUrl();
|
23 |
+
|
24 |
+
return $orderUrl . $base . "/{$extn}";
|
25 |
+
}
|
26 |
+
|
27 |
+
public function update($params = null)
|
28 |
+
{
|
29 |
+
return parent::_update($params);
|
30 |
+
}
|
31 |
+
|
32 |
+
public function delete()
|
33 |
+
{
|
34 |
+
return parent::_delete('order', 'tax_lines');
|
35 |
+
}
|
36 |
+
}
|
lib/Conekta/lib/Conekta/Token.php
CHANGED
@@ -1,19 +1,23 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static function find($id)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
public static function create($params = null)
|
13 |
{
|
14 |
$class = get_called_class();
|
15 |
-
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
/**
|
@@ -23,6 +27,6 @@ class Conekta_Token extends Conekta_Resource
|
|
23 |
{
|
24 |
$class = get_called_class();
|
25 |
|
26 |
-
return
|
27 |
}
|
28 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Token extends Resource
|
8 |
{
|
9 |
public static function find($id)
|
10 |
{
|
11 |
$class = get_called_class();
|
12 |
|
13 |
+
return parent::_scpFind($class, $id);
|
14 |
}
|
15 |
|
16 |
public static function create($params = null)
|
17 |
{
|
18 |
$class = get_called_class();
|
19 |
+
|
20 |
+
return parent::_scpCreate($class, $params);
|
21 |
}
|
22 |
|
23 |
/**
|
27 |
{
|
28 |
$class = get_called_class();
|
29 |
|
30 |
+
return parent::_scpFind($class, $id);
|
31 |
}
|
32 |
}
|
lib/Conekta/lib/Conekta/Util.php
CHANGED
@@ -1,24 +1,40 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static $types = array(
|
6 |
-
'webhook' => '
|
7 |
-
'webhook_log' => '
|
8 |
-
'billing_address' => '
|
9 |
-
'bank_transfer_payout_method' => '
|
10 |
-
'payout' => '
|
11 |
-
'payee' => '
|
12 |
-
'payout_method' => '
|
13 |
-
'card_payment' => '
|
14 |
-
'cash_payment' => '
|
15 |
-
'bank_transfer_payment' => '
|
16 |
-
'card' => '
|
17 |
-
'charge' => '
|
18 |
-
'customer' => '
|
19 |
-
'event' => '
|
20 |
-
'plan' => '
|
21 |
-
'subscription' => '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
);
|
23 |
|
24 |
public static function convertToConektaObject($resp)
|
@@ -32,21 +48,23 @@ abstract class Conekta_Util
|
|
32 |
|
33 |
return $instance;
|
34 |
}
|
|
|
35 |
if (isset($resp['street1']) || isset($resp['street2'])) {
|
36 |
-
$class = '
|
37 |
$instance = new $class();
|
38 |
$instance->loadFromArray($resp);
|
39 |
|
40 |
return $instance;
|
41 |
}
|
|
|
42 |
if (current($resp)) {
|
43 |
-
$instance = new
|
44 |
$instance->loadFromArray($resp);
|
45 |
|
46 |
return $instance;
|
47 |
}
|
48 |
|
49 |
-
return new
|
50 |
}
|
51 |
|
52 |
return $resp;
|
1 |
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Object;
|
6 |
+
|
7 |
+
abstract class Util
|
8 |
{
|
9 |
public static $types = array(
|
10 |
+
'webhook' => '\Conekta\Webhook',
|
11 |
+
'webhook_log' => '\Conekta\WebhookLog',
|
12 |
+
'billing_address' => '\Conekta\Address',
|
13 |
+
'bank_transfer_payout_method' => '\Conekta\Method',
|
14 |
+
'payout' => '\Conekta\Payout',
|
15 |
+
'payee' => '\Conekta\Payee',
|
16 |
+
'payout_method' => '\Conekta\PayoutMethod',
|
17 |
+
'card_payment' => '\Conekta\PaymentMethod',
|
18 |
+
'cash_payment' => '\Conekta\PaymentMethod',
|
19 |
+
'bank_transfer_payment' => '\Conekta\PaymentMethod',
|
20 |
+
'card' => '\Conekta\Card',
|
21 |
+
'charge' => '\Conekta\Charge',
|
22 |
+
'customer' => '\Conekta\Customer',
|
23 |
+
'event' => '\Conekta\Event',
|
24 |
+
'plan' => '\Conekta\Plan',
|
25 |
+
'subscription' => '\Conekta\Subscription',
|
26 |
+
'payment_source' => '\Conekta\PaymentSource',
|
27 |
+
'tax_line' => '\Conekta\TaxLine',
|
28 |
+
'shipping_line' => '\Conekta\ShippingLine',
|
29 |
+
'discount_line' => '\Conekta\DiscountLine',
|
30 |
+
'conekta_list' => '\Conekta\ConektaList',
|
31 |
+
'shipping_contact' => '\Conekta\ShippingContact',
|
32 |
+
'lang' => '\Conekta\Lang',
|
33 |
+
'line_item' => '\Conekta\LineItem',
|
34 |
+
'order' => '\Conekta\Order',
|
35 |
+
'fiscal_entity' => '\Conekta\FiscalEntity',
|
36 |
+
'return' => '\Conekta\OrderReturn',
|
37 |
+
'token' => '\Conekta\Token'
|
38 |
);
|
39 |
|
40 |
public static function convertToConektaObject($resp)
|
48 |
|
49 |
return $instance;
|
50 |
}
|
51 |
+
|
52 |
if (isset($resp['street1']) || isset($resp['street2'])) {
|
53 |
+
$class = '\Conekta\Address';
|
54 |
$instance = new $class();
|
55 |
$instance->loadFromArray($resp);
|
56 |
|
57 |
return $instance;
|
58 |
}
|
59 |
+
|
60 |
if (current($resp)) {
|
61 |
+
$instance = new Object();
|
62 |
$instance->loadFromArray($resp);
|
63 |
|
64 |
return $instance;
|
65 |
}
|
66 |
|
67 |
+
return new Object();
|
68 |
}
|
69 |
|
70 |
return $resp;
|
lib/Conekta/lib/Conekta/Webhook.php
CHANGED
@@ -1,35 +1,39 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
public static function find($id)
|
6 |
{
|
7 |
$class = get_called_class();
|
8 |
|
9 |
-
return
|
10 |
}
|
11 |
|
12 |
public static function where($params = null)
|
13 |
{
|
14 |
$class = get_called_class();
|
15 |
|
16 |
-
return
|
17 |
}
|
18 |
|
19 |
public static function create($params = null)
|
20 |
{
|
21 |
$class = get_called_class();
|
22 |
|
23 |
-
return
|
24 |
}
|
25 |
|
26 |
public function delete()
|
27 |
{
|
28 |
-
return
|
29 |
}
|
30 |
|
31 |
public function update($params = null)
|
32 |
{
|
33 |
-
return
|
34 |
}
|
35 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class Webhook extends Resource
|
8 |
{
|
9 |
public static function find($id)
|
10 |
{
|
11 |
$class = get_called_class();
|
12 |
|
13 |
+
return parent::_scpFind($class, $id);
|
14 |
}
|
15 |
|
16 |
public static function where($params = null)
|
17 |
{
|
18 |
$class = get_called_class();
|
19 |
|
20 |
+
return parent::_scpWhere($class, $params);
|
21 |
}
|
22 |
|
23 |
public static function create($params = null)
|
24 |
{
|
25 |
$class = get_called_class();
|
26 |
|
27 |
+
return parent::_scpCreate($class, $params);
|
28 |
}
|
29 |
|
30 |
public function delete()
|
31 |
{
|
32 |
+
return parent::_delete();
|
33 |
}
|
34 |
|
35 |
public function update($params = null)
|
36 |
{
|
37 |
+
return parent::_update($params);
|
38 |
}
|
39 |
}
|
lib/Conekta/lib/Conekta/WebhookLog.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
{
|
5 |
}
|
1 |
+
<?php
|
2 |
|
3 |
+
namespace Conekta;
|
4 |
+
|
5 |
+
use \Conekta\Resource;
|
6 |
+
|
7 |
+
class WebhookLog extends Resource
|
8 |
{
|
9 |
}
|
lib/Conekta/test/Conekta-1.0.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Set Api key for testing
|
4 |
+
function setApiKey()
|
5 |
+
{
|
6 |
+
$apiEnvKey = getenv('CONEKTA_API');
|
7 |
+
if (!$apiEnvKey) {
|
8 |
+
$apiEnvKey = '1tv5yJp3xnVZ7eK67m4h';
|
9 |
+
}
|
10 |
+
\Conekta\Conekta::setApiKey($apiEnvKey);
|
11 |
+
}
|
12 |
+
function unsetApiKey()
|
13 |
+
{
|
14 |
+
if (isset($env) == false) {
|
15 |
+
$env = \Conekta\Conekta::setApiKey('');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
function setApiVersion($version)
|
19 |
+
{
|
20 |
+
\Conekta\Conekta::setApiVersion($version);
|
21 |
+
}
|
22 |
+
|
23 |
+
function setPlugin($plugin){
|
24 |
+
\Conekta\Conekta::setPlugin($plugin);
|
25 |
+
}
|
26 |
+
|
27 |
+
function setEnvLocale($locale){
|
28 |
+
\Conekta\Conekta::setLocale($locale);
|
29 |
+
}
|
30 |
+
|
31 |
+
// Load test suite via composer or manually
|
32 |
+
$test_suite = @include_once dirname(__FILE__).'/simpletest/autorun.php';
|
33 |
+
|
34 |
+
if (!$test_suite) {
|
35 |
+
$test_suite = @include_once dirname(__FILE__).'/../vendor/simpletest/simpletest/autorun.php';
|
36 |
+
}
|
37 |
+
|
38 |
+
if (!$test_suite) {
|
39 |
+
echo 'Test cases depend on SimpleTest.'.
|
40 |
+
'Download it at <http://www.simpletest.org/>, and either install it '.
|
41 |
+
"in your PHP include_path or put it in the test/ directory.\n";
|
42 |
+
exit(1);
|
43 |
+
}
|
44 |
+
|
45 |
+
// Throw an exception on any error
|
46 |
+
function exception_error_handler($errno, $errstr, $errfile, $errline)
|
47 |
+
{
|
48 |
+
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
|
49 |
+
}
|
50 |
+
|
51 |
+
set_error_handler('exception_error_handler');
|
52 |
+
error_reporting(E_ALL | E_STRICT);
|
53 |
+
|
54 |
+
// Load Conekta lib
|
55 |
+
require_once dirname(__FILE__).'/../lib/Conekta.php';
|
56 |
+
|
57 |
+
// Include tests
|
58 |
+
|
59 |
+
require_once dirname(__FILE__).'/Conekta-1.0/ChargeTest.php';
|
60 |
+
require_once dirname(__FILE__).'/Conekta-1.0/CustomerTest.php';
|
61 |
+
require_once dirname(__FILE__).'/Conekta-1.0/EventTest.php';
|
62 |
+
require_once dirname(__FILE__).'/Conekta-1.0/PlanTest.php';
|
63 |
+
require_once dirname(__FILE__).'/Conekta-1.0/ErrorTest.php';
|
64 |
+
require_once dirname(__FILE__).'/Conekta-1.0/PayoutTest.php';
|
65 |
+
require_once dirname(__FILE__).'/Conekta-1.0/WebhookTest.php';
|
66 |
+
require_once dirname(__FILE__).'/Conekta-1.0/LogTest.php';
|
67 |
+
require_once dirname(__FILE__).'/Conekta-1.0/ConektaTest.php';
|
lib/Conekta/test/Conekta-1.0/ChargeTest.php
ADDED
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ChargeTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_payment_method = array(
|
6 |
+
'amount' => 2000,
|
7 |
+
'currency' => 'mxn',
|
8 |
+
'description' => 'Some desc',
|
9 |
+
'details'=> array(
|
10 |
+
'name'=> 'Arnulfo Quimare',
|
11 |
+
'phone'=> '403-342-0642',
|
12 |
+
'email'=> 'logan@x-men.org',
|
13 |
+
'customer'=> array(
|
14 |
+
'logged_in'=> true,
|
15 |
+
'successful_purchases'=> 14,
|
16 |
+
'created_at'=> 1379784950,
|
17 |
+
'updated_at'=> 1379784950,
|
18 |
+
'offline_payments'=> 4,
|
19 |
+
'score'=> 9
|
20 |
+
),
|
21 |
+
'line_items'=> array(
|
22 |
+
array(
|
23 |
+
'name'=> 'Box of Cohiba S1s',
|
24 |
+
'description'=> 'Imported From Mex.',
|
25 |
+
'unit_price'=> 20000,
|
26 |
+
'quantity'=> 1,
|
27 |
+
'sku'=> 'cohb_s1',
|
28 |
+
'category'=> 'food'
|
29 |
+
)
|
30 |
+
)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
public static $intvalid_payment_method = array(
|
35 |
+
'amount' => 10,
|
36 |
+
'currency' => 'mxn',
|
37 |
+
'description' => 'Some desc',
|
38 |
+
'details'=> array(
|
39 |
+
'name'=> 'Arnulfo Quimare',
|
40 |
+
'phone'=> '403-342-0642',
|
41 |
+
'email'=> 'logan@x-men.org',
|
42 |
+
'customer'=> array(
|
43 |
+
'logged_in'=> true,
|
44 |
+
'successful_purchases'=> 14,
|
45 |
+
'created_at'=> 1379784950,
|
46 |
+
'updated_at'=> 1379784950,
|
47 |
+
'offline_payments'=> 4,
|
48 |
+
'score'=> 9
|
49 |
+
),
|
50 |
+
'line_items'=> array(
|
51 |
+
array(
|
52 |
+
'name'=> 'Box of Cohiba S1s',
|
53 |
+
'description'=> 'Imported From Mex.',
|
54 |
+
'unit_price'=> 20000,
|
55 |
+
'quantity'=> 1,
|
56 |
+
'sku'=> 'cohb_s1',
|
57 |
+
'category'=> 'food'
|
58 |
+
)
|
59 |
+
)
|
60 |
+
)
|
61 |
+
);
|
62 |
+
|
63 |
+
public static $valid_visa_card = array('card' => 'tok_test_visa_4242');
|
64 |
+
|
65 |
+
public function testSuccesfulWhere()
|
66 |
+
{
|
67 |
+
setApiKey();
|
68 |
+
setApiVersion('1.0.0');
|
69 |
+
$charges = \Conekta\Charge::where();
|
70 |
+
$this->assertTrue(strpos(get_class($charges), 'Object') !== false);
|
71 |
+
$this->assertTrue(strpos(get_class($charges[0]), 'Charge') !== false);
|
72 |
+
}
|
73 |
+
|
74 |
+
public function testUnsuccesfulPMCreate()
|
75 |
+
{
|
76 |
+
$pm = self::$intvalid_payment_method;
|
77 |
+
$card = self::$valid_visa_card;
|
78 |
+
setApiKey();
|
79 |
+
setApiVersion('1.0.0');
|
80 |
+
try {
|
81 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
82 |
+
} catch (Exception $e) {
|
83 |
+
$this->assertTrue(strpos($e->getMessage(), 'The minimum for card payments is 3 pesos. Check that the amount is in cents as explained in the documentation.') !== false);
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
public function testSuccesfulRefund()
|
88 |
+
{
|
89 |
+
setApiVersion('1.0.0');
|
90 |
+
$pm = self::$valid_payment_method;
|
91 |
+
$card = self::$valid_visa_card;
|
92 |
+
setApiKey();
|
93 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
94 |
+
$this->assertTrue($cpm->status == 'paid');
|
95 |
+
$cpm->refund();
|
96 |
+
$this->assertTrue($cpm->status == 'refunded');
|
97 |
+
}
|
98 |
+
|
99 |
+
public function testUnsuccesfulRefund()
|
100 |
+
{
|
101 |
+
$pm = self::$valid_payment_method;
|
102 |
+
$card = self::$valid_visa_card;
|
103 |
+
setApiKey();
|
104 |
+
setApiVersion('1.0.0');
|
105 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
106 |
+
$this->assertTrue($cpm->status == 'paid');
|
107 |
+
try {
|
108 |
+
$cpm->refund(3000);
|
109 |
+
} catch (Exception $e) {
|
110 |
+
$this->assertTrue(strpos($e->getMessage(), 'The amount to refund exceeds the charge total') !== false);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
public function testSuccesfulCapture()
|
115 |
+
{
|
116 |
+
setApiVersion('1.0.0');
|
117 |
+
$pm = self::$valid_payment_method;
|
118 |
+
$card = self::$valid_visa_card;
|
119 |
+
$capture = array('preauthorize' => true);
|
120 |
+
setApiKey();
|
121 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card, $capture));
|
122 |
+
$this->assertTrue($cpm->status == 'pre_authorized');
|
123 |
+
$cpm->capture();
|
124 |
+
$this->assertTrue($cpm->status == 'paid');
|
125 |
+
}
|
126 |
+
}
|
lib/Conekta/test/Conekta-1.0/ConektaTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ConektaTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public function testApiLocaleInitializerStyle()
|
7 |
+
{
|
8 |
+
setEnvLocale('en');
|
9 |
+
$this->assertTrue( \Conekta\Conekta::$locale == 'en');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function testPluginInitializerStyle()
|
13 |
+
{
|
14 |
+
setApiKey();
|
15 |
+
setPlugin('spree');
|
16 |
+
$this->assertTrue( \Conekta\Conekta::$plugin == 'spree');
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
lib/Conekta/test/Conekta-1.0/CustomerTest.php
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CustomerTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer = array(
|
6 |
+
'email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine'
|
8 |
+
);
|
9 |
+
|
10 |
+
public function testSuccesfulCustomerFind()
|
11 |
+
{
|
12 |
+
setApiKey();
|
13 |
+
setApiVersion('1.0.0');
|
14 |
+
$c = \Conekta\Customer::create(self::$valid_customer);
|
15 |
+
$customer = \Conekta\Customer::find($c->id);
|
16 |
+
$this->assertTrue(strpos(get_class($customer), 'Customer') !== false);
|
17 |
+
}
|
18 |
+
|
19 |
+
public function testSuccesfulCustomerWhere()
|
20 |
+
{
|
21 |
+
setApiKey();
|
22 |
+
setApiVersion('1.0.0');
|
23 |
+
$customers = \Conekta\Customer::where();
|
24 |
+
$this->assertTrue(strpos(get_class($customers), 'Object') !== false);
|
25 |
+
$this->assertTrue(strpos(get_class($customers[0]), 'Customer') !== false);
|
26 |
+
}
|
27 |
+
|
28 |
+
public function testSuccesfulCustomerUpdate()
|
29 |
+
{
|
30 |
+
setApiKey();
|
31 |
+
setApiVersion('1.0.0');
|
32 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
33 |
+
$customer->update(
|
34 |
+
array(
|
35 |
+
'name' => 'Logan',
|
36 |
+
'email' => 'logan@x-men.org',
|
37 |
+
));
|
38 |
+
$this->assertTrue(strpos($customer->name, 'Logan') !== false);
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
public function testAddCardToCustomer()
|
43 |
+
{
|
44 |
+
setApiKey();
|
45 |
+
setApiVersion('1.0.0');
|
46 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
47 |
+
$customer->createCard(array('token' => 'tok_test_visa_1881'));
|
48 |
+
$this->assertTrue(strpos(end($customer->cards)->last4, '1881') !== false);
|
49 |
+
}
|
50 |
+
|
51 |
+
public function testDeleteCard()
|
52 |
+
{
|
53 |
+
setApiKey();
|
54 |
+
setApiVersion('1.0.0');
|
55 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
56 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
57 |
+
$card = $customer->cards[0]->delete();
|
58 |
+
$this->assertTrue($card->deleted == true);
|
59 |
+
}
|
60 |
+
|
61 |
+
public function testUpdateCard()
|
62 |
+
{
|
63 |
+
setApiKey();
|
64 |
+
setApiVersion('1.0.0');
|
65 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
66 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
67 |
+
$customer->cards[0]->update(array('token' => 'tok_test_mastercard_4444', 'active' => false));
|
68 |
+
$this->assertTrue(strpos($customer->cards[0]->last4, '4444') !== false);
|
69 |
+
}
|
70 |
+
|
71 |
+
public function testSuccesfulSubscriptionCreate()
|
72 |
+
{
|
73 |
+
setApiKey();
|
74 |
+
setApiVersion('1.0.0');
|
75 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
76 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
77 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
78 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
79 |
+
$this->assertTrue(strpos(get_class($subscription), 'Conekta\Subscription') !== false);
|
80 |
+
}
|
81 |
+
|
82 |
+
public function testSuccesfulSubscriptionUpdate()
|
83 |
+
{
|
84 |
+
setApiKey();
|
85 |
+
setApiVersion('1.0.0');
|
86 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
87 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
88 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
89 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
90 |
+
try {
|
91 |
+
$plan = \Conekta\Plan::find('gold-plan2');
|
92 |
+
} catch (Exception $e) {
|
93 |
+
$plan = \Conekta\Plan::create(array(
|
94 |
+
'id' => 'gold-plan2',
|
95 |
+
'name' => 'Gold Plan',
|
96 |
+
'amount' => 10000,
|
97 |
+
'currency' => 'MXN',
|
98 |
+
'interval' => 'month',
|
99 |
+
'frequency' => 1,
|
100 |
+
'trial_period_days' => 15,
|
101 |
+
'expiry_count' => 12,
|
102 |
+
)
|
103 |
+
);
|
104 |
+
}
|
105 |
+
$subscription->update(array('plan' => $plan->id));
|
106 |
+
$this->assertTrue(strpos($subscription->plan_id, 'gold-plan2') !== false);
|
107 |
+
}
|
108 |
+
|
109 |
+
public function testUnsuccesfulSubscriptionCreate()
|
110 |
+
{
|
111 |
+
setApiKey();
|
112 |
+
setApiVersion('1.0.0');
|
113 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
114 |
+
try {
|
115 |
+
$subscription = $customer->createSubscription(array(
|
116 |
+
'plan' => 'unexistent-plan', ));
|
117 |
+
} catch (Exception $e) {
|
118 |
+
$this->assertTrue(strpos($e->getMessage(), 'The object Plan unexistent-plan could not be found.') !== false);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
122 |
+
public function testSuccesfulSubscriptionPause()
|
123 |
+
{
|
124 |
+
setApiKey();
|
125 |
+
setApiVersion('1.0.0');
|
126 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
127 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
128 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
129 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
130 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
131 |
+
$subscription->pause();
|
132 |
+
$this->assertTrue(strpos($subscription->status, 'paused') !== false);
|
133 |
+
}
|
134 |
+
|
135 |
+
public function testSuccesfulSubscriptionResume()
|
136 |
+
{
|
137 |
+
setApiKey();
|
138 |
+
setApiVersion('1.0.0');
|
139 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
140 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
141 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
142 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
143 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
144 |
+
$subscription->pause();
|
145 |
+
$subscription->resume();
|
146 |
+
$this->assertTrue(strpos($subscription->status, 'in_trial') !== false);
|
147 |
+
}
|
148 |
+
|
149 |
+
public function testSuccesfulSubscriptionCancel()
|
150 |
+
{
|
151 |
+
setApiKey();
|
152 |
+
setApiVersion('1.0.0');
|
153 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
154 |
+
$card = array('cards' => array('tok_test_visa_4242'));
|
155 |
+
$customer = \Conekta\Customer::create(array_merge(self::$valid_customer, $card));
|
156 |
+
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
157 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
158 |
+
$subscription->cancel();
|
159 |
+
$this->assertTrue(strpos($subscription->status, 'canceled') !== false);
|
160 |
+
}
|
161 |
+
|
162 |
+
}
|
lib/Conekta/test/Conekta-1.0/ErrorTest.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ErrorTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testNoIdError()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
try {
|
10 |
+
$charge = \Conekta\Charge::find('0');
|
11 |
+
} catch (Exception $e) {
|
12 |
+
$this->assertTrue(strpos($e->getMessage(), 'Could not get the id of Resource instance.') !== false);
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
public function testNoConnectionError()
|
17 |
+
{
|
18 |
+
setApiVersion('1.0.0');
|
19 |
+
$apiUrl = \Conekta\Conekta::$apiBase;
|
20 |
+
\Conekta\Conekta::$apiBase = 'http://localhost:3001';
|
21 |
+
try {
|
22 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4242')));
|
23 |
+
} catch (Exception $e) {
|
24 |
+
$this->assertTrue(strpos(get_class($e), 'NoConnectionError') !== false);
|
25 |
+
}
|
26 |
+
\Conekta\Conekta::$apiBase = $apiUrl;
|
27 |
+
}
|
28 |
+
|
29 |
+
public function testApiError()
|
30 |
+
{
|
31 |
+
setApiKey();
|
32 |
+
setApiVersion('1.0.0');
|
33 |
+
try {
|
34 |
+
$customer = \Conekta\Customer::create(array(
|
35 |
+
'cards' => array('tok_test_visa_4243'),
|
36 |
+
'name' => 'Test Name',
|
37 |
+
'email' => 'test@conekta.io'
|
38 |
+
));
|
39 |
+
} catch (Exception $e) {
|
40 |
+
$this->assertTrue(strpos(get_class($e), 'ParameterValidationError') !== false);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
public function testAuthenticationError()
|
45 |
+
{
|
46 |
+
unsetApiKey();
|
47 |
+
setApiVersion('1.0.0');
|
48 |
+
try {
|
49 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4242')));
|
50 |
+
} catch (Exception $e) {
|
51 |
+
$this->assertTrue(strpos(get_class($e), 'AuthenticationError') !== false);
|
52 |
+
}
|
53 |
+
setApiKey();
|
54 |
+
}
|
55 |
+
|
56 |
+
public function testParameterValidationError()
|
57 |
+
{
|
58 |
+
setApiKey();
|
59 |
+
setApiVersion('1.0.0');
|
60 |
+
try {
|
61 |
+
$plan = \Conekta\Plan::create(array('id' => 'gold-plan'));
|
62 |
+
} catch (Exception $e) {
|
63 |
+
$this->assertTrue(strpos(get_class($e), 'ParameterValidationError') !== false);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
|
67 |
+
public function testProcessingError()
|
68 |
+
{
|
69 |
+
setApiVersion('1.0.0');
|
70 |
+
$charges = \Conekta\Charge::where();
|
71 |
+
foreach ($charges as $charge) {
|
72 |
+
if (strpos($charge->status, 'pre_authorized') !== false) {
|
73 |
+
$ok = true;
|
74 |
+
continue;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
try {
|
78 |
+
if (isset($ok)) {
|
79 |
+
$charge->capture();
|
80 |
+
}
|
81 |
+
} catch (Exception $e) {
|
82 |
+
$this->assertTrue(strpos(get_class($e), 'ProcessingError') !== false);
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
public function testResourceNotFoundError()
|
87 |
+
{
|
88 |
+
setApiKey();
|
89 |
+
setApiVersion('1.0.0');
|
90 |
+
try {
|
91 |
+
$charge = \Conekta\Charge::find('1');
|
92 |
+
} catch (Exception $e) {
|
93 |
+
$this->assertTrue(strpos(get_class($e), 'ResourceNotFoundError') !== false);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
lib/Conekta/test/Conekta-1.0/EventTest.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class EventTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulWhere()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
$events = \Conekta\Event::where();
|
10 |
+
$this->assertTrue(strpos(get_class($events), 'Object') !== false);
|
11 |
+
$this->assertTrue(strpos(get_class($events[0]), 'Event') !== false);
|
12 |
+
}
|
13 |
+
}
|
lib/Conekta/test/Conekta-1.0/LangTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use \Conekta\Lang;
|
4 |
+
|
5 |
+
class LangTest extends UnitTestCase
|
6 |
+
{
|
7 |
+
public function testShouldTranslatesMessage()
|
8 |
+
{
|
9 |
+
$this->assertEqual(
|
10 |
+
'There was an error. Please contact system administrator.',
|
11 |
+
Lang::translate('error.resource.id_purchaser', Lang::EN)
|
12 |
+
);
|
13 |
+
|
14 |
+
$this->assertEqual(
|
15 |
+
'Hubo un error. Favor de contactar al administrador del sistema.',
|
16 |
+
Lang::translate('error.resource.id_purchaser', Lang::ES)
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
lib/Conekta/test/Conekta-1.0/LogTest.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class LogTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulFind()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
$logs = \Conekta\Log::where();
|
10 |
+
$log = \Conekta\Log::find($logs[0]['id']);
|
11 |
+
$this->assertTrue(strpos(get_class($log), 'Log') !== false);
|
12 |
+
}
|
13 |
+
|
14 |
+
public function testSuccesfulWhere()
|
15 |
+
{
|
16 |
+
setApiKey();
|
17 |
+
setApiVersion('1.0.0');
|
18 |
+
$logs = \Conekta\Log::where();
|
19 |
+
$this->assertTrue(strpos(get_class($logs), 'Conekta\Object') !== false);
|
20 |
+
$this->assertTrue(strpos(get_class($logs[0]), 'Conekta\Object') !== false);
|
21 |
+
}
|
22 |
+
}
|
lib/Conekta/test/Conekta-1.0/PayoutTest.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PayoutTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulGetPayout()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
$payee = \Conekta\Payee::create(array(
|
10 |
+
'name' => 'John Doe',
|
11 |
+
'email' => 'j_d@radcorp->com',
|
12 |
+
'phone' => '555555555',
|
13 |
+
'bank' => array(
|
14 |
+
'account_number' => '032180000118359719',
|
15 |
+
'account_holder' => 'J D - Radcorp',
|
16 |
+
'description' => 'Conekta To JD',
|
17 |
+
'statement_description' => 'Conekta To JD 111111111',
|
18 |
+
'statement_reference' => '111111111',
|
19 |
+
),
|
20 |
+
'billing_address' => array(
|
21 |
+
'company_name' => 'Rad Corp',
|
22 |
+
'tax_id' => 'tax121212abc',
|
23 |
+
'street1' => 'Guadalupe 73',
|
24 |
+
'street2' => 'Despacho 32',
|
25 |
+
'street3' => 'Condesa',
|
26 |
+
'city' => 'Cuauhtemoc',
|
27 |
+
'state' => 'DF',
|
28 |
+
'country' => 'MX',
|
29 |
+
'zip' => '06100',
|
30 |
+
),
|
31 |
+
));
|
32 |
+
$this->assertTrue(strpos(get_class($payee), 'Payee') !== false);
|
33 |
+
$this->assertTrue(strpos('555555555', $payee->phone) !== false);
|
34 |
+
$this->assertTrue(strpos('032180000118359719', $payee->payout_methods[0]->account_number) !== false);
|
35 |
+
$this->assertTrue(strpos('J D - Radcorp', $payee->payout_methods[0]->account_holder) !== false);
|
36 |
+
$this->assertTrue(strpos('ixe', $payee->payout_methods[0]->bank) !== false);
|
37 |
+
$this->assertTrue(isset($payee->default_payout_method_id));
|
38 |
+
|
39 |
+
$this->assertTrue(strpos('Conekta To JD', $payee->payout_methods[0]->description) !== false);
|
40 |
+
$this->assertTrue(strpos('Conekta To JD 111111111', $payee->payout_methods[0]->statement_description) !== false);
|
41 |
+
$this->assertTrue(strpos('111111111', $payee->payout_methods[0]->statement_reference) !== false);
|
42 |
+
$this->assertTrue(strpos('Rad Corp', $payee->billing_address->company_name) !== false);
|
43 |
+
$this->assertTrue(strpos('tax121212abc', $payee->billing_address->tax_id) !== false);
|
44 |
+
$this->assertTrue(strpos('06100', $payee->billing_address->zip) !== false);
|
45 |
+
|
46 |
+
$payout = \Conekta\Payout::create(array(
|
47 |
+
'amount' => 5000,
|
48 |
+
'currency' => 'MXN',
|
49 |
+
'payee' => $payee->id,
|
50 |
+
));
|
51 |
+
$this->assertTrue(strpos(get_class($payout), 'Payout') !== false);
|
52 |
+
$this->assertTrue(5000 == $payout->amount);
|
53 |
+
$this->assertTrue(strpos('MXN', $payout->currency) !== false);
|
54 |
+
|
55 |
+
$this->assertTrue(strpos('032180000118359719', $payout->method->account_number) !== false);
|
56 |
+
$this->assertTrue(strpos('J D - Radcorp', $payout->method->account_holder) !== false);
|
57 |
+
$this->assertTrue(strpos('ixe', $payout->method->bank) !== false);
|
58 |
+
//$this->assertTrue(count($payout->transactions) == 0); // Not it the response
|
59 |
+
}
|
60 |
+
}
|
lib/Conekta/test/Conekta-1.0/PlanTest.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class PlanTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulGetPlan()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
$plans = \Conekta\Plan::where();
|
10 |
+
$p = $plans[0];
|
11 |
+
$plan = \Conekta\Plan::find($p->id);
|
12 |
+
$this->assertTrue(strpos(get_class($plan), 'Plan') !== false);
|
13 |
+
}
|
14 |
+
|
15 |
+
public function testSuccesfulWhere()
|
16 |
+
{
|
17 |
+
setApiKey();
|
18 |
+
setApiVersion('1.0.0');
|
19 |
+
$plans = \Conekta\Plan::where();
|
20 |
+
$this->assertTrue(strpos(get_class($plans), 'Object') !== false);
|
21 |
+
$this->assertTrue(strpos(get_class($plans[0]), 'Plan') !== false);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function testSuccesfulPlanCreate()
|
25 |
+
{
|
26 |
+
setApiKey();
|
27 |
+
setApiVersion('1.0.0');
|
28 |
+
$plans = \Conekta\Plan::where();
|
29 |
+
$plan = \Conekta\Plan::create(array(
|
30 |
+
'id' => 'gold-plan'.substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0, 50), 1).substr(md5(time()), 1),
|
31 |
+
'name' => 'Gold Plan',
|
32 |
+
'amount' => 10000,
|
33 |
+
'currency' => 'MXN',
|
34 |
+
'interval' => 'month',
|
35 |
+
'frequency' => 10,
|
36 |
+
'trial_period_days' => 15,
|
37 |
+
'expiry_count' => 12,
|
38 |
+
));
|
39 |
+
$this->assertTrue(strpos(get_class($plan), 'Plan') !== false);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function testUpdatePlan()
|
43 |
+
{
|
44 |
+
setApiKey();
|
45 |
+
setApiVersion('1.0.0');
|
46 |
+
$plans = \Conekta\Plan::where();
|
47 |
+
$plan = $plans[0];
|
48 |
+
$plan->update(array('name' => 'Silver Plan'));
|
49 |
+
$this->assertTrue(strpos($plan->name, 'Silver Plan') !== false);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function testDeletePlan()
|
53 |
+
{
|
54 |
+
setApiKey();
|
55 |
+
setApiVersion('1.0.0');
|
56 |
+
$plans = \Conekta\Plan::where();
|
57 |
+
$plan = $plans[0];
|
58 |
+
$plan->delete();
|
59 |
+
$this->assertTrue($plan->deleted == true);
|
60 |
+
}
|
61 |
+
}
|
lib/Conekta/test/Conekta-1.0/WebhookTest.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WebhookTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $events = array("events" =>
|
6 |
+
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
7 |
+
"charge.fraudulent", "charge.refunded", "charge.created", "customer.created",
|
8 |
+
"customer.updated", "customer.deleted", "webhook.created", "webhook.updated",
|
9 |
+
"webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated",
|
10 |
+
"charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won",
|
11 |
+
"payout.created", "payout.retrying", "payout.paid_out", "payout.failed",
|
12 |
+
"plan.created", "plan.updated", "plan.deleted", "subscription.created",
|
13 |
+
"subscription.paused", "subscription.resumed", "subscription.canceled",
|
14 |
+
"subscription.expired", "subscription.updated", "subscription.paid",
|
15 |
+
"subscription.payment_failed", "payee.created", "payee.updated",
|
16 |
+
"payee.deleted", "payee.payout_method.created",
|
17 |
+
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
18 |
+
|
19 |
+
public static $url = array("url" => "http://www.example.com/my_listener");
|
20 |
+
|
21 |
+
public function testSuccesfulWebhookCreate()
|
22 |
+
{
|
23 |
+
setApiKey();
|
24 |
+
setApiVersion('1.0.0');
|
25 |
+
$webhook = \Conekta\Webhook::create(array_merge(self::$url, self::$events));
|
26 |
+
$this->assertTrue(strpos(get_class($webhook), 'Webhook') !== false);
|
27 |
+
$this->assertTrue(strpos($webhook->webhook_url, self::$url["url"]) !== false);
|
28 |
+
$webhook->update(array("url" => "http://www.example.com/my_listener"));
|
29 |
+
$this->assertTrue(strpos($webhook->webhook_url, "http://www.example.com/my_listener") !== false);
|
30 |
+
$webhook->delete();
|
31 |
+
}
|
32 |
+
}
|
lib/Conekta/test/Conekta-2.0.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Set Api key for testing
|
4 |
+
function setApiKey()
|
5 |
+
{
|
6 |
+
$apiEnvKey = getenv('CONEKTA_API');
|
7 |
+
if (!$apiEnvKey) {
|
8 |
+
$apiEnvKey = '1tv5yJp3xnVZ7eK67m4h';
|
9 |
+
}
|
10 |
+
\Conekta\Conekta::setApiKey($apiEnvKey);
|
11 |
+
}
|
12 |
+
function unsetApiKey()
|
13 |
+
{
|
14 |
+
if (isset($env) == false) {
|
15 |
+
$env = \Conekta\Conekta::setApiKey('');
|
16 |
+
}
|
17 |
+
}
|
18 |
+
function setApiVersion($version)
|
19 |
+
{
|
20 |
+
\Conekta\Conekta::setApiVersion($version);
|
21 |
+
}
|
22 |
+
|
23 |
+
function setPlugin($plugin){
|
24 |
+
\Conekta\Conekta::setPlugin($plugin);
|
25 |
+
}
|
26 |
+
|
27 |
+
function setEnvLocale($locale){
|
28 |
+
\Conekta\Conekta::setLocale($locale);
|
29 |
+
}
|
30 |
+
|
31 |
+
// Load test suite via composer or manually
|
32 |
+
$test_suite = @include_once dirname(__FILE__).'/simpletest/autorun.php';
|
33 |
+
|
34 |
+
if (!$test_suite) {
|
35 |
+
$test_suite = @include_once dirname(__FILE__).'/../vendor/simpletest/simpletest/autorun.php';
|
36 |
+
}
|
37 |
+
|
38 |
+
if (!$test_suite) {
|
39 |
+
echo 'Test cases depend on SimpleTest.'.
|
40 |
+
'Download it at <http://www.simpletest.org/>, and either install it '.
|
41 |
+
"in your PHP include_path or put it in the test/ directory.\n";
|
42 |
+
exit(1);
|
43 |
+
}
|
44 |
+
|
45 |
+
// Throw an exception on any error
|
46 |
+
function exception_error_handler($errno, $errstr, $errfile, $errline)
|
47 |
+
{
|
48 |
+
throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
|
49 |
+
}
|
50 |
+
|
51 |
+
set_error_handler('exception_error_handler');
|
52 |
+
error_reporting(E_ALL | E_STRICT);
|
53 |
+
|
54 |
+
// Load Conekta lib
|
55 |
+
require_once dirname(__FILE__).'/../lib/Conekta.php';
|
56 |
+
|
57 |
+
// Include tests
|
58 |
+
|
59 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ChargeTest.php';
|
60 |
+
require_once dirname(__FILE__).'/Conekta-2.0/CustomerTest.php';
|
61 |
+
require_once dirname(__FILE__).'/Conekta-2.0/WebhookTest.php';
|
62 |
+
require_once dirname(__FILE__).'/Conekta-2.0/OrderTest.php';
|
63 |
+
require_once dirname(__FILE__).'/Conekta-2.0/SourceTest.php';
|
64 |
+
require_once dirname(__FILE__).'/Conekta-2.0/TaxLineTest.php';
|
65 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ConektaListTest.php';
|
66 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ShippingContactTest.php';
|
67 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ShippingLineTest.php';
|
68 |
+
require_once dirname(__FILE__).'/Conekta-2.0/LineItemTest.php';
|
69 |
+
require_once dirname(__FILE__).'/Conekta-2.0/DiscountLineTest.php';
|
70 |
+
require_once dirname(__FILE__).'/Conekta-2.0/FiscalEntityTest.php';
|
71 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ErrorListTest.php';
|
72 |
+
require_once dirname(__FILE__).'/Conekta-2.0/ConektaTest.php';
|
lib/Conekta/test/Conekta-2.0/ChargeTest.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ChargeTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_payment_method = array(
|
6 |
+
'amount' => 2000,
|
7 |
+
'currency' => 'mxn',
|
8 |
+
'description' => 'Some desc',
|
9 |
+
'details'=> array(
|
10 |
+
'name'=> 'Arnulfo Quimare',
|
11 |
+
'phone'=> '403-342-0642',
|
12 |
+
'email'=> 'logan@x-men.org',
|
13 |
+
'customer'=> array(
|
14 |
+
'logged_in'=> true,
|
15 |
+
'successful_purchases'=> 14,
|
16 |
+
'created_at'=> 1379784950,
|
17 |
+
'updated_at'=> 1379784950,
|
18 |
+
'offline_payments'=> 4,
|
19 |
+
'score'=> 9
|
20 |
+
),
|
21 |
+
'line_items'=> array(
|
22 |
+
array(
|
23 |
+
'name'=> 'Box of Cohiba S1s',
|
24 |
+
'description'=> 'Imported From Mex.',
|
25 |
+
'unit_price'=> 20000,
|
26 |
+
'quantity'=> 1,
|
27 |
+
'sku'=> 'cohb_s1',
|
28 |
+
'category'=> 'food'
|
29 |
+
)
|
30 |
+
)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
public static $intvalid_payment_method = array(
|
35 |
+
'amount' => 10,
|
36 |
+
'currency' => 'mxn',
|
37 |
+
'description' => 'Some desc',
|
38 |
+
'details'=> array(
|
39 |
+
'name'=> 'Arnulfo Quimare',
|
40 |
+
'phone'=> '403-342-0642',
|
41 |
+
'email'=> 'logan@x-men.org',
|
42 |
+
'customer'=> array(
|
43 |
+
'logged_in'=> true,
|
44 |
+
'successful_purchases'=> 14,
|
45 |
+
'created_at'=> 1379784950,
|
46 |
+
'updated_at'=> 1379784950,
|
47 |
+
'offline_payments'=> 4,
|
48 |
+
'score'=> 9
|
49 |
+
),
|
50 |
+
'line_items'=> array(
|
51 |
+
array(
|
52 |
+
'name'=> 'Box of Cohiba S1s',
|
53 |
+
'description'=> 'Imported From Mex.',
|
54 |
+
'unit_price'=> 20000,
|
55 |
+
'quantity'=> 1,
|
56 |
+
'sku'=> 'cohb_s1',
|
57 |
+
'category'=> 'food'
|
58 |
+
)
|
59 |
+
)
|
60 |
+
)
|
61 |
+
);
|
62 |
+
|
63 |
+
public static $valid_visa_card = array('card' => 'tok_test_visa_4242');
|
64 |
+
|
65 |
+
public function testSuccesfulFindCharge()
|
66 |
+
{
|
67 |
+
$pm = self::$valid_payment_method;
|
68 |
+
$card = self::$valid_visa_card;
|
69 |
+
setApiKey();
|
70 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
71 |
+
$this->assertTrue($cpm->status == 'paid');
|
72 |
+
$pm = \Conekta\Charge::find($cpm->id);
|
73 |
+
$this->assertTrue(strpos(get_class($pm), 'Charge') !== false);
|
74 |
+
}
|
75 |
+
|
76 |
+
public function testSuccesfulBankPMCreate()
|
77 |
+
{
|
78 |
+
$pm = self::$valid_payment_method;
|
79 |
+
$bank = array('bank' => array('type' => 'banorte'));
|
80 |
+
setApiKey();
|
81 |
+
$bpm = \Conekta\Charge::create(array_merge($pm, $bank));
|
82 |
+
$this->assertTrue($bpm->payment_method->service_number == "127589");
|
83 |
+
$this->assertTrue($bpm->payment_method->service_name == "Conekta");
|
84 |
+
$this->assertTrue(intval($bpm->payment_method->reference) > 0);
|
85 |
+
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
86 |
+
$this->assertTrue($bpm->status == 'pending_payment');
|
87 |
+
}
|
88 |
+
|
89 |
+
public function testSuccesfulSpeiPMCreate()
|
90 |
+
{
|
91 |
+
$pm = self::$valid_payment_method;
|
92 |
+
$spei = array('bank' => array('type' => 'spei'));
|
93 |
+
setApiKey();
|
94 |
+
$bpm = \Conekta\Charge::create(array_merge($pm, $spei));
|
95 |
+
$this->assertTrue($bpm->payment_method->bank == "STP");
|
96 |
+
$this->assertTrue(intval($bpm->payment_method->clabe) > 0);
|
97 |
+
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
98 |
+
$this->assertTrue($bpm->status == 'pending_payment');
|
99 |
+
}
|
100 |
+
|
101 |
+
public function testSuccesfulCardPMCreate()
|
102 |
+
{
|
103 |
+
$pm = self::$valid_payment_method;
|
104 |
+
$card = self::$valid_visa_card;
|
105 |
+
setApiKey();
|
106 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
107 |
+
$this->assertTrue($cpm->status == 'paid');
|
108 |
+
}
|
109 |
+
|
110 |
+
public function testSuccesfulOxxoPMCreate()
|
111 |
+
{
|
112 |
+
$pm = self::$valid_payment_method;
|
113 |
+
$oxxo = array('cash' => array('type' => 'oxxo'));
|
114 |
+
setApiKey();
|
115 |
+
$opm = \Conekta\Charge::create(array_merge($pm, $oxxo));
|
116 |
+
$this->assertTrue(is_numeric($opm->payment_method->expires_at));
|
117 |
+
$this->assertTrue($opm->payment_method->store_name == "OXXO");
|
118 |
+
$this->assertTrue($opm->status == 'pending_payment');
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
lib/Conekta/test/Conekta-2.0/ConektaListTest.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ConektaListTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public function testSuccessfulNext()
|
7 |
+
{
|
8 |
+
setApiKey();
|
9 |
+
$order_list = $this->createResponseMockUp();
|
10 |
+
$window = \Conekta\Order::where(array('limit' => 5, "next" => $order_list[9]->id));
|
11 |
+
$this->assertTrue($window[0]->id == $order_list[10]->id);
|
12 |
+
$window->next(array('limit' => 1));
|
13 |
+
$this->assertTrue($window[0]->id == $order_list[15]->id);
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
public function testSuccessfulPrevious()
|
18 |
+
{
|
19 |
+
setApiKey();
|
20 |
+
$order_list = $this->createResponseMockUp();
|
21 |
+
$window = \Conekta\Order::where(array('limit' => 5, 'next' => $order_list[14]->id));
|
22 |
+
$this->assertTrue($window[0]->id == $order_list[15]->id);
|
23 |
+
$window->previous(array('limit' => 1));
|
24 |
+
$this->assertTrue($window[0]->id == $order_list[14]->id);
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
protected function createResponseMockUp(){
|
29 |
+
$string = file_get_contents("test/support/fixtures/orders.json");
|
30 |
+
$json_response = json_decode($string, true);
|
31 |
+
$order_list = new \Conekta\ConektaList("Order", $json_response);
|
32 |
+
$order_list->loadFromArray($json_response);
|
33 |
+
return $order_list;
|
34 |
+
}
|
35 |
+
|
36 |
+
}
|
lib/Conekta/test/Conekta-2.0/ConektaTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ConektaTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public function testApiLocaleInitializerStyle()
|
7 |
+
{
|
8 |
+
setEnvLocale('en');
|
9 |
+
$this->assertTrue( \Conekta\Conekta::$locale == 'en');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function testPluginInitializerStyle()
|
13 |
+
{
|
14 |
+
setApiKey();
|
15 |
+
setPlugin('spree');
|
16 |
+
$this->assertTrue( \Conekta\Conekta::$plugin == 'spree');
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
lib/Conekta/test/Conekta-2.0/CustomerTest.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class CustomerTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer = array(
|
6 |
+
'email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine'
|
8 |
+
);
|
9 |
+
|
10 |
+
public function testSuccesfulCustomerCreate()
|
11 |
+
{
|
12 |
+
setApiKey();
|
13 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
14 |
+
$this->assertTrue(strpos(get_class($customer), 'Customer') !== false);
|
15 |
+
}
|
16 |
+
|
17 |
+
public function testSuccessfulCustomerNewWhere()
|
18 |
+
{
|
19 |
+
setApiKey();
|
20 |
+
$customers = \Conekta\Customer::where();
|
21 |
+
$this->assertTrue(strpos(get_class($customers), 'ConektaList') !== false);
|
22 |
+
$this->assertTrue(strpos($customers->elements_type, 'Customer') !== false);
|
23 |
+
$this->assertTrue(strpos(get_class($customers[0]), 'Customer') !== false);
|
24 |
+
$this->assertTrue(strpos(get_class(end($customers)), 'Customer') !== false);
|
25 |
+
}
|
26 |
+
|
27 |
+
public function testSuccesfulDeleteCustomer()
|
28 |
+
{
|
29 |
+
setApiKey();
|
30 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
31 |
+
$customer->delete();
|
32 |
+
$this->assertTrue($customer->deleted == true);
|
33 |
+
}
|
34 |
+
|
35 |
+
public function testUnsuccesfulCustomerCreate()
|
36 |
+
{
|
37 |
+
setApiKey();
|
38 |
+
try {
|
39 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
40 |
+
} catch (Exception $e) {
|
41 |
+
$this->assertTrue(strpos($e->getMessage(), 'Object tok_test_visa_4241 could not be found.') !== false);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
public function testSuccesfulSourceCreate()
|
46 |
+
{
|
47 |
+
setApiKey();
|
48 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
49 |
+
$source = $customer->createPaymentSource(array(
|
50 |
+
'token_id' => 'tok_test_visa_4242',
|
51 |
+
'type' => 'card'
|
52 |
+
));
|
53 |
+
$this->assertTrue(strpos(get_class($source), 'PaymentSource') !== false);
|
54 |
+
$this->assertTrue(strpos(get_class($customer->payment_sources), 'ConektaList') !== false);
|
55 |
+
$this->assertTrue($customer->payment_sources->total == 1);
|
56 |
+
}
|
57 |
+
|
58 |
+
public function testSuccesfulShippingContactCreate()
|
59 |
+
{
|
60 |
+
setApiKey();
|
61 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
62 |
+
$shipping_contact = $customer->createShippingContact(array(
|
63 |
+
'receiver' => 'John Williams',
|
64 |
+
'phone' => '+523333350360',
|
65 |
+
'email' => 'test@conekta.io',
|
66 |
+
'address' => array(
|
67 |
+
'street1' => 'Wallaaby',
|
68 |
+
'city' => 'Sydney',
|
69 |
+
'state' => 'P. Sherman',
|
70 |
+
'country' => 'MX',
|
71 |
+
'postal_code' => '78215'
|
72 |
+
)
|
73 |
+
));
|
74 |
+
$this->assertTrue(strpos(get_class($shipping_contact), 'ShippingContact') !== false);
|
75 |
+
$this->assertTrue(strpos(get_class($customer->shipping_contacts), 'ConektaList') !== false);
|
76 |
+
$this->assertTrue($customer->shipping_contacts->total == 1);
|
77 |
+
}
|
78 |
+
|
79 |
+
public function testSuccesfulFiscalEntityCreate()
|
80 |
+
{
|
81 |
+
setApiKey();
|
82 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
83 |
+
$fiscal_entity = $customer->createFiscalEntity(array(
|
84 |
+
'tax_id' => 'AMGH851205MN1',
|
85 |
+
'company_name' => 'Test SA de CV',
|
86 |
+
'email' => 'test@conekta.io',
|
87 |
+
'phone' => '+5213353319758',
|
88 |
+
'address' => array(
|
89 |
+
'street1' => '250 Alexis St',
|
90 |
+
'internal_number' => '19',
|
91 |
+
'external_number' => '10',
|
92 |
+
'city' => 'Red Deer',
|
93 |
+
'state' => 'Alberta',
|
94 |
+
'country' => 'MX',
|
95 |
+
'postal_code' => '78216'
|
96 |
+
)
|
97 |
+
));
|
98 |
+
|
99 |
+
$this->assertTrue(strpos(get_class($fiscal_entity), 'FiscalEntity') !== false);
|
100 |
+
$this->assertTrue(strpos(get_class($customer->fiscal_entities), 'ConektaList') !== false);
|
101 |
+
$this->assertTrue($customer->fiscal_entities->total == 1);
|
102 |
+
}
|
103 |
+
}
|
lib/Conekta/test/Conekta-2.0/DiscountLineTest.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DiscountLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn',
|
20 |
+
'discount_lines' => array(
|
21 |
+
array(
|
22 |
+
'code' => 'Cupon de descuento',
|
23 |
+
'amount' => 10,
|
24 |
+
'type' => 'loyalty'
|
25 |
+
),
|
26 |
+
array(
|
27 |
+
'code' => 'Cupon de descuento',
|
28 |
+
'amount' => 5,
|
29 |
+
'type' => 'loyalty'
|
30 |
+
)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
public function testSuccessfulDiscountLineDelete()
|
35 |
+
{
|
36 |
+
setApiKey();
|
37 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
38 |
+
$discount_line = $order->discount_lines[0];
|
39 |
+
$discount_line->delete();
|
40 |
+
|
41 |
+
$this->assertTrue($discount_line->deleted == true);
|
42 |
+
}
|
43 |
+
|
44 |
+
public function testSuccessfulDiscountLineUpdate()
|
45 |
+
{
|
46 |
+
setApiKey();
|
47 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
48 |
+
$discount_line = $order->discount_lines[0];
|
49 |
+
$discount_line->update(array('amount' => 11));
|
50 |
+
|
51 |
+
$this->assertTrue($discount_line->amount == 11);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function testUnsuccessfulDiscountLineUpdate()
|
55 |
+
{
|
56 |
+
setApiKey();
|
57 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
58 |
+
$discount_line = $order->discount_lines[0];
|
59 |
+
try{
|
60 |
+
$discount_line->update(array('amount' => -1));
|
61 |
+
} catch(Exception $e) {
|
62 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
lib/Conekta/test/Conekta-2.0/ErrorListTest.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ErrorListTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public static $invalid_customer =
|
7 |
+
array('email' => 'hola@hola.com',
|
8 |
+
'cards' => array('tok_test_visa_4241')
|
9 |
+
);
|
10 |
+
|
11 |
+
public function testNoIdError()
|
12 |
+
{
|
13 |
+
setApiKey();
|
14 |
+
try {
|
15 |
+
$customer = \Conekta\Customer::find('0');
|
16 |
+
} catch (Exception $e) {
|
17 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
public function testNoConnectionError()
|
22 |
+
{
|
23 |
+
setApiKey();
|
24 |
+
$apiUrl = \Conekta\Conekta::$apiBase;
|
25 |
+
\Conekta\Conekta::$apiBase = 'http://localhost:3001';
|
26 |
+
try {
|
27 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4241')));
|
28 |
+
} catch (Exception $e) {
|
29 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
30 |
+
}
|
31 |
+
\Conekta\Conekta::$apiBase = $apiUrl;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function testApiError(){
|
35 |
+
setApiKey();
|
36 |
+
try {
|
37 |
+
$customer = \Conekta\Customer::create(self::$invalid_customer);
|
38 |
+
} catch (Exception $e) {
|
39 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
public function testResourceNotFoundError()
|
44 |
+
{
|
45 |
+
setApiKey();
|
46 |
+
try {
|
47 |
+
$customer = \Conekta\Customer::find('1');
|
48 |
+
} catch (Exception $e) {
|
49 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
lib/Conekta/test/Conekta-2.0/FiscalEntityTest.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FiscalEntityTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer = array(
|
6 |
+
'cards' => array('tok_test_visa_4242'),
|
7 |
+
'name' => 'Test Name',
|
8 |
+
'email' => 'test@conekta.io',
|
9 |
+
'fiscal_entities' => array(array(
|
10 |
+
'tax_id' => 'AMGH851205MN1',
|
11 |
+
'name' => 'Test SA de CV',
|
12 |
+
'email' => 'test@conekta.io',
|
13 |
+
'phone' => '+5213353319758',
|
14 |
+
'address' => array(
|
15 |
+
'street1' => '250 Alexis St',
|
16 |
+
'internal_number' => "19",
|
17 |
+
'external_number' => '10',
|
18 |
+
'city' => 'Red Deer',
|
19 |
+
'state' => 'Alberta',
|
20 |
+
'country' => 'MX',
|
21 |
+
'postal_code' => '78216'
|
22 |
+
)
|
23 |
+
))
|
24 |
+
);
|
25 |
+
|
26 |
+
public function testSuccessfulFiscalEntityDelete()
|
27 |
+
{
|
28 |
+
setApiKey();
|
29 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
30 |
+
|
31 |
+
$fiscal_entity = $customer->fiscal_entities[0]->delete();
|
32 |
+
|
33 |
+
$this->assertTrue($fiscal_entity->deleted);
|
34 |
+
}
|
35 |
+
|
36 |
+
public function testSuccessfulFiscalEntityUpdate()
|
37 |
+
{
|
38 |
+
setApiKey();
|
39 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
40 |
+
|
41 |
+
$customer->fiscal_entities[0]->update(array(
|
42 |
+
'name' => 'Another name'
|
43 |
+
));
|
44 |
+
|
45 |
+
$this->assertTrue($customer->fiscal_entities[0]->name == 'Another name');
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testUnsuccessfulFiscalEntityUpdate()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
52 |
+
|
53 |
+
try {
|
54 |
+
$customer->fiscal_entities[0]->update(array(
|
55 |
+
'name' => 'Company name'
|
56 |
+
));
|
57 |
+
} catch (Exception $e) {
|
58 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
lib/Conekta/test/Conekta-2.0/LangTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use \Conekta\Lang;
|
4 |
+
|
5 |
+
class LangTest extends UnitTestCase
|
6 |
+
{
|
7 |
+
public function testShouldTranslatesMessage()
|
8 |
+
{
|
9 |
+
$this->assertEqual(
|
10 |
+
'There was an error. Please contact system administrator.',
|
11 |
+
Lang::translate('error.resource.id_purchaser', Lang::EN)
|
12 |
+
);
|
13 |
+
|
14 |
+
$this->assertEqual(
|
15 |
+
'Hubo un error. Favor de contactar al administrador del sistema.',
|
16 |
+
Lang::translate('error.resource.id_purchaser', Lang::ES)
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
lib/Conekta/test/Conekta-2.0/LineItemTest.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class LineItemTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'type' => 'physical',
|
14 |
+
'tags' => array('food', 'mexican food')
|
15 |
+
),
|
16 |
+
array(
|
17 |
+
'name'=> 'Box of Cohiba S1s',
|
18 |
+
'description'=> 'Imported From Mex.',
|
19 |
+
'unit_price'=> 3500,
|
20 |
+
'quantity'=> 1,
|
21 |
+
'type' => 'physical',
|
22 |
+
'tags' => array('food')
|
23 |
+
)
|
24 |
+
),
|
25 |
+
'currency' => 'mxn'
|
26 |
+
);
|
27 |
+
|
28 |
+
public function testSuccessfulLineItemDelete()
|
29 |
+
{
|
30 |
+
setApiKey();
|
31 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
32 |
+
$line_item = $order->line_items[0];
|
33 |
+
$line_item->delete();
|
34 |
+
|
35 |
+
$this->assertTrue($line_item->deleted == true);
|
36 |
+
}
|
37 |
+
|
38 |
+
public function testSuccessfulLineItemUpdate()
|
39 |
+
{
|
40 |
+
setApiKey();
|
41 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
42 |
+
$line_item = $order->line_items[0];
|
43 |
+
$line_item->update(array('unit_price' => 1000));
|
44 |
+
|
45 |
+
$this->assertTrue($line_item->unit_price == 1000);
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testUnsuccessfulLineItemUpdate()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
52 |
+
$line_item = $order->line_items[0];
|
53 |
+
try {
|
54 |
+
$line_item->update(array('unit_price' => -1));
|
55 |
+
|
56 |
+
} catch(Exception $e) {
|
57 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
lib/Conekta/test/Conekta-2.0/OrderTest.php
ADDED
@@ -0,0 +1,302 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class OrderTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn',
|
20 |
+
'metadata' => array('test' => 'extra info')
|
21 |
+
);
|
22 |
+
|
23 |
+
public static $valid_return = array(
|
24 |
+
'amount' => 20000,
|
25 |
+
'reason' => 'requested_by_client',
|
26 |
+
'currency' => 'MXN',
|
27 |
+
);
|
28 |
+
|
29 |
+
public function testSuccesfulCreateOrder()
|
30 |
+
{
|
31 |
+
setApiKey();
|
32 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
33 |
+
$this->assertTrue(strpos($order->metadata["test"], 'extra info') !== false);
|
34 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
35 |
+
|
36 |
+
}
|
37 |
+
|
38 |
+
public function testSuccesfulCreateOrderWithCharges()
|
39 |
+
{
|
40 |
+
$charges =
|
41 |
+
array(
|
42 |
+
'charges' => array(
|
43 |
+
array(
|
44 |
+
'payment_source' => array(
|
45 |
+
'type' => 'oxxo_cash',
|
46 |
+
'expires_at' => strtotime(date("Y-m-d H:i:s")) + "36000"
|
47 |
+
),
|
48 |
+
'amount' => 20000
|
49 |
+
)
|
50 |
+
),
|
51 |
+
'currency' => 'mxn',
|
52 |
+
'customer_info' => array(
|
53 |
+
'name' => 'John Constantine',
|
54 |
+
'phone' => '+5213353319758',
|
55 |
+
'email' => 'hola@hola.com'
|
56 |
+
)
|
57 |
+
);
|
58 |
+
setApiKey();
|
59 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $charges));
|
60 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
61 |
+
$this->assertTrue(count($order->charges) > 0);
|
62 |
+
}
|
63 |
+
|
64 |
+
public function testSuccesfulCharge()
|
65 |
+
{
|
66 |
+
$other_params =
|
67 |
+
array(
|
68 |
+
'currency' => 'mxn',
|
69 |
+
'customer_info' => array(
|
70 |
+
'name' => 'John Constantine',
|
71 |
+
'phone' => '+5213353319758',
|
72 |
+
'email' => 'hola@hola.com'
|
73 |
+
)
|
74 |
+
);
|
75 |
+
setApiKey();
|
76 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $other_params));
|
77 |
+
$charge_params = array(
|
78 |
+
'payment_source' => array('type' => 'oxxo_cash'),
|
79 |
+
'amount' => 20000
|
80 |
+
);
|
81 |
+
$charge = $order->createCharge($charge_params);
|
82 |
+
|
83 |
+
$this->assertTrue(strpos(get_class($charge), 'Charge') !== false);
|
84 |
+
$this->assertTrue(strpos(get_class($order->charges), 'ConektaList') !== false);
|
85 |
+
$this->assertTrue($order->charges->total == 1);
|
86 |
+
}
|
87 |
+
|
88 |
+
#Update an order
|
89 |
+
public function testSuccesfulOrderUpdate()
|
90 |
+
{
|
91 |
+
setApiKey();
|
92 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
93 |
+
|
94 |
+
$updated_parameters = array(
|
95 |
+
'line_items'=> array(
|
96 |
+
array(
|
97 |
+
'name'=> 'Box of chocolates',
|
98 |
+
'description'=> 'Imported From Uruguay.',
|
99 |
+
'unit_price'=> 30000,
|
100 |
+
'quantity'=> 2,
|
101 |
+
'sku'=> 'choc_s3',
|
102 |
+
'category'=> 'expendables',
|
103 |
+
'type' => 'physical',
|
104 |
+
'tags' => array('Chocolate', 'Sudamerican chocolates')
|
105 |
+
)
|
106 |
+
),
|
107 |
+
'currency' => 'USD'
|
108 |
+
);
|
109 |
+
|
110 |
+
$order->update($updated_parameters);
|
111 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
112 |
+
}
|
113 |
+
|
114 |
+
public function testUnsuccessfulOrderUpdate()
|
115 |
+
{
|
116 |
+
$charges = array(
|
117 |
+
array(
|
118 |
+
'payment_source' => array(
|
119 |
+
'type' => 'oxxo_cash'
|
120 |
+
),
|
121 |
+
'amount' => 10
|
122 |
+
)
|
123 |
+
);
|
124 |
+
|
125 |
+
setApiKey();
|
126 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
127 |
+
try {
|
128 |
+
$order->update(array('charges' => $charges));
|
129 |
+
} catch(Exception $e) {
|
130 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
public function testSuccesfulOrderFind()
|
135 |
+
{
|
136 |
+
setApiKey();
|
137 |
+
$id = \Conekta\Order::create(self::$valid_order)->id;
|
138 |
+
$order = \Conekta\Order::find($id);
|
139 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
140 |
+
}
|
141 |
+
|
142 |
+
public function testSuccesfulOrderWhere()
|
143 |
+
{
|
144 |
+
setApiKey();
|
145 |
+
$orders = \Conekta\Order::where();
|
146 |
+
|
147 |
+
$this->assertTrue(strpos(get_class($orders), 'ConektaList') !== false);
|
148 |
+
$this->assertTrue(strpos($orders->elements_type, 'Order') !== false);
|
149 |
+
$this->assertTrue(strpos(get_class($orders[0]), 'Order') !== false);
|
150 |
+
$this->assertTrue(strpos(get_class(end($orders)), 'Order') !== false);
|
151 |
+
}
|
152 |
+
|
153 |
+
public function testSuccessfulLineItem()
|
154 |
+
{
|
155 |
+
setApiKey();
|
156 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
157 |
+
|
158 |
+
$line_item = $order->createLineItem(array(
|
159 |
+
'name'=> 'Box of Cohiba S1s',
|
160 |
+
'description'=> 'Imported From Mex.',
|
161 |
+
'unit_price'=> 20000,
|
162 |
+
'quantity'=> 1,
|
163 |
+
'type' => 'physical',
|
164 |
+
'tags' => array('food', 'mexican food')
|
165 |
+
));
|
166 |
+
|
167 |
+
$this->assertTrue(strpos(get_class($line_item), 'LineItem') !== false);
|
168 |
+
$this->assertTrue(strpos(get_class($order->line_items), 'ConektaList') !== false);
|
169 |
+
$this->assertTrue($order->line_items->total == 2);
|
170 |
+
}
|
171 |
+
|
172 |
+
public function testSuccessfulTaxLine()
|
173 |
+
{
|
174 |
+
setApiKey();
|
175 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
176 |
+
|
177 |
+
$tax_line = $order->createTaxLine(array(
|
178 |
+
'description' => 'IVA',
|
179 |
+
'amount' => 60
|
180 |
+
));
|
181 |
+
|
182 |
+
$tax_line = $order->createTaxLine(array(
|
183 |
+
'description' => 'ISR',
|
184 |
+
'amount' => 6
|
185 |
+
));
|
186 |
+
|
187 |
+
$this->assertTrue(strpos(get_class($tax_line), 'TaxLine') !== false);
|
188 |
+
$this->assertTrue(strpos(get_class($order->tax_lines), 'ConektaList') !== false);
|
189 |
+
$this->assertTrue($order->tax_lines->total == 2);
|
190 |
+
}
|
191 |
+
|
192 |
+
public function testSuccessfulShippingLine()
|
193 |
+
{
|
194 |
+
setApiKey();
|
195 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
196 |
+
|
197 |
+
$shipping_line = $order->createShippingLine(array(
|
198 |
+
'description' => 'Free Shipping',
|
199 |
+
'amount' => 0,
|
200 |
+
'tracking_number' => 'TRACK123',
|
201 |
+
'carrier' => 'USPS',
|
202 |
+
'method' => 'Train'
|
203 |
+
));
|
204 |
+
|
205 |
+
$this->assertTrue(strpos(get_class($shipping_line), 'ShippingLine') !== false);
|
206 |
+
$this->assertTrue(strpos(get_class($order->shipping_lines), 'ConektaList') !== false);
|
207 |
+
$this->assertTrue($order->shipping_lines->total == 1);
|
208 |
+
}
|
209 |
+
|
210 |
+
public function testSuccessfulDiscountLine()
|
211 |
+
{
|
212 |
+
setApiKey();
|
213 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
214 |
+
$discount_line = $order->createDiscountLine(array(
|
215 |
+
'code' => 'Cupon de descuento',
|
216 |
+
'amount' => 10,
|
217 |
+
'type' => 'loyalty'
|
218 |
+
));
|
219 |
+
$this->assertTrue(strpos(get_class($discount_line), 'DiscountLine') !== false);
|
220 |
+
$this->assertTrue(strpos(get_class($order->discount_lines), 'ConektaList') !== false);
|
221 |
+
$this->assertTrue($order->discount_lines->total == 1);
|
222 |
+
}
|
223 |
+
|
224 |
+
public function testSuccessfulFiscalEntity()
|
225 |
+
{
|
226 |
+
setApiKey();
|
227 |
+
|
228 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
229 |
+
$fiscal_entity = $order->createFiscalEntity(array(
|
230 |
+
'tax_id' => 'AMGH851205MN1',
|
231 |
+
'company_name' => 'Test SA de CV',
|
232 |
+
'email' => 'test@conekta.io',
|
233 |
+
'phone' => '+5213353319758',
|
234 |
+
'address' => array(
|
235 |
+
'street1' => '250 Alexis St',
|
236 |
+
'internal_number' => '19',
|
237 |
+
'external_number' => '10',
|
238 |
+
'city' => 'Red Deer',
|
239 |
+
'state' => 'Alberta',
|
240 |
+
'country' => 'MX',
|
241 |
+
'postal_code' => '78216')
|
242 |
+
));
|
243 |
+
|
244 |
+
$this->assertTrue(strpos(get_class($fiscal_entity), 'FiscalEntity') !== false);
|
245 |
+
}
|
246 |
+
|
247 |
+
public function testSuccessfulReturn()
|
248 |
+
{
|
249 |
+
$charges =
|
250 |
+
array(
|
251 |
+
'charges' => array(
|
252 |
+
array(
|
253 |
+
'payment_source' => array(
|
254 |
+
'type' => 'card',
|
255 |
+
'token_id' => 'tok_test_visa_4242'
|
256 |
+
),
|
257 |
+
'amount' => 20000
|
258 |
+
)
|
259 |
+
),
|
260 |
+
'currency' => 'mxn',
|
261 |
+
'customer_info' => array(
|
262 |
+
'name' => 'John Constantine',
|
263 |
+
'phone' => '+5213353319758',
|
264 |
+
'email' => 'hola@hola.com'
|
265 |
+
)
|
266 |
+
);
|
267 |
+
setApiKey();
|
268 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $charges));
|
269 |
+
$order->createReturn(array_merge(self::$valid_return, array('order_id' => $order->id)));
|
270 |
+
$returnedOrder = \Conekta\Order::find($order->id);
|
271 |
+
$this->assertTrue(strpos(get_class($order->returns[0]), 'OrderReturn') !== false);
|
272 |
+
$this->assertTrue($returnedOrder->status == 'returned');
|
273 |
+
}
|
274 |
+
|
275 |
+
public function testSuccessfulCapture()
|
276 |
+
{
|
277 |
+
$charges =
|
278 |
+
array(
|
279 |
+
'preauthorize' => true,
|
280 |
+
'charges' => array(
|
281 |
+
array(
|
282 |
+
'payment_source' => array(
|
283 |
+
'type' => 'oxxo_cash',
|
284 |
+
'expires_at' => strtotime(date("Y-m-d H:i:s")) + "36000"
|
285 |
+
),
|
286 |
+
'amount' => 20000
|
287 |
+
)
|
288 |
+
),
|
289 |
+
'currency' => 'mxn',
|
290 |
+
'customer_info' => array(
|
291 |
+
'name' => 'John Constantine',
|
292 |
+
'phone' => '+5213353319758',
|
293 |
+
'email' => 'hola@hola.com'
|
294 |
+
)
|
295 |
+
);
|
296 |
+
setApiKey();
|
297 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $charges));
|
298 |
+
$this->assertTrue($order->preauthorize == true);
|
299 |
+
$order->capture();
|
300 |
+
$this->assertTrue($order->preauthorize == false);
|
301 |
+
}
|
302 |
+
}
|
lib/Conekta/test/Conekta-2.0/ShippingContactTest.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ShippingContactTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer =
|
6 |
+
array('email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine',
|
8 |
+
'shipping_contacts' => array(
|
9 |
+
array(
|
10 |
+
'receiver' => 'Jack Bauer',
|
11 |
+
'phone' => '+5213353319758',
|
12 |
+
'email' => 'thomas.logan@xmen.org',
|
13 |
+
'address' => array(
|
14 |
+
'street1' => '250 Alexis St',
|
15 |
+
'city' => 'Red Deer',
|
16 |
+
'state' => 'Alberta',
|
17 |
+
'country' => 'CA',
|
18 |
+
'postal_code' => 'T4N 0B8'
|
19 |
+
)
|
20 |
+
),
|
21 |
+
array(
|
22 |
+
'receiver' => 'John Williams',
|
23 |
+
'phone' => '+5213353319758',
|
24 |
+
'email' => 'rogue@xmen.org',
|
25 |
+
'address' => array(
|
26 |
+
'street1' => '250 Alexis St',
|
27 |
+
'city' => 'Red Deer',
|
28 |
+
'state' => 'Alberta',
|
29 |
+
'country' => 'CA',
|
30 |
+
'postal_code' => 'T4N 0B8'
|
31 |
+
)
|
32 |
+
)
|
33 |
+
)
|
34 |
+
);
|
35 |
+
|
36 |
+
public function testSuccessfulShippingContactDelete()
|
37 |
+
{
|
38 |
+
setApiKey();
|
39 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
40 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
41 |
+
$shipping_contact->delete();
|
42 |
+
|
43 |
+
$this->assertTrue($shipping_contact->deleted == true);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function testSuccessfulShippingContactUpdate()
|
47 |
+
{
|
48 |
+
setApiKey();
|
49 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
50 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
51 |
+
$shipping_contact->update(array('receiver' => 'Tony Almeida'));
|
52 |
+
$this->assertTrue($shipping_contact->receiver == 'Tony Almeida');
|
53 |
+
}
|
54 |
+
|
55 |
+
public function testUnsuccessfulShippingContactUpdate()
|
56 |
+
{
|
57 |
+
setApiKey();
|
58 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
59 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
60 |
+
try{
|
61 |
+
$shipping_contact->update(array('email' => 123));
|
62 |
+
}catch (Exception $e) {
|
63 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
lib/Conekta/test/Conekta-2.0/ShippingLineTest.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ShippingLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn',
|
20 |
+
'shipping_lines' => array(
|
21 |
+
array(
|
22 |
+
'description' => 'Free Shipping',
|
23 |
+
'amount' => 0,
|
24 |
+
'tracking_number' => 'TRACK123',
|
25 |
+
'carrier' => 'USPS',
|
26 |
+
'method' => 'Train'
|
27 |
+
),
|
28 |
+
array(
|
29 |
+
'description' => 'Free Shipping',
|
30 |
+
'amount' => 40,
|
31 |
+
'tracking_number' => 'TRACK124',
|
32 |
+
'carrier' => 'USPS',
|
33 |
+
'method' => 'Train'
|
34 |
+
)
|
35 |
+
)
|
36 |
+
);
|
37 |
+
|
38 |
+
public function testSuccessfulShippingLineDelete()
|
39 |
+
{
|
40 |
+
setApiKey();
|
41 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
42 |
+
$shipping_line = $order->shipping_lines[0];
|
43 |
+
$shipping_line->delete();
|
44 |
+
|
45 |
+
$this->assertTrue($shipping_line->deleted == true);
|
46 |
+
}
|
47 |
+
|
48 |
+
public function testSuccessfulShippingLineUpdate()
|
49 |
+
{
|
50 |
+
setApiKey();
|
51 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
52 |
+
$shipping_line = $order->shipping_lines[0];
|
53 |
+
$shipping_line->update(array('method' => 'Air'));
|
54 |
+
|
55 |
+
$this->assertTrue($shipping_line->method == 'Air');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function testUnsuccessfulShippingLineUpdate()
|
59 |
+
{
|
60 |
+
setApiKey();
|
61 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
62 |
+
$shipping_line = $order->shipping_lines[0];
|
63 |
+
try{
|
64 |
+
$shipping_line->update(array('amount' => -1));
|
65 |
+
} catch (Exception $e) {
|
66 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
lib/Conekta/test/Conekta-2.0/SourceTest.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SourceTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer =
|
6 |
+
array('email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine',
|
8 |
+
'payment_sources' => array(array(
|
9 |
+
'token_id' => 'tok_test_visa_4242',
|
10 |
+
'type' => 'card'
|
11 |
+
))
|
12 |
+
);
|
13 |
+
|
14 |
+
public function testSuccesfulDeleteSources()
|
15 |
+
{
|
16 |
+
setApiKey();
|
17 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
18 |
+
$payment_source = $customer->payment_sources[0];
|
19 |
+
|
20 |
+
$payment_source->delete();
|
21 |
+
|
22 |
+
$this->assertTrue($payment_source->deleted == true);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function testSuccesfulUpdateSources()
|
26 |
+
{
|
27 |
+
setApiKey();
|
28 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
29 |
+
$payment_source = $customer->payment_sources[0];
|
30 |
+
$payment_source->update(array('exp_month' => '11'));
|
31 |
+
$this->assertTrue($payment_source->exp_month == '11');
|
32 |
+
}
|
33 |
+
|
34 |
+
public function testUnsuccesfulUpdateSources(){
|
35 |
+
setApiKey();
|
36 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
37 |
+
$payment_source = $customer->payment_sources[0];
|
38 |
+
try{
|
39 |
+
$payment_source->update(array('token_id' => 'tok_test_visa_4241'));
|
40 |
+
}catch (Exception $e) {
|
41 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
lib/Conekta/test/Conekta-2.0/TaxLineTest.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TaxLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items' => array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'tax_lines' => array(
|
20 |
+
array(
|
21 |
+
'description' => 'IVA',
|
22 |
+
'amount' => 60
|
23 |
+
),
|
24 |
+
array(
|
25 |
+
'description' => 'ISR',
|
26 |
+
'amount' => 100
|
27 |
+
)
|
28 |
+
),
|
29 |
+
'currency' => 'mxn'
|
30 |
+
);
|
31 |
+
|
32 |
+
public function testSuccessfulTaxLineDelete()
|
33 |
+
{
|
34 |
+
setApiKey();
|
35 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
36 |
+
$tax_line = $order->tax_lines[0];
|
37 |
+
$tax_line->delete();
|
38 |
+
|
39 |
+
$this->assertTrue($tax_line->deleted == true);
|
40 |
+
}
|
41 |
+
|
42 |
+
public function testSuccessfulTaxLineUpdate()
|
43 |
+
{
|
44 |
+
setApiKey();
|
45 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
46 |
+
$tax_line = $order->tax_lines[0];
|
47 |
+
$tax_line->update(array('amount' => 10));
|
48 |
+
|
49 |
+
$this->assertTrue($tax_line->amount == 10);
|
50 |
+
}
|
51 |
+
|
52 |
+
public function testUnsuccessfulTaxLineUpdate()
|
53 |
+
{
|
54 |
+
setApiKey();
|
55 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
56 |
+
$tax_line = $order->tax_lines[0];
|
57 |
+
try {
|
58 |
+
$tax_line->update(array('amount' => -1));
|
59 |
+
} catch (Exception $e) {
|
60 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
lib/Conekta/test/Conekta-2.0/WebhookTest.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WebhookTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $events = array("events" =>
|
6 |
+
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
7 |
+
"charge.fraudulent", "charge.refunded", "charge.created", "customer.created",
|
8 |
+
"customer.updated", "customer.deleted", "webhook.created", "webhook.updated",
|
9 |
+
"webhook.deleted", "charge.chargeback.created", "charge.chargeback.updated",
|
10 |
+
"charge.chargeback.under_review", "charge.chargeback.lost", "charge.chargeback.won",
|
11 |
+
"payout.created", "payout.retrying", "payout.paid_out", "payout.failed",
|
12 |
+
"plan.created", "plan.updated", "plan.deleted", "subscription.created",
|
13 |
+
"subscription.paused", "subscription.resumed", "subscription.canceled",
|
14 |
+
"subscription.expired", "subscription.updated", "subscription.paid",
|
15 |
+
"subscription.payment_failed", "payee.created", "payee.updated",
|
16 |
+
"payee.deleted", "payee.payout_method.created",
|
17 |
+
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
18 |
+
|
19 |
+
public static $url = array("url" => "http://www.example.com/my_listener");
|
20 |
+
|
21 |
+
public function testSuccesfulWebhookCreate()
|
22 |
+
{
|
23 |
+
setApiKey();
|
24 |
+
$webhook = \Conekta\Webhook::create(array_merge(self::$url, self::$events));
|
25 |
+
$this->assertTrue(strpos(get_class($webhook), 'Webhook') !== false);
|
26 |
+
$this->assertTrue(strpos($webhook->webhook_url, self::$url["url"]) !== false);
|
27 |
+
$webhook->update(array("url" => "http://www.example.com/my_listener"));
|
28 |
+
$this->assertTrue(strpos($webhook->webhook_url, "http://www.example.com/my_listener") !== false);
|
29 |
+
$webhook->delete();
|
30 |
+
}
|
31 |
+
}
|
lib/Conekta/test/Conekta.php
CHANGED
@@ -7,14 +7,26 @@ function setApiKey()
|
|
7 |
if (!$apiEnvKey) {
|
8 |
$apiEnvKey = '1tv5yJp3xnVZ7eK67m4h';
|
9 |
}
|
10 |
-
Conekta::setApiKey($apiEnvKey);
|
11 |
}
|
12 |
function unsetApiKey()
|
13 |
{
|
14 |
if (isset($env) == false) {
|
15 |
-
$env = Conekta::setApiKey('');
|
16 |
}
|
17 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
// Load test suite via composer or manually
|
20 |
$test_suite = @include_once dirname(__FILE__).'/simpletest/autorun.php';
|
@@ -50,3 +62,15 @@ require_once dirname(__FILE__).'/Conekta/PlanTest.php';
|
|
50 |
require_once dirname(__FILE__).'/Conekta/ErrorTest.php';
|
51 |
require_once dirname(__FILE__).'/Conekta/PayoutTest.php';
|
52 |
require_once dirname(__FILE__).'/Conekta/WebhookTest.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if (!$apiEnvKey) {
|
8 |
$apiEnvKey = '1tv5yJp3xnVZ7eK67m4h';
|
9 |
}
|
10 |
+
\Conekta\Conekta::setApiKey($apiEnvKey);
|
11 |
}
|
12 |
function unsetApiKey()
|
13 |
{
|
14 |
if (isset($env) == false) {
|
15 |
+
$env = \Conekta\Conekta::setApiKey('');
|
16 |
}
|
17 |
}
|
18 |
+
function setApiVersion($version)
|
19 |
+
{
|
20 |
+
\Conekta\Conekta::setApiVersion($version);
|
21 |
+
}
|
22 |
+
|
23 |
+
function setPlugin($plugin){
|
24 |
+
\Conekta\Conekta::setPlugin($plugin);
|
25 |
+
}
|
26 |
+
|
27 |
+
function setEnvLocale($locale){
|
28 |
+
\Conekta\Conekta::setLocale($locale);
|
29 |
+
}
|
30 |
|
31 |
// Load test suite via composer or manually
|
32 |
$test_suite = @include_once dirname(__FILE__).'/simpletest/autorun.php';
|
62 |
require_once dirname(__FILE__).'/Conekta/ErrorTest.php';
|
63 |
require_once dirname(__FILE__).'/Conekta/PayoutTest.php';
|
64 |
require_once dirname(__FILE__).'/Conekta/WebhookTest.php';
|
65 |
+
require_once dirname(__FILE__).'/Conekta/LogTest.php';
|
66 |
+
require_once dirname(__FILE__).'/Conekta/OrderTest.php';
|
67 |
+
require_once dirname(__FILE__).'/Conekta/SourceTest.php';
|
68 |
+
require_once dirname(__FILE__).'/Conekta/TaxLineTest.php';
|
69 |
+
require_once dirname(__FILE__).'/Conekta/ConektaListTest.php';
|
70 |
+
require_once dirname(__FILE__).'/Conekta/ShippingContactTest.php';
|
71 |
+
require_once dirname(__FILE__).'/Conekta/ShippingLineTest.php';
|
72 |
+
require_once dirname(__FILE__).'/Conekta/LineItemTest.php';
|
73 |
+
require_once dirname(__FILE__).'/Conekta/DiscountLineTest.php';
|
74 |
+
require_once dirname(__FILE__).'/Conekta/FiscalEntityTest.php';
|
75 |
+
require_once dirname(__FILE__).'/Conekta/ErrorListTest.php';
|
76 |
+
require_once dirname(__FILE__).'/Conekta/ConektaTest.php';
|
lib/Conekta/test/Conekta/ChargeTest.php
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public static $valid_payment_method = array(
|
6 |
'amount' => 2000,
|
7 |
'currency' => 'mxn',
|
8 |
'description' => 'Some desc',
|
9 |
'details'=> array(
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
29 |
)
|
30 |
-
)
|
31 |
)
|
32 |
);
|
33 |
|
@@ -36,27 +36,27 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
36 |
'currency' => 'mxn',
|
37 |
'description' => 'Some desc',
|
38 |
'details'=> array(
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
58 |
)
|
59 |
-
)
|
60 |
)
|
61 |
);
|
62 |
|
@@ -67,18 +67,18 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
67 |
$pm = self::$valid_payment_method;
|
68 |
$card = self::$valid_visa_card;
|
69 |
setApiKey();
|
70 |
-
$cpm =
|
71 |
$this->assertTrue($cpm->status == 'paid');
|
72 |
-
$pm =
|
73 |
-
$this->assertTrue(strpos(get_class($pm), '
|
74 |
}
|
75 |
|
76 |
public function testSuccesfulWhere()
|
77 |
{
|
78 |
setApiKey();
|
79 |
-
$charges =
|
80 |
-
$this->assertTrue(strpos(get_class($charges), '
|
81 |
-
$this->assertTrue(strpos(get_class($charges[0]), '
|
82 |
}
|
83 |
|
84 |
public function testSuccesfulBankPMCreate()
|
@@ -86,7 +86,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
86 |
$pm = self::$valid_payment_method;
|
87 |
$bank = array('bank' => array('type' => 'banorte'));
|
88 |
setApiKey();
|
89 |
-
$bpm =
|
90 |
$this->assertTrue($bpm->payment_method->service_number == "127589");
|
91 |
$this->assertTrue($bpm->payment_method->service_name == "Conekta");
|
92 |
$this->assertTrue(intval($bpm->payment_method->reference) > 0);
|
@@ -99,7 +99,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
99 |
$pm = self::$valid_payment_method;
|
100 |
$spei = array('bank' => array('type' => 'spei'));
|
101 |
setApiKey();
|
102 |
-
$bpm =
|
103 |
$this->assertTrue($bpm->payment_method->bank == "STP");
|
104 |
$this->assertTrue(intval($bpm->payment_method->clabe) > 0);
|
105 |
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
@@ -111,7 +111,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
111 |
$pm = self::$valid_payment_method;
|
112 |
$card = self::$valid_visa_card;
|
113 |
setApiKey();
|
114 |
-
$cpm =
|
115 |
$this->assertTrue($cpm->status == 'paid');
|
116 |
}
|
117 |
|
@@ -120,9 +120,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
120 |
$pm = self::$valid_payment_method;
|
121 |
$oxxo = array('cash' => array('type' => 'oxxo'));
|
122 |
setApiKey();
|
123 |
-
$opm =
|
124 |
-
$this->assertTrue($opm->payment_method->barcode_url == "http://s3.amazonaws.com/cash_payment_barcodes/12345678901234567890123456789012.png");
|
125 |
-
$this->assertTrue($opm->payment_method->barcode == "12345678901234567890123456789012");
|
126 |
$this->assertTrue(is_numeric($opm->payment_method->expires_at));
|
127 |
$this->assertTrue($opm->payment_method->store_name == "OXXO");
|
128 |
$this->assertTrue($opm->status == 'pending_payment');
|
@@ -134,7 +132,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
134 |
$card = self::$valid_visa_card;
|
135 |
setApiKey();
|
136 |
try {
|
137 |
-
$cpm =
|
138 |
} catch (Exception $e) {
|
139 |
$this->assertTrue(strpos($e->getMessage(), 'The minimum for card payments is 3 pesos. Check that the amount is in cents as explained in the documentation.') !== false);
|
140 |
}
|
@@ -145,7 +143,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
145 |
$pm = self::$valid_payment_method;
|
146 |
$card = self::$valid_visa_card;
|
147 |
setApiKey();
|
148 |
-
$cpm =
|
149 |
$this->assertTrue($cpm->status == 'paid');
|
150 |
$cpm->refund();
|
151 |
$this->assertTrue($cpm->status == 'refunded');
|
@@ -156,7 +154,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
156 |
$pm = self::$valid_payment_method;
|
157 |
$card = self::$valid_visa_card;
|
158 |
setApiKey();
|
159 |
-
$cpm =
|
160 |
$this->assertTrue($cpm->status == 'paid');
|
161 |
try {
|
162 |
$cpm->refund(3000);
|
@@ -171,7 +169,7 @@ class Conekta_ChargeTest extends UnitTestCase
|
|
171 |
$card = self::$valid_visa_card;
|
172 |
$capture = array('capture' => false);
|
173 |
setApiKey();
|
174 |
-
$cpm =
|
175 |
$this->assertTrue($cpm->status == 'pre_authorized');
|
176 |
$cpm->capture();
|
177 |
$this->assertTrue($cpm->status == 'paid');
|
1 |
<?php
|
2 |
|
3 |
+
class ChargeTest extends UnitTestCase
|
4 |
{
|
5 |
public static $valid_payment_method = array(
|
6 |
'amount' => 2000,
|
7 |
'currency' => 'mxn',
|
8 |
'description' => 'Some desc',
|
9 |
'details'=> array(
|
10 |
+
'name'=> 'Arnulfo Quimare',
|
11 |
+
'phone'=> '403-342-0642',
|
12 |
+
'email'=> 'logan@x-men.org',
|
13 |
+
'customer'=> array(
|
14 |
+
'logged_in'=> true,
|
15 |
+
'successful_purchases'=> 14,
|
16 |
+
'created_at'=> 1379784950,
|
17 |
+
'updated_at'=> 1379784950,
|
18 |
+
'offline_payments'=> 4,
|
19 |
+
'score'=> 9
|
20 |
+
),
|
21 |
+
'line_items'=> array(
|
22 |
+
array(
|
23 |
+
'name'=> 'Box of Cohiba S1s',
|
24 |
+
'description'=> 'Imported From Mex.',
|
25 |
+
'unit_price'=> 20000,
|
26 |
+
'quantity'=> 1,
|
27 |
+
'sku'=> 'cohb_s1',
|
28 |
+
'category'=> 'food'
|
29 |
+
)
|
30 |
)
|
|
|
31 |
)
|
32 |
);
|
33 |
|
36 |
'currency' => 'mxn',
|
37 |
'description' => 'Some desc',
|
38 |
'details'=> array(
|
39 |
+
'name'=> 'Arnulfo Quimare',
|
40 |
+
'phone'=> '403-342-0642',
|
41 |
+
'email'=> 'logan@x-men.org',
|
42 |
+
'customer'=> array(
|
43 |
+
'logged_in'=> true,
|
44 |
+
'successful_purchases'=> 14,
|
45 |
+
'created_at'=> 1379784950,
|
46 |
+
'updated_at'=> 1379784950,
|
47 |
+
'offline_payments'=> 4,
|
48 |
+
'score'=> 9
|
49 |
+
),
|
50 |
+
'line_items'=> array(
|
51 |
+
array(
|
52 |
+
'name'=> 'Box of Cohiba S1s',
|
53 |
+
'description'=> 'Imported From Mex.',
|
54 |
+
'unit_price'=> 20000,
|
55 |
+
'quantity'=> 1,
|
56 |
+
'sku'=> 'cohb_s1',
|
57 |
+
'category'=> 'food'
|
58 |
+
)
|
59 |
)
|
|
|
60 |
)
|
61 |
);
|
62 |
|
67 |
$pm = self::$valid_payment_method;
|
68 |
$card = self::$valid_visa_card;
|
69 |
setApiKey();
|
70 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
71 |
$this->assertTrue($cpm->status == 'paid');
|
72 |
+
$pm = \Conekta\Charge::find($cpm->id);
|
73 |
+
$this->assertTrue(strpos(get_class($pm), 'Charge') !== false);
|
74 |
}
|
75 |
|
76 |
public function testSuccesfulWhere()
|
77 |
{
|
78 |
setApiKey();
|
79 |
+
$charges = \Conekta\Charge::where();
|
80 |
+
$this->assertTrue(strpos(get_class($charges), 'Object') !== false);
|
81 |
+
$this->assertTrue(strpos(get_class($charges[0]), 'Charge') !== false);
|
82 |
}
|
83 |
|
84 |
public function testSuccesfulBankPMCreate()
|
86 |
$pm = self::$valid_payment_method;
|
87 |
$bank = array('bank' => array('type' => 'banorte'));
|
88 |
setApiKey();
|
89 |
+
$bpm = \Conekta\Charge::create(array_merge($pm, $bank));
|
90 |
$this->assertTrue($bpm->payment_method->service_number == "127589");
|
91 |
$this->assertTrue($bpm->payment_method->service_name == "Conekta");
|
92 |
$this->assertTrue(intval($bpm->payment_method->reference) > 0);
|
99 |
$pm = self::$valid_payment_method;
|
100 |
$spei = array('bank' => array('type' => 'spei'));
|
101 |
setApiKey();
|
102 |
+
$bpm = \Conekta\Charge::create(array_merge($pm, $spei));
|
103 |
$this->assertTrue($bpm->payment_method->bank == "STP");
|
104 |
$this->assertTrue(intval($bpm->payment_method->clabe) > 0);
|
105 |
$this->assertTrue(is_numeric($bpm->payment_method->expires_at));
|
111 |
$pm = self::$valid_payment_method;
|
112 |
$card = self::$valid_visa_card;
|
113 |
setApiKey();
|
114 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
115 |
$this->assertTrue($cpm->status == 'paid');
|
116 |
}
|
117 |
|
120 |
$pm = self::$valid_payment_method;
|
121 |
$oxxo = array('cash' => array('type' => 'oxxo'));
|
122 |
setApiKey();
|
123 |
+
$opm = \Conekta\Charge::create(array_merge($pm, $oxxo));
|
|
|
|
|
124 |
$this->assertTrue(is_numeric($opm->payment_method->expires_at));
|
125 |
$this->assertTrue($opm->payment_method->store_name == "OXXO");
|
126 |
$this->assertTrue($opm->status == 'pending_payment');
|
132 |
$card = self::$valid_visa_card;
|
133 |
setApiKey();
|
134 |
try {
|
135 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
136 |
} catch (Exception $e) {
|
137 |
$this->assertTrue(strpos($e->getMessage(), 'The minimum for card payments is 3 pesos. Check that the amount is in cents as explained in the documentation.') !== false);
|
138 |
}
|
143 |
$pm = self::$valid_payment_method;
|
144 |
$card = self::$valid_visa_card;
|
145 |
setApiKey();
|
146 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
147 |
$this->assertTrue($cpm->status == 'paid');
|
148 |
$cpm->refund();
|
149 |
$this->assertTrue($cpm->status == 'refunded');
|
154 |
$pm = self::$valid_payment_method;
|
155 |
$card = self::$valid_visa_card;
|
156 |
setApiKey();
|
157 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card));
|
158 |
$this->assertTrue($cpm->status == 'paid');
|
159 |
try {
|
160 |
$cpm->refund(3000);
|
169 |
$card = self::$valid_visa_card;
|
170 |
$capture = array('capture' => false);
|
171 |
setApiKey();
|
172 |
+
$cpm = \Conekta\Charge::create(array_merge($pm, $card, $capture));
|
173 |
$this->assertTrue($cpm->status == 'pre_authorized');
|
174 |
$cpm->capture();
|
175 |
$this->assertTrue($cpm->status == 'paid');
|
lib/Conekta/test/Conekta/ConektaListTest.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ConektaListTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn'
|
20 |
+
);
|
21 |
+
|
22 |
+
public static $valid_customer =
|
23 |
+
array('email' => 'hola@hola.com',
|
24 |
+
'name' => 'John Constantine',
|
25 |
+
'sources' => array(array(
|
26 |
+
'token_id' => 'tok_test_visa_4242',
|
27 |
+
'type' => 'card'
|
28 |
+
))
|
29 |
+
);
|
30 |
+
|
31 |
+
public function testSuccessfulNext()
|
32 |
+
{
|
33 |
+
setApiKey();
|
34 |
+
setApiVersion('1.1.0');
|
35 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
36 |
+
$customers = \Conekta\Customer::where();
|
37 |
+
$first_window = \Conekta\Customer::where(array('limit' => 10));
|
38 |
+
$first_window->next(array('limit' => 1));
|
39 |
+
$id = $first_window[0]->id;
|
40 |
+
|
41 |
+
$this->assertTrue($id == $customers[10]->id);
|
42 |
+
}
|
43 |
+
|
44 |
+
public function testSuccessfulPrevious()
|
45 |
+
{
|
46 |
+
setApiKey();
|
47 |
+
setApiVersion('1.1.0');
|
48 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
49 |
+
$orders = \Conekta\Order::where();
|
50 |
+
|
51 |
+
$last_window = \Conekta\Order::where(array('limit' => 10, 'starting_after' => $orders[9]->id));
|
52 |
+
$last_window->previous(array('limit' => 1));
|
53 |
+
$id = $last_window[0]->id;
|
54 |
+
|
55 |
+
$this->assertTrue($id == $orders[9]->id);
|
56 |
+
}
|
57 |
+
|
58 |
+
}
|
lib/Conekta/test/Conekta/ConektaTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ConektaTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public function testApiLocaleInitializerStyle()
|
7 |
+
{
|
8 |
+
setEnvLocale('en');
|
9 |
+
$this->assertTrue( \Conekta\Conekta::$locale == 'en');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function testPluginInitializerStyle()
|
13 |
+
{
|
14 |
+
setApiKey();
|
15 |
+
setPlugin('spree');
|
16 |
+
$this->assertTrue( \Conekta\Conekta::$plugin == 'spree');
|
17 |
+
}
|
18 |
+
|
19 |
+
}
|
lib/Conekta/test/Conekta/CustomerTest.php
CHANGED
@@ -1,34 +1,40 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
public function testSuccesfulCustomerCreate()
|
6 |
{
|
7 |
setApiKey();
|
8 |
-
$customer =
|
9 |
-
$this->assertTrue(strpos(get_class($customer), '
|
10 |
}
|
11 |
|
12 |
public function testSuccesfulCustomerFind()
|
13 |
{
|
14 |
setApiKey();
|
15 |
-
$c =
|
16 |
-
$customer =
|
17 |
-
$this->assertTrue(strpos(get_class($customer), '
|
18 |
}
|
19 |
|
20 |
public function testSuccesfulCustomerWhere()
|
21 |
{
|
22 |
setApiKey();
|
23 |
-
$customers =
|
24 |
-
$this->assertTrue(strpos(get_class($customers), '
|
25 |
-
$this->assertTrue(strpos(get_class($customers[0]), '
|
26 |
}
|
27 |
|
28 |
public function testSuccesfulDeleteCustomer()
|
29 |
{
|
30 |
setApiKey();
|
31 |
-
$customer =
|
32 |
$customer->delete();
|
33 |
$this->assertTrue($customer->deleted == true);
|
34 |
}
|
@@ -36,12 +42,12 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
36 |
public function testSuccesfulCustomerUpdate()
|
37 |
{
|
38 |
setApiKey();
|
39 |
-
$customer =
|
40 |
$customer->update(
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
$this->assertTrue(strpos($customer->name, 'Logan') !== false);
|
46 |
}
|
47 |
|
@@ -49,16 +55,16 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
49 |
{
|
50 |
setApiKey();
|
51 |
try {
|
52 |
-
$customer =
|
53 |
} catch (Exception $e) {
|
54 |
$this->assertTrue(strpos($e->getMessage(), 'Object tok_test_visa_4241 could not be found.') !== false);
|
55 |
}
|
56 |
}
|
57 |
|
58 |
-
|
59 |
{
|
60 |
setApiKey();
|
61 |
-
$customer =
|
62 |
$customer->createCard(array('token' => 'tok_test_visa_1881'));
|
63 |
$this->assertTrue(strpos(end($customer->cards)->last4, '1881') !== false);
|
64 |
}
|
@@ -66,7 +72,7 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
66 |
public function testDeleteCard()
|
67 |
{
|
68 |
setApiKey();
|
69 |
-
$customer =
|
70 |
$card = $customer->cards[0]->delete();
|
71 |
$this->assertTrue($card->deleted == true);
|
72 |
}
|
@@ -74,7 +80,7 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
74 |
public function testUpdateCard()
|
75 |
{
|
76 |
setApiKey();
|
77 |
-
$customer =
|
78 |
$customer->cards[0]->update(array('token' => 'tok_test_mastercard_4444', 'active' => false));
|
79 |
$this->assertTrue(strpos($customer->cards[0]->last4, '4444') !== false);
|
80 |
}
|
@@ -82,30 +88,30 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
82 |
public function testSuccesfulSubscriptionCreate()
|
83 |
{
|
84 |
setApiKey();
|
85 |
-
$customer =
|
86 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
87 |
-
$this->assertTrue(strpos(get_class($subscription), '
|
88 |
}
|
89 |
|
90 |
public function testSuccesfulSubscriptionUpdate()
|
91 |
{
|
92 |
setApiKey();
|
93 |
-
|
|
|
94 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
95 |
try {
|
96 |
-
$plan =
|
97 |
} catch (Exception $e) {
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
)
|
109 |
);
|
110 |
}
|
111 |
$subscription->update(array('plan' => $plan->id));
|
@@ -115,7 +121,7 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
115 |
public function testUnsuccesfulSubscriptionCreate()
|
116 |
{
|
117 |
setApiKey();
|
118 |
-
$customer =
|
119 |
try {
|
120 |
$subscription = $customer->createSubscription(array(
|
121 |
'plan' => 'unexistent-plan', ));
|
@@ -127,9 +133,9 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
127 |
public function testSuccesfulSubscriptionPause()
|
128 |
{
|
129 |
setApiKey();
|
130 |
-
$customer =
|
131 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
132 |
-
$this->assertTrue(strpos(get_class($subscription), '
|
133 |
$subscription->pause();
|
134 |
$this->assertTrue(strpos($subscription->status, 'paused') !== false);
|
135 |
}
|
@@ -137,9 +143,9 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
137 |
public function testSuccesfulSubscriptionResume()
|
138 |
{
|
139 |
setApiKey();
|
140 |
-
$customer =
|
141 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
142 |
-
$this->assertTrue(strpos(get_class($subscription), '
|
143 |
$subscription->pause();
|
144 |
$subscription->resume();
|
145 |
$this->assertTrue(strpos($subscription->status, 'in_trial') !== false);
|
@@ -148,10 +154,65 @@ class Conekta_CustomerTest extends UnitTestCase
|
|
148 |
public function testSuccesfulSubscriptionCancel()
|
149 |
{
|
150 |
setApiKey();
|
151 |
-
$customer =
|
152 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
153 |
-
$this->assertTrue(strpos(get_class($subscription), '
|
154 |
$subscription->cancel();
|
155 |
$this->assertTrue(strpos($subscription->status, 'canceled') !== false);
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class CustomerTest extends UnitTestCase
|
4 |
{
|
5 |
+
public static $valid_customer =
|
6 |
+
array('email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine',
|
8 |
+
'cards' => array('tok_test_visa_4242')
|
9 |
+
);
|
10 |
+
|
11 |
public function testSuccesfulCustomerCreate()
|
12 |
{
|
13 |
setApiKey();
|
14 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
15 |
+
$this->assertTrue(strpos(get_class($customer), 'Customer') !== false);
|
16 |
}
|
17 |
|
18 |
public function testSuccesfulCustomerFind()
|
19 |
{
|
20 |
setApiKey();
|
21 |
+
$c = \Conekta\Customer::create(self::$valid_customer);
|
22 |
+
$customer = \Conekta\Customer::find($c->id);
|
23 |
+
$this->assertTrue(strpos(get_class($customer), 'Customer') !== false);
|
24 |
}
|
25 |
|
26 |
public function testSuccesfulCustomerWhere()
|
27 |
{
|
28 |
setApiKey();
|
29 |
+
$customers = \Conekta\Customer::where();
|
30 |
+
$this->assertTrue(strpos(get_class($customers), 'Object') !== false);
|
31 |
+
$this->assertTrue(strpos(get_class($customers[0]), 'Customer') !== false);
|
32 |
}
|
33 |
|
34 |
public function testSuccesfulDeleteCustomer()
|
35 |
{
|
36 |
setApiKey();
|
37 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
38 |
$customer->delete();
|
39 |
$this->assertTrue($customer->deleted == true);
|
40 |
}
|
42 |
public function testSuccesfulCustomerUpdate()
|
43 |
{
|
44 |
setApiKey();
|
45 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
46 |
$customer->update(
|
47 |
+
array(
|
48 |
+
'name' => 'Logan',
|
49 |
+
'email' => 'logan@x-men.org',
|
50 |
+
));
|
51 |
$this->assertTrue(strpos($customer->name, 'Logan') !== false);
|
52 |
}
|
53 |
|
55 |
{
|
56 |
setApiKey();
|
57 |
try {
|
58 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
59 |
} catch (Exception $e) {
|
60 |
$this->assertTrue(strpos($e->getMessage(), 'Object tok_test_visa_4241 could not be found.') !== false);
|
61 |
}
|
62 |
}
|
63 |
|
64 |
+
public function testAddCardToCustomer()
|
65 |
{
|
66 |
setApiKey();
|
67 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
68 |
$customer->createCard(array('token' => 'tok_test_visa_1881'));
|
69 |
$this->assertTrue(strpos(end($customer->cards)->last4, '1881') !== false);
|
70 |
}
|
72 |
public function testDeleteCard()
|
73 |
{
|
74 |
setApiKey();
|
75 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
76 |
$card = $customer->cards[0]->delete();
|
77 |
$this->assertTrue($card->deleted == true);
|
78 |
}
|
80 |
public function testUpdateCard()
|
81 |
{
|
82 |
setApiKey();
|
83 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
84 |
$customer->cards[0]->update(array('token' => 'tok_test_mastercard_4444', 'active' => false));
|
85 |
$this->assertTrue(strpos($customer->cards[0]->last4, '4444') !== false);
|
86 |
}
|
88 |
public function testSuccesfulSubscriptionCreate()
|
89 |
{
|
90 |
setApiKey();
|
91 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
92 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
93 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
94 |
}
|
95 |
|
96 |
public function testSuccesfulSubscriptionUpdate()
|
97 |
{
|
98 |
setApiKey();
|
99 |
+
setApiVersion('1.0.0');
|
100 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
101 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
102 |
try {
|
103 |
+
$plan = \Conekta\Plan::find('gold-plan2');
|
104 |
} catch (Exception $e) {
|
105 |
+
$plan = \Conekta\Plan::create(array(
|
106 |
+
'id' => 'gold-plan2',
|
107 |
+
'name' => 'Gold Plan',
|
108 |
+
'amount' => 10000,
|
109 |
+
'currency' => 'MXN',
|
110 |
+
'interval' => 'month',
|
111 |
+
'frequency' => 1,
|
112 |
+
'trial_period_days' => 15,
|
113 |
+
'expiry_count' => 12,
|
114 |
+
)
|
|
|
115 |
);
|
116 |
}
|
117 |
$subscription->update(array('plan' => $plan->id));
|
121 |
public function testUnsuccesfulSubscriptionCreate()
|
122 |
{
|
123 |
setApiKey();
|
124 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
125 |
try {
|
126 |
$subscription = $customer->createSubscription(array(
|
127 |
'plan' => 'unexistent-plan', ));
|
133 |
public function testSuccesfulSubscriptionPause()
|
134 |
{
|
135 |
setApiKey();
|
136 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
137 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
138 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
139 |
$subscription->pause();
|
140 |
$this->assertTrue(strpos($subscription->status, 'paused') !== false);
|
141 |
}
|
143 |
public function testSuccesfulSubscriptionResume()
|
144 |
{
|
145 |
setApiKey();
|
146 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
147 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
148 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
149 |
$subscription->pause();
|
150 |
$subscription->resume();
|
151 |
$this->assertTrue(strpos($subscription->status, 'in_trial') !== false);
|
154 |
public function testSuccesfulSubscriptionCancel()
|
155 |
{
|
156 |
setApiKey();
|
157 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
158 |
$subscription = $customer->createSubscription(array('plan' => 'gold-plan'));
|
159 |
+
$this->assertTrue(strpos(get_class($subscription), 'Subscription') !== false);
|
160 |
$subscription->cancel();
|
161 |
$this->assertTrue(strpos($subscription->status, 'canceled') !== false);
|
162 |
}
|
163 |
+
|
164 |
+
public function testSuccesfulSourceCreate()
|
165 |
+
{
|
166 |
+
setApiKey();
|
167 |
+
setApiVersion('1.1.0');
|
168 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
169 |
+
$source = $customer->createSource(array(
|
170 |
+
'token_id' => 'tok_test_visa_4242',
|
171 |
+
'type' => 'card'
|
172 |
+
));
|
173 |
+
|
174 |
+
$this->assertTrue(strpos(get_class($source), 'Source') !== false);
|
175 |
+
}
|
176 |
+
|
177 |
+
public function testSuccesfulShippingContactCreate()
|
178 |
+
{
|
179 |
+
setApiKey();
|
180 |
+
setApiVersion('1.1.0');
|
181 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
182 |
+
$shippingContact = $customer->createShippingContact(array(
|
183 |
+
'email' => 'test@conekta.io',
|
184 |
+
'address' => array(
|
185 |
+
'street1' => 'Wallaaby',
|
186 |
+
'city' => 'Sydney',
|
187 |
+
'state' => 'P. Sherman',
|
188 |
+
'country' => 'MX',
|
189 |
+
'zip' => '78215'
|
190 |
+
)
|
191 |
+
));
|
192 |
+
$this->assertTrue(strpos(get_class($shippingContact), 'ShippingContact') !== false);
|
193 |
+
}
|
194 |
+
|
195 |
+
public function testSuccesfulFiscalEntityCreate()
|
196 |
+
{
|
197 |
+
setApiKey();
|
198 |
+
setApiVersion('1.1.0');
|
199 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
200 |
+
$fiscalEntity = $customer->createFiscalEntity(array(
|
201 |
+
'tax_id' => 'AMGH851205MN1',
|
202 |
+
'company_name' => 'Test SA de CV',
|
203 |
+
'email' => 'test@conekta.io',
|
204 |
+
'phone' => '+5213353319758',
|
205 |
+
'address' => array(
|
206 |
+
'street1' => '250 Alexis St',
|
207 |
+
'internal_number' => 19,
|
208 |
+
'external_number' => 10,
|
209 |
+
'city' => 'Red Deer',
|
210 |
+
'state' => 'Alberta',
|
211 |
+
'country' => 'MX',
|
212 |
+
'zip' => '78216'
|
213 |
+
)
|
214 |
+
));
|
215 |
+
|
216 |
+
$this->assertTrue(strpos(get_class($fiscalEntity), 'FiscalEntity') !== false);
|
217 |
+
}
|
218 |
}
|
lib/Conekta/test/Conekta/DiscountLineTest.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class DiscountLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn',
|
20 |
+
'discount_lines' => array(
|
21 |
+
array(
|
22 |
+
'description' => 'Cupon de descuento',
|
23 |
+
'amount' => 10,
|
24 |
+
'kind' => 'loyalty'
|
25 |
+
),
|
26 |
+
array(
|
27 |
+
'description' => 'Cupon de descuento',
|
28 |
+
'amount' => 5,
|
29 |
+
'kind' => 'loyalty'
|
30 |
+
)
|
31 |
+
)
|
32 |
+
);
|
33 |
+
|
34 |
+
public function testSuccessfulDiscountLineDelete()
|
35 |
+
{
|
36 |
+
setApiKey();
|
37 |
+
setApiVersion('1.1.0');
|
38 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
39 |
+
$discount_line = $order->discount_lines[0];
|
40 |
+
$discount_line->delete();
|
41 |
+
|
42 |
+
$this->assertTrue($discount_line->deleted == true);
|
43 |
+
}
|
44 |
+
|
45 |
+
public function testSuccessfulDiscountLineUpdate()
|
46 |
+
{
|
47 |
+
setApiKey();
|
48 |
+
setApiVersion('1.1.0');
|
49 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
50 |
+
$discount_line = $order->discount_lines[0];
|
51 |
+
$discount_line->update(array('amount' => 11));
|
52 |
+
|
53 |
+
$this->assertTrue($discount_line->amount == 11);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function testUnsuccessfulDiscountLineUpdate()
|
57 |
+
{
|
58 |
+
setApiKey();
|
59 |
+
setApiVersion('1.1.0');
|
60 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
61 |
+
$discount_line = $order->discount_lines[0];
|
62 |
+
try{
|
63 |
+
$discount_line->update(array('amount' => -1));
|
64 |
+
} catch(Exception $e) {
|
65 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
lib/Conekta/test/Conekta/ErrorListTest.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ErrorListTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
|
6 |
+
public static $invalid_customer =
|
7 |
+
array('email' => 'hola@hola.com',
|
8 |
+
'cards' => array('tok_test_visa_4241')
|
9 |
+
);
|
10 |
+
|
11 |
+
public function testNoIdError()
|
12 |
+
{
|
13 |
+
setApiKey();
|
14 |
+
setApiVersion('1.1.0');
|
15 |
+
try {
|
16 |
+
$customer = \Conekta\Customer::find('0');
|
17 |
+
} catch (Exception $e) {
|
18 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
public function testNoConnectionError()
|
23 |
+
{
|
24 |
+
setApiKey();
|
25 |
+
setApiVersion('1.1.0');
|
26 |
+
$apiUrl = \Conekta\Conekta::$apiBase;
|
27 |
+
\Conekta\Conekta::$apiBase = 'http://localhost:3001';
|
28 |
+
try {
|
29 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4241')));
|
30 |
+
} catch (Exception $e) {
|
31 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
32 |
+
}
|
33 |
+
\Conekta\Conekta::$apiBase = $apiUrl;
|
34 |
+
}
|
35 |
+
|
36 |
+
public function testApiError(){
|
37 |
+
setApiKey();
|
38 |
+
setApiVersion('1.1.0');
|
39 |
+
try {
|
40 |
+
$customer = \Conekta\Customer::create(self::$invalid_customer);
|
41 |
+
} catch (Exception $e) {
|
42 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
public function testResourceNotFoundError()
|
47 |
+
{
|
48 |
+
setApiKey();
|
49 |
+
setApiVersion('1.1.0');
|
50 |
+
try {
|
51 |
+
$customer = \Conekta\Customer::find('1');
|
52 |
+
} catch (Exception $e) {
|
53 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
lib/Conekta/test/Conekta/ErrorTest.php
CHANGED
@@ -1,36 +1,40 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function testNoIdError()
|
6 |
{
|
7 |
setApiKey();
|
8 |
try {
|
9 |
-
$charge =
|
10 |
} catch (Exception $e) {
|
11 |
-
$this->assertTrue(strpos($e->getMessage(), 'Could not get the id of
|
12 |
}
|
13 |
}
|
14 |
|
15 |
public function testNoConnectionError()
|
16 |
{
|
17 |
-
$apiUrl = Conekta::$apiBase;
|
18 |
-
Conekta::$apiBase = 'http://localhost:3001';
|
19 |
try {
|
20 |
-
$customer =
|
21 |
} catch (Exception $e) {
|
22 |
-
$this->assertTrue(strpos(get_class($e), '
|
23 |
}
|
24 |
-
Conekta::$apiBase = $apiUrl;
|
25 |
}
|
26 |
|
27 |
public function testApiError()
|
28 |
{
|
29 |
setApiKey();
|
30 |
try {
|
31 |
-
$customer =
|
|
|
|
|
|
|
|
|
32 |
} catch (Exception $e) {
|
33 |
-
$this->assertTrue(strpos(get_class($e), '
|
34 |
}
|
35 |
}
|
36 |
|
@@ -38,9 +42,9 @@ class Conekta_ErrorTest extends UnitTestCase
|
|
38 |
{
|
39 |
unsetApiKey();
|
40 |
try {
|
41 |
-
$customer =
|
42 |
} catch (Exception $e) {
|
43 |
-
$this->assertTrue(strpos(get_class($e), '
|
44 |
}
|
45 |
setApiKey();
|
46 |
}
|
@@ -49,15 +53,15 @@ class Conekta_ErrorTest extends UnitTestCase
|
|
49 |
{
|
50 |
setApiKey();
|
51 |
try {
|
52 |
-
$plan =
|
53 |
} catch (Exception $e) {
|
54 |
-
$this->assertTrue(strpos(get_class($e), '
|
55 |
}
|
56 |
}
|
57 |
|
58 |
public function testProcessingError()
|
59 |
{
|
60 |
-
$charges =
|
61 |
foreach ($charges as $charge) {
|
62 |
if (strpos($charge->status, 'pre_authorized') !== false) {
|
63 |
$ok = true;
|
@@ -69,7 +73,7 @@ class Conekta_ErrorTest extends UnitTestCase
|
|
69 |
$charge->capture();
|
70 |
}
|
71 |
} catch (Exception $e) {
|
72 |
-
$this->assertTrue(strpos(get_class($e), '
|
73 |
}
|
74 |
}
|
75 |
|
@@ -77,9 +81,9 @@ class Conekta_ErrorTest extends UnitTestCase
|
|
77 |
{
|
78 |
setApiKey();
|
79 |
try {
|
80 |
-
$charge =
|
81 |
} catch (Exception $e) {
|
82 |
-
$this->assertTrue(strpos(get_class($e), '
|
83 |
}
|
84 |
}
|
85 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class ErrorTest extends UnitTestCase
|
4 |
{
|
5 |
public function testNoIdError()
|
6 |
{
|
7 |
setApiKey();
|
8 |
try {
|
9 |
+
$charge = \Conekta\Charge::find('0');
|
10 |
} catch (Exception $e) {
|
11 |
+
$this->assertTrue(strpos($e->getMessage(), 'Could not get the id of Resource instance.') !== false);
|
12 |
}
|
13 |
}
|
14 |
|
15 |
public function testNoConnectionError()
|
16 |
{
|
17 |
+
$apiUrl = \Conekta\Conekta::$apiBase;
|
18 |
+
\Conekta\Conekta::$apiBase = 'http://localhost:3001';
|
19 |
try {
|
20 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4242')));
|
21 |
} catch (Exception $e) {
|
22 |
+
$this->assertTrue(strpos(get_class($e), 'NoConnectionError') !== false);
|
23 |
}
|
24 |
+
\Conekta\Conekta::$apiBase = $apiUrl;
|
25 |
}
|
26 |
|
27 |
public function testApiError()
|
28 |
{
|
29 |
setApiKey();
|
30 |
try {
|
31 |
+
$customer = \Conekta\Customer::create(array(
|
32 |
+
'cards' => array('tok_test_visa_4243'),
|
33 |
+
'name' => 'Test Name',
|
34 |
+
'email' => 'test@conekta.io'
|
35 |
+
));
|
36 |
} catch (Exception $e) {
|
37 |
+
$this->assertTrue(strpos(get_class($e), 'ParameterValidationError') !== false);
|
38 |
}
|
39 |
}
|
40 |
|
42 |
{
|
43 |
unsetApiKey();
|
44 |
try {
|
45 |
+
$customer = \Conekta\Customer::create(array('cards' => array('tok_test_visa_4242')));
|
46 |
} catch (Exception $e) {
|
47 |
+
$this->assertTrue(strpos(get_class($e), 'AuthenticationError') !== false);
|
48 |
}
|
49 |
setApiKey();
|
50 |
}
|
53 |
{
|
54 |
setApiKey();
|
55 |
try {
|
56 |
+
$plan = \Conekta\Plan::create(array('id' => 'gold-plan'));
|
57 |
} catch (Exception $e) {
|
58 |
+
$this->assertTrue(strpos(get_class($e), 'ParameterValidationError') !== false);
|
59 |
}
|
60 |
}
|
61 |
|
62 |
public function testProcessingError()
|
63 |
{
|
64 |
+
$charges = \Conekta\Charge::where();
|
65 |
foreach ($charges as $charge) {
|
66 |
if (strpos($charge->status, 'pre_authorized') !== false) {
|
67 |
$ok = true;
|
73 |
$charge->capture();
|
74 |
}
|
75 |
} catch (Exception $e) {
|
76 |
+
$this->assertTrue(strpos(get_class($e), 'ProcessingError') !== false);
|
77 |
}
|
78 |
}
|
79 |
|
81 |
{
|
82 |
setApiKey();
|
83 |
try {
|
84 |
+
$charge = \Conekta\Charge::find('1');
|
85 |
} catch (Exception $e) {
|
86 |
+
$this->assertTrue(strpos(get_class($e), 'ResourceNotFoundError') !== false);
|
87 |
}
|
88 |
}
|
89 |
}
|
lib/Conekta/test/Conekta/EventTest.php
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function testSuccesfulWhere()
|
6 |
{
|
7 |
setApiKey();
|
8 |
-
|
9 |
-
$
|
10 |
-
$this->assertTrue(strpos(get_class($events
|
|
|
11 |
}
|
12 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class EventTest extends UnitTestCase
|
4 |
{
|
5 |
public function testSuccesfulWhere()
|
6 |
{
|
7 |
setApiKey();
|
8 |
+
setApiVersion('1.0.0');
|
9 |
+
$events = \Conekta\Event::where();
|
10 |
+
$this->assertTrue(strpos(get_class($events), 'Object') !== false);
|
11 |
+
$this->assertTrue(strpos(get_class($events[0]), 'Event') !== false);
|
12 |
}
|
13 |
}
|
lib/Conekta/test/Conekta/FiscalEntityTest.php
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FiscalEntityTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer = array(
|
6 |
+
'cards' => array('tok_test_visa_4242'),
|
7 |
+
'name' => 'Test Name',
|
8 |
+
'email' => 'test@conekta.io',
|
9 |
+
'fiscal_entities' => array(array(
|
10 |
+
'tax_id' => 'AMGH851205MN1',
|
11 |
+
'company_name' => 'Test SA de CV',
|
12 |
+
'email' => 'test@conekta.io',
|
13 |
+
'phone' => '+5213353319758',
|
14 |
+
'address' => array(
|
15 |
+
'street1' => '250 Alexis St',
|
16 |
+
'internal_number' => 19,
|
17 |
+
'external_number' => 10,
|
18 |
+
'city' => 'Red Deer',
|
19 |
+
'state' => 'Alberta',
|
20 |
+
'country' => 'MX',
|
21 |
+
'zip' => '78216'
|
22 |
+
)
|
23 |
+
))
|
24 |
+
);
|
25 |
+
|
26 |
+
public function testSuccessfulFiscalEntityDelete()
|
27 |
+
{
|
28 |
+
setApiKey();
|
29 |
+
setApiVersion("1.1.0");
|
30 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
31 |
+
|
32 |
+
$fiscal_entity = $customer->fiscal_entities[0]->delete();
|
33 |
+
|
34 |
+
$this->assertTrue($fiscal_entity->deleted);
|
35 |
+
}
|
36 |
+
|
37 |
+
public function testSuccessfulFiscalEntityUpdate()
|
38 |
+
{
|
39 |
+
setApiKey();
|
40 |
+
setApiVersion("1.1.0");
|
41 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
42 |
+
|
43 |
+
$customer->fiscal_entities[0]->update(array(
|
44 |
+
'company_name' => 'Company name'
|
45 |
+
));
|
46 |
+
|
47 |
+
$this->assertTrue($customer->fiscal_entities[0]->company_name == 'Company name');
|
48 |
+
}
|
49 |
+
|
50 |
+
public function testUnsuccessfulFiscalEntityUpdate()
|
51 |
+
{
|
52 |
+
setApiKey();
|
53 |
+
setApiVersion("1.1.0");
|
54 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
55 |
+
|
56 |
+
try {
|
57 |
+
$customer->fiscal_entities[0]->update(array(
|
58 |
+
'company_name' => 'Company name'
|
59 |
+
));
|
60 |
+
} catch (Exception $e) {
|
61 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
lib/Conekta/test/Conekta/LangTest.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use \Conekta\Lang;
|
4 |
+
|
5 |
+
class LangTest extends UnitTestCase
|
6 |
+
{
|
7 |
+
public function testShouldTranslatesMessage()
|
8 |
+
{
|
9 |
+
$this->assertEqual(
|
10 |
+
'There was an error. Please contact system administrator.',
|
11 |
+
Lang::translate('error.resource.id_purchaser', Lang::EN)
|
12 |
+
);
|
13 |
+
|
14 |
+
$this->assertEqual(
|
15 |
+
'Hubo un error. Favor de contactar al administrador del sistema.',
|
16 |
+
Lang::translate('error.resource.id_purchaser', Lang::ES)
|
17 |
+
);
|
18 |
+
}
|
19 |
+
}
|
lib/Conekta/test/Conekta/LineItemTest.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class LineItemTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'type' => 'physical',
|
14 |
+
'tags' => array('food', 'mexican food')
|
15 |
+
),
|
16 |
+
array(
|
17 |
+
'name'=> 'Box of Cohiba S1s',
|
18 |
+
'description'=> 'Imported From Mex.',
|
19 |
+
'unit_price'=> 3500,
|
20 |
+
'quantity'=> 1,
|
21 |
+
'type' => 'physical',
|
22 |
+
'tags' => array('food')
|
23 |
+
)
|
24 |
+
),
|
25 |
+
'currency' => 'mxn'
|
26 |
+
);
|
27 |
+
|
28 |
+
public function testSuccessfulLineItemDelete()
|
29 |
+
{
|
30 |
+
setApiKey();
|
31 |
+
setApiVersion('1.1.0');
|
32 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
33 |
+
$line_item = $order->line_items[0];
|
34 |
+
$line_item->delete();
|
35 |
+
|
36 |
+
$this->assertTrue($line_item->deleted == true);
|
37 |
+
}
|
38 |
+
|
39 |
+
public function testSuccessfulLineItemUpdate()
|
40 |
+
{
|
41 |
+
setApiKey();
|
42 |
+
setApiVersion('1.1.0');
|
43 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
44 |
+
$line_item = $order->line_items[0];
|
45 |
+
$line_item->update(array('unit_price' => 1000));
|
46 |
+
|
47 |
+
$this->assertTrue($line_item->unit_price == 1000);
|
48 |
+
}
|
49 |
+
|
50 |
+
public function testUnsuccessfulLineItemUpdate()
|
51 |
+
{
|
52 |
+
setApiKey();
|
53 |
+
setApiVersion('1.1.0');
|
54 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
55 |
+
$line_item = $order->line_items[0];
|
56 |
+
try {
|
57 |
+
$line_item->update(array('unit_price' => -1));
|
58 |
+
|
59 |
+
} catch(Exception $e) {
|
60 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
lib/Conekta/test/Conekta/LogTest.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class LogTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public function testSuccesfulFind()
|
6 |
+
{
|
7 |
+
setApiKey();
|
8 |
+
$logs = \Conekta\Log::where();
|
9 |
+
$log = \Conekta\Log::find($logs[0]['id']);
|
10 |
+
$this->assertTrue(strpos(get_class($log), 'Log') !== false);
|
11 |
+
}
|
12 |
+
|
13 |
+
public function testSuccesfulWhere()
|
14 |
+
{
|
15 |
+
setApiKey();
|
16 |
+
$logs = \Conekta\Log::where();
|
17 |
+
$this->assertTrue(strpos(get_class($logs), 'Conekta\Object') !== false);
|
18 |
+
$this->assertTrue(strpos(get_class($logs[0]), 'Conekta\Object') !== false);
|
19 |
+
}
|
20 |
+
}
|
lib/Conekta/test/Conekta/OrderTest.php
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class OrderTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn'
|
20 |
+
);
|
21 |
+
|
22 |
+
public function testSuccesfulCreateOrder()
|
23 |
+
{
|
24 |
+
setApiKey();
|
25 |
+
setApiVersion("1.1.0");
|
26 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
27 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function testSuccesfulCreateOrderWithCharges()
|
31 |
+
{
|
32 |
+
$charges =
|
33 |
+
array(
|
34 |
+
'charges' => array(
|
35 |
+
array(
|
36 |
+
'source' => array(
|
37 |
+
'type' => 'oxxo_cash',
|
38 |
+
'expires_at' => strtotime(date("Y-m-d H:i:s")) + "36000"
|
39 |
+
),
|
40 |
+
'amount' => 20000
|
41 |
+
)
|
42 |
+
),
|
43 |
+
'currency' => 'mxn',
|
44 |
+
'customer_info' => array(
|
45 |
+
'name' => 'John Constantine',
|
46 |
+
'phone' => '+5213353319758',
|
47 |
+
'email' => 'hola@hola.com'
|
48 |
+
)
|
49 |
+
);
|
50 |
+
setApiKey();
|
51 |
+
setApiVersion('1.1.0');
|
52 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $charges));
|
53 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function testSuccesfulCharge()
|
57 |
+
{
|
58 |
+
$other_params =
|
59 |
+
array(
|
60 |
+
'currency' => 'mxn',
|
61 |
+
'customer_info' => array(
|
62 |
+
'name' => 'John Constantine',
|
63 |
+
'phone' => '+5213353319758',
|
64 |
+
'email' => 'hola@hola.com'
|
65 |
+
)
|
66 |
+
);
|
67 |
+
setApiKey();
|
68 |
+
setApiVersion('1.1.0');
|
69 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order, $other_params));
|
70 |
+
$charge_params = array(
|
71 |
+
'source' => array('type' => 'oxxo_cash'),
|
72 |
+
'amount' => 20000
|
73 |
+
);
|
74 |
+
$charge = $order->createCharge($charge_params);
|
75 |
+
|
76 |
+
$this->assertTrue(strpos(get_class($charge), 'Charge') !== false);
|
77 |
+
}
|
78 |
+
|
79 |
+
#Update an order
|
80 |
+
public function testSuccesfulOrderUpdate()
|
81 |
+
{
|
82 |
+
setApiKey();
|
83 |
+
setApiVersion('1.1.0');
|
84 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
85 |
+
|
86 |
+
$updated_parameters = array(
|
87 |
+
'line_items'=> array(
|
88 |
+
array(
|
89 |
+
'name'=> 'Box of chocolates',
|
90 |
+
'description'=> 'Imported From Uruguay.',
|
91 |
+
'unit_price'=> 30000,
|
92 |
+
'quantity'=> 2,
|
93 |
+
'sku'=> 'choc_s3',
|
94 |
+
'category'=> 'expendables',
|
95 |
+
'type' => 'physical',
|
96 |
+
'tags' => array('Chocolate', 'Sudamerican chocolates')
|
97 |
+
)
|
98 |
+
),
|
99 |
+
'currency' => 'USD'
|
100 |
+
);
|
101 |
+
|
102 |
+
$order->update($updated_parameters);
|
103 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
104 |
+
}
|
105 |
+
|
106 |
+
public function testUnsuccessfulOrderUpdate()
|
107 |
+
{
|
108 |
+
$charges = array(
|
109 |
+
array(
|
110 |
+
'source' => array(
|
111 |
+
'type' => 'oxxo_cash'
|
112 |
+
),
|
113 |
+
'amount' => 10
|
114 |
+
)
|
115 |
+
);
|
116 |
+
|
117 |
+
setApiKey();
|
118 |
+
setApiVersion('1.1.0');
|
119 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
120 |
+
try {
|
121 |
+
$order->update(array('charges' => $charges));
|
122 |
+
} catch(Exception $e) {
|
123 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
public function testSuccesfulOrderFind()
|
128 |
+
{
|
129 |
+
setApiKey();
|
130 |
+
setApiVersion('1.1.0');
|
131 |
+
$id = \Conekta\Order::create(array_merge(self::$valid_order))->id;
|
132 |
+
$order = \Conekta\Order::find($id);
|
133 |
+
$this->assertTrue(strpos(get_class($order), 'Order') !== false);
|
134 |
+
}
|
135 |
+
|
136 |
+
public function testSuccesfulOrderWhere()
|
137 |
+
{
|
138 |
+
setApiKey();
|
139 |
+
setApiVersion("1.1.0");
|
140 |
+
$orders = \Conekta\Order::where();
|
141 |
+
|
142 |
+
$this->assertTrue(strpos(get_class($orders), 'ConektaList') !== false);
|
143 |
+
$this->assertTrue(strpos($orders->elements_type, 'Order') !== false);
|
144 |
+
$this->assertTrue(strpos(get_class($orders[0]), 'Order') !== false);
|
145 |
+
}
|
146 |
+
|
147 |
+
public function testSuccessfulLineItem()
|
148 |
+
{
|
149 |
+
setApiKey();
|
150 |
+
setApiVersion('1.1.0');
|
151 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
152 |
+
|
153 |
+
$lineItem = $order->createLineItem(array(
|
154 |
+
'name'=> 'Box of Cohiba S1s',
|
155 |
+
'description'=> 'Imported From Mex.',
|
156 |
+
'unit_price'=> 20000,
|
157 |
+
'quantity'=> 1,
|
158 |
+
'type' => 'physical',
|
159 |
+
'tags' => array('food', 'mexican food')
|
160 |
+
));
|
161 |
+
|
162 |
+
$this->assertTrue(strpos(get_class($lineItem), 'LineItem') !== false);
|
163 |
+
}
|
164 |
+
|
165 |
+
public function testSuccessfulTaxLine()
|
166 |
+
{
|
167 |
+
setApiKey();
|
168 |
+
setApiVersion('1.1.0');
|
169 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
170 |
+
|
171 |
+
$taxLine = $order->createTaxLine(array(
|
172 |
+
'description' => 'IVA',
|
173 |
+
'amount' => 60
|
174 |
+
));
|
175 |
+
|
176 |
+
$this->assertTrue(strpos(get_class($taxLine), 'TaxLine') !== false);
|
177 |
+
}
|
178 |
+
|
179 |
+
public function testSuccessfulShippingLine()
|
180 |
+
{
|
181 |
+
setApiKey();
|
182 |
+
setApiVersion('1.1.0');
|
183 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
184 |
+
|
185 |
+
$shippingLine = $order->createShippingLine(array(
|
186 |
+
'description' => 'Free Shipping',
|
187 |
+
'amount' => 0,
|
188 |
+
'tracking_number' => 'TRACK123',
|
189 |
+
'carrier' => 'USPS',
|
190 |
+
'method' => 'Train'
|
191 |
+
));
|
192 |
+
|
193 |
+
$this->assertTrue(strpos(get_class($shippingLine), 'ShippingLine') !== false);
|
194 |
+
}
|
195 |
+
|
196 |
+
public function testSuccessfulDiscountLine()
|
197 |
+
{
|
198 |
+
setApiKey();
|
199 |
+
setApiVersion('1.1.0');
|
200 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
201 |
+
|
202 |
+
$discountLine = $order->createDiscountLine(array(
|
203 |
+
'description' => 'Cupon de descuento',
|
204 |
+
'amount' => 10,
|
205 |
+
'kind' => 'loyalty'
|
206 |
+
));
|
207 |
+
|
208 |
+
$this->assertTrue(strpos(get_class($discountLine), 'DiscountLine') !== false);
|
209 |
+
}
|
210 |
+
|
211 |
+
public function testSuccessfulFiscalEntity()
|
212 |
+
{
|
213 |
+
setApiKey();
|
214 |
+
setApiVersion('1.1.0');
|
215 |
+
$order = \Conekta\Order::create(array_merge(self::$valid_order));
|
216 |
+
|
217 |
+
$fiscalEntity = $order->createFiscalEntity(array(
|
218 |
+
'tax_id' => 'AMGH851205MN1',
|
219 |
+
'company_name' => 'Test SA de CV',
|
220 |
+
'email' => 'test@conekta.io',
|
221 |
+
'phone' => '+5213353319758',
|
222 |
+
'address' => array(
|
223 |
+
'street1' => '250 Alexis St',
|
224 |
+
'internal_number' => 19,
|
225 |
+
'external_number' => 10,
|
226 |
+
'city' => 'Red Deer',
|
227 |
+
'state' => 'Alberta',
|
228 |
+
'country' => 'MX',
|
229 |
+
'zip' => '78216')
|
230 |
+
));
|
231 |
+
|
232 |
+
$this->assertTrue(strpos(get_class($fiscalEntity), 'FiscalEntity') !== false);
|
233 |
+
}
|
234 |
+
}
|
lib/Conekta/test/Conekta/PayoutTest.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function testSuccesfulGetPayout()
|
6 |
{
|
7 |
setApiKey();
|
8 |
-
$payee =
|
9 |
'name' => 'John Doe',
|
10 |
'email' => 'j_d@radcorp->com',
|
11 |
'phone' => '555555555',
|
@@ -28,7 +28,7 @@ class Conekta_PayoutTest extends UnitTestCase
|
|
28 |
'zip' => '06100',
|
29 |
),
|
30 |
));
|
31 |
-
$this->assertTrue(strpos(get_class($payee), '
|
32 |
$this->assertTrue(strpos('555555555', $payee->phone) !== false);
|
33 |
$this->assertTrue(strpos('032180000118359719', $payee->payout_methods[0]->account_number) !== false);
|
34 |
$this->assertTrue(strpos('J D - Radcorp', $payee->payout_methods[0]->account_holder) !== false);
|
@@ -42,12 +42,12 @@ class Conekta_PayoutTest extends UnitTestCase
|
|
42 |
$this->assertTrue(strpos('tax121212abc', $payee->billing_address->tax_id) !== false);
|
43 |
$this->assertTrue(strpos('06100', $payee->billing_address->zip) !== false);
|
44 |
|
45 |
-
$payout =
|
46 |
'amount' => 5000,
|
47 |
'currency' => 'MXN',
|
48 |
'payee' => $payee->id,
|
49 |
));
|
50 |
-
$this->assertTrue(strpos(get_class($payout), '
|
51 |
$this->assertTrue(5000 == $payout->amount);
|
52 |
$this->assertTrue(strpos('MXN', $payout->currency) !== false);
|
53 |
|
1 |
<?php
|
2 |
|
3 |
+
class PayoutTest extends UnitTestCase
|
4 |
{
|
5 |
public function testSuccesfulGetPayout()
|
6 |
{
|
7 |
setApiKey();
|
8 |
+
$payee = \Conekta\Payee::create(array(
|
9 |
'name' => 'John Doe',
|
10 |
'email' => 'j_d@radcorp->com',
|
11 |
'phone' => '555555555',
|
28 |
'zip' => '06100',
|
29 |
),
|
30 |
));
|
31 |
+
$this->assertTrue(strpos(get_class($payee), 'Payee') !== false);
|
32 |
$this->assertTrue(strpos('555555555', $payee->phone) !== false);
|
33 |
$this->assertTrue(strpos('032180000118359719', $payee->payout_methods[0]->account_number) !== false);
|
34 |
$this->assertTrue(strpos('J D - Radcorp', $payee->payout_methods[0]->account_holder) !== false);
|
42 |
$this->assertTrue(strpos('tax121212abc', $payee->billing_address->tax_id) !== false);
|
43 |
$this->assertTrue(strpos('06100', $payee->billing_address->zip) !== false);
|
44 |
|
45 |
+
$payout = \Conekta\Payout::create(array(
|
46 |
'amount' => 5000,
|
47 |
'currency' => 'MXN',
|
48 |
'payee' => $payee->id,
|
49 |
));
|
50 |
+
$this->assertTrue(strpos(get_class($payout), 'Payout') !== false);
|
51 |
$this->assertTrue(5000 == $payout->amount);
|
52 |
$this->assertTrue(strpos('MXN', $payout->currency) !== false);
|
53 |
|
lib/Conekta/test/Conekta/PlanTest.php
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public function testSuccesfulGetPlan()
|
6 |
{
|
7 |
setApiKey();
|
8 |
-
$plans =
|
9 |
$p = $plans[0];
|
10 |
-
$plan =
|
11 |
-
$this->assertTrue(strpos(get_class($plan), '
|
12 |
}
|
13 |
|
14 |
public function testSuccesfulWhere()
|
15 |
{
|
16 |
setApiKey();
|
17 |
-
$plans =
|
18 |
-
$this->assertTrue(strpos(get_class($plans), '
|
19 |
-
$this->assertTrue(strpos(get_class($plans[0]), '
|
20 |
}
|
21 |
|
22 |
public function testSuccesfulPlanCreate()
|
23 |
{
|
24 |
setApiKey();
|
25 |
-
$plans =
|
26 |
-
$plan =
|
27 |
'id' => 'gold-plan'.substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0, 50), 1).substr(md5(time()), 1),
|
28 |
'name' => 'Gold Plan',
|
29 |
'amount' => 10000,
|
@@ -33,13 +33,13 @@ class Conekta_PlanTest extends UnitTestCase
|
|
33 |
'trial_period_days' => 15,
|
34 |
'expiry_count' => 12,
|
35 |
));
|
36 |
-
$this->assertTrue(strpos(get_class($plan), '
|
37 |
}
|
38 |
|
39 |
public function testUpdatePlan()
|
40 |
{
|
41 |
setApiKey();
|
42 |
-
$plans =
|
43 |
$plan = $plans[0];
|
44 |
$plan->update(array('name' => 'Silver Plan'));
|
45 |
$this->assertTrue(strpos($plan->name, 'Silver Plan') !== false);
|
@@ -48,7 +48,7 @@ class Conekta_PlanTest extends UnitTestCase
|
|
48 |
public function testDeletePlan()
|
49 |
{
|
50 |
setApiKey();
|
51 |
-
$plans =
|
52 |
$plan = $plans[0];
|
53 |
$plan->delete();
|
54 |
$this->assertTrue($plan->deleted == true);
|
1 |
<?php
|
2 |
|
3 |
+
class PlanTest extends UnitTestCase
|
4 |
{
|
5 |
public function testSuccesfulGetPlan()
|
6 |
{
|
7 |
setApiKey();
|
8 |
+
$plans = \Conekta\Plan::where();
|
9 |
$p = $plans[0];
|
10 |
+
$plan = \Conekta\Plan::find($p->id);
|
11 |
+
$this->assertTrue(strpos(get_class($plan), 'Plan') !== false);
|
12 |
}
|
13 |
|
14 |
public function testSuccesfulWhere()
|
15 |
{
|
16 |
setApiKey();
|
17 |
+
$plans = \Conekta\Plan::where();
|
18 |
+
$this->assertTrue(strpos(get_class($plans), 'Object') !== false);
|
19 |
+
$this->assertTrue(strpos(get_class($plans[0]), 'Plan') !== false);
|
20 |
}
|
21 |
|
22 |
public function testSuccesfulPlanCreate()
|
23 |
{
|
24 |
setApiKey();
|
25 |
+
$plans = \Conekta\Plan::where();
|
26 |
+
$plan = \Conekta\Plan::create(array(
|
27 |
'id' => 'gold-plan'.substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0, 50), 1).substr(md5(time()), 1),
|
28 |
'name' => 'Gold Plan',
|
29 |
'amount' => 10000,
|
33 |
'trial_period_days' => 15,
|
34 |
'expiry_count' => 12,
|
35 |
));
|
36 |
+
$this->assertTrue(strpos(get_class($plan), 'Plan') !== false);
|
37 |
}
|
38 |
|
39 |
public function testUpdatePlan()
|
40 |
{
|
41 |
setApiKey();
|
42 |
+
$plans = \Conekta\Plan::where();
|
43 |
$plan = $plans[0];
|
44 |
$plan->update(array('name' => 'Silver Plan'));
|
45 |
$this->assertTrue(strpos($plan->name, 'Silver Plan') !== false);
|
48 |
public function testDeletePlan()
|
49 |
{
|
50 |
setApiKey();
|
51 |
+
$plans = \Conekta\Plan::where();
|
52 |
$plan = $plans[0];
|
53 |
$plan->delete();
|
54 |
$this->assertTrue($plan->deleted == true);
|
lib/Conekta/test/Conekta/ShippingContactTest.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ShippingContentTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer =
|
6 |
+
array('email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine',
|
8 |
+
'shipping_contacts' => array(
|
9 |
+
array(
|
10 |
+
'email' => 'thomas.logan@xmen.org',
|
11 |
+
'address' => array(
|
12 |
+
'street1' => '250 Alexis St',
|
13 |
+
'city' => 'Red Deer',
|
14 |
+
'state' => 'Alberta',
|
15 |
+
'country' => 'CA',
|
16 |
+
'zip' => 'T4N 0B8'
|
17 |
+
)
|
18 |
+
),
|
19 |
+
array(
|
20 |
+
'email' => 'rogue@xmen.org',
|
21 |
+
'address' => array(
|
22 |
+
'street1' => '250 Alexis St',
|
23 |
+
'city' => 'Red Deer',
|
24 |
+
'state' => 'Alberta',
|
25 |
+
'country' => 'CA',
|
26 |
+
'zip' => 'T4N 0B8'
|
27 |
+
)
|
28 |
+
)
|
29 |
+
)
|
30 |
+
);
|
31 |
+
|
32 |
+
public function testSuccessfulShippingContactDelete()
|
33 |
+
{
|
34 |
+
setApiKey();
|
35 |
+
setApiVersion('1.1.0');
|
36 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
37 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
38 |
+
$shipping_contact->delete();
|
39 |
+
|
40 |
+
$this->assertTrue($shipping_contact->deleted == true);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function testSuccessfulShippingContactUpdate()
|
44 |
+
{
|
45 |
+
setApiKey();
|
46 |
+
setApiVersion('1.1.0');
|
47 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
48 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
49 |
+
$shipping_contact->update(array('email' => 'hola@hola.com'));
|
50 |
+
|
51 |
+
$this->assertTrue($shipping_contact->email == 'hola@hola.com');
|
52 |
+
}
|
53 |
+
|
54 |
+
public function testUnsuccessfulShippingContactUpdate()
|
55 |
+
{
|
56 |
+
setApiKey();
|
57 |
+
setApiVersion('1.1.0');
|
58 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
59 |
+
$shipping_contact = $customer->shipping_contacts[0];
|
60 |
+
try{
|
61 |
+
$shipping_contact->update(array('email' => 123));
|
62 |
+
}catch (Exception $e) {
|
63 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
lib/Conekta/test/Conekta/ShippingLineTest.php
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class ShippingLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items'=> array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'currency' => 'mxn',
|
20 |
+
'shipping_lines' => array(
|
21 |
+
array(
|
22 |
+
'description' => 'Free Shipping',
|
23 |
+
'amount' => 0,
|
24 |
+
'tracking_number' => 'TRACK123',
|
25 |
+
'carrier' => 'USPS',
|
26 |
+
'method' => 'Train'
|
27 |
+
),
|
28 |
+
array(
|
29 |
+
'description' => 'Free Shipping',
|
30 |
+
'amount' => 40,
|
31 |
+
'tracking_number' => 'TRACK124',
|
32 |
+
'carrier' => 'USPS',
|
33 |
+
'method' => 'Train'
|
34 |
+
)
|
35 |
+
)
|
36 |
+
);
|
37 |
+
|
38 |
+
public function testSuccessfulShippingLineDelete()
|
39 |
+
{
|
40 |
+
setApiKey();
|
41 |
+
setApiVersion('1.1.0');
|
42 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
43 |
+
$shipping_line = $order->shipping_lines[0];
|
44 |
+
$shipping_line->delete();
|
45 |
+
|
46 |
+
$this->assertTrue($shipping_line->deleted == true);
|
47 |
+
}
|
48 |
+
|
49 |
+
public function testSuccessfulShippingLineUpdate()
|
50 |
+
{
|
51 |
+
setApiKey();
|
52 |
+
setApiVersion('1.1.0');
|
53 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
54 |
+
$shipping_line = $order->shipping_lines[0];
|
55 |
+
$shipping_line->update(array('method' => 'Air'));
|
56 |
+
|
57 |
+
$this->assertTrue($shipping_line->method == 'Air');
|
58 |
+
}
|
59 |
+
|
60 |
+
public function testUnsuccessfulShippingLineUpdate()
|
61 |
+
{
|
62 |
+
setApiKey();
|
63 |
+
setApiVersion('1.1.0');
|
64 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
65 |
+
$shipping_line = $order->shipping_lines[0];
|
66 |
+
try{
|
67 |
+
$shipping_line->update(array('amount' => -1));
|
68 |
+
} catch (Exception $e) {
|
69 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
lib/Conekta/test/Conekta/SourceTest.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SourceTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_customer =
|
6 |
+
array('email' => 'hola@hola.com',
|
7 |
+
'name' => 'John Constantine',
|
8 |
+
'sources' => array(array(
|
9 |
+
'token_id' => 'tok_test_visa_4242',
|
10 |
+
'type' => 'card'
|
11 |
+
))
|
12 |
+
);
|
13 |
+
|
14 |
+
public function testSuccesfulDeleteSources()
|
15 |
+
{
|
16 |
+
setApiVersion('1.1.0');
|
17 |
+
setApiKey();
|
18 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
19 |
+
$source = $customer->sources[0];
|
20 |
+
$source->delete();
|
21 |
+
$this->assertTrue($source->deleted == true);
|
22 |
+
}
|
23 |
+
|
24 |
+
public function testSuccesfulUpdateSources()
|
25 |
+
{
|
26 |
+
setApiVersion('1.1.0');
|
27 |
+
setApiKey();
|
28 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
29 |
+
$source = $customer->sources[0];
|
30 |
+
$source->update(array('exp_month' => '11'));
|
31 |
+
$this->assertTrue($source->exp_month == '11');
|
32 |
+
}
|
33 |
+
|
34 |
+
public function testUnsuccesfulUpdateSources(){
|
35 |
+
setApiVersion('1.1.0');
|
36 |
+
setApiKey();
|
37 |
+
$customer = \Conekta\Customer::create(self::$valid_customer);
|
38 |
+
$source = $customer->sources[0];
|
39 |
+
try{
|
40 |
+
$source->update(array('token_id' => 'tok_test_visa_4241'));
|
41 |
+
}catch (Exception $e) {
|
42 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
lib/Conekta/test/Conekta/TaxLineTest.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class TaxLineTest extends UnitTestCase
|
4 |
+
{
|
5 |
+
public static $valid_order =
|
6 |
+
array(
|
7 |
+
'line_items' => array(
|
8 |
+
array(
|
9 |
+
'name'=> 'Box of Cohiba S1s',
|
10 |
+
'description'=> 'Imported From Mex.',
|
11 |
+
'unit_price'=> 20000,
|
12 |
+
'quantity'=> 1,
|
13 |
+
'sku'=> 'cohb_s1',
|
14 |
+
'category'=> 'food',
|
15 |
+
'type' => 'physical',
|
16 |
+
'tags' => array('food', 'mexican food')
|
17 |
+
)
|
18 |
+
),
|
19 |
+
'tax_lines' => array(
|
20 |
+
array(
|
21 |
+
'description' => 'IVA',
|
22 |
+
'amount' => 60
|
23 |
+
),
|
24 |
+
array(
|
25 |
+
'description' => 'ISR',
|
26 |
+
'amount' => 100
|
27 |
+
)
|
28 |
+
),
|
29 |
+
'currency' => 'mxn'
|
30 |
+
);
|
31 |
+
|
32 |
+
public function testSuccessfulTaxLineDelete()
|
33 |
+
{
|
34 |
+
setApiKey();
|
35 |
+
setApiVersion('1.1.0');
|
36 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
37 |
+
$tax_line = $order->tax_lines[0];
|
38 |
+
$tax_line->delete();
|
39 |
+
|
40 |
+
$this->assertTrue($tax_line->deleted == true);
|
41 |
+
}
|
42 |
+
|
43 |
+
public function testSuccessfulTaxLineUpdate()
|
44 |
+
{
|
45 |
+
setApiKey();
|
46 |
+
setApiVersion('1.1.0');
|
47 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
48 |
+
$tax_line = $order->tax_lines[0];
|
49 |
+
$tax_line->update(array('amount' => 10));
|
50 |
+
|
51 |
+
$this->assertTrue($tax_line->amount == 10);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function testUnsuccessfulTaxLineUpdate()
|
55 |
+
{
|
56 |
+
setApiKey();
|
57 |
+
setApiVersion('1.1.0');
|
58 |
+
$order = \Conekta\Order::create(self::$valid_order);
|
59 |
+
$tax_line = $order->tax_lines[0];
|
60 |
+
try {
|
61 |
+
$tax_line->update(array('amount' => -1));
|
62 |
+
} catch (Exception $e) {
|
63 |
+
$this->assertTrue(strpos(get_class($e), 'ErrorList') == true);
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
lib/Conekta/test/Conekta/WebhookTest.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
{
|
5 |
public static $events = array("events" =>
|
6 |
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
@@ -16,16 +16,16 @@ class Conekta_WebhookTest extends UnitTestCase
|
|
16 |
"payee.deleted", "payee.payout_method.created",
|
17 |
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
18 |
|
19 |
-
public static $url = array("url" => "http://
|
20 |
|
21 |
public function testSuccesfulWebhookCreate()
|
22 |
{
|
23 |
setApiKey();
|
24 |
-
$webhook =
|
25 |
-
$this->assertTrue(strpos(get_class($webhook), '
|
26 |
$this->assertTrue(strpos($webhook->webhook_url, self::$url["url"]) !== false);
|
27 |
-
$webhook->update(array("url" => "http://
|
28 |
-
$this->assertTrue(strpos($webhook->webhook_url, "http://
|
29 |
$webhook->delete();
|
30 |
}
|
31 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class WebhookTest extends UnitTestCase
|
4 |
{
|
5 |
public static $events = array("events" =>
|
6 |
array("charge.created", "charge.paid", "charge.under_fraud_review",
|
16 |
"payee.deleted", "payee.payout_method.created",
|
17 |
"payee.payout_method.updated", "payee.payout_method.deleted"));
|
18 |
|
19 |
+
public static $url = array("url" => "http://www.example.com/my_listener");
|
20 |
|
21 |
public function testSuccesfulWebhookCreate()
|
22 |
{
|
23 |
setApiKey();
|
24 |
+
$webhook = \Conekta\Webhook::create(array_merge(self::$url, self::$events));
|
25 |
+
$this->assertTrue(strpos(get_class($webhook), 'Webhook') !== false);
|
26 |
$this->assertTrue(strpos($webhook->webhook_url, self::$url["url"]) !== false);
|
27 |
+
$webhook->update(array("url" => "http://www.example.com/my_listener"));
|
28 |
+
$this->assertTrue(strpos($webhook->webhook_url, "http://www.example.com/my_listener") !== false);
|
29 |
$webhook->delete();
|
30 |
}
|
31 |
}
|
lib/Conekta/test/support/fixtures/orders.json
ADDED
@@ -0,0 +1,2394 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"next_page_url": "https://api.conekta.io/orders?next=ord_2fth4jbNMQ5Bmkofq",
|
3 |
+
"previous_page_url": null,
|
4 |
+
"has_more": true,
|
5 |
+
"total": 14216,
|
6 |
+
"object": "list",
|
7 |
+
"data": [
|
8 |
+
{
|
9 |
+
"livemode": false,
|
10 |
+
"amount": 20000,
|
11 |
+
"status": "created",
|
12 |
+
"customer_id": null,
|
13 |
+
"currency": "MXN",
|
14 |
+
"capture": true,
|
15 |
+
"last_payment_info": {
|
16 |
+
"charge_id": "58865636dba34dd852000afe",
|
17 |
+
"payment_method": "OxxoPayment",
|
18 |
+
"payment_brand": null,
|
19 |
+
"status": "pending_payment"
|
20 |
+
},
|
21 |
+
"customer_info": {
|
22 |
+
"email": "hola@hola.com",
|
23 |
+
"phone": "+5213353319758",
|
24 |
+
"name": "John Constantine",
|
25 |
+
"corporate": null,
|
26 |
+
"account_age": null,
|
27 |
+
"paid_transactions": null,
|
28 |
+
"first_paid_at": 0
|
29 |
+
},
|
30 |
+
"shipping_contact": null,
|
31 |
+
"fiscal_entity": null,
|
32 |
+
"object": "order",
|
33 |
+
"id": "ord_2fth5M3rEuYiegi7R",
|
34 |
+
"metadata": {
|
35 |
+
"test": "extra info"
|
36 |
+
},
|
37 |
+
"created_at": 1485198902,
|
38 |
+
"updated_at": 1485198903,
|
39 |
+
"line_items": {
|
40 |
+
"starting_after": null,
|
41 |
+
"ending_before": null,
|
42 |
+
"object": "list",
|
43 |
+
"has_more": false,
|
44 |
+
"total": 1,
|
45 |
+
"data": [
|
46 |
+
{
|
47 |
+
"name": "Box of Cohiba S1s",
|
48 |
+
"description": "Imported From Mex.",
|
49 |
+
"unit_price": 20000,
|
50 |
+
"quantity": 1,
|
51 |
+
"sku": "cohb_s1",
|
52 |
+
"shippable": null,
|
53 |
+
"tags": [
|
54 |
+
"food",
|
55 |
+
"mexican food"
|
56 |
+
],
|
57 |
+
"brand": null,
|
58 |
+
"type": "physical",
|
59 |
+
"object": "line_item",
|
60 |
+
"id": "line_item_2fth5M3rEuYiegi7P",
|
61 |
+
"parent_id": "ord_2fth5M3rEuYiegi7R",
|
62 |
+
"metadata": {}
|
63 |
+
}
|
64 |
+
]
|
65 |
+
},
|
66 |
+
"shipping_lines": {
|
67 |
+
"starting_after": null,
|
68 |
+
"ending_before": null,
|
69 |
+
"object": "list",
|
70 |
+
"has_more": false,
|
71 |
+
"total": 0,
|
72 |
+
"data": []
|
73 |
+
},
|
74 |
+
"tax_lines": {
|
75 |
+
"starting_after": null,
|
76 |
+
"ending_before": null,
|
77 |
+
"object": "list",
|
78 |
+
"has_more": false,
|
79 |
+
"total": 0,
|
80 |
+
"data": []
|
81 |
+
},
|
82 |
+
"discount_lines": {
|
83 |
+
"starting_after": null,
|
84 |
+
"ending_before": null,
|
85 |
+
"object": "list",
|
86 |
+
"has_more": false,
|
87 |
+
"total": 0,
|
88 |
+
"data": []
|
89 |
+
},
|
90 |
+
"charges": {
|
91 |
+
"starting_after": null,
|
92 |
+
"ending_before": null,
|
93 |
+
"object": "list",
|
94 |
+
"has_more": false,
|
95 |
+
"total": 1,
|
96 |
+
"data": [
|
97 |
+
{
|
98 |
+
"id": "58865636dba34dd852000afe",
|
99 |
+
"livemode": false,
|
100 |
+
"created_at": 1485198902,
|
101 |
+
"currency": "MXN",
|
102 |
+
"description": null,
|
103 |
+
"reference_id": null,
|
104 |
+
"failure_code": null,
|
105 |
+
"failure_message": null,
|
106 |
+
"monthly_installments": null,
|
107 |
+
"device_fingerprint": null,
|
108 |
+
"payment_method": {
|
109 |
+
"barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/sandbox_reference.png",
|
110 |
+
"service_name": "OxxoPay",
|
111 |
+
"object": "cash_payment",
|
112 |
+
"type": "oxxo",
|
113 |
+
"expires_at": 1485234903,
|
114 |
+
"store_name": "OXXO",
|
115 |
+
"reference": "93345678901234"
|
116 |
+
},
|
117 |
+
"object": "charge",
|
118 |
+
"status": "pending_payment",
|
119 |
+
"amount": 20000,
|
120 |
+
"paid_at": null,
|
121 |
+
"fee": 812,
|
122 |
+
"customer_id": "",
|
123 |
+
"order_id": "ord_2fth5M3rEuYiegi7R",
|
124 |
+
"refunds": {
|
125 |
+
"starting_after": null,
|
126 |
+
"ending_before": null,
|
127 |
+
"object": "list",
|
128 |
+
"has_more": false,
|
129 |
+
"total": 0,
|
130 |
+
"data": []
|
131 |
+
}
|
132 |
+
}
|
133 |
+
]
|
134 |
+
},
|
135 |
+
"returns": {
|
136 |
+
"starting_after": null,
|
137 |
+
"ending_before": null,
|
138 |
+
"object": "list",
|
139 |
+
"has_more": false,
|
140 |
+
"total": 0,
|
141 |
+
"data": []
|
142 |
+
}
|
143 |
+
},
|
144 |
+
{
|
145 |
+
"livemode": false,
|
146 |
+
"amount": 20000,
|
147 |
+
"status": "returned",
|
148 |
+
"customer_id": null,
|
149 |
+
"currency": "MXN",
|
150 |
+
"capture": true,
|
151 |
+
"last_payment_info": {
|
152 |
+
"charge_id": "5886562ddba34dd35d000aad",
|
153 |
+
"payment_method": "CreditCardPayment",
|
154 |
+
"payment_brand": "VISA",
|
155 |
+
"status": "paid"
|
156 |
+
},
|
157 |
+
"customer_info": {
|
158 |
+
"email": "hola@hola.com",
|
159 |
+
"phone": "+5213353319758",
|
160 |
+
"name": "John Constantine",
|
161 |
+
"corporate": null,
|
162 |
+
"account_age": null,
|
163 |
+
"paid_transactions": null,
|
164 |
+
"first_paid_at": 0
|
165 |
+
},
|
166 |
+
"shipping_contact": null,
|
167 |
+
"fiscal_entity": null,
|
168 |
+
"object": "order",
|
169 |
+
"id": "ord_2fth5EQUZ7UtB9fQT",
|
170 |
+
"metadata": {
|
171 |
+
"test": "extra info"
|
172 |
+
},
|
173 |
+
"created_at": 1485198893,
|
174 |
+
"updated_at": 1485198901,
|
175 |
+
"line_items": {
|
176 |
+
"starting_after": null,
|
177 |
+
"ending_before": null,
|
178 |
+
"object": "list",
|
179 |
+
"has_more": false,
|
180 |
+
"total": 1,
|
181 |
+
"data": [
|
182 |
+
{
|
183 |
+
"name": "Box of Cohiba S1s",
|
184 |
+
"description": "Imported From Mex.",
|
185 |
+
"unit_price": 20000,
|
186 |
+
"quantity": 1,
|
187 |
+
"sku": "cohb_s1",
|
188 |
+
"shippable": null,
|
189 |
+
"tags": [
|
190 |
+
"food",
|
191 |
+
"mexican food"
|
192 |
+
],
|
193 |
+
"brand": null,
|
194 |
+
"type": "physical",
|
195 |
+
"object": "line_item",
|
196 |
+
"id": "line_item_2fth5EQUZ7UtB9fQR",
|
197 |
+
"parent_id": "ord_2fth5EQUZ7UtB9fQT",
|
198 |
+
"metadata": {}
|
199 |
+
}
|
200 |
+
]
|
201 |
+
},
|
202 |
+
"shipping_lines": {
|
203 |
+
"starting_after": null,
|
204 |
+
"ending_before": null,
|
205 |
+
"object": "list",
|
206 |
+
"has_more": false,
|
207 |
+
"total": 0,
|
208 |
+
"data": []
|
209 |
+
},
|
210 |
+
"tax_lines": {
|
211 |
+
"starting_after": null,
|
212 |
+
"ending_before": null,
|
213 |
+
"object": "list",
|
214 |
+
"has_more": false,
|
215 |
+
"total": 0,
|
216 |
+
"data": []
|
217 |
+
},
|
218 |
+
"discount_lines": {
|
219 |
+
"starting_after": null,
|
220 |
+
"ending_before": null,
|
221 |
+
"object": "list",
|
222 |
+
"has_more": false,
|
223 |
+
"total": 0,
|
224 |
+
"data": []
|
225 |
+
},
|
226 |
+
"charges": {
|
227 |
+
"starting_after": null,
|
228 |
+
"ending_before": null,
|
229 |
+
"object": "list",
|
230 |
+
"has_more": false,
|
231 |
+
"total": 1,
|
232 |
+
"data": [
|
233 |
+
{
|
234 |
+
"id": "5886562ddba34dd35d000aad",
|
235 |
+
"livemode": false,
|
236 |
+
"created_at": 1485198893,
|
237 |
+
"currency": "MXN",
|
238 |
+
"description": null,
|
239 |
+
"reference_id": null,
|
240 |
+
"failure_code": null,
|
241 |
+
"failure_message": null,
|
242 |
+
"monthly_installments": null,
|
243 |
+
"device_fingerprint": "123456789abcdefghijkmnopqrstuv",
|
244 |
+
"payment_method": {
|
245 |
+
"name": "Jorge Lopez",
|
246 |
+
"exp_month": "12",
|
247 |
+
"exp_year": "19",
|
248 |
+
"auth_code": "810688",
|
249 |
+
"object": "card_payment",
|
250 |
+
"type": "credit",
|
251 |
+
"normalized_device_fingerprint": null,
|
252 |
+
"last4": "4242",
|
253 |
+
"brand": "visa",
|
254 |
+
"issuer": "",
|
255 |
+
"account_type": "",
|
256 |
+
"country": "US",
|
257 |
+
"fraud_score": 29,
|
258 |
+
"fraud_indicators": []
|
259 |
+
},
|
260 |
+
"object": "charge",
|
261 |
+
"status": "refunded",
|
262 |
+
"amount": 20000,
|
263 |
+
"paid_at": 1485198899,
|
264 |
+
"fee": 963,
|
265 |
+
"customer_id": "",
|
266 |
+
"order_id": "ord_2fth5EQUZ7UtB9fQT",
|
267 |
+
"refunds": {
|
268 |
+
"starting_after": null,
|
269 |
+
"ending_before": null,
|
270 |
+
"object": "list",
|
271 |
+
"has_more": false,
|
272 |
+
"total": 1,
|
273 |
+
"data": [
|
274 |
+
{
|
275 |
+
"object": "refund",
|
276 |
+
"amount": -20000,
|
277 |
+
"auth_code": "810688",
|
278 |
+
"id": "58865635edbb6ede090004f7",
|
279 |
+
"created_at": 1485198901
|
280 |
+
}
|
281 |
+
]
|
282 |
+
}
|
283 |
+
}
|
284 |
+
]
|
285 |
+
},
|
286 |
+
"returns": {
|
287 |
+
"starting_after": null,
|
288 |
+
"ending_before": null,
|
289 |
+
"object": "list",
|
290 |
+
"has_more": false,
|
291 |
+
"total": 1,
|
292 |
+
"data": [
|
293 |
+
{
|
294 |
+
"livemode": false,
|
295 |
+
"amount": 20000,
|
296 |
+
"currency": "MXN",
|
297 |
+
"charge_id": "5886562ddba34dd35d000aad",
|
298 |
+
"reason": "Reason return",
|
299 |
+
"id": "ord_ret_2fth5KdEjehMzxpTh",
|
300 |
+
"object": "return",
|
301 |
+
"created_at": 1485198900,
|
302 |
+
"parent_id": "ord_2fth5EQUZ7UtB9fQT"
|
303 |
+
}
|
304 |
+
]
|
305 |
+
}
|
306 |
+
},
|
307 |
+
{
|
308 |
+
"livemode": false,
|
309 |
+
"amount": 20000,
|
310 |
+
"status": "created",
|
311 |
+
"customer_id": null,
|
312 |
+
"currency": "MXN",
|
313 |
+
"capture": true,
|
314 |
+
"last_payment_info": null,
|
315 |
+
"customer_info": null,
|
316 |
+
"shipping_contact": null,
|
317 |
+
"fiscal_entity": {
|
318 |
+
"tax_id": "AMGH851205MN1",
|
319 |
+
"company_name": "Test SA de CV",
|
320 |
+
"phone": "+5213353319758",
|
321 |
+
"email": "test@conekta.io",
|
322 |
+
"address": {
|
323 |
+
"street1": "250 Alexis St",
|
324 |
+
"street2": null,
|
325 |
+
"street3": null,
|
326 |
+
"internal_number": 19,
|
327 |
+
"external_number": 10,
|
328 |
+
"city": "Red Deer",
|
329 |
+
"state": "Alberta",
|
330 |
+
"zip": "78216",
|
331 |
+
"country": "mx",
|
332 |
+
"object": "fiscal_entity_address"
|
333 |
+
},
|
334 |
+
"id": "fis_ent_2fth5Diga4CBE9Q5g",
|
335 |
+
"object": "fiscal_entity",
|
336 |
+
"created_at": 1485198892
|
337 |
+
},
|
338 |
+
"object": "order",
|
339 |
+
"id": "ord_2fth5Cys3rdXXRmmH",
|
340 |
+
"metadata": {
|
341 |
+
"test": "extra info"
|
342 |
+
},
|
343 |
+
"created_at": 1485198892,
|
344 |
+
"updated_at": 1485198892,
|
345 |
+
"line_items": {
|
346 |
+
"starting_after": null,
|
347 |
+
"ending_before": null,
|
348 |
+
"object": "list",
|
349 |
+
"has_more": false,
|
350 |
+
"total": 1,
|
351 |
+
"data": [
|
352 |
+
{
|
353 |
+
"name": "Box of Cohiba S1s",
|
354 |
+
"description": "Imported From Mex.",
|
355 |
+
"unit_price": 20000,
|
356 |
+
"quantity": 1,
|
357 |
+
"sku": "cohb_s1",
|
358 |
+
"shippable": null,
|
359 |
+
"tags": [
|
360 |
+
"food",
|
361 |
+
"mexican food"
|
362 |
+
],
|
363 |
+
"brand": null,
|
364 |
+
"type": "physical",
|
365 |
+
"object": "line_item",
|
366 |
+
"id": "line_item_2fth5Cys3rdXXRmmG",
|
367 |
+
"parent_id": "ord_2fth5Cys3rdXXRmmH",
|
368 |
+
"metadata": {}
|
369 |
+
}
|
370 |
+
]
|
371 |
+
},
|
372 |
+
"shipping_lines": {
|
373 |
+
"starting_after": null,
|
374 |
+
"ending_before": null,
|
375 |
+
"object": "list",
|
376 |
+
"has_more": false,
|
377 |
+
"total": 0,
|
378 |
+
"data": []
|
379 |
+
},
|
380 |
+
"tax_lines": {
|
381 |
+
"starting_after": null,
|
382 |
+
"ending_before": null,
|
383 |
+
"object": "list",
|
384 |
+
"has_more": false,
|
385 |
+
"total": 0,
|
386 |
+
"data": []
|
387 |
+
},
|
388 |
+
"discount_lines": {
|
389 |
+
"starting_after": null,
|
390 |
+
"ending_before": null,
|
391 |
+
"object": "list",
|
392 |
+
"has_more": false,
|
393 |
+
"total": 0,
|
394 |
+
"data": []
|
395 |
+
},
|
396 |
+
"charges": {
|
397 |
+
"starting_after": null,
|
398 |
+
"ending_before": null,
|
399 |
+
"object": "list",
|
400 |
+
"has_more": false,
|
401 |
+
"total": 0,
|
402 |
+
"data": []
|
403 |
+
},
|
404 |
+
"returns": {
|
405 |
+
"starting_after": null,
|
406 |
+
"ending_before": null,
|
407 |
+
"object": "list",
|
408 |
+
"has_more": false,
|
409 |
+
"total": 0,
|
410 |
+
"data": []
|
411 |
+
}
|
412 |
+
},
|
413 |
+
{
|
414 |
+
"livemode": false,
|
415 |
+
"amount": 20000,
|
416 |
+
"status": "created",
|
417 |
+
"customer_id": null,
|
418 |
+
"currency": "MXN",
|
419 |
+
"capture": true,
|
420 |
+
"last_payment_info": null,
|
421 |
+
"customer_info": null,
|
422 |
+
"shipping_contact": null,
|
423 |
+
"fiscal_entity": null,
|
424 |
+
"object": "order",
|
425 |
+
"id": "ord_2fth5CF3Xf4syc56p",
|
426 |
+
"metadata": {
|
427 |
+
"test": "extra info"
|
428 |
+
},
|
429 |
+
"created_at": 1485198890,
|
430 |
+
"updated_at": 1485198890,
|
431 |
+
"line_items": {
|
432 |
+
"starting_after": null,
|
433 |
+
"ending_before": null,
|
434 |
+
"object": "list",
|
435 |
+
"has_more": false,
|
436 |
+
"total": 1,
|
437 |
+
"data": [
|
438 |
+
{
|
439 |
+
"name": "Box of Cohiba S1s",
|
440 |
+
"description": "Imported From Mex.",
|
441 |
+
"unit_price": 20000,
|
442 |
+
"quantity": 1,
|
443 |
+
"sku": "cohb_s1",
|
444 |
+
"shippable": null,
|
445 |
+
"tags": [
|
446 |
+
"food",
|
447 |
+
"mexican food"
|
448 |
+
],
|
449 |
+
"brand": null,
|
450 |
+
"type": "physical",
|
451 |
+
"object": "line_item",
|
452 |
+
"id": "line_item_2fth5CF3Xf4syc56o",
|
453 |
+
"parent_id": "ord_2fth5CF3Xf4syc56p",
|
454 |
+
"metadata": {}
|
455 |
+
}
|
456 |
+
]
|
457 |
+
},
|
458 |
+
"shipping_lines": {
|
459 |
+
"starting_after": null,
|
460 |
+
"ending_before": null,
|
461 |
+
"object": "list",
|
462 |
+
"has_more": false,
|
463 |
+
"total": 0,
|
464 |
+
"data": []
|
465 |
+
},
|
466 |
+
"tax_lines": {
|
467 |
+
"starting_after": null,
|
468 |
+
"ending_before": null,
|
469 |
+
"object": "list",
|
470 |
+
"has_more": false,
|
471 |
+
"total": 0,
|
472 |
+
"data": []
|
473 |
+
},
|
474 |
+
"discount_lines": {
|
475 |
+
"starting_after": null,
|
476 |
+
"ending_before": null,
|
477 |
+
"object": "list",
|
478 |
+
"has_more": false,
|
479 |
+
"total": 0,
|
480 |
+
"data": []
|
481 |
+
},
|
482 |
+
"charges": {
|
483 |
+
"starting_after": null,
|
484 |
+
"ending_before": null,
|
485 |
+
"object": "list",
|
486 |
+
"has_more": false,
|
487 |
+
"total": 0,
|
488 |
+
"data": []
|
489 |
+
},
|
490 |
+
"returns": {
|
491 |
+
"starting_after": null,
|
492 |
+
"ending_before": null,
|
493 |
+
"object": "list",
|
494 |
+
"has_more": false,
|
495 |
+
"total": 0,
|
496 |
+
"data": []
|
497 |
+
}
|
498 |
+
},
|
499 |
+
{
|
500 |
+
"livemode": false,
|
501 |
+
"amount": 20000,
|
502 |
+
"status": "created",
|
503 |
+
"customer_id": null,
|
504 |
+
"currency": "MXN",
|
505 |
+
"capture": true,
|
506 |
+
"last_payment_info": null,
|
507 |
+
"customer_info": null,
|
508 |
+
"shipping_contact": null,
|
509 |
+
"fiscal_entity": null,
|
510 |
+
"object": "order",
|
511 |
+
"id": "ord_2fth5BWE1TWEMLQcN",
|
512 |
+
"metadata": {
|
513 |
+
"test": "extra info"
|
514 |
+
},
|
515 |
+
"created_at": 1485198889,
|
516 |
+
"updated_at": 1485198889,
|
517 |
+
"line_items": {
|
518 |
+
"starting_after": null,
|
519 |
+
"ending_before": null,
|
520 |
+
"object": "list",
|
521 |
+
"has_more": false,
|
522 |
+
"total": 1,
|
523 |
+
"data": [
|
524 |
+
{
|
525 |
+
"name": "Box of Cohiba S1s",
|
526 |
+
"description": "Imported From Mex.",
|
527 |
+
"unit_price": 20000,
|
528 |
+
"quantity": 1,
|
529 |
+
"sku": "cohb_s1",
|
530 |
+
"shippable": null,
|
531 |
+
"tags": [
|
532 |
+
"food",
|
533 |
+
"mexican food"
|
534 |
+
],
|
535 |
+
"brand": null,
|
536 |
+
"type": "physical",
|
537 |
+
"object": "line_item",
|
538 |
+
"id": "line_item_2fth5BWE1TWEMLQcM",
|
539 |
+
"parent_id": "ord_2fth5BWE1TWEMLQcN",
|
540 |
+
"metadata": {}
|
541 |
+
}
|
542 |
+
]
|
543 |
+
},
|
544 |
+
"shipping_lines": {
|
545 |
+
"starting_after": null,
|
546 |
+
"ending_before": null,
|
547 |
+
"object": "list",
|
548 |
+
"has_more": false,
|
549 |
+
"total": 1,
|
550 |
+
"data": [
|
551 |
+
{
|
552 |
+
"amount": 0,
|
553 |
+
"carrier": "USPS",
|
554 |
+
"method": "Train",
|
555 |
+
"tracking_number": "TRACK123",
|
556 |
+
"object": "shipping_line",
|
557 |
+
"id": "ship_lin_2fth5BPx1AMTtJDKt",
|
558 |
+
"parent_id": "ord_2fth5BWE1TWEMLQcN",
|
559 |
+
"metadata": null
|
560 |
+
}
|
561 |
+
]
|
562 |
+
},
|
563 |
+
"tax_lines": {
|
564 |
+
"starting_after": null,
|
565 |
+
"ending_before": null,
|
566 |
+
"object": "list",
|
567 |
+
"has_more": false,
|
568 |
+
"total": 0,
|
569 |
+
"data": []
|
570 |
+
},
|
571 |
+
"discount_lines": {
|
572 |
+
"starting_after": null,
|
573 |
+
"ending_before": null,
|
574 |
+
"object": "list",
|
575 |
+
"has_more": false,
|
576 |
+
"total": 0,
|
577 |
+
"data": []
|
578 |
+
},
|
579 |
+
"charges": {
|
580 |
+
"starting_after": null,
|
581 |
+
"ending_before": null,
|
582 |
+
"object": "list",
|
583 |
+
"has_more": false,
|
584 |
+
"total": 0,
|
585 |
+
"data": []
|
586 |
+
},
|
587 |
+
"returns": {
|
588 |
+
"starting_after": null,
|
589 |
+
"ending_before": null,
|
590 |
+
"object": "list",
|
591 |
+
"has_more": false,
|
592 |
+
"total": 0,
|
593 |
+
"data": []
|
594 |
+
}
|
595 |
+
},
|
596 |
+
{
|
597 |
+
"livemode": false,
|
598 |
+
"amount": 20066,
|
599 |
+
"status": "created",
|
600 |
+
"customer_id": null,
|
601 |
+
"currency": "MXN",
|
602 |
+
"capture": true,
|
603 |
+
"last_payment_info": null,
|
604 |
+
"customer_info": null,
|
605 |
+
"shipping_contact": null,
|
606 |
+
"fiscal_entity": null,
|
607 |
+
"object": "order",
|
608 |
+
"id": "ord_2fth59yZRv6zGdkks",
|
609 |
+
"metadata": {
|
610 |
+
"test": "extra info"
|
611 |
+
},
|
612 |
+
"created_at": 1485198887,
|
613 |
+
"updated_at": 1485198888,
|
614 |
+
"line_items": {
|
615 |
+
"starting_after": null,
|
616 |
+
"ending_before": null,
|
617 |
+
"object": "list",
|
618 |
+
"has_more": false,
|
619 |
+
"total": 1,
|
620 |
+
"data": [
|
621 |
+
{
|
622 |
+
"name": "Box of Cohiba S1s",
|
623 |
+
"description": "Imported From Mex.",
|
624 |
+
"unit_price": 20000,
|
625 |
+
"quantity": 1,
|
626 |
+
"sku": "cohb_s1",
|
627 |
+
"shippable": null,
|
628 |
+
"tags": [
|
629 |
+
"food",
|
630 |
+
"mexican food"
|
631 |
+
],
|
632 |
+
"brand": null,
|
633 |
+
"type": "physical",
|
634 |
+
"object": "line_item",
|
635 |
+
"id": "line_item_2fth59yZRv6zGdkkr",
|
636 |
+
"parent_id": "ord_2fth59yZRv6zGdkks",
|
637 |
+
"metadata": {}
|
638 |
+
}
|
639 |
+
]
|
640 |
+
},
|
641 |
+
"shipping_lines": {
|
642 |
+
"starting_after": null,
|
643 |
+
"ending_before": null,
|
644 |
+
"object": "list",
|
645 |
+
"has_more": false,
|
646 |
+
"total": 0,
|
647 |
+
"data": []
|
648 |
+
},
|
649 |
+
"tax_lines": {
|
650 |
+
"starting_after": null,
|
651 |
+
"ending_before": null,
|
652 |
+
"object": "list",
|
653 |
+
"has_more": false,
|
654 |
+
"total": 2,
|
655 |
+
"data": [
|
656 |
+
{
|
657 |
+
"description": "IVA",
|
658 |
+
"amount": 60,
|
659 |
+
"object": "tax_line",
|
660 |
+
"id": "tax_lin_2fth5Af8UxnpG2YqT",
|
661 |
+
"parent_id": "ord_2fth59yZRv6zGdkks",
|
662 |
+
"metadata": null
|
663 |
+
},
|
664 |
+
{
|
665 |
+
"description": "ISR",
|
666 |
+
"amount": 6,
|
667 |
+
"object": "tax_line",
|
668 |
+
"id": "tax_lin_2fth5AmQVFwaj4k7v",
|
669 |
+
"parent_id": "ord_2fth59yZRv6zGdkks",
|
670 |
+
"metadata": null
|
671 |
+
}
|
672 |
+
]
|
673 |
+
},
|
674 |
+
"discount_lines": {
|
675 |
+
"starting_after": null,
|
676 |
+
"ending_before": null,
|
677 |
+
"object": "list",
|
678 |
+
"has_more": false,
|
679 |
+
"total": 0,
|
680 |
+
"data": []
|
681 |
+
},
|
682 |
+
"charges": {
|
683 |
+
"starting_after": null,
|
684 |
+
"ending_before": null,
|
685 |
+
"object": "list",
|
686 |
+
"has_more": false,
|
687 |
+
"total": 0,
|
688 |
+
"data": []
|
689 |
+
},
|
690 |
+
"returns": {
|
691 |
+
"starting_after": null,
|
692 |
+
"ending_before": null,
|
693 |
+
"object": "list",
|
694 |
+
"has_more": false,
|
695 |
+
"total": 0,
|
696 |
+
"data": []
|
697 |
+
}
|
698 |
+
},
|
699 |
+
{
|
700 |
+
"livemode": false,
|
701 |
+
"amount": 40000,
|
702 |
+
"status": "created",
|
703 |
+
"customer_id": null,
|
704 |
+
"currency": "MXN",
|
705 |
+
"capture": true,
|
706 |
+
"last_payment_info": null,
|
707 |
+
"customer_info": null,
|
708 |
+
"shipping_contact": null,
|
709 |
+
"fiscal_entity": null,
|
710 |
+
"object": "order",
|
711 |
+
"id": "ord_2fth58SfvN6sWdVms",
|
712 |
+
"metadata": {
|
713 |
+
"test": "extra info"
|
714 |
+
},
|
715 |
+
"created_at": 1485198886,
|
716 |
+
"updated_at": 1485198887,
|
717 |
+
"line_items": {
|
718 |
+
"starting_after": null,
|
719 |
+
"ending_before": null,
|
720 |
+
"object": "list",
|
721 |
+
"has_more": false,
|
722 |
+
"total": 2,
|
723 |
+
"data": [
|
724 |
+
{
|
725 |
+
"name": "Box of Cohiba S1s",
|
726 |
+
"description": "Imported From Mex.",
|
727 |
+
"unit_price": 20000,
|
728 |
+
"quantity": 1,
|
729 |
+
"sku": "cohb_s1",
|
730 |
+
"shippable": null,
|
731 |
+
"tags": [
|
732 |
+
"food",
|
733 |
+
"mexican food"
|
734 |
+
],
|
735 |
+
"brand": null,
|
736 |
+
"type": "physical",
|
737 |
+
"object": "line_item",
|
738 |
+
"id": "line_item_2fth58SfvN6sWdVmr",
|
739 |
+
"parent_id": "ord_2fth58SfvN6sWdVms",
|
740 |
+
"metadata": {}
|
741 |
+
},
|
742 |
+
{
|
743 |
+
"name": "Box of Cohiba S1s",
|
744 |
+
"description": "Imported From Mex.",
|
745 |
+
"unit_price": 20000,
|
746 |
+
"quantity": 1,
|
747 |
+
"sku": null,
|
748 |
+
"shippable": null,
|
749 |
+
"tags": [
|
750 |
+
"food",
|
751 |
+
"mexican food"
|
752 |
+
],
|
753 |
+
"brand": null,
|
754 |
+
"type": "physical",
|
755 |
+
"object": "line_item",
|
756 |
+
"id": "line_item_2fth59yZRv6zRXgTt",
|
757 |
+
"parent_id": "ord_2fth58SfvN6sWdVms",
|
758 |
+
"metadata": {}
|
759 |
+
}
|
760 |
+
]
|
761 |
+
},
|
762 |
+
"shipping_lines": {
|
763 |
+
"starting_after": null,
|
764 |
+
"ending_before": null,
|
765 |
+
"object": "list",
|
766 |
+
"has_more": false,
|
767 |
+
"total": 0,
|
768 |
+
"data": []
|
769 |
+
},
|
770 |
+
"tax_lines": {
|
771 |
+
"starting_after": null,
|
772 |
+
"ending_before": null,
|
773 |
+
"object": "list",
|
774 |
+
"has_more": false,
|
775 |
+
"total": 0,
|
776 |
+
"data": []
|
777 |
+
},
|
778 |
+
"discount_lines": {
|
779 |
+
"starting_after": null,
|
780 |
+
"ending_before": null,
|
781 |
+
"object": "list",
|
782 |
+
"has_more": false,
|
783 |
+
"total": 0,
|
784 |
+
"data": []
|
785 |
+
},
|
786 |
+
"charges": {
|
787 |
+
"starting_after": null,
|
788 |
+
"ending_before": null,
|
789 |
+
"object": "list",
|
790 |
+
"has_more": false,
|
791 |
+
"total": 0,
|
792 |
+
"data": []
|
793 |
+
},
|
794 |
+
"returns": {
|
795 |
+
"starting_after": null,
|
796 |
+
"ending_before": null,
|
797 |
+
"object": "list",
|
798 |
+
"has_more": false,
|
799 |
+
"total": 0,
|
800 |
+
"data": []
|
801 |
+
}
|
802 |
+
},
|
803 |
+
{
|
804 |
+
"livemode": false,
|
805 |
+
"amount": 20000,
|
806 |
+
"status": "created",
|
807 |
+
"customer_id": null,
|
808 |
+
"currency": "MXN",
|
809 |
+
"capture": true,
|
810 |
+
"last_payment_info": null,
|
811 |
+
"customer_info": null,
|
812 |
+
"shipping_contact": null,
|
813 |
+
"fiscal_entity": null,
|
814 |
+
"object": "order",
|
815 |
+
"id": "ord_2fth56EDMmQvWQZtr",
|
816 |
+
"metadata": {
|
817 |
+
"test": "extra info"
|
818 |
+
},
|
819 |
+
"created_at": 1485198882,
|
820 |
+
"updated_at": 1485198882,
|
821 |
+
"line_items": {
|
822 |
+
"starting_after": null,
|
823 |
+
"ending_before": null,
|
824 |
+
"object": "list",
|
825 |
+
"has_more": false,
|
826 |
+
"total": 1,
|
827 |
+
"data": [
|
828 |
+
{
|
829 |
+
"name": "Box of Cohiba S1s",
|
830 |
+
"description": "Imported From Mex.",
|
831 |
+
"unit_price": 20000,
|
832 |
+
"quantity": 1,
|
833 |
+
"sku": "cohb_s1",
|
834 |
+
"shippable": null,
|
835 |
+
"tags": [
|
836 |
+
"food",
|
837 |
+
"mexican food"
|
838 |
+
],
|
839 |
+
"brand": null,
|
840 |
+
"type": "physical",
|
841 |
+
"object": "line_item",
|
842 |
+
"id": "line_item_2fth56EDMmQvWQZtq",
|
843 |
+
"parent_id": "ord_2fth56EDMmQvWQZtr",
|
844 |
+
"metadata": {}
|
845 |
+
}
|
846 |
+
]
|
847 |
+
},
|
848 |
+
"shipping_lines": {
|
849 |
+
"starting_after": null,
|
850 |
+
"ending_before": null,
|
851 |
+
"object": "list",
|
852 |
+
"has_more": false,
|
853 |
+
"total": 0,
|
854 |
+
"data": []
|
855 |
+
},
|
856 |
+
"tax_lines": {
|
857 |
+
"starting_after": null,
|
858 |
+
"ending_before": null,
|
859 |
+
"object": "list",
|
860 |
+
"has_more": false,
|
861 |
+
"total": 0,
|
862 |
+
"data": []
|
863 |
+
},
|
864 |
+
"discount_lines": {
|
865 |
+
"starting_after": null,
|
866 |
+
"ending_before": null,
|
867 |
+
"object": "list",
|
868 |
+
"has_more": false,
|
869 |
+
"total": 0,
|
870 |
+
"data": []
|
871 |
+
},
|
872 |
+
"charges": {
|
873 |
+
"starting_after": null,
|
874 |
+
"ending_before": null,
|
875 |
+
"object": "list",
|
876 |
+
"has_more": false,
|
877 |
+
"total": 0,
|
878 |
+
"data": []
|
879 |
+
},
|
880 |
+
"returns": {
|
881 |
+
"starting_after": null,
|
882 |
+
"ending_before": null,
|
883 |
+
"object": "list",
|
884 |
+
"has_more": false,
|
885 |
+
"total": 0,
|
886 |
+
"data": []
|
887 |
+
}
|
888 |
+
},
|
889 |
+
{
|
890 |
+
"livemode": false,
|
891 |
+
"amount": 20000,
|
892 |
+
"status": "created",
|
893 |
+
"customer_id": null,
|
894 |
+
"currency": "MXN",
|
895 |
+
"capture": true,
|
896 |
+
"last_payment_info": null,
|
897 |
+
"customer_info": null,
|
898 |
+
"shipping_contact": null,
|
899 |
+
"fiscal_entity": null,
|
900 |
+
"object": "order",
|
901 |
+
"id": "ord_2fth54kaKNHdPHBKk",
|
902 |
+
"metadata": {
|
903 |
+
"test": "extra info"
|
904 |
+
},
|
905 |
+
"created_at": 1485198880,
|
906 |
+
"updated_at": 1485198880,
|
907 |
+
"line_items": {
|
908 |
+
"starting_after": null,
|
909 |
+
"ending_before": null,
|
910 |
+
"object": "list",
|
911 |
+
"has_more": false,
|
912 |
+
"total": 1,
|
913 |
+
"data": [
|
914 |
+
{
|
915 |
+
"name": "Box of Cohiba S1s",
|
916 |
+
"description": "Imported From Mex.",
|
917 |
+
"unit_price": 20000,
|
918 |
+
"quantity": 1,
|
919 |
+
"sku": "cohb_s1",
|
920 |
+
"shippable": null,
|
921 |
+
"tags": [
|
922 |
+
"food",
|
923 |
+
"mexican food"
|
924 |
+
],
|
925 |
+
"brand": null,
|
926 |
+
"type": "physical",
|
927 |
+
"object": "line_item",
|
928 |
+
"id": "line_item_2fth54kaKNHdPHBKj",
|
929 |
+
"parent_id": "ord_2fth54kaKNHdPHBKk",
|
930 |
+
"metadata": {}
|
931 |
+
}
|
932 |
+
]
|
933 |
+
},
|
934 |
+
"shipping_lines": {
|
935 |
+
"starting_after": null,
|
936 |
+
"ending_before": null,
|
937 |
+
"object": "list",
|
938 |
+
"has_more": false,
|
939 |
+
"total": 0,
|
940 |
+
"data": []
|
941 |
+
},
|
942 |
+
"tax_lines": {
|
943 |
+
"starting_after": null,
|
944 |
+
"ending_before": null,
|
945 |
+
"object": "list",
|
946 |
+
"has_more": false,
|
947 |
+
"total": 0,
|
948 |
+
"data": []
|
949 |
+
},
|
950 |
+
"discount_lines": {
|
951 |
+
"starting_after": null,
|
952 |
+
"ending_before": null,
|
953 |
+
"object": "list",
|
954 |
+
"has_more": false,
|
955 |
+
"total": 0,
|
956 |
+
"data": []
|
957 |
+
},
|
958 |
+
"charges": {
|
959 |
+
"starting_after": null,
|
960 |
+
"ending_before": null,
|
961 |
+
"object": "list",
|
962 |
+
"has_more": false,
|
963 |
+
"total": 0,
|
964 |
+
"data": []
|
965 |
+
},
|
966 |
+
"returns": {
|
967 |
+
"starting_after": null,
|
968 |
+
"ending_before": null,
|
969 |
+
"object": "list",
|
970 |
+
"has_more": false,
|
971 |
+
"total": 0,
|
972 |
+
"data": []
|
973 |
+
}
|
974 |
+
},
|
975 |
+
{
|
976 |
+
"livemode": false,
|
977 |
+
"amount": 60000,
|
978 |
+
"status": "created",
|
979 |
+
"customer_id": null,
|
980 |
+
"currency": "USD",
|
981 |
+
"capture": true,
|
982 |
+
"last_payment_info": null,
|
983 |
+
"customer_info": null,
|
984 |
+
"shipping_contact": null,
|
985 |
+
"fiscal_entity": null,
|
986 |
+
"object": "order",
|
987 |
+
"id": "ord_2fth5451GKboLvQfW",
|
988 |
+
"metadata": {
|
989 |
+
"test": "extra info"
|
990 |
+
},
|
991 |
+
"created_at": 1485198879,
|
992 |
+
"updated_at": 1485198880,
|
993 |
+
"line_items": {
|
994 |
+
"starting_after": null,
|
995 |
+
"ending_before": null,
|
996 |
+
"object": "list",
|
997 |
+
"has_more": false,
|
998 |
+
"total": 1,
|
999 |
+
"data": [
|
1000 |
+
{
|
1001 |
+
"name": "Box of chocolates",
|
1002 |
+
"description": "Imported From Uruguay.",
|
1003 |
+
"unit_price": 30000,
|
1004 |
+
"quantity": 2,
|
1005 |
+
"sku": "choc_s3",
|
1006 |
+
"shippable": null,
|
1007 |
+
"tags": [
|
1008 |
+
"Chocolate",
|
1009 |
+
"Sudamerican chocolates"
|
1010 |
+
],
|
1011 |
+
"brand": null,
|
1012 |
+
"type": "physical",
|
1013 |
+
"object": "line_item",
|
1014 |
+
"id": "line_item_2fth54kaKNHdPHBKi",
|
1015 |
+
"parent_id": "ord_2fth5451GKboLvQfW",
|
1016 |
+
"metadata": {}
|
1017 |
+
}
|
1018 |
+
]
|
1019 |
+
},
|
1020 |
+
"shipping_lines": {
|
1021 |
+
"starting_after": null,
|
1022 |
+
"ending_before": null,
|
1023 |
+
"object": "list",
|
1024 |
+
"has_more": false,
|
1025 |
+
"total": 0,
|
1026 |
+
"data": []
|
1027 |
+
},
|
1028 |
+
"tax_lines": {
|
1029 |
+
"starting_after": null,
|
1030 |
+
"ending_before": null,
|
1031 |
+
"object": "list",
|
1032 |
+
"has_more": false,
|
1033 |
+
"total": 0,
|
1034 |
+
"data": []
|
1035 |
+
},
|
1036 |
+
"discount_lines": {
|
1037 |
+
"starting_after": null,
|
1038 |
+
"ending_before": null,
|
1039 |
+
"object": "list",
|
1040 |
+
"has_more": false,
|
1041 |
+
"total": 0,
|
1042 |
+
"data": []
|
1043 |
+
},
|
1044 |
+
"charges": {
|
1045 |
+
"starting_after": null,
|
1046 |
+
"ending_before": null,
|
1047 |
+
"object": "list",
|
1048 |
+
"has_more": false,
|
1049 |
+
"total": 0,
|
1050 |
+
"data": []
|
1051 |
+
},
|
1052 |
+
"returns": {
|
1053 |
+
"starting_after": null,
|
1054 |
+
"ending_before": null,
|
1055 |
+
"object": "list",
|
1056 |
+
"has_more": false,
|
1057 |
+
"total": 0,
|
1058 |
+
"data": []
|
1059 |
+
}
|
1060 |
+
},
|
1061 |
+
{
|
1062 |
+
"livemode": false,
|
1063 |
+
"amount": 20000,
|
1064 |
+
"status": "created",
|
1065 |
+
"customer_id": null,
|
1066 |
+
"currency": "MXN",
|
1067 |
+
"capture": true,
|
1068 |
+
"last_payment_info": {
|
1069 |
+
"charge_id": "5886561ddba34dd852000ad8",
|
1070 |
+
"payment_method": "OxxoPayment",
|
1071 |
+
"payment_brand": null,
|
1072 |
+
"status": "pending_payment"
|
1073 |
+
},
|
1074 |
+
"customer_info": {
|
1075 |
+
"email": "hola@hola.com",
|
1076 |
+
"phone": "+5213353319758",
|
1077 |
+
"name": "John Constantine",
|
1078 |
+
"corporate": null,
|
1079 |
+
"account_age": null,
|
1080 |
+
"paid_transactions": null,
|
1081 |
+
"first_paid_at": 0
|
1082 |
+
},
|
1083 |
+
"shipping_contact": null,
|
1084 |
+
"fiscal_entity": null,
|
1085 |
+
"object": "order",
|
1086 |
+
"id": "ord_2fth51uaEsBnzUthh",
|
1087 |
+
"metadata": {
|
1088 |
+
"test": "extra info"
|
1089 |
+
},
|
1090 |
+
"created_at": 1485198876,
|
1091 |
+
"updated_at": 1485198876,
|
1092 |
+
"line_items": {
|
1093 |
+
"starting_after": null,
|
1094 |
+
"ending_before": null,
|
1095 |
+
"object": "list",
|
1096 |
+
"has_more": false,
|
1097 |
+
"total": 1,
|
1098 |
+
"data": [
|
1099 |
+
{
|
1100 |
+
"name": "Box of Cohiba S1s",
|
1101 |
+
"description": "Imported From Mex.",
|
1102 |
+
"unit_price": 20000,
|
1103 |
+
"quantity": 1,
|
1104 |
+
"sku": "cohb_s1",
|
1105 |
+
"shippable": null,
|
1106 |
+
"tags": [
|
1107 |
+
"food",
|
1108 |
+
"mexican food"
|
1109 |
+
],
|
1110 |
+
"brand": null,
|
1111 |
+
"type": "physical",
|
1112 |
+
"object": "line_item",
|
1113 |
+
"id": "line_item_2fth51uaEsBnzUthf",
|
1114 |
+
"parent_id": "ord_2fth51uaEsBnzUthh",
|
1115 |
+
"metadata": {}
|
1116 |
+
}
|
1117 |
+
]
|
1118 |
+
},
|
1119 |
+
"shipping_lines": {
|
1120 |
+
"starting_after": null,
|
1121 |
+
"ending_before": null,
|
1122 |
+
"object": "list",
|
1123 |
+
"has_more": false,
|
1124 |
+
"total": 0,
|
1125 |
+
"data": []
|
1126 |
+
},
|
1127 |
+
"tax_lines": {
|
1128 |
+
"starting_after": null,
|
1129 |
+
"ending_before": null,
|
1130 |
+
"object": "list",
|
1131 |
+
"has_more": false,
|
1132 |
+
"total": 0,
|
1133 |
+
"data": []
|
1134 |
+
},
|
1135 |
+
"discount_lines": {
|
1136 |
+
"starting_after": null,
|
1137 |
+
"ending_before": null,
|
1138 |
+
"object": "list",
|
1139 |
+
"has_more": false,
|
1140 |
+
"total": 0,
|
1141 |
+
"data": []
|
1142 |
+
},
|
1143 |
+
"charges": {
|
1144 |
+
"starting_after": null,
|
1145 |
+
"ending_before": null,
|
1146 |
+
"object": "list",
|
1147 |
+
"has_more": false,
|
1148 |
+
"total": 1,
|
1149 |
+
"data": [
|
1150 |
+
{
|
1151 |
+
"id": "5886561ddba34dd852000ad8",
|
1152 |
+
"livemode": false,
|
1153 |
+
"created_at": 1485198877,
|
1154 |
+
"currency": "MXN",
|
1155 |
+
"description": null,
|
1156 |
+
"reference_id": null,
|
1157 |
+
"failure_code": null,
|
1158 |
+
"failure_message": null,
|
1159 |
+
"monthly_installments": null,
|
1160 |
+
"device_fingerprint": null,
|
1161 |
+
"payment_method": {
|
1162 |
+
"barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/sandbox_reference.png",
|
1163 |
+
"service_name": "OxxoPay",
|
1164 |
+
"object": "cash_payment",
|
1165 |
+
"type": "oxxo",
|
1166 |
+
"expires_at": 1487808000,
|
1167 |
+
"store_name": "OXXO",
|
1168 |
+
"reference": "93345678901234"
|
1169 |
+
},
|
1170 |
+
"object": "charge",
|
1171 |
+
"status": "pending_payment",
|
1172 |
+
"amount": 20000,
|
1173 |
+
"paid_at": null,
|
1174 |
+
"fee": 812,
|
1175 |
+
"customer_id": "",
|
1176 |
+
"order_id": "ord_2fth51uaEsBnzUthh",
|
1177 |
+
"refunds": {
|
1178 |
+
"starting_after": null,
|
1179 |
+
"ending_before": null,
|
1180 |
+
"object": "list",
|
1181 |
+
"has_more": false,
|
1182 |
+
"total": 0,
|
1183 |
+
"data": []
|
1184 |
+
}
|
1185 |
+
}
|
1186 |
+
]
|
1187 |
+
},
|
1188 |
+
"returns": {
|
1189 |
+
"starting_after": null,
|
1190 |
+
"ending_before": null,
|
1191 |
+
"object": "list",
|
1192 |
+
"has_more": false,
|
1193 |
+
"total": 0,
|
1194 |
+
"data": []
|
1195 |
+
}
|
1196 |
+
},
|
1197 |
+
{
|
1198 |
+
"livemode": false,
|
1199 |
+
"amount": 20000,
|
1200 |
+
"status": "fulfilled",
|
1201 |
+
"customer_id": null,
|
1202 |
+
"currency": "MXN",
|
1203 |
+
"capture": true,
|
1204 |
+
"last_payment_info": {
|
1205 |
+
"charge_id": "5886561bedbb6ede090004cf",
|
1206 |
+
"payment_method": "OxxoPayment",
|
1207 |
+
"payment_brand": null,
|
1208 |
+
"status": "pending_payment"
|
1209 |
+
},
|
1210 |
+
"customer_info": {
|
1211 |
+
"email": "hola@hola.com",
|
1212 |
+
"phone": "+5213353319758",
|
1213 |
+
"name": "John Constantine",
|
1214 |
+
"corporate": null,
|
1215 |
+
"account_age": null,
|
1216 |
+
"paid_transactions": null,
|
1217 |
+
"first_paid_at": 0
|
1218 |
+
},
|
1219 |
+
"shipping_contact": null,
|
1220 |
+
"fiscal_entity": null,
|
1221 |
+
"object": "order",
|
1222 |
+
"id": "ord_2fth51Akifd9NDEDA",
|
1223 |
+
"metadata": {
|
1224 |
+
"test": "extra info"
|
1225 |
+
},
|
1226 |
+
"created_at": 1485198875,
|
1227 |
+
"updated_at": 1485198907,
|
1228 |
+
"line_items": {
|
1229 |
+
"starting_after": null,
|
1230 |
+
"ending_before": null,
|
1231 |
+
"object": "list",
|
1232 |
+
"has_more": false,
|
1233 |
+
"total": 1,
|
1234 |
+
"data": [
|
1235 |
+
{
|
1236 |
+
"name": "Box of Cohiba S1s",
|
1237 |
+
"description": "Imported From Mex.",
|
1238 |
+
"unit_price": 20000,
|
1239 |
+
"quantity": 1,
|
1240 |
+
"sku": "cohb_s1",
|
1241 |
+
"shippable": null,
|
1242 |
+
"tags": [
|
1243 |
+
"food",
|
1244 |
+
"mexican food"
|
1245 |
+
],
|
1246 |
+
"brand": null,
|
1247 |
+
"type": "physical",
|
1248 |
+
"object": "line_item",
|
1249 |
+
"id": "line_item_2fth51Akifd9NDED8",
|
1250 |
+
"parent_id": "ord_2fth51Akifd9NDEDA",
|
1251 |
+
"metadata": {}
|
1252 |
+
}
|
1253 |
+
]
|
1254 |
+
},
|
1255 |
+
"shipping_lines": {
|
1256 |
+
"starting_after": null,
|
1257 |
+
"ending_before": null,
|
1258 |
+
"object": "list",
|
1259 |
+
"has_more": false,
|
1260 |
+
"total": 0,
|
1261 |
+
"data": []
|
1262 |
+
},
|
1263 |
+
"tax_lines": {
|
1264 |
+
"starting_after": null,
|
1265 |
+
"ending_before": null,
|
1266 |
+
"object": "list",
|
1267 |
+
"has_more": false,
|
1268 |
+
"total": 0,
|
1269 |
+
"data": []
|
1270 |
+
},
|
1271 |
+
"discount_lines": {
|
1272 |
+
"starting_after": null,
|
1273 |
+
"ending_before": null,
|
1274 |
+
"object": "list",
|
1275 |
+
"has_more": false,
|
1276 |
+
"total": 0,
|
1277 |
+
"data": []
|
1278 |
+
},
|
1279 |
+
"charges": {
|
1280 |
+
"starting_after": null,
|
1281 |
+
"ending_before": null,
|
1282 |
+
"object": "list",
|
1283 |
+
"has_more": false,
|
1284 |
+
"total": 1,
|
1285 |
+
"data": [
|
1286 |
+
{
|
1287 |
+
"id": "5886561bedbb6ede090004cf",
|
1288 |
+
"livemode": false,
|
1289 |
+
"created_at": 1485198875,
|
1290 |
+
"currency": "MXN",
|
1291 |
+
"description": null,
|
1292 |
+
"reference_id": null,
|
1293 |
+
"failure_code": null,
|
1294 |
+
"failure_message": null,
|
1295 |
+
"monthly_installments": null,
|
1296 |
+
"device_fingerprint": null,
|
1297 |
+
"payment_method": {
|
1298 |
+
"barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/sandbox_reference.png",
|
1299 |
+
"service_name": "OxxoPay",
|
1300 |
+
"object": "cash_payment",
|
1301 |
+
"type": "oxxo",
|
1302 |
+
"expires_at": 1485234876,
|
1303 |
+
"store_name": "OXXO",
|
1304 |
+
"reference": "93345678901234"
|
1305 |
+
},
|
1306 |
+
"object": "charge",
|
1307 |
+
"status": "paid",
|
1308 |
+
"amount": 20000,
|
1309 |
+
"paid_at": 1485198907,
|
1310 |
+
"fee": 812,
|
1311 |
+
"customer_id": "",
|
1312 |
+
"order_id": "ord_2fth51Akifd9NDEDA",
|
1313 |
+
"refunds": {
|
1314 |
+
"starting_after": null,
|
1315 |
+
"ending_before": null,
|
1316 |
+
"object": "list",
|
1317 |
+
"has_more": false,
|
1318 |
+
"total": 0,
|
1319 |
+
"data": []
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
]
|
1323 |
+
},
|
1324 |
+
"returns": {
|
1325 |
+
"starting_after": null,
|
1326 |
+
"ending_before": null,
|
1327 |
+
"object": "list",
|
1328 |
+
"has_more": false,
|
1329 |
+
"total": 0,
|
1330 |
+
"data": []
|
1331 |
+
}
|
1332 |
+
},
|
1333 |
+
{
|
1334 |
+
"livemode": false,
|
1335 |
+
"amount": 20000,
|
1336 |
+
"status": "created",
|
1337 |
+
"customer_id": null,
|
1338 |
+
"currency": "MXN",
|
1339 |
+
"capture": true,
|
1340 |
+
"last_payment_info": null,
|
1341 |
+
"customer_info": null,
|
1342 |
+
"shipping_contact": null,
|
1343 |
+
"fiscal_entity": null,
|
1344 |
+
"object": "order",
|
1345 |
+
"id": "ord_2fth4yh7gGVrC7s6p",
|
1346 |
+
"metadata": {
|
1347 |
+
"test": "extra info"
|
1348 |
+
},
|
1349 |
+
"created_at": 1485198873,
|
1350 |
+
"updated_at": 1485198873,
|
1351 |
+
"line_items": {
|
1352 |
+
"starting_after": null,
|
1353 |
+
"ending_before": null,
|
1354 |
+
"object": "list",
|
1355 |
+
"has_more": false,
|
1356 |
+
"total": 1,
|
1357 |
+
"data": [
|
1358 |
+
{
|
1359 |
+
"name": "Box of Cohiba S1s",
|
1360 |
+
"description": "Imported From Mex.",
|
1361 |
+
"unit_price": 20000,
|
1362 |
+
"quantity": 1,
|
1363 |
+
"sku": "cohb_s1",
|
1364 |
+
"shippable": null,
|
1365 |
+
"tags": [
|
1366 |
+
"food",
|
1367 |
+
"mexican food"
|
1368 |
+
],
|
1369 |
+
"brand": null,
|
1370 |
+
"type": "physical",
|
1371 |
+
"object": "line_item",
|
1372 |
+
"id": "line_item_2fth4yh7gGVrC7s6o",
|
1373 |
+
"parent_id": "ord_2fth4yh7gGVrC7s6p",
|
1374 |
+
"metadata": {}
|
1375 |
+
}
|
1376 |
+
]
|
1377 |
+
},
|
1378 |
+
"shipping_lines": {
|
1379 |
+
"starting_after": null,
|
1380 |
+
"ending_before": null,
|
1381 |
+
"object": "list",
|
1382 |
+
"has_more": false,
|
1383 |
+
"total": 0,
|
1384 |
+
"data": []
|
1385 |
+
},
|
1386 |
+
"tax_lines": {
|
1387 |
+
"starting_after": null,
|
1388 |
+
"ending_before": null,
|
1389 |
+
"object": "list",
|
1390 |
+
"has_more": false,
|
1391 |
+
"total": 0,
|
1392 |
+
"data": []
|
1393 |
+
},
|
1394 |
+
"discount_lines": {
|
1395 |
+
"starting_after": null,
|
1396 |
+
"ending_before": null,
|
1397 |
+
"object": "list",
|
1398 |
+
"has_more": false,
|
1399 |
+
"total": 0,
|
1400 |
+
"data": []
|
1401 |
+
},
|
1402 |
+
"charges": {
|
1403 |
+
"starting_after": null,
|
1404 |
+
"ending_before": null,
|
1405 |
+
"object": "list",
|
1406 |
+
"has_more": false,
|
1407 |
+
"total": 0,
|
1408 |
+
"data": []
|
1409 |
+
},
|
1410 |
+
"returns": {
|
1411 |
+
"starting_after": null,
|
1412 |
+
"ending_before": null,
|
1413 |
+
"object": "list",
|
1414 |
+
"has_more": false,
|
1415 |
+
"total": 0,
|
1416 |
+
"data": []
|
1417 |
+
}
|
1418 |
+
},
|
1419 |
+
{
|
1420 |
+
"livemode": false,
|
1421 |
+
"amount": 2000,
|
1422 |
+
"status": "fulfilled",
|
1423 |
+
"customer_id": null,
|
1424 |
+
"currency": "MXN",
|
1425 |
+
"capture": true,
|
1426 |
+
"last_payment_info": {
|
1427 |
+
"charge_id": "588655e8c835f06c7b000a13",
|
1428 |
+
"payment_method": "CreditCardPayment",
|
1429 |
+
"payment_brand": "VISA",
|
1430 |
+
"status": "paid"
|
1431 |
+
},
|
1432 |
+
"customer_info": {
|
1433 |
+
"email": "logan@x-men.org",
|
1434 |
+
"phone": "4033420642",
|
1435 |
+
"name": "Arnulfo Quimare",
|
1436 |
+
"corporate": false,
|
1437 |
+
"account_age": null,
|
1438 |
+
"paid_transactions": null,
|
1439 |
+
"first_paid_at": 0
|
1440 |
+
},
|
1441 |
+
"shipping_contact": null,
|
1442 |
+
"fiscal_entity": null,
|
1443 |
+
"object": "order",
|
1444 |
+
"id": "ord_2fth4kLBsbdqQ2UBT",
|
1445 |
+
"metadata": {},
|
1446 |
+
"created_at": 1485198824,
|
1447 |
+
"updated_at": 1485198850,
|
1448 |
+
"line_items": {
|
1449 |
+
"starting_after": null,
|
1450 |
+
"ending_before": null,
|
1451 |
+
"object": "list",
|
1452 |
+
"has_more": false,
|
1453 |
+
"total": 1,
|
1454 |
+
"data": [
|
1455 |
+
{
|
1456 |
+
"name": "Box of Cohiba S1s",
|
1457 |
+
"description": "Imported From Mex.",
|
1458 |
+
"unit_price": 20000,
|
1459 |
+
"quantity": 1,
|
1460 |
+
"sku": "cohb_s1",
|
1461 |
+
"shippable": null,
|
1462 |
+
"tags": null,
|
1463 |
+
"brand": null,
|
1464 |
+
"type": "food",
|
1465 |
+
"object": "line_item",
|
1466 |
+
"id": "line_item_2fth4MQhACmJEk5UK",
|
1467 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UBT",
|
1468 |
+
"metadata": {}
|
1469 |
+
}
|
1470 |
+
]
|
1471 |
+
},
|
1472 |
+
"shipping_lines": {
|
1473 |
+
"starting_after": null,
|
1474 |
+
"ending_before": null,
|
1475 |
+
"object": "list",
|
1476 |
+
"has_more": false,
|
1477 |
+
"total": 0,
|
1478 |
+
"data": []
|
1479 |
+
},
|
1480 |
+
"tax_lines": {
|
1481 |
+
"starting_after": null,
|
1482 |
+
"ending_before": null,
|
1483 |
+
"object": "list",
|
1484 |
+
"has_more": false,
|
1485 |
+
"total": 0,
|
1486 |
+
"data": []
|
1487 |
+
},
|
1488 |
+
"discount_lines": {
|
1489 |
+
"starting_after": null,
|
1490 |
+
"ending_before": null,
|
1491 |
+
"object": "list",
|
1492 |
+
"has_more": false,
|
1493 |
+
"total": 0,
|
1494 |
+
"data": []
|
1495 |
+
},
|
1496 |
+
"charges": {
|
1497 |
+
"starting_after": null,
|
1498 |
+
"ending_before": null,
|
1499 |
+
"object": "list",
|
1500 |
+
"has_more": false,
|
1501 |
+
"total": 1,
|
1502 |
+
"data": [
|
1503 |
+
{
|
1504 |
+
"id": "588655e8c835f06c7b000a13",
|
1505 |
+
"livemode": false,
|
1506 |
+
"created_at": 1485198824,
|
1507 |
+
"currency": "MXN",
|
1508 |
+
"description": null,
|
1509 |
+
"reference_id": null,
|
1510 |
+
"failure_code": null,
|
1511 |
+
"failure_message": null,
|
1512 |
+
"monthly_installments": null,
|
1513 |
+
"device_fingerprint": "123456789abcdefghijkmnopqrstuv",
|
1514 |
+
"payment_method": {
|
1515 |
+
"name": "Jorge Lopez",
|
1516 |
+
"exp_month": "12",
|
1517 |
+
"exp_year": "19",
|
1518 |
+
"auth_code": "049748",
|
1519 |
+
"object": "card_payment",
|
1520 |
+
"type": "credit",
|
1521 |
+
"normalized_device_fingerprint": null,
|
1522 |
+
"last4": "4242",
|
1523 |
+
"brand": "visa",
|
1524 |
+
"issuer": "",
|
1525 |
+
"account_type": "",
|
1526 |
+
"country": "US",
|
1527 |
+
"fraud_score": 29,
|
1528 |
+
"fraud_indicators": []
|
1529 |
+
},
|
1530 |
+
"object": "charge",
|
1531 |
+
"status": "paid",
|
1532 |
+
"amount": 2000,
|
1533 |
+
"paid_at": 1485198831,
|
1534 |
+
"fee": 357,
|
1535 |
+
"customer_id": "",
|
1536 |
+
"order_id": "ord_2fth4kLBsbdqQ2UBT",
|
1537 |
+
"refunds": {
|
1538 |
+
"starting_after": null,
|
1539 |
+
"ending_before": null,
|
1540 |
+
"object": "list",
|
1541 |
+
"has_more": false,
|
1542 |
+
"total": 0,
|
1543 |
+
"data": []
|
1544 |
+
}
|
1545 |
+
}
|
1546 |
+
]
|
1547 |
+
},
|
1548 |
+
"returns": {
|
1549 |
+
"starting_after": null,
|
1550 |
+
"ending_before": null,
|
1551 |
+
"object": "list",
|
1552 |
+
"has_more": false,
|
1553 |
+
"total": 0,
|
1554 |
+
"data": []
|
1555 |
+
}
|
1556 |
+
},
|
1557 |
+
{
|
1558 |
+
"livemode": false,
|
1559 |
+
"amount": 2000,
|
1560 |
+
"status": "fulfilled",
|
1561 |
+
"customer_id": null,
|
1562 |
+
"currency": "MXN",
|
1563 |
+
"capture": true,
|
1564 |
+
"last_payment_info": {
|
1565 |
+
"charge_id": "588655d5dba34dd35d000a5d",
|
1566 |
+
"payment_method": "OxxoPayment",
|
1567 |
+
"payment_brand": null,
|
1568 |
+
"status": "paid"
|
1569 |
+
},
|
1570 |
+
"customer_info": {
|
1571 |
+
"email": "logan@x-men.org",
|
1572 |
+
"phone": "403-342-0642",
|
1573 |
+
"name": "Arnulfo Quimare",
|
1574 |
+
"corporate": false,
|
1575 |
+
"account_age": null,
|
1576 |
+
"paid_transactions": null,
|
1577 |
+
"first_paid_at": 0
|
1578 |
+
},
|
1579 |
+
"shipping_contact": null,
|
1580 |
+
"fiscal_entity": null,
|
1581 |
+
"object": "order",
|
1582 |
+
"id": "ord_2fth4kLBsbdqQ2UBQ",
|
1583 |
+
"metadata": {},
|
1584 |
+
"created_at": 1485198805,
|
1585 |
+
"updated_at": 1485198848,
|
1586 |
+
"line_items": {
|
1587 |
+
"starting_after": null,
|
1588 |
+
"ending_before": null,
|
1589 |
+
"object": "list",
|
1590 |
+
"has_more": false,
|
1591 |
+
"total": 1,
|
1592 |
+
"data": [
|
1593 |
+
{
|
1594 |
+
"name": "Box of Cohiba S1s",
|
1595 |
+
"description": "Imported From Mex.",
|
1596 |
+
"unit_price": 20000,
|
1597 |
+
"quantity": 1,
|
1598 |
+
"sku": "cohb_s1",
|
1599 |
+
"shippable": null,
|
1600 |
+
"tags": null,
|
1601 |
+
"brand": null,
|
1602 |
+
"type": "food",
|
1603 |
+
"object": "line_item",
|
1604 |
+
"id": "line_item_2fth47SNjZwo9PGGt",
|
1605 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UBQ",
|
1606 |
+
"metadata": {}
|
1607 |
+
}
|
1608 |
+
]
|
1609 |
+
},
|
1610 |
+
"shipping_lines": {
|
1611 |
+
"starting_after": null,
|
1612 |
+
"ending_before": null,
|
1613 |
+
"object": "list",
|
1614 |
+
"has_more": false,
|
1615 |
+
"total": 0,
|
1616 |
+
"data": []
|
1617 |
+
},
|
1618 |
+
"tax_lines": {
|
1619 |
+
"starting_after": null,
|
1620 |
+
"ending_before": null,
|
1621 |
+
"object": "list",
|
1622 |
+
"has_more": false,
|
1623 |
+
"total": 0,
|
1624 |
+
"data": []
|
1625 |
+
},
|
1626 |
+
"discount_lines": {
|
1627 |
+
"starting_after": null,
|
1628 |
+
"ending_before": null,
|
1629 |
+
"object": "list",
|
1630 |
+
"has_more": false,
|
1631 |
+
"total": 0,
|
1632 |
+
"data": []
|
1633 |
+
},
|
1634 |
+
"charges": {
|
1635 |
+
"starting_after": null,
|
1636 |
+
"ending_before": null,
|
1637 |
+
"object": "list",
|
1638 |
+
"has_more": false,
|
1639 |
+
"total": 1,
|
1640 |
+
"data": [
|
1641 |
+
{
|
1642 |
+
"id": "588655d5dba34dd35d000a5d",
|
1643 |
+
"livemode": false,
|
1644 |
+
"created_at": 1485198805,
|
1645 |
+
"currency": "MXN",
|
1646 |
+
"description": null,
|
1647 |
+
"reference_id": null,
|
1648 |
+
"failure_code": null,
|
1649 |
+
"failure_message": null,
|
1650 |
+
"monthly_installments": null,
|
1651 |
+
"device_fingerprint": null,
|
1652 |
+
"payment_method": {
|
1653 |
+
"barcode_url": "https://s3.amazonaws.com/cash_payment_barcodes/sandbox_reference.png",
|
1654 |
+
"service_name": "OxxoPay",
|
1655 |
+
"object": "cash_payment",
|
1656 |
+
"type": "oxxo",
|
1657 |
+
"expires_at": 1487808000,
|
1658 |
+
"store_name": "OXXO",
|
1659 |
+
"reference": "93345678901234"
|
1660 |
+
},
|
1661 |
+
"object": "charge",
|
1662 |
+
"status": "paid",
|
1663 |
+
"amount": 2000,
|
1664 |
+
"paid_at": 1485198838,
|
1665 |
+
"fee": 81,
|
1666 |
+
"customer_id": "",
|
1667 |
+
"order_id": "ord_2fth4kLBsbdqQ2UBQ",
|
1668 |
+
"refunds": {
|
1669 |
+
"starting_after": null,
|
1670 |
+
"ending_before": null,
|
1671 |
+
"object": "list",
|
1672 |
+
"has_more": false,
|
1673 |
+
"total": 0,
|
1674 |
+
"data": []
|
1675 |
+
}
|
1676 |
+
}
|
1677 |
+
]
|
1678 |
+
},
|
1679 |
+
"returns": {
|
1680 |
+
"starting_after": null,
|
1681 |
+
"ending_before": null,
|
1682 |
+
"object": "list",
|
1683 |
+
"has_more": false,
|
1684 |
+
"total": 0,
|
1685 |
+
"data": []
|
1686 |
+
}
|
1687 |
+
},
|
1688 |
+
{
|
1689 |
+
"livemode": false,
|
1690 |
+
"amount": 2000,
|
1691 |
+
"status": "fulfilled",
|
1692 |
+
"customer_id": null,
|
1693 |
+
"currency": "MXN",
|
1694 |
+
"capture": true,
|
1695 |
+
"last_payment_info": {
|
1696 |
+
"charge_id": "588655cedba34dd852000aa9",
|
1697 |
+
"payment_method": "SpeiPayment",
|
1698 |
+
"payment_brand": null,
|
1699 |
+
"status": "paid"
|
1700 |
+
},
|
1701 |
+
"customer_info": {
|
1702 |
+
"email": "logan@x-men.org",
|
1703 |
+
"phone": "403-342-0642",
|
1704 |
+
"name": "Arnulfo Quimare",
|
1705 |
+
"corporate": false,
|
1706 |
+
"account_age": null,
|
1707 |
+
"paid_transactions": null,
|
1708 |
+
"first_paid_at": 0
|
1709 |
+
},
|
1710 |
+
"shipping_contact": null,
|
1711 |
+
"fiscal_entity": null,
|
1712 |
+
"object": "order",
|
1713 |
+
"id": "ord_2fth4kLBsbdqQ2UB9",
|
1714 |
+
"metadata": {},
|
1715 |
+
"created_at": 1485198798,
|
1716 |
+
"updated_at": 1485198847,
|
1717 |
+
"line_items": {
|
1718 |
+
"starting_after": null,
|
1719 |
+
"ending_before": null,
|
1720 |
+
"object": "list",
|
1721 |
+
"has_more": false,
|
1722 |
+
"total": 1,
|
1723 |
+
"data": [
|
1724 |
+
{
|
1725 |
+
"name": "Box of Cohiba S1s",
|
1726 |
+
"description": "Imported From Mex.",
|
1727 |
+
"unit_price": 20000,
|
1728 |
+
"quantity": 1,
|
1729 |
+
"sku": "cohb_s1",
|
1730 |
+
"shippable": null,
|
1731 |
+
"tags": null,
|
1732 |
+
"brand": null,
|
1733 |
+
"type": "food",
|
1734 |
+
"object": "line_item",
|
1735 |
+
"id": "line_item_2fth42Ge6B1Fcbh9J",
|
1736 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UB9",
|
1737 |
+
"metadata": {}
|
1738 |
+
}
|
1739 |
+
]
|
1740 |
+
},
|
1741 |
+
"shipping_lines": {
|
1742 |
+
"starting_after": null,
|
1743 |
+
"ending_before": null,
|
1744 |
+
"object": "list",
|
1745 |
+
"has_more": false,
|
1746 |
+
"total": 0,
|
1747 |
+
"data": []
|
1748 |
+
},
|
1749 |
+
"tax_lines": {
|
1750 |
+
"starting_after": null,
|
1751 |
+
"ending_before": null,
|
1752 |
+
"object": "list",
|
1753 |
+
"has_more": false,
|
1754 |
+
"total": 0,
|
1755 |
+
"data": []
|
1756 |
+
},
|
1757 |
+
"discount_lines": {
|
1758 |
+
"starting_after": null,
|
1759 |
+
"ending_before": null,
|
1760 |
+
"object": "list",
|
1761 |
+
"has_more": false,
|
1762 |
+
"total": 0,
|
1763 |
+
"data": []
|
1764 |
+
},
|
1765 |
+
"charges": {
|
1766 |
+
"starting_after": null,
|
1767 |
+
"ending_before": null,
|
1768 |
+
"object": "list",
|
1769 |
+
"has_more": false,
|
1770 |
+
"total": 1,
|
1771 |
+
"data": [
|
1772 |
+
{
|
1773 |
+
"id": "588655cedba34dd852000aa9",
|
1774 |
+
"livemode": false,
|
1775 |
+
"created_at": 1485198798,
|
1776 |
+
"currency": "MXN",
|
1777 |
+
"description": null,
|
1778 |
+
"reference_id": null,
|
1779 |
+
"failure_code": null,
|
1780 |
+
"failure_message": null,
|
1781 |
+
"monthly_installments": null,
|
1782 |
+
"device_fingerprint": null,
|
1783 |
+
"payment_method": {
|
1784 |
+
"clabe": "646180111812345678",
|
1785 |
+
"bank": "STP",
|
1786 |
+
"issuing_account_holder_name": null,
|
1787 |
+
"issuing_account_tax_id": null,
|
1788 |
+
"issuing_account_bank": null,
|
1789 |
+
"issuing_account_number": null,
|
1790 |
+
"receiving_account_holder_name": null,
|
1791 |
+
"receiving_account_tax_id": null,
|
1792 |
+
"receiving_account_number": "646180111812345678",
|
1793 |
+
"receiving_account_bank": "STP",
|
1794 |
+
"reference_number": null,
|
1795 |
+
"description": null,
|
1796 |
+
"tracking_code": null,
|
1797 |
+
"executed_at": null,
|
1798 |
+
"object": "bank_transfer_payment",
|
1799 |
+
"type": "spei",
|
1800 |
+
"expires_at": 1492974798
|
1801 |
+
},
|
1802 |
+
"object": "charge",
|
1803 |
+
"status": "paid",
|
1804 |
+
"amount": 2000,
|
1805 |
+
"paid_at": 1485198828,
|
1806 |
+
"fee": 928,
|
1807 |
+
"customer_id": "",
|
1808 |
+
"order_id": "ord_2fth4kLBsbdqQ2UB9",
|
1809 |
+
"refunds": {
|
1810 |
+
"starting_after": null,
|
1811 |
+
"ending_before": null,
|
1812 |
+
"object": "list",
|
1813 |
+
"has_more": false,
|
1814 |
+
"total": 0,
|
1815 |
+
"data": []
|
1816 |
+
}
|
1817 |
+
}
|
1818 |
+
]
|
1819 |
+
},
|
1820 |
+
"returns": {
|
1821 |
+
"starting_after": null,
|
1822 |
+
"ending_before": null,
|
1823 |
+
"object": "list",
|
1824 |
+
"has_more": false,
|
1825 |
+
"total": 0,
|
1826 |
+
"data": []
|
1827 |
+
}
|
1828 |
+
},
|
1829 |
+
{
|
1830 |
+
"livemode": false,
|
1831 |
+
"amount": 2000,
|
1832 |
+
"status": "fulfilled",
|
1833 |
+
"customer_id": null,
|
1834 |
+
"currency": "MXN",
|
1835 |
+
"capture": true,
|
1836 |
+
"last_payment_info": {
|
1837 |
+
"charge_id": "588655e1dba34dd35d000a6f",
|
1838 |
+
"payment_method": "CreditCardPayment",
|
1839 |
+
"payment_brand": "VISA",
|
1840 |
+
"status": "paid"
|
1841 |
+
},
|
1842 |
+
"customer_info": {
|
1843 |
+
"email": "logan@x-men.org",
|
1844 |
+
"phone": "4033420642",
|
1845 |
+
"name": "Arnulfo Quimare",
|
1846 |
+
"corporate": false,
|
1847 |
+
"account_age": null,
|
1848 |
+
"paid_transactions": null,
|
1849 |
+
"first_paid_at": 0
|
1850 |
+
},
|
1851 |
+
"shipping_contact": null,
|
1852 |
+
"fiscal_entity": null,
|
1853 |
+
"object": "order",
|
1854 |
+
"id": "ord_2fth4kLBsbdqQ2UAx",
|
1855 |
+
"metadata": {},
|
1856 |
+
"created_at": 1485198817,
|
1857 |
+
"updated_at": 1485198849,
|
1858 |
+
"line_items": {
|
1859 |
+
"starting_after": null,
|
1860 |
+
"ending_before": null,
|
1861 |
+
"object": "list",
|
1862 |
+
"has_more": false,
|
1863 |
+
"total": 1,
|
1864 |
+
"data": [
|
1865 |
+
{
|
1866 |
+
"name": "Box of Cohiba S1s",
|
1867 |
+
"description": "Imported From Mex.",
|
1868 |
+
"unit_price": 20000,
|
1869 |
+
"quantity": 1,
|
1870 |
+
"sku": "cohb_s1",
|
1871 |
+
"shippable": null,
|
1872 |
+
"tags": null,
|
1873 |
+
"brand": null,
|
1874 |
+
"type": "food",
|
1875 |
+
"object": "line_item",
|
1876 |
+
"id": "line_item_2fth4GJCyxhaedEA2",
|
1877 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UAx",
|
1878 |
+
"metadata": {}
|
1879 |
+
}
|
1880 |
+
]
|
1881 |
+
},
|
1882 |
+
"shipping_lines": {
|
1883 |
+
"starting_after": null,
|
1884 |
+
"ending_before": null,
|
1885 |
+
"object": "list",
|
1886 |
+
"has_more": false,
|
1887 |
+
"total": 0,
|
1888 |
+
"data": []
|
1889 |
+
},
|
1890 |
+
"tax_lines": {
|
1891 |
+
"starting_after": null,
|
1892 |
+
"ending_before": null,
|
1893 |
+
"object": "list",
|
1894 |
+
"has_more": false,
|
1895 |
+
"total": 0,
|
1896 |
+
"data": []
|
1897 |
+
},
|
1898 |
+
"discount_lines": {
|
1899 |
+
"starting_after": null,
|
1900 |
+
"ending_before": null,
|
1901 |
+
"object": "list",
|
1902 |
+
"has_more": false,
|
1903 |
+
"total": 0,
|
1904 |
+
"data": []
|
1905 |
+
},
|
1906 |
+
"charges": {
|
1907 |
+
"starting_after": null,
|
1908 |
+
"ending_before": null,
|
1909 |
+
"object": "list",
|
1910 |
+
"has_more": false,
|
1911 |
+
"total": 1,
|
1912 |
+
"data": [
|
1913 |
+
{
|
1914 |
+
"id": "588655e1dba34dd35d000a6f",
|
1915 |
+
"livemode": false,
|
1916 |
+
"created_at": 1485198817,
|
1917 |
+
"currency": "MXN",
|
1918 |
+
"description": null,
|
1919 |
+
"reference_id": null,
|
1920 |
+
"failure_code": null,
|
1921 |
+
"failure_message": null,
|
1922 |
+
"monthly_installments": null,
|
1923 |
+
"device_fingerprint": "123456789abcdefghijkmnopqrstuv",
|
1924 |
+
"payment_method": {
|
1925 |
+
"name": "Jorge Lopez",
|
1926 |
+
"exp_month": "12",
|
1927 |
+
"exp_year": "19",
|
1928 |
+
"auth_code": "324597",
|
1929 |
+
"object": "card_payment",
|
1930 |
+
"type": "credit",
|
1931 |
+
"normalized_device_fingerprint": null,
|
1932 |
+
"last4": "4242",
|
1933 |
+
"brand": "visa",
|
1934 |
+
"issuer": "",
|
1935 |
+
"account_type": "",
|
1936 |
+
"country": "US",
|
1937 |
+
"fraud_score": 29,
|
1938 |
+
"fraud_indicators": []
|
1939 |
+
},
|
1940 |
+
"object": "charge",
|
1941 |
+
"status": "paid",
|
1942 |
+
"amount": 2000,
|
1943 |
+
"paid_at": 1485198823,
|
1944 |
+
"fee": 357,
|
1945 |
+
"customer_id": "",
|
1946 |
+
"order_id": "ord_2fth4kLBsbdqQ2UAx",
|
1947 |
+
"refunds": {
|
1948 |
+
"starting_after": null,
|
1949 |
+
"ending_before": null,
|
1950 |
+
"object": "list",
|
1951 |
+
"has_more": false,
|
1952 |
+
"total": 0,
|
1953 |
+
"data": []
|
1954 |
+
}
|
1955 |
+
}
|
1956 |
+
]
|
1957 |
+
},
|
1958 |
+
"returns": {
|
1959 |
+
"starting_after": null,
|
1960 |
+
"ending_before": null,
|
1961 |
+
"object": "list",
|
1962 |
+
"has_more": false,
|
1963 |
+
"total": 0,
|
1964 |
+
"data": []
|
1965 |
+
}
|
1966 |
+
},
|
1967 |
+
{
|
1968 |
+
"livemode": false,
|
1969 |
+
"amount": 2000,
|
1970 |
+
"status": "returned",
|
1971 |
+
"customer_id": null,
|
1972 |
+
"currency": "MXN",
|
1973 |
+
"capture": true,
|
1974 |
+
"last_payment_info": {
|
1975 |
+
"charge_id": "588655d9c835f0fde2000aa1",
|
1976 |
+
"payment_method": "CreditCardPayment",
|
1977 |
+
"payment_brand": "VISA",
|
1978 |
+
"status": "refunded"
|
1979 |
+
},
|
1980 |
+
"customer_info": {
|
1981 |
+
"email": "logan@x-men.org",
|
1982 |
+
"phone": "4033420642",
|
1983 |
+
"name": "Arnulfo Quimare",
|
1984 |
+
"corporate": false,
|
1985 |
+
"account_age": null,
|
1986 |
+
"paid_transactions": null,
|
1987 |
+
"first_paid_at": 0
|
1988 |
+
},
|
1989 |
+
"shipping_contact": null,
|
1990 |
+
"fiscal_entity": null,
|
1991 |
+
"object": "order",
|
1992 |
+
"id": "ord_2fth4kLBsbdqQ2UAg",
|
1993 |
+
"metadata": {},
|
1994 |
+
"created_at": 1485198809,
|
1995 |
+
"updated_at": 1485198848,
|
1996 |
+
"line_items": {
|
1997 |
+
"starting_after": null,
|
1998 |
+
"ending_before": null,
|
1999 |
+
"object": "list",
|
2000 |
+
"has_more": false,
|
2001 |
+
"total": 1,
|
2002 |
+
"data": [
|
2003 |
+
{
|
2004 |
+
"name": "Box of Cohiba S1s",
|
2005 |
+
"description": "Imported From Mex.",
|
2006 |
+
"unit_price": 20000,
|
2007 |
+
"quantity": 1,
|
2008 |
+
"sku": "cohb_s1",
|
2009 |
+
"shippable": null,
|
2010 |
+
"tags": null,
|
2011 |
+
"brand": null,
|
2012 |
+
"type": "food",
|
2013 |
+
"object": "line_item",
|
2014 |
+
"id": "line_item_2fth4ALQMDKZz74XN",
|
2015 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UAg",
|
2016 |
+
"metadata": {}
|
2017 |
+
}
|
2018 |
+
]
|
2019 |
+
},
|
2020 |
+
"shipping_lines": {
|
2021 |
+
"starting_after": null,
|
2022 |
+
"ending_before": null,
|
2023 |
+
"object": "list",
|
2024 |
+
"has_more": false,
|
2025 |
+
"total": 0,
|
2026 |
+
"data": []
|
2027 |
+
},
|
2028 |
+
"tax_lines": {
|
2029 |
+
"starting_after": null,
|
2030 |
+
"ending_before": null,
|
2031 |
+
"object": "list",
|
2032 |
+
"has_more": false,
|
2033 |
+
"total": 0,
|
2034 |
+
"data": []
|
2035 |
+
},
|
2036 |
+
"discount_lines": {
|
2037 |
+
"starting_after": null,
|
2038 |
+
"ending_before": null,
|
2039 |
+
"object": "list",
|
2040 |
+
"has_more": false,
|
2041 |
+
"total": 0,
|
2042 |
+
"data": []
|
2043 |
+
},
|
2044 |
+
"charges": {
|
2045 |
+
"starting_after": null,
|
2046 |
+
"ending_before": null,
|
2047 |
+
"object": "list",
|
2048 |
+
"has_more": false,
|
2049 |
+
"total": 1,
|
2050 |
+
"data": [
|
2051 |
+
{
|
2052 |
+
"id": "588655d9c835f0fde2000aa1",
|
2053 |
+
"livemode": false,
|
2054 |
+
"created_at": 1485198809,
|
2055 |
+
"currency": "MXN",
|
2056 |
+
"description": null,
|
2057 |
+
"reference_id": null,
|
2058 |
+
"failure_code": null,
|
2059 |
+
"failure_message": null,
|
2060 |
+
"monthly_installments": null,
|
2061 |
+
"device_fingerprint": "123456789abcdefghijkmnopqrstuv",
|
2062 |
+
"payment_method": {
|
2063 |
+
"name": "Jorge Lopez",
|
2064 |
+
"exp_month": "12",
|
2065 |
+
"exp_year": "19",
|
2066 |
+
"auth_code": "182788",
|
2067 |
+
"object": "card_payment",
|
2068 |
+
"type": "credit",
|
2069 |
+
"normalized_device_fingerprint": null,
|
2070 |
+
"last4": "4242",
|
2071 |
+
"brand": "visa",
|
2072 |
+
"issuer": "",
|
2073 |
+
"account_type": "",
|
2074 |
+
"country": "US",
|
2075 |
+
"fraud_score": 29,
|
2076 |
+
"fraud_indicators": []
|
2077 |
+
},
|
2078 |
+
"object": "charge",
|
2079 |
+
"status": "refunded",
|
2080 |
+
"amount": 2000,
|
2081 |
+
"paid_at": 1485198815,
|
2082 |
+
"fee": 357,
|
2083 |
+
"customer_id": "",
|
2084 |
+
"order_id": "ord_2fth4kLBsbdqQ2UAg",
|
2085 |
+
"refunds": {
|
2086 |
+
"starting_after": null,
|
2087 |
+
"ending_before": null,
|
2088 |
+
"object": "list",
|
2089 |
+
"has_more": false,
|
2090 |
+
"total": 1,
|
2091 |
+
"data": [
|
2092 |
+
{
|
2093 |
+
"object": "refund",
|
2094 |
+
"amount": -2000,
|
2095 |
+
"auth_code": "182788",
|
2096 |
+
"id": "588655e1c835f0fde2000aaf",
|
2097 |
+
"created_at": 1485198817
|
2098 |
+
}
|
2099 |
+
]
|
2100 |
+
}
|
2101 |
+
}
|
2102 |
+
]
|
2103 |
+
},
|
2104 |
+
"returns": {
|
2105 |
+
"starting_after": null,
|
2106 |
+
"ending_before": null,
|
2107 |
+
"object": "list",
|
2108 |
+
"has_more": false,
|
2109 |
+
"total": 1,
|
2110 |
+
"data": [
|
2111 |
+
{
|
2112 |
+
"livemode": false,
|
2113 |
+
"amount": -2000,
|
2114 |
+
"currency": "MXN",
|
2115 |
+
"charge_id": "588655d9c835f0fde2000aa1",
|
2116 |
+
"reason": "unknown",
|
2117 |
+
"id": "ord_ret_2fth4kLBsbdqQ2UAj",
|
2118 |
+
"object": "return",
|
2119 |
+
"created_at": 1485198855,
|
2120 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UAg"
|
2121 |
+
}
|
2122 |
+
]
|
2123 |
+
}
|
2124 |
+
},
|
2125 |
+
{
|
2126 |
+
"livemode": false,
|
2127 |
+
"amount": 2000,
|
2128 |
+
"status": "fulfilled",
|
2129 |
+
"customer_id": null,
|
2130 |
+
"currency": "MXN",
|
2131 |
+
"capture": true,
|
2132 |
+
"last_payment_info": {
|
2133 |
+
"charge_id": "588655cddba34dd35d000a49",
|
2134 |
+
"payment_method": "BanortePayment",
|
2135 |
+
"payment_brand": null,
|
2136 |
+
"status": "paid"
|
2137 |
+
},
|
2138 |
+
"customer_info": {
|
2139 |
+
"email": "logan@x-men.org",
|
2140 |
+
"phone": "403-342-0642",
|
2141 |
+
"name": "Arnulfo Quimare",
|
2142 |
+
"corporate": false,
|
2143 |
+
"account_age": null,
|
2144 |
+
"paid_transactions": null,
|
2145 |
+
"first_paid_at": 0
|
2146 |
+
},
|
2147 |
+
"shipping_contact": null,
|
2148 |
+
"fiscal_entity": null,
|
2149 |
+
"object": "order",
|
2150 |
+
"id": "ord_2fth4kLBsbdqQ2UAa",
|
2151 |
+
"metadata": {},
|
2152 |
+
"created_at": 1485198797,
|
2153 |
+
"updated_at": 1485198846,
|
2154 |
+
"line_items": {
|
2155 |
+
"starting_after": null,
|
2156 |
+
"ending_before": null,
|
2157 |
+
"object": "list",
|
2158 |
+
"has_more": false,
|
2159 |
+
"total": 1,
|
2160 |
+
"data": [
|
2161 |
+
{
|
2162 |
+
"name": "Box of Cohiba S1s",
|
2163 |
+
"description": "Imported From Mex.",
|
2164 |
+
"unit_price": 20000,
|
2165 |
+
"quantity": 1,
|
2166 |
+
"sku": "cohb_s1",
|
2167 |
+
"shippable": null,
|
2168 |
+
"tags": null,
|
2169 |
+
"brand": null,
|
2170 |
+
"type": "food",
|
2171 |
+
"object": "line_item",
|
2172 |
+
"id": "line_item_2fth41XpZySc9DxML",
|
2173 |
+
"parent_id": "ord_2fth4kLBsbdqQ2UAa",
|
2174 |
+
"metadata": {}
|
2175 |
+
}
|
2176 |
+
]
|
2177 |
+
},
|
2178 |
+
"shipping_lines": {
|
2179 |
+
"starting_after": null,
|
2180 |
+
"ending_before": null,
|
2181 |
+
"object": "list",
|
2182 |
+
"has_more": false,
|
2183 |
+
"total": 0,
|
2184 |
+
"data": []
|
2185 |
+
},
|
2186 |
+
"tax_lines": {
|
2187 |
+
"starting_after": null,
|
2188 |
+
"ending_before": null,
|
2189 |
+
"object": "list",
|
2190 |
+
"has_more": false,
|
2191 |
+
"total": 0,
|
2192 |
+
"data": []
|
2193 |
+
},
|
2194 |
+
"discount_lines": {
|
2195 |
+
"starting_after": null,
|
2196 |
+
"ending_before": null,
|
2197 |
+
"object": "list",
|
2198 |
+
"has_more": false,
|
2199 |
+
"total": 0,
|
2200 |
+
"data": []
|
2201 |
+
},
|
2202 |
+
"charges": {
|
2203 |
+
"starting_after": null,
|
2204 |
+
"ending_before": null,
|
2205 |
+
"object": "list",
|
2206 |
+
"has_more": false,
|
2207 |
+
"total": 1,
|
2208 |
+
"data": [
|
2209 |
+
{
|
2210 |
+
"id": "588655cddba34dd35d000a49",
|
2211 |
+
"livemode": false,
|
2212 |
+
"created_at": 1485198797,
|
2213 |
+
"currency": "MXN",
|
2214 |
+
"description": null,
|
2215 |
+
"reference_id": null,
|
2216 |
+
"failure_code": null,
|
2217 |
+
"failure_message": null,
|
2218 |
+
"monthly_installments": null,
|
2219 |
+
"device_fingerprint": null,
|
2220 |
+
"payment_method": {
|
2221 |
+
"service_name": "Conekta",
|
2222 |
+
"service_number": "127589",
|
2223 |
+
"reference": "123456789012345",
|
2224 |
+
"object": "bank_transfer_payment",
|
2225 |
+
"type": "banorte",
|
2226 |
+
"expires_at": 1492974797
|
2227 |
+
},
|
2228 |
+
"object": "charge",
|
2229 |
+
"status": "paid",
|
2230 |
+
"amount": 2000,
|
2231 |
+
"paid_at": 1485198828,
|
2232 |
+
"fee": 1411,
|
2233 |
+
"customer_id": "",
|
2234 |
+
"order_id": "ord_2fth4kLBsbdqQ2UAa",
|
2235 |
+
"refunds": {
|
2236 |
+
"starting_after": null,
|
2237 |
+
"ending_before": null,
|
2238 |
+
"object": "list",
|
2239 |
+
"has_more": false,
|
2240 |
+
"total": 0,
|
2241 |
+
"data": []
|
2242 |
+
}
|
2243 |
+
}
|
2244 |
+
]
|
2245 |
+
},
|
2246 |
+
"returns": {
|
2247 |
+
"starting_after": null,
|
2248 |
+
"ending_before": null,
|
2249 |
+
"object": "list",
|
2250 |
+
"has_more": false,
|
2251 |
+
"total": 0,
|
2252 |
+
"data": []
|
2253 |
+
}
|
2254 |
+
},
|
2255 |
+
{
|
2256 |
+
"livemode": false,
|
2257 |
+
"amount": 2000,
|
2258 |
+
"status": "fulfilled",
|
2259 |
+
"customer_id": null,
|
2260 |
+
"currency": "MXN",
|
2261 |
+
"capture": true,
|
2262 |
+
"last_payment_info": {
|
2263 |
+
"charge_id": "588655cedba34dd35d000a53",
|
2264 |
+
"payment_method": "CreditCardPayment",
|
2265 |
+
"payment_brand": "VISA",
|
2266 |
+
"status": "paid"
|
2267 |
+
},
|
2268 |
+
"customer_info": {
|
2269 |
+
"email": "logan@x-men.org",
|
2270 |
+
"phone": "4033420642",
|
2271 |
+
"name": "Arnulfo Quimare",
|
2272 |
+
"corporate": false,
|
2273 |
+
"account_age": null,
|
2274 |
+
"paid_transactions": null,
|
2275 |
+
"first_paid_at": 0
|
2276 |
+
},
|
2277 |
+
"shipping_contact": null,
|
2278 |
+
"fiscal_entity": null,
|
2279 |
+
"object": "order",
|
2280 |
+
"id": "ord_2fth4jbNMQ5Bmkofq",
|
2281 |
+
"metadata": {},
|
2282 |
+
"created_at": 1485198798,
|
2283 |
+
"updated_at": 1485198847,
|
2284 |
+
"line_items": {
|
2285 |
+
"starting_after": null,
|
2286 |
+
"ending_before": null,
|
2287 |
+
"object": "list",
|
2288 |
+
"has_more": false,
|
2289 |
+
"total": 1,
|
2290 |
+
"data": [
|
2291 |
+
{
|
2292 |
+
"name": "Box of Cohiba S1s",
|
2293 |
+
"description": "Imported From Mex.",
|
2294 |
+
"unit_price": 20000,
|
2295 |
+
"quantity": 1,
|
2296 |
+
"sku": "cohb_s1",
|
2297 |
+
"shippable": null,
|
2298 |
+
"tags": null,
|
2299 |
+
"brand": null,
|
2300 |
+
"type": "food",
|
2301 |
+
"object": "line_item",
|
2302 |
+
"id": "line_item_2fth42Ge6B1FmVcqs",
|
2303 |
+
"parent_id": "ord_2fth4jbNMQ5Bmkofq",
|
2304 |
+
"metadata": {}
|
2305 |
+
}
|
2306 |
+
]
|
2307 |
+
},
|
2308 |
+
"shipping_lines": {
|
2309 |
+
"starting_after": null,
|
2310 |
+
"ending_before": null,
|
2311 |
+
"object": "list",
|
2312 |
+
"has_more": false,
|
2313 |
+
"total": 0,
|
2314 |
+
"data": []
|
2315 |
+
},
|
2316 |
+
"tax_lines": {
|
2317 |
+
"starting_after": null,
|
2318 |
+
"ending_before": null,
|
2319 |
+
"object": "list",
|
2320 |
+
"has_more": false,
|
2321 |
+
"total": 0,
|
2322 |
+
"data": []
|
2323 |
+
},
|
2324 |
+
"discount_lines": {
|
2325 |
+
"starting_after": null,
|
2326 |
+
"ending_before": null,
|
2327 |
+
"object": "list",
|
2328 |
+
"has_more": false,
|
2329 |
+
"total": 0,
|
2330 |
+
"data": []
|
2331 |
+
},
|
2332 |
+
"charges": {
|
2333 |
+
"starting_after": null,
|
2334 |
+
"ending_before": null,
|
2335 |
+
"object": "list",
|
2336 |
+
"has_more": false,
|
2337 |
+
"total": 1,
|
2338 |
+
"data": [
|
2339 |
+
{
|
2340 |
+
"id": "588655cedba34dd35d000a53",
|
2341 |
+
"livemode": false,
|
2342 |
+
"created_at": 1485198798,
|
2343 |
+
"currency": "MXN",
|
2344 |
+
"description": null,
|
2345 |
+
"reference_id": null,
|
2346 |
+
"failure_code": null,
|
2347 |
+
"failure_message": null,
|
2348 |
+
"monthly_installments": null,
|
2349 |
+
"device_fingerprint": "123456789abcdefghijkmnopqrstuv",
|
2350 |
+
"payment_method": {
|
2351 |
+
"name": "Jorge Lopez",
|
2352 |
+
"exp_month": "12",
|
2353 |
+
"exp_year": "19",
|
2354 |
+
"auth_code": "848452",
|
2355 |
+
"object": "card_payment",
|
2356 |
+
"type": "credit",
|
2357 |
+
"normalized_device_fingerprint": null,
|
2358 |
+
"last4": "4242",
|
2359 |
+
"brand": "visa",
|
2360 |
+
"issuer": "",
|
2361 |
+
"account_type": "",
|
2362 |
+
"country": "US",
|
2363 |
+
"fraud_score": 29,
|
2364 |
+
"fraud_indicators": []
|
2365 |
+
},
|
2366 |
+
"object": "charge",
|
2367 |
+
"status": "paid",
|
2368 |
+
"amount": 2000,
|
2369 |
+
"paid_at": 1485198804,
|
2370 |
+
"fee": 357,
|
2371 |
+
"customer_id": "",
|
2372 |
+
"order_id": "ord_2fth4jbNMQ5Bmkofq",
|
2373 |
+
"refunds": {
|
2374 |
+
"starting_after": null,
|
2375 |
+
"ending_before": null,
|
2376 |
+
"object": "list",
|
2377 |
+
"has_more": false,
|
2378 |
+
"total": 0,
|
2379 |
+
"data": []
|
2380 |
+
}
|
2381 |
+
}
|
2382 |
+
]
|
2383 |
+
},
|
2384 |
+
"returns": {
|
2385 |
+
"starting_after": null,
|
2386 |
+
"ending_before": null,
|
2387 |
+
"object": "list",
|
2388 |
+
"has_more": false,
|
2389 |
+
"total": 0,
|
2390 |
+
"data": []
|
2391 |
+
}
|
2392 |
+
}
|
2393 |
+
]
|
2394 |
+
}
|
package.xml
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Conekta_Payment_Extension</name>
|
4 |
-
<version>0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license uri="https://
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension offers all the payment methods supported by Conekta.</summary>
|
@@ -16,12 +16,11 @@ Bank Transfer Payments
|
|
16 |
OXXO Payments
|
17 |
SPEI Payments
|
18 |
When a customer purchases using a conekta payment method, the plugin connects to the Conekta API to process the order and sends a notification regarding the order status. This plugin allows you to add its payment methods to your checkout using Conekta.</description>
|
19 |
-
<notes>*
|
20 |
-
* Enhance webhook logic.</notes>
|
21 |
<authors><author><name>Mauricio Murga</name><user>MauricioMurga</user><email>mauricio@conekta.io</email></author></authors>
|
22 |
-
<date>
|
23 |
-
<time>17:
|
24 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Conekta_Bank.xml" hash="465ffbbce1f9b2ae5117a82065793db4"/><file name="Conekta_Card.xml" hash="0e54ddadeeb68f84eccd4f793779d2f4"/><file name="Conekta_Oxxo.xml" hash="4f0b2ebdd76cd58c816676d50074fa6a"/><file name="Conekta_Spei.xml" hash="9db396a5b3eea128d8004e211139cd67"/><file name="Conekta_Webhook.xml" hash="a20f99746029abc92a3d42aae1d62b52"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Conekta_Bank.csv" hash="b32880305046367a14fae4d322cba623"/><file name="Conekta_Card.csv" hash="f6b1bf916bb112b281ae33dbb570fa5a"/><file name="Conekta_Oxxo.csv" hash="470f448bdd9154fc60775a0469d487c9"/><file name="Conekta_Spei.csv" hash="4c61037151931d2a4fa65002b863b339"/></dir><dir name="es_MX"><file name="Conekta_Bank.csv" hash="9511ce51ac6622d16f102ea01d579e32"/><file name="Conekta_Card.csv" hash="284831712004802818d4812492e4c4a9"/><file name="Conekta_Oxxo.csv" hash="99991ce72602a02f4c49767eb8e7372b"/><file name="Conekta_Spei.csv" hash="86e205c81ca78d01b613e4bd1cb451d3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bank.xml" hash="67e1d8610affc796aaca52ba854fd74f"/><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="bank"><dir name="form"><file name="bank.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="bank.phtml" hash="e781118478f2546c7924af19024a7adb"/></dir></dir><dir name="card"><dir name="form"><file name="card.phtml" hash="b50c67ad211b603f0e45fd705361a4ab"/></dir><dir name="info"><file name="card.phtml" hash="7667a88bf6b048edffc73ccbe1501434"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="c4df033e2de87bd379908b966b795c28"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="bank.xml" hash="67e1d8610affc796aaca52ba854fd74f"/><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="bank"><dir name="form"><file name="bank.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="bank.phtml" hash="e781118478f2546c7924af19024a7adb"/></dir></dir><dir name="card"><dir name="form"><file name="card.phtml" hash="b50c67ad211b603f0e45fd705361a4ab"/></dir><dir name="info"><file name="card.phtml" hash="1f2c48a1e4a3f81d62c24a2b9a6183aa"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="checkout"><file name="success.phtml" hash="6a252cde00cc4117da4a47b30ec9e378"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="c4df033e2de87bd379908b966b795c28"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Conekta"><dir name="Bank"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="3ea1dbfd5e3a757d7359eac096fe2de7"/><file name="Days.php" hash="cd07792e8ed27ec523838a9c2675eaf6"/></dir></dir></dir><dir name="Form"><file name="Bank.php" hash="22618b41a43a559ac18c59ae1d19b908"/></dir><dir name="Info"><file name="Bank.php" hash="7e1d809555dcabb68883a8cc427af303"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c86a3d8a0a6409f98de883fe39c18282"/></dir><dir name="Model"><file name="Bank.php" hash="05eea071a9f3f1c5ea9241e03bae7928"/><file name="Observer.php" hash="11ecd9f7666b6819c3f949d8da67e29f"/></dir><dir name="etc"><file name="config.xml" hash="b9489df1ddf982cb5ae786088390c098"/><file name="system.xml" hash="ace3a23971997be4bd4029e161a0d2bc"/></dir><dir name="sql"><dir name="bank_setup"><file name="mysql4-install-0.1.0.php" hash="db6e167f787814f665ec2078131d8f4b"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="694caabbb883534a63339c5f1ffaf04a"/><file name="mysql4-upgrade-0.2.1-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="96b8c0c80405296bf04fb86c3e5892d4"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/></dir></dir></dir><dir name="Card"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Installments.php" hash="7c828e5dc74f4cd717408bf5de48cf21"/></dir></dir></dir><dir name="Form"><file name="Card.php" hash="cbf6f16bacacaf8df45025a8a800fcd0"/></dir><dir name="Info"><file name="Card.php" hash="32ed58d7763b8697395cb2aee5008642"/></dir><dir name="Page"><dir name="Html"><file name="Head.php" hash="62602ff6206bf8b94d24a905b0229a43"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5a279dbd0f0cf90324dab9f597069272"/></dir><dir name="Model"><file name="Card.php" hash="e3b9aa104b15a294119bc2a2a1cdbdcf"/><file name="Observer.php" hash="b3af910fc38a4ca2c83c9a41a0399ff1"/></dir><dir name="etc"><file name="config.xml" hash="0a37e2f68c019411f56e69f0ebcdcb79"/><file name="system.xml" hash="419203bc2d4c8f99dd8020c06a37bccf"/></dir><dir name="sql"><dir name="card_setup"><file name="mysql4-install-0.1.0.php" hash="92381e3159990a46c7dd674c0d4205c1"/><file name="mysql4-upgrade-0.1.0-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="384467a7e6370c5731364738f7d3e00e"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="8b74e1986cd1731f32cde85d32b9c9a6"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/></dir></dir></dir><dir name="Oxxo"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="37145f64cbb2110f5a13bdca7a72fe5a"/><file name="Days.php" hash="341151ef5d2a0a4698b570b2df808035"/></dir></dir></dir><dir name="Form"><file name="Oxxo.php" hash="b4ea3507621a3cc55e7682b5b40ca494"/></dir><dir name="Info"><file name="Oxxo.php" hash="5971309dd65d108462164148b1bbfcf2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="815b0990e244ba098fd0772adcb6ff80"/></dir><dir name="Model"><file name="Observer.php" hash="c347186cbb8131c66eba7f6471fcac61"/><file name="Oxxo.php" hash="35df4edece58fbb38064ff5f4c0e7f06"/></dir><dir name="etc"><file name="config.xml" hash="4dfb759ca073248d2d43dd90e0aac7e9"/><file name="system.xml" hash="355914552e096428c683eebfec4b9e4e"/></dir><dir name="sql"><dir name="oxxo_setup"><file name="mysql4-install-0.1.0.php" hash="2362488b3b0d450132f7991cb1648c74"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="5ac7a7c41e38ddab259c9ea252b69877"/><file name="mysql4-upgrade-0.1.9-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/></dir></dir></dir><dir name="Realtime"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="2e3bfc37584c1bd3a8908fb505d387ef"/><file name="Days.php" hash="703e1e0155075e69148de33cae3b1405"/></dir></dir></dir><dir name="Form"><file name="Realtime.php" hash="f91d10d074548d90dd57aa68caa6724d"/></dir><dir name="Info"><file name="Realtime.php" hash="3791a8315135a4ae97c2788fa7d7c019"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b370f1d0bfc208a27ce800f026e4e335"/></dir><dir name="Model"><file name="Observer.php" hash="eb48522d8f3fea522f66b1bb62545359"/><file name="Realtime.php" hash="98b191eee860e47481a2da94dc3f06f5"/></dir><dir name="etc"><file name="config.xml" hash="6b9e5cc4bf10f23d2b7574debfc3c834"/><file name="system.xml" hash="8be164ff2af425b3ffea2ee3d94bf92f"/></dir><dir name="sql"><dir name="realtime_setup"><file name="mysql4-install-0.1.0.php" hash="101a3dfd8e9b8159a21bba1f70cbace1"/><file name="mysql4-upgrade-0.1.0-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/></dir></dir></dir><dir name="Spei"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="4fd0b98355269c5168956746710d4e31"/><file name="Days.php" hash="bb7a0c3189a0f337fdba4fd7b1f35f33"/></dir></dir></dir><dir name="Form"><file name="Spei.php" hash="11f305f6ed1f924f2c1924e3713f1136"/></dir><dir name="Info"><file name="Spei.php" hash="714d7003f7d336e5a531b8a2ccda1150"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0a9c69b0acac3ace1f110fc6446f42ae"/></dir><dir name="Model"><file name="Observer.php" hash="b186e3bf52529b8758926c164388534d"/><file name="Spei.php" hash="ca4d43c380f0b308c6722af74a647d69"/></dir><dir name="etc"><file name="config.xml" hash="d6d004d8a0c4ce23375a08ac3829ebe7"/><file name="system.xml" hash="ab5aad7dd3f67efe8be8968fd9ace626"/></dir><dir name="sql"><dir name="spei_setup"><file name="mysql4-install-0.1.0.php" hash="43006151eb2d8e278cdaf483db52f277"/><file name="mysql4-upgrade-0.2.5-0.2.6.php" hash="8baf3e2e26a0e4841de6e6c76326819a"/><file name="mysql4-upgrade-0.2.6-0.3.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.0-0.3.1.php" hash="ab5be6e3abb5cd4281f96a712346c05f"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/></dir></dir></dir><dir name="Webhook"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="4eeed710e4b3de2e2bb860754dcfee11"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Url.php" hash="6c7eef481f3d5db911118e5f2566ecc9"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="68c2234a7573e0b6fd5f57a623fcade4"/></dir><dir name="controllers"><file name="AjaxController.php" hash="e2ccbbb262240a5050b96f11f3e25214"/></dir><dir name="etc"><file name="config.xml" hash="e422e06cac07b616ccada7a6ee90c640"/><file name="system.xml" hash="6c5e6a5a4bbe126735d48d3bd2cb9ea9"/></dir></dir></dir></target><target name="magelib"><dir name="Conekta"><file name="CHANGELOG" hash="807826243c471b7f58545775cb9bd699"/><file name="LICENSE" hash="5504ebddc2becac4fcf24734b28632ae"/><file name="README.md" hash="27522a458fbe9a7fbe2b2369322b4896"/><file name="composer.json" hash="3102c308e10a0752bef69d30150c5ca1"/><file name="composer.lock" hash="14cf81f275ada3fa4f646e64a2983b3b"/><dir name="lib"><dir name="Conekta"><file name="Address.php" hash="53f9ead73473bd89c56b179e0e560acb"/><file name="Card.php" hash="cac03a528b206b146aa2e436fb74a593"/><file name="Charge.php" hash="0c069edf9f724195722deb5a2c48758f"/><file name="Conekta.php" hash="d33f560469d55c396a2bc7da7c02935c"/><file name="Customer.php" hash="a6f5c47456c01f65a982a812a3988c00"/><file name="Error.php" hash="7d2a0415932005786e57b22fad2941ef"/><file name="Event.php" hash="4e4a5d5bc4fd42c37a447f101ba50e0d"/><file name="Method.php" hash="28fa98bc684b14d469adc5a9c10bce26"/><file name="Object.php" hash="d02888627d6507813b118966f8c9c3b7"/><file name="Payee.php" hash="3d545baa5137218df1f2f306b20da8b1"/><file name="PaymentMethod.php" hash="82da8783050670d22fbd040f34f1c2fd"/><file name="Payout.php" hash="9e5c96c08df0436e417deca2edf692d8"/><file name="PayoutMethod.php" hash="2e2dec5d433e50354dbccd6ef23e8f1a"/><file name="Plan.php" hash="12d5a54fe163994f5e97b934129a8d8d"/><file name="Requestor.php" hash="81f478b675d65f2cd89692499c1ad72c"/><file name="Resource.php" hash="53df6df376c6f141e84595ed782b8baa"/><file name="Subscription.php" hash="f2a63686b2d5e85cb3627c1426665db5"/><file name="Token.php" hash="2b953723bb06b7ff7701d28d080b052d"/><file name="Util.php" hash="bb5f089ba557b775fe59281f9bb398ad"/><file name="Webhook.php" hash="2fffba414d2f831694f6e15511f9583d"/><file name="WebhookLog.php" hash="b053454f7b376bbc4ccffe99b489a1de"/></dir><file name="Conekta.php" hash="77678a889d7ff90dc87fe0a2a4f91fe3"/><dir name="locales"><file name="Lang.php" hash="1f39bf36ddb6dfe123a5a717fbc52d86"/><dir name="messages"><file name="en.php" hash="e298057a1876c6dbd9644b1c7e1bacde"/><file name="es.php" hash="32dd54b605441a97da212302a3bb0979"/></dir></dir><dir name="ssl_data"><file name="ca_bundle.crt" hash="035148c907bab6ccfca027cca4842f48"/></dir></dir><dir name="readme_files"><file name="cover.png" hash="43d4fa2e91aa504f40c1da5542cd324c"/></dir><dir name="test"><dir name="Conekta"><file name="ChargeTest.php" hash="59938a84bbe8648dca1c86914c6bceb2"/><file name="CustomerTest.php" hash="c89ed5cd1d93948335a35d83cf9d2b52"/><file name="ErrorTest.php" hash="27170b2fe55c81cfc50a2c30adfcb68d"/><file name="EventTest.php" hash="5bcc67fc780f88af99ca070c6bddb788"/><file name="PayoutTest.php" hash="183ff8911954355a2ecda972e676cba9"/><file name="PlanTest.php" hash="d391dc6f5a2a9dd933bf850e2d74c3b4"/><file name="TokenTest.php" hash="e51027f7abd634f25f7b4b4246a573cd"/><file name="WebhookTest.php" hash="3e13c84e2b466bee3e6872ced3b4b114"/></dir><file name="Conekta.php" hash="478260fe34dcd328eb1c7a0c619febad"/></dir><dir name="vendor"><file name="autoload.php" hash="af8e9ab968332411505aafb78acb8ce0"/><dir name="composer"><file name="ClassLoader.php" hash="3e420cbf8bc3c56158e3dcd277613b03"/><file name="LICENSE" hash="084a034acbad39464e3df608c6dc064f"/><file name="autoload_classmap.php" hash="df3f1202396bd228a9280fa44c9441b4"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="dd3a00f0d13eb29781edd8c77d4c5100"/><file name="autoload_real.php" hash="28bef80f182e2056db8aa5ac2ff96d98"/><file name="installed.json" hash="99915314ba4af269b4f7a678edfbecfd"/></dir><dir name="simpletest"><dir name="simpletest"><file name="HELP_MY_TESTS_DONT_WORK_ANYMORE" hash="3f406bdc4f474b19e7063a816796fbe5"/><file name="LICENSE" hash="5804fe91d3294da4ac47c02b454bbc8a"/><file name="README.md" hash="9a1a55ea734a189a45218d64a3fc4414"/><file name="TODO.xml" hash="2d139c030cb4b9e795c40e519d9f8aa6"/><file name="VERSION" hash="30a04cf33ee91a3ecf4b75c71268f316"/><file name="arguments.php" hash="4c6194e05032ba054e8794843005c276"/><file name="authentication.php" hash="225f1aa1f5e576c226fa55f0f5fdb3d3"/><file name="autorun.php" hash="07b636ac423f644f61e1efe5836cc2c5"/><file name="browser.php" hash="e3763dd907fdcefebeb362dead3bd297"/><file name="collector.php" hash="d32b42465099ac97c71a74bfdeeeaa3d"/><file name="compatibility.php" hash="71fa238285cf0cd6a1ba454025fc8621"/><file name="composer.json" hash="3f5ded2bac5dd27faf52fddb17c27d54"/><file name="cookies.php" hash="ce93a09c12ee4127c4036f9af0dbfb09"/><file name="default_reporter.php" hash="66fc41c96027ae79e0b74fb4f5f40d17"/><file name="detached.php" hash="52ae08c35f7ec5ee12d67f83214d4e34"/><dir name="docs"><dir name="en"><file name="docs.css" hash="5b7dbf32aa4131ede54d0fe94132679c"/></dir><dir name="fr"><file name="docs.css" hash="0f93d4963f3ff9e76560b8a6e347311c"/></dir><dir name="it"><file name="docs.css" hash="5ac7c8b1922e9f1ef1da90de9ac41b18"/></dir><dir name="lastcraft"><file name="README" hash="fc2dc2ade984ecf05bcccd9ff57f1f02"/></dir><dir name="onpk"><file name="README" hash="c4fd86ddf38fae7b3a2776cef85a3fe4"/></dir><dir name="pkg"><file name="README" hash="cd13a15621e570aa2c14ccb31416e2b6"/></dir><dir name="simpletest.org"><file name="README" hash="acccb858df6e845ce4fd96414bc68e0b"/><file name="favicon.ico" hash="3da65fcd78587c78f4318766920adbf7"/><dir name="images"><file name="book-domain-driven-design.jpg" hash="1859db386d5cb80d5961bd63661ea7e0"/><file name="book-guide-to-php-design-patterns.jpg" hash="1b4465bf27bf9560521c5ffa8fe2eac7"/><file name="book-the-php-anthology-object-oriented-php-solutions.jpg" hash="d40cd1936cfd934c46d02b4be32c3431"/><file name="quote.png" hash="6d4f92821e22fdb3df82fb4e0e52df73"/><file name="simpletest-contribute.png" hash="6a254fb62293d9e3ea30244f0ab21cb4"/><file name="simpletest-download.png" hash="2169293cf557234b382fd77dffb21e5d"/><file name="simpletest-external-bottom.png" hash="261e7efc8d623cd10bafafe4c1912a0d"/><file name="simpletest-external-middle.png" hash="ce3fc96e3643a06962aed7239e41de6d"/><file name="simpletest-external-top.png" hash="88839a4a297065e69b2d75b2bb8aa541"/><file name="simpletest-internal-bottom.png" hash="cab42bcbd4db5ba4dce668c1e17883f9"/><file name="simpletest-internal-middle.png" hash="d81e2658da3bee581c6464a68b4914d7"/><file name="simpletest-internal-top.png" hash="e19a97b38a9ce14b3e716d8ec812e1f7"/><file name="simpletest-logo.png" hash="44761b8a3267bbc3f12d130c65f1468f"/><file name="simpletest-start-testing.png" hash="10d2a1a66ed890f341acf4c9890c9b8d"/><file name="simpletest-support.png" hash="b2439ad8ad05db490f70aad010dc159a"/><file name="test-in-cli.png" hash="9ad0b5a8b32a9a7f1b58b2dad9a0162d"/><file name="test-with-1-fail.png" hash="f0a51f709293abf10b597104db5e086d"/><file name="test-with-1-pass.png" hash="1d559637183bd3ce4e6ec027032c57df"/></dir><file name="index.html" hash="f6c1f9e20b5be23ec3dcaba9bb61f8f8"/><dir name="js"><file name="jquery-1.2.1.pack.js" hash="ebe0ea764139f30972055e9f79972277"/><file name="jquery-speakers_coaches_consultants.js" hash="3240cc94790e14310e1b888e04177fc4"/><file name="jquery.heartbeat.js" hash="b4172c0601a9b2f5119c6ae21cf3e26e"/><file name="jquery.sparkline.js" hash="5dd0c5160bc61f966731f7372be48b40"/></dir><file name="simpletest.css" hash="eefdfa08047f9843b5ffa164378c4d2a"/><dir name="views"><file name="heartbeat.php" hash="3d058a12be15758164fd1b1818948009"/><file name="photos_stream.php" hash="70e3335e53a21d09ea8e2ddb71d4a0f8"/></dir></dir><dir name="source"><dir name="en"><file name="about.xml" hash="6d39ebe29794b672b44a56317185fb48"/><file name="authentication_documentation.xml" hash="19994a81057bd6917dd6d5dad36d1d24"/><file name="books_website.xml" hash="221d7cb35bf610ac6a98a6c744161d63"/><file name="boundary_classes_tutorial.xml" hash="83f604a5e1ea5ed827f0470a0c63f6a4"/><file name="browser_documentation.xml" hash="d7234400c7f56781e354a7dc96a935d6"/><file name="changelog.xml" hash="66f8bd7170bb5b11945f590d6cc4c106"/><file name="coding_standards.xml" hash="c0fcaca889bf8c40bc2d24701fbb82d8"/><file name="display_subclass_tutorial.xml" hash="f26cb02634a13d4cdba30fdd3179701d"/><file name="download_website.xml" hash="46f25c6012eb58b9fdcffa4c2a0a8115"/><file name="expectation_documentation.xml" hash="bb53c3a5e02df320ff4ccec3bef8fd82"/><file name="experimental_dom_tester.xml" hash="8c10699fdee68185ace58906d57c3740"/><file name="experimental_intro.xml" hash="a838a73ad96b076cd7f912b6614c7acd"/><file name="experimental_recorder.xml" hash="e5c345c470283acf26bcfca3779dec85"/><file name="extension_eclipse.xml" hash="17d89b7b38b41c584d3be8461a387722"/><file name="first_test_tutorial.xml" hash="1b6b23e96023decca4283d3d91861dd3"/><file name="form_testing_documentation.xml" hash="8d1995b71c3c128345b0ca901bb065f4"/><file name="gain_control_tutorial.xml" hash="79db24d6407f217b0305230d2912ddfb"/><file name="group_test_documentation.xml" hash="6ad611331cd1df021f8e73654789fac1"/><file name="group_test_tutorial.xml" hash="e541a1feeacfa30b4aadb89ddb0d0cce"/><file name="heartbeat.xml" hash="3cb3df4745c7f3eb2898c3ae982e225f"/><file name="ideas.xml" hash="51065e174db3cff947159e78d285b68c"/><file name="improving_design_tutorial.xml" hash="e11bd92ec44121e43cae2f8fcdd7c3d7"/><file name="index.xml" hash="47114a47fec3ef9b0b6bbcbda9b23c6e"/><file name="intro.xml" hash="008e0ab06f0f7c46646abe0e0b161138"/><file name="mock_objects_documentation.xml" hash="181f407ab63f18dcdef5da501a400e05"/><file name="mock_objects_tutorial.xml" hash="e630aa76458d83c33737bb4a838d772b"/><file name="overview.xml" hash="117c63809c0c3935c27e2a4862d02d01"/><file name="partial_mocks_documentation.xml" hash="862aa39bc35f0b05e5a53baf82a08456"/><file name="photos_stream.xml" hash="30391a258322b1acbc03479128903fa6"/><file name="reporter_documentation.xml" hash="d085908d92d5fe762d707a86d78c95fd"/><file name="screencasts.xml" hash="31d954a2472c41323f72f9db4986819f"/><file name="simple_test.xml" hash="03f04037fba6bdc15fe6a5329384e76e"/><file name="softwares_using_simpletest.xml" hash="098ec0ef382da86bfab983f8ee7bbffe"/><file name="speakers_coaches_consultancy.xml" hash="a25abcf66ddadc3559cdd02b30bc5ae1"/><file name="subclass_tutorial.xml" hash="7c63b99cbc12b7306c751ec3a8e3f8f9"/><file name="support_website.xml" hash="7f4c7d8efd1244e2febbd6d55fce3fec"/><file name="unit_test_documentation.xml" hash="95c70a8b86ae2af050344b9909837eeb"/><file name="web_tester_documentation.xml" hash="c7de94ccc38c3292c06324abd4c9c404"/><file name="writing_extensions.xml" hash="a6cf1d316aeecfe6b62f49110ba40178"/></dir><dir name="fr"><file name="authentication_documentation.xml" hash="5e9b5f0e83dabc6821bc9355822141a3"/><file name="books_website.xml" hash="6dcff10571b04c9882b23c222c36921a"/><file name="boundary_classes_tutorial.xml" hash="a53d99a183d6bf3b02c05a845787bac5"/><file name="browser_documentation.xml" hash="2f5a38c865948566c1ee0aed97d987a4"/><file name="display_subclass_tutorial.xml" hash="6f68ff2370c3cdb21f947e6bce99b082"/><file name="download_website.xml" hash="200f02d1cabe455bbb02a125cfa61bf0"/><file name="expectation_documentation.xml" hash="aa84acd07fb8a1b8dbcdbee98260ae34"/><file name="extension_eclipse.xml" hash="8bb81a19b50908542d5946e2379964ad"/><file name="first_test_tutorial.xml" hash="1ab59cf29a5a1cc1e855d5f1f1a408be"/><file name="form_testing_documentation.xml" hash="da2defce5ed3a57f078435dcf99cc39f"/><file name="gain_control_tutorial.xml" hash="edcc56a348cba9a8ecb8a17012a0845c"/><file name="group_test_documentation.xml" hash="b509b96b7895bea18befef25094eb77a"/><file name="group_test_tutorial.xml" hash="6d0ef31a33c03eaff46b29dee5274772"/><file name="improving_design_tutorial.xml" hash="e180ef801599f7789d3e588b8459f35d"/><file name="index.xml" hash="0e6ecc4f019f208a84deefbd51a6f2c1"/><file name="intro.xml" hash="cabbc40bd72f65511d1e5cd8f4319055"/><file name="logiciels_utilisant_simpletest.xml" hash="b837d7e3dcdb84422bdf0eca1b557f9d"/><file name="mock_objects_documentation.xml" hash="a063715560a4fed9e8596c398e2e3acb"/><file name="mock_objects_tutorial.xml" hash="27ef3d69dbe5d62ea5c3569836bae875"/><file name="overview.xml" hash="f6ce2f96d0cbea507e02bddd7ad67eb2"/><file name="partial_mocks_documentation.xml" hash="eec2acc0705cd40380b3269b7aec97a3"/><file name="reporter_documentation.xml" hash="0c72e1ef975ee9ba9fd86505cb79f7ad"/><file name="simple_test.xml" hash="d64a81a9f79957e5bf49d46049bb60e8"/><file name="subclass_tutorial.xml" hash="bd6b9c76f7b2191ebb3038f24915a04f"/><file name="support_website.xml" hash="1ce933485528c6cafbfa6771ce5c7408"/><file name="unit_test_documentation.xml" hash="bc1a100fd2936ab60f70d58e4fdba508"/><file name="web_tester_documentation.xml" hash="9899e6ad8af338fba4e8d9ac4d5a6b59"/></dir><dir name="it"><file name="about.xml" hash="923b75582ff95061ee00368197ded617"/><file name="authentication_documentation.xml" hash="c8c46ac93a719f5e617acb8923a14d47"/><file name="books_website.xml" hash="6d8f1b775dcd1c0e5e12d048538f92d6"/><file name="boundary_classes_tutorial.xml" hash="1c2ff2c2bfecad602ba6c44bd39bb4c3"/><file name="browser_documentation.xml" hash="1160f5ca6a3471a395f8e57c93072123"/><file name="changelog.xml" hash="72d655f005d76f7fb2e139a499e01eb6"/><file name="coding_standards.xml" hash="3b6f04d4b40c6c61c9b82fe59a1cd7c2"/><file name="display_subclass_tutorial.xml" hash="d138c6530471fdec4af8ce06de159235"/><file name="download_website.xml" hash="8feeb56c79bf112de7cbd6839aee8f2a"/><file name="expectation_documentation.xml" hash="01a333342a32ec82d2bf0bb7145b3e7e"/><file name="experimental_dom_tester.xml" hash="3f03247884e746e330766555d5221b9c"/><file name="experimental_intro.xml" hash="5d82baa6ee7d7bbaee8d4e82cd9a8a31"/><file name="experimental_recorder.xml" hash="007ffc2aaaf73d2ddfda9224bee9a9cf"/><file name="extension_eclipse.xml" hash="5550c74d3aabd9f346b5b6c5b25b4f9b"/><file name="first_test_tutorial.xml" hash="f972dc2ac2fdb69cffad2149ab7034ac"/><file name="form_testing_documentation.xml" hash="5e4312fe41301c99d08e960184809124"/><file name="gain_control_tutorial.xml" hash="84446a8a56c1d218ca280508f5562d29"/><file name="group_test_documentation.xml" hash="d9658f22648ed2129b1ca92f996fe420"/><file name="group_test_tutorial.xml" hash="767644a28186d8144822ad7c3faf404e"/><file name="heartbeat.xml" hash="a6cbf305d35b308ad166506c5238bfd1"/><file name="ideas.xml" hash="275ddbde6191c604c801d2d92142cee0"/><file name="improving_design_tutorial.xml" hash="392d76bc2a26f847d891d0bd7ba17e1b"/><file name="index.xml" hash="2946afd04340068e4e779713edcc0f6f"/><file name="intro.xml" hash="b4c61c9e581580e61eea60acef37c433"/><file name="mock_objects_documentation.xml" hash="54bc5978459bc4a7bc784fbeacf35596"/><file name="mock_objects_tutorial.xml" hash="6ee072398983265038b4a3105f9c7560"/><file name="overview.xml" hash="1d95af8965218c166ff3ca9354d1f361"/><file name="partial_mocks_documentation.xml" hash="348ea1d2bcb49f7e25870b65099748cb"/><file name="photos_stream.xml" hash="78369acd568e0a2cdb462e5a36266825"/><file name="reporter_documentation.xml" hash="4e9df7fde40ead71d18ed89cbea13211"/><file name="screencasts.xml" hash="f2d0e1866c3886f12d9168e5271e9f58"/><file name="simple_test.xml" hash="f1d678a66712d91716d39f4ff1974c9c"/><file name="softwares_using_simpletest.xml" hash="9da6235f328aaae7d23b2f18a533badd"/><file name="speakers_coaches_consultancy.xml" hash="3acaebe7a5d0b8784fc3a7b87bfa8ca7"/><file name="subclass_tutorial.xml" hash="be157d2ea3bb13fafa24baa38fde47b1"/><file name="support_website.xml" hash="23bc1ee0c9427969947dede9215bc289"/><file name="unit_test_documentation.xml" hash="66042a13a46ec24c87e68f2d7a7ee172"/><file name="web_tester_documentation.xml" hash="37e7ac35659745fd632de39fe6e75347"/><file name="writing_extensions.xml" hash="c4affe3f6d2441ba5a37bf6a0c570d28"/></dir></dir></dir><file name="dumper.php" hash="f4a8478cfc033ce567c053ca6ed844ba"/><file name="eclipse.php" hash="7a66eafab9d025316c049733d893b09a"/><file name="encoding.php" hash="f2d77aba0fb15d0ded526060a4cd8724"/><file name="errors.php" hash="db938b577288bd6d06a21b40daebf6e5"/><file name="exceptions.php" hash="a8bc5f58d12f3d640cc1a2d6cea42970"/><file name="expectation.php" hash="05b00c7a47f4331bb492ba0dbe6e354e"/><dir name="extensions"><file name="colortext_reporter.php" hash="9da03e2f8c2923205ddbc0c1922d9438"/><dir name="coverage"><file name="autocoverage.php" hash="6c4bf1f9cfaf1e2a44f8e1daa22f817e"/><dir name="bin"><file name="php-coverage-close.php" hash="93e7d76d232b24a3ddf29a58ae81ac36"/><file name="php-coverage-open.php" hash="b68fe18909158074805f28a09e9231d3"/><file name="php-coverage-report.php" hash="132c91ee2a8c0675898e8ad314aa421a"/></dir><file name="coverage.php" hash="2b49981614e4d124ec5fb957a5ebf54f"/><file name="coverage_calculator.php" hash="74cc62ca660885af88b77cd138e90884"/><file name="coverage_data_handler.php" hash="2ce3631df3fe8bb0abd032dd49e5ab67"/><file name="coverage_reporter.php" hash="982e3b629f47c043f667cceb809ad66b"/><file name="coverage_utils.php" hash="987a1fd23caa86ccf4392dbf058d604c"/><file name="coverage_writer.php" hash="4863fda0a8bd9edb87e27e911622b9f7"/><file name="simple_coverage_writer.php" hash="dd76d62cdfb5e4fabb583c8722f4a0f8"/><dir name="templates"><file name="file.php" hash="50530c678b4e01d2098195da2e4f3281"/><file name="index.php" hash="5c704447f52c136e8f0c93fb0769cb29"/></dir><dir name="test"><file name="coverage_calculator_test.php" hash="d7d32298bc3a93075caad25323489459"/><file name="coverage_data_handler_test.php" hash="2493d24d212e96bd65dcdf705a30d44c"/><file name="coverage_reporter_test.php" hash="9fdf89a4894b45d4546fd07925f736c8"/><file name="coverage_test.php" hash="558a1c6bfc5756461e4704c99b3db20b"/><file name="coverage_utils_test.php" hash="9391fa69a9457ebbf0d902bc196e452c"/><dir name="sample"><file name="code.php" hash="4483572d5657ec564fc35c06f2f7a4e0"/></dir><file name="simple_coverage_writer_test.php" hash="90f7da3df27afe225e0122112c36b8fe"/><file name="test.php" hash="d01d5cf3f4e7152af32101a1cdab2f0a"/></dir></dir><dir name="css"><file name="webunit.css" hash="b764971cdf3f5dd6cc89fc923a9d8321"/></dir><dir name="dom_tester"><file name="css_selector.php" hash="b1db3d4a4f78733d7bbf166c654ec74d"/><dir name="test"><file name="dom_tester_doc_test.php" hash="678afaa853c3905f2da4cf7a0c223bc3"/><file name="dom_tester_test.php" hash="4ceaecb82b50759a27cfe80217fec3cc"/><dir name="support"><file name="child_adjacent.html" hash="6bf975cd518a9c81ef479adb9c7d9c4f"/><file name="dom_tester.html" hash="254430e082cad52d61665be7549442a6"/></dir></dir></dir><file name="dom_tester.php" hash="9f872457e43deb2a994ad57a759ba16b"/><dir name="img"><file name="wait.gif" hash="5cdd3d1eaa03216e9c16840b7a6f8d6e"/></dir><dir name="js"><dir name="tests"><file name="TestOfWebunit.js.html" hash="63cca591ca1be6ece6c89ceb01150701"/></dir><file name="webunit.js" hash="f74982d6fcf5aa3dd3f0e16c94493fb5"/><file name="x.js" hash="d23f58b9b98b778aac7248e31a28b9f8"/></dir><file name="junit_xml_reporter.php" hash="f58b152488a250f459cac3924e8dcba3"/><file name="pear_test_case.php" hash="ce02457889e1fd7e9cfc23e1a42cf50b"/><file name="selenese_tester.php" hash="0318c68b44439582a1c21b7f1f6bf986"/><dir name="selenium"><file name="remote-control.php" hash="6271054521fdf0140704e7ede1697b69"/><dir name="test"><file name="remote-control_test.php" hash="fca468414168b65355e7386eae50277f"/></dir></dir><file name="selenium.php" hash="61668613373373ceac57ad1e58545fb9"/><dir name="testdox"><file name="test.php" hash="95611e38fc6ce476c2da971eccc56b14"/></dir><file name="testdox.php" hash="0a516e7962be9479f98549fb48ac8e4f"/><dir name="treemap_reporter"><file name="jquery.php" hash="d78daf57cb98be89a11d0e0ab43b2650"/><dir name="test"><file name="treemap_node_test.php" hash="234531dafc2f74ef7c5904b3e8143859"/></dir><file name="treemap_recorder.php" hash="aa4c0c29664d04448f846371c5080788"/></dir><file name="treemap_reporter.php" hash="7d34ffd35e5ef6fd749bc25348f1c62a"/><file name="webunit_reporter.php" hash="331f7fabd83f54553e372cb864676b38"/></dir><file name="form.php" hash="6b2a25e18e45aadba2dcc351e98a2b5a"/><file name="frames.php" hash="fb19dc3564fce2f43b3b5b7867a7d75f"/><file name="http.php" hash="b282fa48bca0ad837d0b30ce3d0c3a28"/><file name="invoker.php" hash="b3482030f6f245cc64cef9f014d45f87"/><file name="mock_objects.php" hash="d65cd917978a294d978c1604aeab3d2e"/><dir name="packages"><dir name="coverage"><file name="generate_coverage.sh" hash="ecd3e44a45f56eaa33518572a273503a"/></dir><dir name="lastcraft"><file name="lastcraft.xslt" hash="c71c8217b83f703c6294dcdcda5be290"/><file name="make_lastcraft_docs.sh" hash="8978ed7ca3660a7123566f8541907f11"/><file name="site_map.xml" hash="bcd564acd3eb3cff5a18686f02637a56"/><file name="transform_all_lastcraft.php" hash="cd2821d4c57898157ab5081f600f9378"/></dir><dir name="onpk"><file name="map_onpk.xml" hash="f17c2dab0b4efa4fcc6d36416ce9eef9"/><file name="onpk.xslt" hash="4b0d049cca443dce8cd61dab712079d0"/><file name="transform_all_onpk.php" hash="9736c0e920674516df65e79f692dd180"/></dir><dir name="pear"><file name="package.xml" hash="dac6d5411165d37a1b38704e6f54b274"/></dir><dir name="phing"><file name="extension.xml" hash="be4b310fccd271f884bb1bf8820df119"/></dir><dir name="phpdoc"><file name="make_phpdoc_docs.sh" hash="c91c7dc65f37a42e8dce403a439917f2"/><file name="phpdoc_docs.xslt" hash="504a9ca691ce8f8a5de26a6b6ef55793"/><file name="simpletest.ini" hash="d7f0cabe8bd211f414297a475b72222c"/></dir><dir name="simpletest.org"><file name="index.php" hash="09bd28a5f3930a2533084e0d49357c12"/><file name="integration.php" hash="4c11262a6b77ba1c7ba5cf139b5a4228"/><file name="map.xml" hash="4b1cf9fdd2a0fb6920df3793ab933f1f"/><file name="package.php" hash="5c5464196aea20948a6b042eca58c341"/><file name="template.html" hash="6eaa5af4a917150f42ef43eab9691255"/><dir name="test"><dir name="package"><file name="content_without_section.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><dir name="en"><file name="synchronisation.xml" hash="cfad55fdd47691e5d5ffc49d0dc73804"/></dir><dir name="fr"><file name="no-synchronisation.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="synchronisation.xml" hash="402eb1fe6abf7479bb93600c6680ca55"/></dir><file name="here_download.xml" hash="4ed80f3e0e12ec023e71e2efab3daec3"/><file name="here_overview.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_simpletest.xml" hash="ec1e970e4e681f61745ea034b8e2911a"/><file name="here_start_testing.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_support.xml" hash="42a071977c1d5cf7419165ff504fcc6e"/><file name="here_unit-tester.xml" hash="17f28ae6cd7cffd61bb7b5da5e1c2282"/><file name="map.xml" hash="830a0d14f19d9a2d2a0ca4d87f95e60e"/><file name="one_section_changelogged.xml" hash="ef839cfab9c2901bc933c676a7bb8ac1"/><file name="one_section_milestoned.xml" hash="9bab3e9f367606a36d4a1e9c242c2a97"/><file name="one_section_with_autorum_php.xml" hash="70592701244fc5d737fa8f10e0b60440"/><file name="one_section_with_php_code.xml" hash="88ffca5e5d3500baaf12cdbc283f1a82"/><file name="script_and_ul.xml" hash="0e0d425619b28d352aaee73ffb9dab98"/></dir><file name="package_test.php" hash="9587007e4428dc361c5d401dd9548933"/></dir></dir><dir name="sourceforge"><file name="build_tarball.sh" hash="e6f37d859fae8a720814ce6ca19bf04f"/><file name="bundled_docs.xslt" hash="d6fd9824f6bd7e5836ed7830bdecd5fe"/><file name="bundled_map.xml" hash="8e0114ac5fafe32432b2411ad658d0a3"/><file name="make_bundled_docs.sh" hash="daf66c5e7f4b127c4e2be65a6a4cad08"/></dir></dir><file name="page.php" hash="e1b7d6443461f6b38fe35e6d93196302"/><file name="php_parser.php" hash="88a3ac023682dd506d0bf9a83a163928"/><file name="recorder.php" hash="0f7054d9ec8f397847776a6b23486b3c"/><file name="reflection_php5.php" hash="7d8f9f2b701a31b702805812eb27ad60"/><file name="remote.php" hash="faee7e6c71a75c5837c126d69212c1a4"/><file name="reporter.php" hash="1a45fad1b8cf0e0cbfa59436a7db69f1"/><file name="scorer.php" hash="407afbc78ede064047284efd06d1573a"/><file name="selector.php" hash="74fdcebec47f531d27ff31c70f58ddbf"/><file name="shell_tester.php" hash="ae7e4cb05db2dc3a1e8cdb9e5fe687b7"/><file name="simpletest.php" hash="27bd3557db083b9a3d0826e318a8ba43"/><file name="socket.php" hash="c7bca250fbab409082a7f4cba0cb92e5"/><file name="tag.php" hash="8c31276f078afbccd555f14a8522638d"/><dir name="test"><file name="acceptance_test.php" hash="ffb78c72da45769bd05480bace0e2440"/><file name="adapter_test.php" hash="089ed2dc33360dd8dda7d44f51347e0c"/><file name="all_tests.php" hash="e1cca5d913429f57f667e39340e6c3cd"/><file name="arguments_test.php" hash="fae94db949b54c9b7385a7ccacaca2b3"/><file name="authentication_test.php" hash="f16bcef77c7767ff20f828a758684736"/><file name="autorun_test.php" hash="1dce083825d8a7c8c127852e5802730d"/><file name="bad_test_suite.php" hash="181e5a57778639aeb3037ed51f062f69"/><file name="browser_test.php" hash="378d34c1fa3be0d68b22bcc674e4fb95"/><file name="collector_test.php" hash="40f68067c2c0e52ebf47c51183f4fbb8"/><file name="command_line_test.php" hash="500bd4bd8c8875b6f0dacad7a3d8622e"/><file name="compatibility_test.php" hash="d694b2e0183107afc232127b17bd511c"/><file name="cookies_test.php" hash="32e4ee16a213770dd99cd0c731950624"/><file name="detached_test.php" hash="344b507bccce782816b75c5c5da6d43d"/><file name="dumper_test.php" hash="d18d27b103f5ae962110a3b8a2e2205f"/><file name="eclipse_test.php" hash="b35ef78293d35ed1957eed94001df827"/><file name="encoding_test.php" hash="6f05c408bc8334418e8dd9d642033eaa"/><file name="errors_test.php" hash="712319188ac8f4eaa1054bde188a286e"/><file name="exceptions_test.php" hash="462c79c331ec0e540226b7d9bc9f2a85"/><file name="expectation_test.php" hash="b18301ebd50c3d76d9ec06f81d234a79"/><file name="extensions_tests.php" hash="88b81a9c71306a3cb1f8ec9597afdd36"/><file name="form_test.php" hash="6d1d1f5061428c3cab015694a7245de6"/><file name="frames_test.php" hash="ada1a277bf3688798d0464ef46a88e3d"/><file name="http_test.php" hash="4c0f306118ce47dfe22391d45f894530"/><file name="interfaces_test.php" hash="bafa0b74ecc836b9a39122d07b3fd6ef"/><file name="interfaces_test_php5_1.php" hash="33d42f8f1e928992bce67bae86d87e25"/><file name="live_test.php" hash="baee207bfcb55040feab53e565044365"/><file name="mock_objects_test.php" hash="64655b2744dee434469f6fe886f03483"/><file name="page_test.php" hash="a603ae712d1ca14450fc1fb80fa79d86"/><file name="parse_error_test.php" hash="01d19d1fe037033ae5b355a05422e82a"/><file name="parsing_test.php" hash="79315ef0998e5461c92da47a079f9ba0"/><file name="php_parser_test.php" hash="3e19d9ef36e7ff9da2ab81c632f25fe2"/><file name="recorder_test.php" hash="6e344c31000040c9a76e677eae5d760e"/><file name="reflection_php5_test.php" hash="469b67b9068b0ee9ddfedaed00bb490b"/><file name="remote_test.php" hash="23ae612ef6868226b8cd8dc5a5c76817"/><file name="shell_test.php" hash="6f25f47bb4278412badd23f686bc33e7"/><file name="shell_tester_test.php" hash="1f82c2fe96ce2ae73ce23fa768000453"/><file name="simpletest_test.php" hash="19c00c1e9cf94278051979137f8b190c"/><dir name="site"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="base_change_redirect.php" hash="3e7a9d0864439800d307d14f0ac23427"/><dir name="base_tag"><file name="base_link.html" hash="0fb0d4fc58c8efcdc4cc6a072406f333"/><file name="form.html" hash="4bf5728fb5793ba11a5e7ab865c50eac"/><file name="frameset.html" hash="206047c4f8b5aae344cd8cf3c9e8a5fa"/><file name="frameset_with_base_tag.html" hash="3b6bb1fbaa042d563d52fcc25c46fe61"/><file name="page_1.html" hash="2eeff2e06cb559e268d3023601ea9138"/><file name="page_2.html" hash="0c8670422465c7d990c8dae999e5bdf7"/><file name="relative_link.html" hash="c1555e3d568e959151309e1b5c6e6db1"/></dir><file name="cookie_based_counter.php" hash="dd7773002a7c5e03903b6cf35bcd522e"/><file name="counting_frameset.html" hash="0ebea4dd9f202014e8f7f90deb6bba8d"/><file name="double_base_change_redirect.php" hash="832b47dce4bd57f1967e388aa238fac1"/><file name="file.html" hash="4c163986c2dc1f8e74a4069184efb486"/><file name="form.html" hash="1eaab823afab219c4cb99076e20547dd"/><file name="form_data_encoded_form.html" hash="37b364932a59e5653db8d75a1b0f144a"/><file name="form_with_array_based_inputs.php" hash="0ef882721bc167c2ceac74dde0846bd1"/><file name="form_with_false_defaults.html" hash="d1ee151195ddfda8d762ee930955d600"/><file name="form_with_mixed_post_and_get.html" hash="55f87cced77c6d1b2500a50129c1f772"/><file name="form_with_quoted_values.php" hash="52dd4234ddff704133dc8d456b26c883"/><file name="form_with_radio_buttons.html" hash="d23fe6f32223666ae8900bda2906e103"/><file name="form_with_tricky_defaults.html" hash="a2992fd2206048d7f4951585d0268b6b"/><file name="form_with_unnamed_submit.html" hash="08836e7584473a795d372268f97b2e5a"/><file name="form_without_action.php" hash="535adcea7f660b5c563273d4a72e241f"/><file name="frame_a.html" hash="74a7ce5a305fd98dce37b2bdb641b874"/><file name="frame_b.html" hash="85eeec074c8c22d4fcb22ea11419b8d7"/><file name="frame_links.html" hash="83e5b360138b6a5605b9e4d44aa54f2d"/><file name="frameset.html" hash="4bd9f9f57790faba848010c0f54feace"/><dir name="front_controller_style"><file name="a_page.php" hash="bef83009f20b91f6d3c426db0820df35"/><file name="index.php" hash="49460e286d4731d5aa3df6407fa36ab0"/><file name="show_request.php" hash="43425cc05ede659f0435b6631a49ab3e"/></dir><file name="link_confirm.php" hash="c9afbfe455c2b51e5b3e84f6c7b01e0d"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="messy_frameset.html" hash="875d156da96c81bc3509d33562b2eb86"/><file name="multiple_widget_form.html" hash="3cf41196d2ea967e00260b108f82504e"/><file name="nested_frameset.html" hash="223349147fa5af19045de7ca61e9e76d"/><file name="network_confirm.php" hash="6a4f552177ed43aac428fde4206a5f84"/><file name="one_page_frameset.html" hash="d41571bb42d445396bbdb561fc2da3b2"/><file name="page_request.php" hash="035b0fec6b840751e8224c0f1dc707eb"/><dir name="path"><file name="base_change_redirect.php" hash="0920a342a7d43bdc952386ad84dea1b0"/><file name="network_confirm.php" hash="8f1e40a7d4c3dd88a2c31af4f086127a"/><file name="show_cookies.php" hash="b53fb77412c7993061967f1584a34068"/></dir><dir name="protected"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="network_confirm.php" hash="b42c1220320892a954fe41ecc2ccb6a9"/><file name=".htaccess" hash="f30780cfeab05516183f1b42e174b700"/><file name=".htpasswd" hash="1de4aa0031b82efd9857e5d688c6b6d9"/></dir><file name="redirect.php" hash="2e785fdceb4ec73f0472997af37c373c"/><file name="request_methods.php" hash="2d2c941a2c9084d8e7446f6b25d32c4e"/><file name="savant_style_form.html" hash="4c4bb6ddffaafa73c698a7af93fb269b"/><file name="search.png" hash="b9fe41794de0476a76987eb3cf4e2156"/><file name="self.php" hash="06f08beff5316e35ca2f784c5e336ebf"/><file name="self_form.php" hash="fa1d902566526b8c5494d734b5631333"/><file name="set_cookies.php" hash="a6ab7bd999ab14bfa9a6c731f465e73c"/><file name="slow_page.php" hash="a08ab767bcaa63cd5b58f88d5dd5d258"/><file name="timestamp.php" hash="7070a50a036292446cce617168841a1b"/><file name="upload_form.html" hash="d04d7e2601c374b6f9ca13de7a58095f"/><file name="upload_handler.php" hash="11d1256048330770f4a4fb0e8435062a"/><file name=".htaccess" hash="61e312cb9d1db877826e8aa77c282b2a"/></dir><file name="socket_test.php" hash="cc9d6986a6df035d5d64c08c0a4ea66f"/><dir name="support"><dir name="collector"><file name="collectable.1" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="collectable.2" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><file name="empty_test_file.php" hash="e25fc8d36540afc3e2711711385d530e"/><file name="failing_test.php" hash="08f0db1ec0f82084ff8eaf31669820e1"/><file name="latin1_sample" hash="e0e4859fcd6072bedb7aa1b6377d7ff1"/><file name="passing_test.php" hash="9e86efddd8c994598d081b73511ffa4a"/><file name="recorder_sample.php" hash="a1819efa081e91ccf60aabee5a9f7a6a"/><file name="spl_examples.php" hash="2d91c4b7e53f7e88d595ff9764b7541a"/><file name="supplementary_upload_sample.txt" hash="dd7472fdc569c968f2b14e0ad0f13a9b"/><file name="test1.php" hash="93eb5ee5206db603f17258d118c707b9"/><file name="upload_sample.txt" hash="0ce6cebb8d7754c9d4484ce78611d24d"/></dir><file name="tag_test.php" hash="95fe8acbaed8e5baecf47ce65f6b2a1e"/><file name="test_with_parse_error.php" hash="cffe3a940c5ff0e6a95fd4b2fc50113f"/><file name="unit_tester_test.php" hash="a1da5a58a818efdbae9ba4239dd1ba66"/><file name="unit_tests.php" hash="dac770d436709cac163eebb8a888902d"/><file name="url_test.php" hash="32d0880854343d93aa6cd35add0de49a"/><file name="user_agent_test.php" hash="77be8f5317298309b230c8d5b74dbf25"/><file name="utf8_test.php" hash="e8bacf74d12ab935a153f281d493c139"/><dir name="visual"><file name="visual_errors.php" hash="0498691bade2198f83245a1867a66a14"/></dir><file name="visual_test.php" hash="cd7505aaef902b45ad954c2f0fcf025d"/><file name="web_tester_test.php" hash="7d8db06ae24f610409156035646ca0b6"/><file name="xml_test.php" hash="84017dbb0176cec12e6c061e63c6ddf3"/></dir><file name="test_case.php" hash="3b13c289f4645222f4525ca32ff55fcc"/><file name="tidy_parser.php" hash="7d690cbd4174c0dd55650f17776679d1"/><dir name="tutorials"><dir name="SimpleTest"><file name="Expectations.pkg" hash="9588f8942ce97024069767f221f07679"/><file name="FormTesting.pkg" hash="b6fa7c27ffe522859b47edb21409de8c"/><file name="GroupTests.pkg" hash="c3ce22f6736b157a7193907985f041ba"/><file name="MockObjects.pkg" hash="f08cfc567158204e336cde9205b5ea0d"/><file name="PartialMock.pkg" hash="3e9753cc2ac611d08b8aa690817888b7"/><file name="Reporting.pkg" hash="fb0e62ddd5d478ad82df4f1b5fca6824"/><file name="ServerStubs.pkg" hash="75f28c80c87200aecaabd438fd8f92e2"/><file name="SimpleTest.pkg" hash="17b7d6f698822d798daa1174864cd147"/><file name="SimpleTest.pkg.ini" hash="62564da9231425fd5418c891ae0d8277"/><file name="UnitTestCase.pkg" hash="85ee5523757e3dd23fd449aa2612c867"/><file name="WebTester.pkg" hash="73c8600440665a79050b956457ba3caf"/></dir></dir><file name="unit_tester.php" hash="de853cd29e840ebf32cf6cc4219f95a4"/><file name="url.php" hash="e70b1045b89bc75abac39d1cb788b003"/><file name="user_agent.php" hash="d7822a5877b756c6119f6db53916016c"/><file name="web_tester.php" hash="9ecdb17974828fae668f45a8b781a0b6"/><file name="xml.php" hash="7b88c3ef197403483393184b6c1e6af5"/><file name=".gitignore" hash="e8a346051f935e6cb104e1dc40998a91"/><file name=".travis.yml" hash="944c26740b6da869954e34ab87d3bb1f"/></dir></dir></dir><file name=".git" hash="778272e6b6a4cfb49303eb8663669329"/><file name=".gitignore" hash="0e4735425dcb9b32241fcf493492c483"/></dir></target></contents>
|
25 |
<compatible/>
|
26 |
<dependencies><required><php><min>5.3.0</min><max>7.0.11</max></php><extension><name>curl</name><min>7.31.0</min><max/></extension><extension><name>json</name><min/><max/></extension><extension><name>mbstring</name><min/><max/></extension></required></dependencies>
|
27 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Conekta_Payment_Extension</name>
|
4 |
+
<version>0.7.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="https://github.com/conekta/conekta-magento/blob/master/LICENSE">MIT</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension offers all the payment methods supported by Conekta.</summary>
|
16 |
OXXO Payments
|
17 |
SPEI Payments
|
18 |
When a customer purchases using a conekta payment method, the plugin connects to the Conekta API to process the order and sends a notification regarding the order status. This plugin allows you to add its payment methods to your checkout using Conekta.</description>
|
19 |
+
<notes>* Adapt plugin to use Conekta API 2.0.0.</notes>
|
|
|
20 |
<authors><author><name>Mauricio Murga</name><user>MauricioMurga</user><email>mauricio@conekta.io</email></author></authors>
|
21 |
+
<date>2017-02-02</date>
|
22 |
+
<time>17:02:36</time>
|
23 |
+
<contents><target name="magelib"><dir name="Conekta"><file name="CHANGELOG" hash="c98d6fb3f213333d078a3934ef8dc548"/><file name="LICENSE" hash="5504ebddc2becac4fcf24734b28632ae"/><file name="README.md" hash="41086cf83522ae906f97640847e8696e"/><file name="composer.json" hash="c81e0242dc7ac1ba68ef3e0f65eb979d"/><file name="composer.lock" hash="14cf81f275ada3fa4f646e64a2983b3b"/><dir name="lib"><dir name="Conekta"><file name="Address.php" hash="b3f7a83f77a943d40ea9c04c6904cbb2"/><file name="Card.php" hash="bf63b2b8f1c22f6248fa94258bb279ae"/><file name="Charge.php" hash="3fa3c6aac1e1a50e7bec42158618b52c"/><file name="Conekta.php" hash="749d7e457fa2be1b69175e97fd346f7c"/><file name="ConektaList.php" hash="064745d880cbc1c99505ca373bb54e50"/><file name="Customer.php" hash="36dea18ddc5d4dbb628d2ad6c1e53c72"/><file name="DiscountLine.php" hash="d589e701cf303bc306f204eea732c717"/><file name="Error.php" hash="878fd0e1e511ce7fe9f4b04a7e7da4cf"/><file name="ErrorList.php" hash="b4730ca1ee62ba0195e376d7cb7c9fbc"/><file name="Event.php" hash="d01cc586b21d083fabb0ba2bbedc9049"/><file name="FiscalEntity.php" hash="82feb237c05b910842a33ae95cfab5d4"/><file name="Lang.php" hash="f73759ce7992477b9383c4f83af47153"/><file name="LineItem.php" hash="0c30410d03328647d3c8bef3c4595c95"/><file name="Log.php" hash="caba89c93fe7ea60c09e764abd2f6904"/><file name="Method.php" hash="f5cc3d6cd51a39831db4d970f2822662"/><file name="Object.php" hash="7e2302e419c4ca22ea8d1213414bc962"/><file name="Order.php" hash="69e7602f1484078993351eb76075c406"/><file name="OrderReturn.php" hash="8a46d6d3b73b94882e352dd4fb862627"/><file name="Payee.php" hash="a3038852fdbfe97618cce0742980e721"/><file name="PaymentMethod.php" hash="82f9647bf71efd652773975eff809cee"/><file name="PaymentSource.php" hash="a212db195121848040f90e7498451bb7"/><file name="Payout.php" hash="ab30da851182211d9a02b58111bc37d4"/><file name="PayoutMethod.php" hash="16073435f0bb3589322ebb4b7b5fc81b"/><file name="Plan.php" hash="7d147534cb0be8aa104d8509e840a96c"/><file name="Requestor.php" hash="7d8c131158ae12f50af2b6bd06b58ab3"/><file name="Resource.php" hash="61042cfea13092eb35cbdcaa2e284cae"/><file name="ShippingContact.php" hash="424ced80f7aa32571dd7d509e660acf2"/><file name="ShippingLine.php" hash="5b88b3b0d97b9af2b7c6ef15e809f565"/><file name="Source.php" hash="81af8eb35f73941f223912cc8c4a7382"/><file name="Subscription.php" hash="c1a216c75ee88dd735b631ab936d7797"/><file name="TaxLine.php" hash="47a3050f26a468eafec44e139fc003c5"/><file name="Token.php" hash="1ef1bfa3a604a97e94e55140e1e752e2"/><file name="Util.php" hash="19810f74658d632b34b8dd732220c21f"/><file name="Webhook.php" hash="378177bb3bce52e9385021237bcef3c7"/><file name="WebhookLog.php" hash="9582ba57bd0385db4c3816fb0c99029d"/></dir><file name="Conekta.php" hash="e8dac4a9d38969c4fa9cf36ba3b82fcb"/><dir name="locales"><file name="Lang.php" hash="1f39bf36ddb6dfe123a5a717fbc52d86"/><dir name="messages"><file name="en.php" hash="e298057a1876c6dbd9644b1c7e1bacde"/><file name="es.php" hash="32dd54b605441a97da212302a3bb0979"/></dir></dir><dir name="ssl_data"><file name="ca_bundle.crt" hash="035148c907bab6ccfca027cca4842f48"/></dir></dir><dir name="readme_files"><file name="cover.png" hash="43d4fa2e91aa504f40c1da5542cd324c"/></dir><dir name="test"><dir name="Conekta"><file name="ChargeTest.php" hash="6bde92ef46be4d43089a020f17843de4"/><file name="ConektaListTest.php" hash="c187dbb03fa304fcc478cb859b76ba35"/><file name="ConektaTest.php" hash="857e86904cac8d0c070ecdc7176c5946"/><file name="CustomerTest.php" hash="186bbfca3ae90c2f217f367a6618a958"/><file name="DiscountLineTest.php" hash="57bc933e05abb177c9d7abbb7b475581"/><file name="ErrorListTest.php" hash="ebd1e90fbcdd695ab63d829b024f44ca"/><file name="ErrorTest.php" hash="f017463a06a93e3bacb12aad9a8b3cc5"/><file name="EventTest.php" hash="f24bcdead5d50c375dd77270cffeb9ab"/><file name="FiscalEntityTest.php" hash="7b5f844e02a85147f4fc718a1ccbcafb"/><file name="LangTest.php" hash="38845b3e4daf546a035a5cb010b39805"/><file name="LineItemTest.php" hash="96435a7e7651cbc308b685fb92269571"/><file name="LogTest.php" hash="a34e08735c724cc915dfea0e2a8551a6"/><file name="OrderTest.php" hash="4abcd0b36c9c2cd8e92c920e9d68bd7b"/><file name="PayoutTest.php" hash="c4d4641babc9331edc981051b5a8b93c"/><file name="PlanTest.php" hash="6891049a6c69a661176037e9f0194f4c"/><file name="ShippingContactTest.php" hash="17593524aa6cacf4eac38cce0f8b8d76"/><file name="ShippingLineTest.php" hash="bc7ce43fca6052c6090f28b77c7b1b65"/><file name="SourceTest.php" hash="2557079c2284ceab7054105c61ac219f"/><file name="TaxLineTest.php" hash="a66a549bff0a7d517b9393487fe022b0"/><file name="TokenTest.php" hash="e51027f7abd634f25f7b4b4246a573cd"/><file name="WebhookTest.php" hash="34570eef9543f10c27287f04176ccf03"/></dir><dir name="Conekta-1.0"><file name="ChargeTest.php" hash="1edd12751da43d51ae250d1a67b34316"/><file name="ConektaTest.php" hash="857e86904cac8d0c070ecdc7176c5946"/><file name="CustomerTest.php" hash="6c543b05a7e5b4ab56202f909ccb59c3"/><file name="ErrorTest.php" hash="9a7f787073ff8b3937f75071ca6c09ca"/><file name="EventTest.php" hash="f24bcdead5d50c375dd77270cffeb9ab"/><file name="LangTest.php" hash="38845b3e4daf546a035a5cb010b39805"/><file name="LogTest.php" hash="81c766cdc5a683569b0cef798d63b2fb"/><file name="PayoutTest.php" hash="22ca25989c9e8a2ce0476030133dafae"/><file name="PlanTest.php" hash="e00a75d8aa2d9c96ecbe3274cd36028b"/><file name="WebhookTest.php" hash="ae1e32fe91159f0d72a691a426d79f3c"/></dir><file name="Conekta-1.0.php" hash="b4c061ccc4f13394da2cc62d3c60705b"/><dir name="Conekta-2.0"><file name="ChargeTest.php" hash="9ca59bc2604b66692f8b1d8479721d7a"/><file name="ConektaListTest.php" hash="713cc142c0849d7eca9c59b92e8ab96a"/><file name="ConektaTest.php" hash="857e86904cac8d0c070ecdc7176c5946"/><file name="CustomerTest.php" hash="cc1380f567fca084e9b8a95a3afa6dcd"/><file name="DiscountLineTest.php" hash="d58ca4f45a3315aec38b69254430f122"/><file name="ErrorListTest.php" hash="1cb79e0d1cdff33542851d98eab3ddbb"/><file name="FiscalEntityTest.php" hash="ec06f47821fde2f1723490926e49ea0d"/><file name="LangTest.php" hash="38845b3e4daf546a035a5cb010b39805"/><file name="LineItemTest.php" hash="2e8eb8d313a344a7338004dbc27fa19c"/><file name="OrderTest.php" hash="325a56f30229f2dfd6b668fe4cf6b6c6"/><file name="ShippingContactTest.php" hash="be6f86a1c435d9318886b282bb547b28"/><file name="ShippingLineTest.php" hash="56c633d3a5e016800f1aa60972c8cfa2"/><file name="SourceTest.php" hash="7754765bb7fa3fd250f0291cfa4942c2"/><file name="TaxLineTest.php" hash="bf4dc5ad0f8b784578eafadcfa5c68c4"/><file name="WebhookTest.php" hash="34570eef9543f10c27287f04176ccf03"/></dir><file name="Conekta-2.0.php" hash="85cce068931d60b81321aae579e3cdf7"/><file name="Conekta.php" hash="21444faa250b62144eada50339c5f489"/><dir name="support"><dir name="fixtures"><file name="orders.json" hash="e873d087f2c3e2b30ce32d5f0c08c7d6"/></dir></dir></dir><dir name="vendor"><file name="autoload.php" hash="af8e9ab968332411505aafb78acb8ce0"/><dir name="composer"><file name="ClassLoader.php" hash="3e420cbf8bc3c56158e3dcd277613b03"/><file name="LICENSE" hash="084a034acbad39464e3df608c6dc064f"/><file name="autoload_classmap.php" hash="df3f1202396bd228a9280fa44c9441b4"/><file name="autoload_namespaces.php" hash="35e12c7d76c4a81633bcf547c0e229a9"/><file name="autoload_psr4.php" hash="dd3a00f0d13eb29781edd8c77d4c5100"/><file name="autoload_real.php" hash="28bef80f182e2056db8aa5ac2ff96d98"/><file name="installed.json" hash="99915314ba4af269b4f7a678edfbecfd"/></dir><dir name="simpletest"><dir name="simpletest"><file name="HELP_MY_TESTS_DONT_WORK_ANYMORE" hash="3f406bdc4f474b19e7063a816796fbe5"/><file name="LICENSE" hash="5804fe91d3294da4ac47c02b454bbc8a"/><file name="README.md" hash="9a1a55ea734a189a45218d64a3fc4414"/><file name="TODO.xml" hash="2d139c030cb4b9e795c40e519d9f8aa6"/><file name="VERSION" hash="30a04cf33ee91a3ecf4b75c71268f316"/><file name="arguments.php" hash="4c6194e05032ba054e8794843005c276"/><file name="authentication.php" hash="225f1aa1f5e576c226fa55f0f5fdb3d3"/><file name="autorun.php" hash="07b636ac423f644f61e1efe5836cc2c5"/><file name="browser.php" hash="e3763dd907fdcefebeb362dead3bd297"/><file name="collector.php" hash="d32b42465099ac97c71a74bfdeeeaa3d"/><file name="compatibility.php" hash="71fa238285cf0cd6a1ba454025fc8621"/><file name="composer.json" hash="3f5ded2bac5dd27faf52fddb17c27d54"/><file name="cookies.php" hash="ce93a09c12ee4127c4036f9af0dbfb09"/><file name="default_reporter.php" hash="66fc41c96027ae79e0b74fb4f5f40d17"/><file name="detached.php" hash="52ae08c35f7ec5ee12d67f83214d4e34"/><dir name="docs"><dir name="en"><file name="docs.css" hash="5b7dbf32aa4131ede54d0fe94132679c"/></dir><dir name="fr"><file name="docs.css" hash="0f93d4963f3ff9e76560b8a6e347311c"/></dir><dir name="it"><file name="docs.css" hash="5ac7c8b1922e9f1ef1da90de9ac41b18"/></dir><dir name="lastcraft"><file name="README" hash="fc2dc2ade984ecf05bcccd9ff57f1f02"/></dir><dir name="onpk"><file name="README" hash="c4fd86ddf38fae7b3a2776cef85a3fe4"/></dir><dir name="pkg"><file name="README" hash="cd13a15621e570aa2c14ccb31416e2b6"/></dir><dir name="simpletest.org"><file name="README" hash="acccb858df6e845ce4fd96414bc68e0b"/><file name="favicon.ico" hash="3da65fcd78587c78f4318766920adbf7"/><dir name="images"><file name="book-domain-driven-design.jpg" hash="1859db386d5cb80d5961bd63661ea7e0"/><file name="book-guide-to-php-design-patterns.jpg" hash="1b4465bf27bf9560521c5ffa8fe2eac7"/><file name="book-the-php-anthology-object-oriented-php-solutions.jpg" hash="d40cd1936cfd934c46d02b4be32c3431"/><file name="quote.png" hash="6d4f92821e22fdb3df82fb4e0e52df73"/><file name="simpletest-contribute.png" hash="6a254fb62293d9e3ea30244f0ab21cb4"/><file name="simpletest-download.png" hash="2169293cf557234b382fd77dffb21e5d"/><file name="simpletest-external-bottom.png" hash="261e7efc8d623cd10bafafe4c1912a0d"/><file name="simpletest-external-middle.png" hash="ce3fc96e3643a06962aed7239e41de6d"/><file name="simpletest-external-top.png" hash="88839a4a297065e69b2d75b2bb8aa541"/><file name="simpletest-internal-bottom.png" hash="cab42bcbd4db5ba4dce668c1e17883f9"/><file name="simpletest-internal-middle.png" hash="d81e2658da3bee581c6464a68b4914d7"/><file name="simpletest-internal-top.png" hash="e19a97b38a9ce14b3e716d8ec812e1f7"/><file name="simpletest-logo.png" hash="44761b8a3267bbc3f12d130c65f1468f"/><file name="simpletest-start-testing.png" hash="10d2a1a66ed890f341acf4c9890c9b8d"/><file name="simpletest-support.png" hash="b2439ad8ad05db490f70aad010dc159a"/><file name="test-in-cli.png" hash="9ad0b5a8b32a9a7f1b58b2dad9a0162d"/><file name="test-with-1-fail.png" hash="f0a51f709293abf10b597104db5e086d"/><file name="test-with-1-pass.png" hash="1d559637183bd3ce4e6ec027032c57df"/></dir><file name="index.html" hash="f6c1f9e20b5be23ec3dcaba9bb61f8f8"/><dir name="js"><file name="jquery-1.2.1.pack.js" hash="ebe0ea764139f30972055e9f79972277"/><file name="jquery-speakers_coaches_consultants.js" hash="3240cc94790e14310e1b888e04177fc4"/><file name="jquery.heartbeat.js" hash="b4172c0601a9b2f5119c6ae21cf3e26e"/><file name="jquery.sparkline.js" hash="5dd0c5160bc61f966731f7372be48b40"/></dir><file name="simpletest.css" hash="eefdfa08047f9843b5ffa164378c4d2a"/><dir name="views"><file name="heartbeat.php" hash="3d058a12be15758164fd1b1818948009"/><file name="photos_stream.php" hash="70e3335e53a21d09ea8e2ddb71d4a0f8"/></dir></dir><dir name="source"><dir name="en"><file name="about.xml" hash="6d39ebe29794b672b44a56317185fb48"/><file name="authentication_documentation.xml" hash="19994a81057bd6917dd6d5dad36d1d24"/><file name="books_website.xml" hash="221d7cb35bf610ac6a98a6c744161d63"/><file name="boundary_classes_tutorial.xml" hash="83f604a5e1ea5ed827f0470a0c63f6a4"/><file name="browser_documentation.xml" hash="d7234400c7f56781e354a7dc96a935d6"/><file name="changelog.xml" hash="66f8bd7170bb5b11945f590d6cc4c106"/><file name="coding_standards.xml" hash="c0fcaca889bf8c40bc2d24701fbb82d8"/><file name="display_subclass_tutorial.xml" hash="f26cb02634a13d4cdba30fdd3179701d"/><file name="download_website.xml" hash="46f25c6012eb58b9fdcffa4c2a0a8115"/><file name="expectation_documentation.xml" hash="bb53c3a5e02df320ff4ccec3bef8fd82"/><file name="experimental_dom_tester.xml" hash="8c10699fdee68185ace58906d57c3740"/><file name="experimental_intro.xml" hash="a838a73ad96b076cd7f912b6614c7acd"/><file name="experimental_recorder.xml" hash="e5c345c470283acf26bcfca3779dec85"/><file name="extension_eclipse.xml" hash="17d89b7b38b41c584d3be8461a387722"/><file name="first_test_tutorial.xml" hash="1b6b23e96023decca4283d3d91861dd3"/><file name="form_testing_documentation.xml" hash="8d1995b71c3c128345b0ca901bb065f4"/><file name="gain_control_tutorial.xml" hash="79db24d6407f217b0305230d2912ddfb"/><file name="group_test_documentation.xml" hash="6ad611331cd1df021f8e73654789fac1"/><file name="group_test_tutorial.xml" hash="e541a1feeacfa30b4aadb89ddb0d0cce"/><file name="heartbeat.xml" hash="3cb3df4745c7f3eb2898c3ae982e225f"/><file name="ideas.xml" hash="51065e174db3cff947159e78d285b68c"/><file name="improving_design_tutorial.xml" hash="e11bd92ec44121e43cae2f8fcdd7c3d7"/><file name="index.xml" hash="47114a47fec3ef9b0b6bbcbda9b23c6e"/><file name="intro.xml" hash="008e0ab06f0f7c46646abe0e0b161138"/><file name="mock_objects_documentation.xml" hash="181f407ab63f18dcdef5da501a400e05"/><file name="mock_objects_tutorial.xml" hash="e630aa76458d83c33737bb4a838d772b"/><file name="overview.xml" hash="117c63809c0c3935c27e2a4862d02d01"/><file name="partial_mocks_documentation.xml" hash="862aa39bc35f0b05e5a53baf82a08456"/><file name="photos_stream.xml" hash="30391a258322b1acbc03479128903fa6"/><file name="reporter_documentation.xml" hash="d085908d92d5fe762d707a86d78c95fd"/><file name="screencasts.xml" hash="31d954a2472c41323f72f9db4986819f"/><file name="simple_test.xml" hash="03f04037fba6bdc15fe6a5329384e76e"/><file name="softwares_using_simpletest.xml" hash="098ec0ef382da86bfab983f8ee7bbffe"/><file name="speakers_coaches_consultancy.xml" hash="a25abcf66ddadc3559cdd02b30bc5ae1"/><file name="subclass_tutorial.xml" hash="7c63b99cbc12b7306c751ec3a8e3f8f9"/><file name="support_website.xml" hash="7f4c7d8efd1244e2febbd6d55fce3fec"/><file name="unit_test_documentation.xml" hash="95c70a8b86ae2af050344b9909837eeb"/><file name="web_tester_documentation.xml" hash="c7de94ccc38c3292c06324abd4c9c404"/><file name="writing_extensions.xml" hash="a6cf1d316aeecfe6b62f49110ba40178"/></dir><dir name="fr"><file name="authentication_documentation.xml" hash="5e9b5f0e83dabc6821bc9355822141a3"/><file name="books_website.xml" hash="6dcff10571b04c9882b23c222c36921a"/><file name="boundary_classes_tutorial.xml" hash="a53d99a183d6bf3b02c05a845787bac5"/><file name="browser_documentation.xml" hash="2f5a38c865948566c1ee0aed97d987a4"/><file name="display_subclass_tutorial.xml" hash="6f68ff2370c3cdb21f947e6bce99b082"/><file name="download_website.xml" hash="200f02d1cabe455bbb02a125cfa61bf0"/><file name="expectation_documentation.xml" hash="aa84acd07fb8a1b8dbcdbee98260ae34"/><file name="extension_eclipse.xml" hash="8bb81a19b50908542d5946e2379964ad"/><file name="first_test_tutorial.xml" hash="1ab59cf29a5a1cc1e855d5f1f1a408be"/><file name="form_testing_documentation.xml" hash="da2defce5ed3a57f078435dcf99cc39f"/><file name="gain_control_tutorial.xml" hash="edcc56a348cba9a8ecb8a17012a0845c"/><file name="group_test_documentation.xml" hash="b509b96b7895bea18befef25094eb77a"/><file name="group_test_tutorial.xml" hash="6d0ef31a33c03eaff46b29dee5274772"/><file name="improving_design_tutorial.xml" hash="e180ef801599f7789d3e588b8459f35d"/><file name="index.xml" hash="0e6ecc4f019f208a84deefbd51a6f2c1"/><file name="intro.xml" hash="cabbc40bd72f65511d1e5cd8f4319055"/><file name="logiciels_utilisant_simpletest.xml" hash="b837d7e3dcdb84422bdf0eca1b557f9d"/><file name="mock_objects_documentation.xml" hash="a063715560a4fed9e8596c398e2e3acb"/><file name="mock_objects_tutorial.xml" hash="27ef3d69dbe5d62ea5c3569836bae875"/><file name="overview.xml" hash="f6ce2f96d0cbea507e02bddd7ad67eb2"/><file name="partial_mocks_documentation.xml" hash="eec2acc0705cd40380b3269b7aec97a3"/><file name="reporter_documentation.xml" hash="0c72e1ef975ee9ba9fd86505cb79f7ad"/><file name="simple_test.xml" hash="d64a81a9f79957e5bf49d46049bb60e8"/><file name="subclass_tutorial.xml" hash="bd6b9c76f7b2191ebb3038f24915a04f"/><file name="support_website.xml" hash="1ce933485528c6cafbfa6771ce5c7408"/><file name="unit_test_documentation.xml" hash="bc1a100fd2936ab60f70d58e4fdba508"/><file name="web_tester_documentation.xml" hash="9899e6ad8af338fba4e8d9ac4d5a6b59"/></dir><dir name="it"><file name="about.xml" hash="923b75582ff95061ee00368197ded617"/><file name="authentication_documentation.xml" hash="c8c46ac93a719f5e617acb8923a14d47"/><file name="books_website.xml" hash="6d8f1b775dcd1c0e5e12d048538f92d6"/><file name="boundary_classes_tutorial.xml" hash="1c2ff2c2bfecad602ba6c44bd39bb4c3"/><file name="browser_documentation.xml" hash="1160f5ca6a3471a395f8e57c93072123"/><file name="changelog.xml" hash="72d655f005d76f7fb2e139a499e01eb6"/><file name="coding_standards.xml" hash="3b6f04d4b40c6c61c9b82fe59a1cd7c2"/><file name="display_subclass_tutorial.xml" hash="d138c6530471fdec4af8ce06de159235"/><file name="download_website.xml" hash="8feeb56c79bf112de7cbd6839aee8f2a"/><file name="expectation_documentation.xml" hash="01a333342a32ec82d2bf0bb7145b3e7e"/><file name="experimental_dom_tester.xml" hash="3f03247884e746e330766555d5221b9c"/><file name="experimental_intro.xml" hash="5d82baa6ee7d7bbaee8d4e82cd9a8a31"/><file name="experimental_recorder.xml" hash="007ffc2aaaf73d2ddfda9224bee9a9cf"/><file name="extension_eclipse.xml" hash="5550c74d3aabd9f346b5b6c5b25b4f9b"/><file name="first_test_tutorial.xml" hash="f972dc2ac2fdb69cffad2149ab7034ac"/><file name="form_testing_documentation.xml" hash="5e4312fe41301c99d08e960184809124"/><file name="gain_control_tutorial.xml" hash="84446a8a56c1d218ca280508f5562d29"/><file name="group_test_documentation.xml" hash="d9658f22648ed2129b1ca92f996fe420"/><file name="group_test_tutorial.xml" hash="767644a28186d8144822ad7c3faf404e"/><file name="heartbeat.xml" hash="a6cbf305d35b308ad166506c5238bfd1"/><file name="ideas.xml" hash="275ddbde6191c604c801d2d92142cee0"/><file name="improving_design_tutorial.xml" hash="392d76bc2a26f847d891d0bd7ba17e1b"/><file name="index.xml" hash="2946afd04340068e4e779713edcc0f6f"/><file name="intro.xml" hash="b4c61c9e581580e61eea60acef37c433"/><file name="mock_objects_documentation.xml" hash="54bc5978459bc4a7bc784fbeacf35596"/><file name="mock_objects_tutorial.xml" hash="6ee072398983265038b4a3105f9c7560"/><file name="overview.xml" hash="1d95af8965218c166ff3ca9354d1f361"/><file name="partial_mocks_documentation.xml" hash="348ea1d2bcb49f7e25870b65099748cb"/><file name="photos_stream.xml" hash="78369acd568e0a2cdb462e5a36266825"/><file name="reporter_documentation.xml" hash="4e9df7fde40ead71d18ed89cbea13211"/><file name="screencasts.xml" hash="f2d0e1866c3886f12d9168e5271e9f58"/><file name="simple_test.xml" hash="f1d678a66712d91716d39f4ff1974c9c"/><file name="softwares_using_simpletest.xml" hash="9da6235f328aaae7d23b2f18a533badd"/><file name="speakers_coaches_consultancy.xml" hash="3acaebe7a5d0b8784fc3a7b87bfa8ca7"/><file name="subclass_tutorial.xml" hash="be157d2ea3bb13fafa24baa38fde47b1"/><file name="support_website.xml" hash="23bc1ee0c9427969947dede9215bc289"/><file name="unit_test_documentation.xml" hash="66042a13a46ec24c87e68f2d7a7ee172"/><file name="web_tester_documentation.xml" hash="37e7ac35659745fd632de39fe6e75347"/><file name="writing_extensions.xml" hash="c4affe3f6d2441ba5a37bf6a0c570d28"/></dir></dir></dir><file name="dumper.php" hash="f4a8478cfc033ce567c053ca6ed844ba"/><file name="eclipse.php" hash="7a66eafab9d025316c049733d893b09a"/><file name="encoding.php" hash="f2d77aba0fb15d0ded526060a4cd8724"/><file name="errors.php" hash="db938b577288bd6d06a21b40daebf6e5"/><file name="exceptions.php" hash="a8bc5f58d12f3d640cc1a2d6cea42970"/><file name="expectation.php" hash="05b00c7a47f4331bb492ba0dbe6e354e"/><dir name="extensions"><file name="colortext_reporter.php" hash="9da03e2f8c2923205ddbc0c1922d9438"/><dir name="coverage"><file name="autocoverage.php" hash="6c4bf1f9cfaf1e2a44f8e1daa22f817e"/><dir name="bin"><file name="php-coverage-close.php" hash="93e7d76d232b24a3ddf29a58ae81ac36"/><file name="php-coverage-open.php" hash="b68fe18909158074805f28a09e9231d3"/><file name="php-coverage-report.php" hash="132c91ee2a8c0675898e8ad314aa421a"/></dir><file name="coverage.php" hash="2b49981614e4d124ec5fb957a5ebf54f"/><file name="coverage_calculator.php" hash="74cc62ca660885af88b77cd138e90884"/><file name="coverage_data_handler.php" hash="2ce3631df3fe8bb0abd032dd49e5ab67"/><file name="coverage_reporter.php" hash="982e3b629f47c043f667cceb809ad66b"/><file name="coverage_utils.php" hash="987a1fd23caa86ccf4392dbf058d604c"/><file name="coverage_writer.php" hash="4863fda0a8bd9edb87e27e911622b9f7"/><file name="simple_coverage_writer.php" hash="dd76d62cdfb5e4fabb583c8722f4a0f8"/><dir name="templates"><file name="file.php" hash="50530c678b4e01d2098195da2e4f3281"/><file name="index.php" hash="5c704447f52c136e8f0c93fb0769cb29"/></dir><dir name="test"><file name="coverage_calculator_test.php" hash="d7d32298bc3a93075caad25323489459"/><file name="coverage_data_handler_test.php" hash="2493d24d212e96bd65dcdf705a30d44c"/><file name="coverage_reporter_test.php" hash="9fdf89a4894b45d4546fd07925f736c8"/><file name="coverage_test.php" hash="558a1c6bfc5756461e4704c99b3db20b"/><file name="coverage_utils_test.php" hash="9391fa69a9457ebbf0d902bc196e452c"/><dir name="sample"><file name="code.php" hash="4483572d5657ec564fc35c06f2f7a4e0"/></dir><file name="simple_coverage_writer_test.php" hash="90f7da3df27afe225e0122112c36b8fe"/><file name="test.php" hash="d01d5cf3f4e7152af32101a1cdab2f0a"/></dir></dir><dir name="css"><file name="webunit.css" hash="b764971cdf3f5dd6cc89fc923a9d8321"/></dir><dir name="dom_tester"><file name="css_selector.php" hash="b1db3d4a4f78733d7bbf166c654ec74d"/><dir name="test"><file name="dom_tester_doc_test.php" hash="678afaa853c3905f2da4cf7a0c223bc3"/><file name="dom_tester_test.php" hash="4ceaecb82b50759a27cfe80217fec3cc"/><dir name="support"><file name="child_adjacent.html" hash="6bf975cd518a9c81ef479adb9c7d9c4f"/><file name="dom_tester.html" hash="254430e082cad52d61665be7549442a6"/></dir></dir></dir><file name="dom_tester.php" hash="9f872457e43deb2a994ad57a759ba16b"/><dir name="img"><file name="wait.gif" hash="5cdd3d1eaa03216e9c16840b7a6f8d6e"/></dir><dir name="js"><dir name="tests"><file name="TestOfWebunit.js.html" hash="63cca591ca1be6ece6c89ceb01150701"/></dir><file name="webunit.js" hash="f74982d6fcf5aa3dd3f0e16c94493fb5"/><file name="x.js" hash="d23f58b9b98b778aac7248e31a28b9f8"/></dir><file name="junit_xml_reporter.php" hash="f58b152488a250f459cac3924e8dcba3"/><file name="pear_test_case.php" hash="ce02457889e1fd7e9cfc23e1a42cf50b"/><file name="selenese_tester.php" hash="0318c68b44439582a1c21b7f1f6bf986"/><dir name="selenium"><file name="remote-control.php" hash="6271054521fdf0140704e7ede1697b69"/><dir name="test"><file name="remote-control_test.php" hash="fca468414168b65355e7386eae50277f"/></dir></dir><file name="selenium.php" hash="61668613373373ceac57ad1e58545fb9"/><dir name="testdox"><file name="test.php" hash="95611e38fc6ce476c2da971eccc56b14"/></dir><file name="testdox.php" hash="0a516e7962be9479f98549fb48ac8e4f"/><dir name="treemap_reporter"><file name="jquery.php" hash="d78daf57cb98be89a11d0e0ab43b2650"/><dir name="test"><file name="treemap_node_test.php" hash="234531dafc2f74ef7c5904b3e8143859"/></dir><file name="treemap_recorder.php" hash="aa4c0c29664d04448f846371c5080788"/></dir><file name="treemap_reporter.php" hash="7d34ffd35e5ef6fd749bc25348f1c62a"/><file name="webunit_reporter.php" hash="331f7fabd83f54553e372cb864676b38"/></dir><file name="form.php" hash="6b2a25e18e45aadba2dcc351e98a2b5a"/><file name="frames.php" hash="fb19dc3564fce2f43b3b5b7867a7d75f"/><file name="http.php" hash="b282fa48bca0ad837d0b30ce3d0c3a28"/><file name="invoker.php" hash="b3482030f6f245cc64cef9f014d45f87"/><file name="mock_objects.php" hash="d65cd917978a294d978c1604aeab3d2e"/><dir name="packages"><dir name="coverage"><file name="generate_coverage.sh" hash="ecd3e44a45f56eaa33518572a273503a"/></dir><dir name="lastcraft"><file name="lastcraft.xslt" hash="c71c8217b83f703c6294dcdcda5be290"/><file name="make_lastcraft_docs.sh" hash="8978ed7ca3660a7123566f8541907f11"/><file name="site_map.xml" hash="bcd564acd3eb3cff5a18686f02637a56"/><file name="transform_all_lastcraft.php" hash="cd2821d4c57898157ab5081f600f9378"/></dir><dir name="onpk"><file name="map_onpk.xml" hash="f17c2dab0b4efa4fcc6d36416ce9eef9"/><file name="onpk.xslt" hash="4b0d049cca443dce8cd61dab712079d0"/><file name="transform_all_onpk.php" hash="9736c0e920674516df65e79f692dd180"/></dir><dir name="pear"><file name="package.xml" hash="dac6d5411165d37a1b38704e6f54b274"/></dir><dir name="phing"><file name="extension.xml" hash="be4b310fccd271f884bb1bf8820df119"/></dir><dir name="phpdoc"><file name="make_phpdoc_docs.sh" hash="c91c7dc65f37a42e8dce403a439917f2"/><file name="phpdoc_docs.xslt" hash="504a9ca691ce8f8a5de26a6b6ef55793"/><file name="simpletest.ini" hash="d7f0cabe8bd211f414297a475b72222c"/></dir><dir name="simpletest.org"><file name="index.php" hash="09bd28a5f3930a2533084e0d49357c12"/><file name="integration.php" hash="4c11262a6b77ba1c7ba5cf139b5a4228"/><file name="map.xml" hash="4b1cf9fdd2a0fb6920df3793ab933f1f"/><file name="package.php" hash="5c5464196aea20948a6b042eca58c341"/><file name="template.html" hash="6eaa5af4a917150f42ef43eab9691255"/><dir name="test"><dir name="package"><file name="content_without_section.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><dir name="en"><file name="synchronisation.xml" hash="cfad55fdd47691e5d5ffc49d0dc73804"/></dir><dir name="fr"><file name="no-synchronisation.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="synchronisation.xml" hash="402eb1fe6abf7479bb93600c6680ca55"/></dir><file name="here_download.xml" hash="4ed80f3e0e12ec023e71e2efab3daec3"/><file name="here_overview.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_simpletest.xml" hash="ec1e970e4e681f61745ea034b8e2911a"/><file name="here_start_testing.xml" hash="05069ab0f30fddc69c189cf54d5b1fbb"/><file name="here_support.xml" hash="42a071977c1d5cf7419165ff504fcc6e"/><file name="here_unit-tester.xml" hash="17f28ae6cd7cffd61bb7b5da5e1c2282"/><file name="map.xml" hash="830a0d14f19d9a2d2a0ca4d87f95e60e"/><file name="one_section_changelogged.xml" hash="ef839cfab9c2901bc933c676a7bb8ac1"/><file name="one_section_milestoned.xml" hash="9bab3e9f367606a36d4a1e9c242c2a97"/><file name="one_section_with_autorum_php.xml" hash="70592701244fc5d737fa8f10e0b60440"/><file name="one_section_with_php_code.xml" hash="88ffca5e5d3500baaf12cdbc283f1a82"/><file name="script_and_ul.xml" hash="0e0d425619b28d352aaee73ffb9dab98"/></dir><file name="package_test.php" hash="9587007e4428dc361c5d401dd9548933"/></dir></dir><dir name="sourceforge"><file name="build_tarball.sh" hash="e6f37d859fae8a720814ce6ca19bf04f"/><file name="bundled_docs.xslt" hash="d6fd9824f6bd7e5836ed7830bdecd5fe"/><file name="bundled_map.xml" hash="8e0114ac5fafe32432b2411ad658d0a3"/><file name="make_bundled_docs.sh" hash="daf66c5e7f4b127c4e2be65a6a4cad08"/></dir></dir><file name="page.php" hash="e1b7d6443461f6b38fe35e6d93196302"/><file name="php_parser.php" hash="88a3ac023682dd506d0bf9a83a163928"/><file name="recorder.php" hash="0f7054d9ec8f397847776a6b23486b3c"/><file name="reflection_php5.php" hash="7d8f9f2b701a31b702805812eb27ad60"/><file name="remote.php" hash="faee7e6c71a75c5837c126d69212c1a4"/><file name="reporter.php" hash="1a45fad1b8cf0e0cbfa59436a7db69f1"/><file name="scorer.php" hash="407afbc78ede064047284efd06d1573a"/><file name="selector.php" hash="74fdcebec47f531d27ff31c70f58ddbf"/><file name="shell_tester.php" hash="ae7e4cb05db2dc3a1e8cdb9e5fe687b7"/><file name="simpletest.php" hash="27bd3557db083b9a3d0826e318a8ba43"/><file name="socket.php" hash="c7bca250fbab409082a7f4cba0cb92e5"/><file name="tag.php" hash="8c31276f078afbccd555f14a8522638d"/><dir name="test"><file name="acceptance_test.php" hash="ffb78c72da45769bd05480bace0e2440"/><file name="adapter_test.php" hash="089ed2dc33360dd8dda7d44f51347e0c"/><file name="all_tests.php" hash="e1cca5d913429f57f667e39340e6c3cd"/><file name="arguments_test.php" hash="fae94db949b54c9b7385a7ccacaca2b3"/><file name="authentication_test.php" hash="f16bcef77c7767ff20f828a758684736"/><file name="autorun_test.php" hash="1dce083825d8a7c8c127852e5802730d"/><file name="bad_test_suite.php" hash="181e5a57778639aeb3037ed51f062f69"/><file name="browser_test.php" hash="378d34c1fa3be0d68b22bcc674e4fb95"/><file name="collector_test.php" hash="40f68067c2c0e52ebf47c51183f4fbb8"/><file name="command_line_test.php" hash="500bd4bd8c8875b6f0dacad7a3d8622e"/><file name="compatibility_test.php" hash="d694b2e0183107afc232127b17bd511c"/><file name="cookies_test.php" hash="32e4ee16a213770dd99cd0c731950624"/><file name="detached_test.php" hash="344b507bccce782816b75c5c5da6d43d"/><file name="dumper_test.php" hash="d18d27b103f5ae962110a3b8a2e2205f"/><file name="eclipse_test.php" hash="b35ef78293d35ed1957eed94001df827"/><file name="encoding_test.php" hash="6f05c408bc8334418e8dd9d642033eaa"/><file name="errors_test.php" hash="712319188ac8f4eaa1054bde188a286e"/><file name="exceptions_test.php" hash="462c79c331ec0e540226b7d9bc9f2a85"/><file name="expectation_test.php" hash="b18301ebd50c3d76d9ec06f81d234a79"/><file name="extensions_tests.php" hash="88b81a9c71306a3cb1f8ec9597afdd36"/><file name="form_test.php" hash="6d1d1f5061428c3cab015694a7245de6"/><file name="frames_test.php" hash="ada1a277bf3688798d0464ef46a88e3d"/><file name="http_test.php" hash="4c0f306118ce47dfe22391d45f894530"/><file name="interfaces_test.php" hash="bafa0b74ecc836b9a39122d07b3fd6ef"/><file name="interfaces_test_php5_1.php" hash="33d42f8f1e928992bce67bae86d87e25"/><file name="live_test.php" hash="baee207bfcb55040feab53e565044365"/><file name="mock_objects_test.php" hash="64655b2744dee434469f6fe886f03483"/><file name="page_test.php" hash="a603ae712d1ca14450fc1fb80fa79d86"/><file name="parse_error_test.php" hash="01d19d1fe037033ae5b355a05422e82a"/><file name="parsing_test.php" hash="79315ef0998e5461c92da47a079f9ba0"/><file name="php_parser_test.php" hash="3e19d9ef36e7ff9da2ab81c632f25fe2"/><file name="recorder_test.php" hash="6e344c31000040c9a76e677eae5d760e"/><file name="reflection_php5_test.php" hash="469b67b9068b0ee9ddfedaed00bb490b"/><file name="remote_test.php" hash="23ae612ef6868226b8cd8dc5a5c76817"/><file name="shell_test.php" hash="6f25f47bb4278412badd23f686bc33e7"/><file name="shell_tester_test.php" hash="1f82c2fe96ce2ae73ce23fa768000453"/><file name="simpletest_test.php" hash="19c00c1e9cf94278051979137f8b190c"/><dir name="site"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="base_change_redirect.php" hash="3e7a9d0864439800d307d14f0ac23427"/><dir name="base_tag"><file name="base_link.html" hash="0fb0d4fc58c8efcdc4cc6a072406f333"/><file name="form.html" hash="4bf5728fb5793ba11a5e7ab865c50eac"/><file name="frameset.html" hash="206047c4f8b5aae344cd8cf3c9e8a5fa"/><file name="frameset_with_base_tag.html" hash="3b6bb1fbaa042d563d52fcc25c46fe61"/><file name="page_1.html" hash="2eeff2e06cb559e268d3023601ea9138"/><file name="page_2.html" hash="0c8670422465c7d990c8dae999e5bdf7"/><file name="relative_link.html" hash="c1555e3d568e959151309e1b5c6e6db1"/></dir><file name="cookie_based_counter.php" hash="dd7773002a7c5e03903b6cf35bcd522e"/><file name="counting_frameset.html" hash="0ebea4dd9f202014e8f7f90deb6bba8d"/><file name="double_base_change_redirect.php" hash="832b47dce4bd57f1967e388aa238fac1"/><file name="file.html" hash="4c163986c2dc1f8e74a4069184efb486"/><file name="form.html" hash="1eaab823afab219c4cb99076e20547dd"/><file name="form_data_encoded_form.html" hash="37b364932a59e5653db8d75a1b0f144a"/><file name="form_with_array_based_inputs.php" hash="0ef882721bc167c2ceac74dde0846bd1"/><file name="form_with_false_defaults.html" hash="d1ee151195ddfda8d762ee930955d600"/><file name="form_with_mixed_post_and_get.html" hash="55f87cced77c6d1b2500a50129c1f772"/><file name="form_with_quoted_values.php" hash="52dd4234ddff704133dc8d456b26c883"/><file name="form_with_radio_buttons.html" hash="d23fe6f32223666ae8900bda2906e103"/><file name="form_with_tricky_defaults.html" hash="a2992fd2206048d7f4951585d0268b6b"/><file name="form_with_unnamed_submit.html" hash="08836e7584473a795d372268f97b2e5a"/><file name="form_without_action.php" hash="535adcea7f660b5c563273d4a72e241f"/><file name="frame_a.html" hash="74a7ce5a305fd98dce37b2bdb641b874"/><file name="frame_b.html" hash="85eeec074c8c22d4fcb22ea11419b8d7"/><file name="frame_links.html" hash="83e5b360138b6a5605b9e4d44aa54f2d"/><file name="frameset.html" hash="4bd9f9f57790faba848010c0f54feace"/><dir name="front_controller_style"><file name="a_page.php" hash="bef83009f20b91f6d3c426db0820df35"/><file name="index.php" hash="49460e286d4731d5aa3df6407fa36ab0"/><file name="show_request.php" hash="43425cc05ede659f0435b6631a49ab3e"/></dir><file name="link_confirm.php" hash="c9afbfe455c2b51e5b3e84f6c7b01e0d"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="messy_frameset.html" hash="875d156da96c81bc3509d33562b2eb86"/><file name="multiple_widget_form.html" hash="3cf41196d2ea967e00260b108f82504e"/><file name="nested_frameset.html" hash="223349147fa5af19045de7ca61e9e76d"/><file name="network_confirm.php" hash="6a4f552177ed43aac428fde4206a5f84"/><file name="one_page_frameset.html" hash="d41571bb42d445396bbdb561fc2da3b2"/><file name="page_request.php" hash="035b0fec6b840751e8224c0f1dc707eb"/><dir name="path"><file name="base_change_redirect.php" hash="0920a342a7d43bdc952386ad84dea1b0"/><file name="network_confirm.php" hash="8f1e40a7d4c3dd88a2c31af4f086127a"/><file name="show_cookies.php" hash="b53fb77412c7993061967f1584a34068"/></dir><dir name="protected"><file name="1.html" hash="690406842c0fa8c1410a5ed446ef8eea"/><file name="2.html" hash="2908e6b3a13cd583a33ba632a67e9c23"/><file name="3.html" hash="305affc685eb0a02936290ca92da9551"/><file name="local_redirect.php" hash="0fca22f64311b669728c776b18c03ad5"/><file name="network_confirm.php" hash="b42c1220320892a954fe41ecc2ccb6a9"/><file name=".htaccess" hash="f30780cfeab05516183f1b42e174b700"/><file name=".htpasswd" hash="1de4aa0031b82efd9857e5d688c6b6d9"/></dir><file name="redirect.php" hash="2e785fdceb4ec73f0472997af37c373c"/><file name="request_methods.php" hash="2d2c941a2c9084d8e7446f6b25d32c4e"/><file name="savant_style_form.html" hash="4c4bb6ddffaafa73c698a7af93fb269b"/><file name="search.png" hash="b9fe41794de0476a76987eb3cf4e2156"/><file name="self.php" hash="06f08beff5316e35ca2f784c5e336ebf"/><file name="self_form.php" hash="fa1d902566526b8c5494d734b5631333"/><file name="set_cookies.php" hash="a6ab7bd999ab14bfa9a6c731f465e73c"/><file name="slow_page.php" hash="a08ab767bcaa63cd5b58f88d5dd5d258"/><file name="timestamp.php" hash="7070a50a036292446cce617168841a1b"/><file name="upload_form.html" hash="d04d7e2601c374b6f9ca13de7a58095f"/><file name="upload_handler.php" hash="11d1256048330770f4a4fb0e8435062a"/><file name=".htaccess" hash="61e312cb9d1db877826e8aa77c282b2a"/></dir><file name="socket_test.php" hash="cc9d6986a6df035d5d64c08c0a4ea66f"/><dir name="support"><dir name="collector"><file name="collectable.1" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="collectable.2" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir><file name="empty_test_file.php" hash="e25fc8d36540afc3e2711711385d530e"/><file name="failing_test.php" hash="08f0db1ec0f82084ff8eaf31669820e1"/><file name="latin1_sample" hash="e0e4859fcd6072bedb7aa1b6377d7ff1"/><file name="passing_test.php" hash="9e86efddd8c994598d081b73511ffa4a"/><file name="recorder_sample.php" hash="a1819efa081e91ccf60aabee5a9f7a6a"/><file name="spl_examples.php" hash="2d91c4b7e53f7e88d595ff9764b7541a"/><file name="supplementary_upload_sample.txt" hash="dd7472fdc569c968f2b14e0ad0f13a9b"/><file name="test1.php" hash="93eb5ee5206db603f17258d118c707b9"/><file name="upload_sample.txt" hash="0ce6cebb8d7754c9d4484ce78611d24d"/></dir><file name="tag_test.php" hash="95fe8acbaed8e5baecf47ce65f6b2a1e"/><file name="test_with_parse_error.php" hash="cffe3a940c5ff0e6a95fd4b2fc50113f"/><file name="unit_tester_test.php" hash="a1da5a58a818efdbae9ba4239dd1ba66"/><file name="unit_tests.php" hash="dac770d436709cac163eebb8a888902d"/><file name="url_test.php" hash="32d0880854343d93aa6cd35add0de49a"/><file name="user_agent_test.php" hash="77be8f5317298309b230c8d5b74dbf25"/><file name="utf8_test.php" hash="e8bacf74d12ab935a153f281d493c139"/><dir name="visual"><file name="visual_errors.php" hash="0498691bade2198f83245a1867a66a14"/></dir><file name="visual_test.php" hash="cd7505aaef902b45ad954c2f0fcf025d"/><file name="web_tester_test.php" hash="7d8db06ae24f610409156035646ca0b6"/><file name="xml_test.php" hash="84017dbb0176cec12e6c061e63c6ddf3"/></dir><file name="test_case.php" hash="3b13c289f4645222f4525ca32ff55fcc"/><file name="tidy_parser.php" hash="7d690cbd4174c0dd55650f17776679d1"/><dir name="tutorials"><dir name="SimpleTest"><file name="Expectations.pkg" hash="9588f8942ce97024069767f221f07679"/><file name="FormTesting.pkg" hash="b6fa7c27ffe522859b47edb21409de8c"/><file name="GroupTests.pkg" hash="c3ce22f6736b157a7193907985f041ba"/><file name="MockObjects.pkg" hash="f08cfc567158204e336cde9205b5ea0d"/><file name="PartialMock.pkg" hash="3e9753cc2ac611d08b8aa690817888b7"/><file name="Reporting.pkg" hash="fb0e62ddd5d478ad82df4f1b5fca6824"/><file name="ServerStubs.pkg" hash="75f28c80c87200aecaabd438fd8f92e2"/><file name="SimpleTest.pkg" hash="17b7d6f698822d798daa1174864cd147"/><file name="SimpleTest.pkg.ini" hash="62564da9231425fd5418c891ae0d8277"/><file name="UnitTestCase.pkg" hash="85ee5523757e3dd23fd449aa2612c867"/><file name="WebTester.pkg" hash="73c8600440665a79050b956457ba3caf"/></dir></dir><file name="unit_tester.php" hash="de853cd29e840ebf32cf6cc4219f95a4"/><file name="url.php" hash="e70b1045b89bc75abac39d1cb788b003"/><file name="user_agent.php" hash="d7822a5877b756c6119f6db53916016c"/><file name="web_tester.php" hash="9ecdb17974828fae668f45a8b781a0b6"/><file name="xml.php" hash="7b88c3ef197403483393184b6c1e6af5"/><file name=".gitignore" hash="e8a346051f935e6cb104e1dc40998a91"/><file name=".travis.yml" hash="944c26740b6da869954e34ab87d3bb1f"/></dir></dir></dir><file name=".git" hash="778272e6b6a4cfb49303eb8663669329"/><file name=".gitignore" hash="0e4735425dcb9b32241fcf493492c483"/></dir></target><target name="magecommunity"><dir name="Conekta"><dir name="Bank"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="3ea1dbfd5e3a757d7359eac096fe2de7"/><file name="Days.php" hash="cd07792e8ed27ec523838a9c2675eaf6"/></dir></dir></dir><dir name="Form"><file name="Bank.php" hash="22618b41a43a559ac18c59ae1d19b908"/></dir><dir name="Info"><file name="Bank.php" hash="7e1d809555dcabb68883a8cc427af303"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c86a3d8a0a6409f98de883fe39c18282"/></dir><dir name="Model"><file name="Bank.php" hash="05eea071a9f3f1c5ea9241e03bae7928"/><file name="Observer.php" hash="4da3a54832096659096704213b55db4a"/><file name=".DS_Store" hash="2896fa04c0c017e174ac2e90cc6f03f1"/></dir><dir name="etc"><file name="config.xml" hash="49e6a05a7f28015b7f023d48f07de91a"/><file name="system.xml" hash="ace3a23971997be4bd4029e161a0d2bc"/></dir><dir name="sql"><dir name="bank_setup"><file name="mysql4-install-0.1.0.php" hash="db6e167f787814f665ec2078131d8f4b"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="694caabbb883534a63339c5f1ffaf04a"/><file name="mysql4-upgrade-0.2.1-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="96b8c0c80405296bf04fb86c3e5892d4"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.6.0-0.7.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="f19ebc3ce1e4b4430e11d43bfcd2ea01"/></dir><file name=".DS_Store" hash="5da8b11ab0da69fc4f2c1d1e5c64b200"/></dir><file name=".DS_Store" hash="c5a9a0736f39fbf5c86032b30a59da7c"/></dir><dir name="Card"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Installments.php" hash="7c828e5dc74f4cd717408bf5de48cf21"/></dir></dir></dir><dir name="Form"><file name="Card.php" hash="cbf6f16bacacaf8df45025a8a800fcd0"/></dir><dir name="Info"><file name="Card.php" hash="32ed58d7763b8697395cb2aee5008642"/></dir><dir name="Page"><dir name="Html"><file name="Head.php" hash="62602ff6206bf8b94d24a905b0229a43"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5a279dbd0f0cf90324dab9f597069272"/></dir><dir name="Model"><file name="Card.php" hash="e3b9aa104b15a294119bc2a2a1cdbdcf"/><file name="Observer.php" hash="c7008b436b02e9927911788603c44d1c"/></dir><dir name="etc"><file name="config.xml" hash="9147446d92b9d57670864183cbd3ae5c"/><file name="system.xml" hash="419203bc2d4c8f99dd8020c06a37bccf"/></dir><dir name="sql"><dir name="card_setup"><file name="mysql4-install-0.1.0.php" hash="92381e3159990a46c7dd674c0d4205c1"/><file name="mysql4-upgrade-0.1.0-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="384467a7e6370c5731364738f7d3e00e"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="8b74e1986cd1731f32cde85d32b9c9a6"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.6.0-0.7.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="134b68dc4524ecf5e946f4c1ac9aff70"/></dir><file name=".DS_Store" hash="33907caf9bdf290a2325a3c393d1f4f2"/></dir><file name=".DS_Store" hash="95008b49447c3682216dc504a2bde04b"/></dir><dir name="Oxxo"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="37145f64cbb2110f5a13bdca7a72fe5a"/><file name="Days.php" hash="341151ef5d2a0a4698b570b2df808035"/></dir></dir></dir><dir name="Form"><file name="Oxxo.php" hash="b4ea3507621a3cc55e7682b5b40ca494"/></dir><dir name="Info"><file name="Oxxo.php" hash="5971309dd65d108462164148b1bbfcf2"/></dir></dir><dir name="Helper"><file name="Data.php" hash="815b0990e244ba098fd0772adcb6ff80"/></dir><dir name="Model"><file name="Observer.php" hash="579e7017e195ad3afbc570d20fd3a36c"/><file name="Oxxo.php" hash="35df4edece58fbb38064ff5f4c0e7f06"/></dir><dir name="etc"><file name="config.xml" hash="fd8b119c66b155f7198720fb51fbc5db"/><file name="system.xml" hash="355914552e096428c683eebfec4b9e4e"/></dir><dir name="sql"><dir name="oxxo_setup"><file name="mysql4-install-0.1.0.php" hash="2362488b3b0d450132f7991cb1648c74"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="5ac7a7c41e38ddab259c9ea252b69877"/><file name="mysql4-upgrade-0.1.9-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.6.0-0.7.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="ec42fa86689fbd0d02bfcda24e1b7e87"/></dir><file name=".DS_Store" hash="1354be522e554115468decbe58b16287"/></dir><file name=".DS_Store" hash="95008b49447c3682216dc504a2bde04b"/></dir><dir name="Spei"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Date.php.back" hash="4fd0b98355269c5168956746710d4e31"/><file name="Days.php" hash="bb7a0c3189a0f337fdba4fd7b1f35f33"/></dir></dir></dir><dir name="Form"><file name="Spei.php" hash="11f305f6ed1f924f2c1924e3713f1136"/></dir><dir name="Info"><file name="Spei.php" hash="714d7003f7d336e5a531b8a2ccda1150"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0a9c69b0acac3ace1f110fc6446f42ae"/></dir><dir name="Model"><file name="Observer.php" hash="1a94e64f58d1bde845a8b999e822a77f"/><file name="Spei.php" hash="ca4d43c380f0b308c6722af74a647d69"/></dir><dir name="etc"><file name="config.xml" hash="3c4a395648a36dadb2e368c5e2fae86e"/><file name="system.xml" hash="ab5aad7dd3f67efe8be8968fd9ace626"/></dir><dir name="sql"><dir name="spei_setup"><file name="mysql4-install-0.1.0.php" hash="43006151eb2d8e278cdaf483db52f277"/><file name="mysql4-upgrade-0.2.5-0.2.6.php" hash="8baf3e2e26a0e4841de6e6c76326819a"/><file name="mysql4-upgrade-0.2.6-0.3.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.0-0.3.1.php" hash="ab5be6e3abb5cd4281f96a712346c05f"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.3-0.3.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.7-0.3.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.8-0.3.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.3.9-0.4.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.0-0.4.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.1-0.4.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.2-0.4.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.3-0.4.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.4-0.4.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.5-0.4.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.6-0.4.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.7-0.4.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.8-0.4.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.4.9-0.5.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.0-0.5.1.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.1-0.5.2.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.2-0.5.3.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.3-0.5.4.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.4-0.5.5.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.5-0.5.6.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.6-0.5.7.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.7-0.5.8.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.8-0.5.9.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.5.9-0.6.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name="mysql4-upgrade-0.6.0-0.7.0.php" hash="76c7ba5f9b9cc424e13fd781de2a15cb"/><file name=".DS_Store" hash="c5654f342d2de541796ba43211e18445"/></dir><file name=".DS_Store" hash="704d608d16b127a257ebc254bab30516"/></dir><file name=".DS_Store" hash="95008b49447c3682216dc504a2bde04b"/></dir><dir name="Webhook"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="beab4fdf37091ff4751e994bf4eb565f"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="Url.php" hash="f32b0eeaa0ec7438073debf615129008"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="68c2234a7573e0b6fd5f57a623fcade4"/></dir><dir name="controllers"><file name="AjaxController.php" hash="2be880db9e0541ba0205561f4998268e"/></dir><dir name="etc"><file name="config.xml" hash="0119f453daf3f06ff2484c9bce5b4206"/><file name="system.xml" hash="074920409bbc56f661844540915192dc"/></dir><file name=".DS_Store" hash="086cbff8e6fc0579174399d06e0f5f10"/></dir><file name=".DS_Store" hash="1a2c5f964f374adb311309ebee5cbe21"/></dir></target><target name="mageetc"><dir name="modules"><file name="Conekta_Bank.xml" hash="465ffbbce1f9b2ae5117a82065793db4"/><file name="Conekta_Card.xml" hash="0e54ddadeeb68f84eccd4f793779d2f4"/><file name="Conekta_Oxxo.xml" hash="4f0b2ebdd76cd58c816676d50074fa6a"/><file name="Conekta_Spei.xml" hash="9db396a5b3eea128d8004e211139cd67"/><file name="Conekta_Webhook.xml" hash="a20f99746029abc92a3d42aae1d62b52"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Conekta_Bank.csv" hash="b32880305046367a14fae4d322cba623"/><file name="Conekta_Card.csv" hash="f6b1bf916bb112b281ae33dbb570fa5a"/><file name="Conekta_Oxxo.csv" hash="470f448bdd9154fc60775a0469d487c9"/><file name="Conekta_Spei.csv" hash="4c61037151931d2a4fa65002b863b339"/></dir><dir name="es_MX"><file name="Conekta_Bank.csv" hash="9511ce51ac6622d16f102ea01d579e32"/><file name="Conekta_Card.csv" hash="284831712004802818d4812492e4c4a9"/><file name="Conekta_Oxxo.csv" hash="99991ce72602a02f4c49767eb8e7372b"/><file name="Conekta_Spei.csv" hash="86e205c81ca78d01b613e4bd1cb451d3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bank.xml" hash="67e1d8610affc796aaca52ba854fd74f"/><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="bank"><dir name="form"><file name="bank.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="bank.phtml" hash="e781118478f2546c7924af19024a7adb"/></dir></dir><dir name="card"><dir name="form"><file name="card.phtml" hash="04f3d779c67c1f4b1edb76e070a192a6"/></dir><dir name="info"><file name="card.phtml" hash="7667a88bf6b048edffc73ccbe1501434"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="5bf7bf96ef4a737e0c8c3850e12382f7"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="layout"><file name="bank.xml" hash="67e1d8610affc796aaca52ba854fd74f"/><file name="card.xml" hash="d3d72d8ee1f232462bf10c8319e3938d"/><file name="oxxo.xml" hash="57f2c08e5ed83291064ee4cbbad1ced8"/><file name="spei.xml" hash="068cb1463bd1d873f774a0b4d2b783e7"/></dir><dir name="template"><dir name="bank"><dir name="form"><file name="bank.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="bank.phtml" hash="e781118478f2546c7924af19024a7adb"/></dir></dir><dir name="card"><dir name="form"><file name="card.phtml" hash="04f3d779c67c1f4b1edb76e070a192a6"/></dir><dir name="info"><file name="card.phtml" hash="1f2c48a1e4a3f81d62c24a2b9a6183aa"/></dir><file name="token.phtml" hash="2da28b73c33a3df12bb08d2af4a45c99"/></dir><dir name="oxxo"><dir name="form"><file name="oxxo.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="oxxo.phtml" hash="5bf7bf96ef4a737e0c8c3850e12382f7"/></dir></dir><dir name="spei"><dir name="form"><file name="spei.phtml" hash="df623b463ebae3b09b3967bde77e5001"/></dir><dir name="info"><file name="spei.phtml" hash="40b232035bdc3dc0a6e0866acb31cae9"/></dir></dir></dir></dir></dir></dir></target></contents>
|
24 |
<compatible/>
|
25 |
<dependencies><required><php><min>5.3.0</min><max>7.0.11</max></php><extension><name>curl</name><min>7.31.0</min><max/></extension><extension><name>json</name><min/><max/></extension><extension><name>mbstring</name><min/><max/></extension></required></dependencies>
|
26 |
</package>
|