From 886f64f14ed32bb36fbdce09fee161999a1ad701 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 21 Nov 2018 13:10:53 +0200 Subject: [PATCH 01/81] https://github.com/abantecart/abantecart-src/issues/1170 --- .../extension/default_parcelforce_48.php | 65 ++++++++++++++----- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/public_html/extensions/default_parcelforce_48/storefront/model/extension/default_parcelforce_48.php b/public_html/extensions/default_parcelforce_48/storefront/model/extension/default_parcelforce_48.php index 6093321d40..d11dcda307 100755 --- a/public_html/extensions/default_parcelforce_48/storefront/model/extension/default_parcelforce_48.php +++ b/public_html/extensions/default_parcelforce_48/storefront/model/extension/default_parcelforce_48.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} /** * Class ModelExtensionDefaultParcelforce48 @@ -28,21 +25,26 @@ */ class ModelExtensionDefaultParcelforce48 extends Model { + function getQuote($address) { //create new instance of language for case when model called from admin-side $language = new ALanguage($this->registry, $this->language->getLanguageCode(), 0); + $language->load($language->language_details['directory']); $language->load('default_parcelforce_48/default_parcelforce_48'); + if ($this->config->get('default_parcelforce_48_status')) { if (!$this->config->get('default_parcelforce_48_location_id')) { $status = true; } else { - $query = $this->db->query("SELECT * - FROM ".$this->db->table('zones_to_locations')." - WHERE location_id = '".(int)$this->config->get('default_parcelforce_48_location_id')."' - AND country_id = '".(int)$address['country_id']."' - AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')"); + $query = $this->db->query( + "SELECT * + FROM ".$this->db->table('zones_to_locations')." + WHERE location_id = '".(int)$this->config->get('default_parcelforce_48_location_id')."' + AND country_id = '".(int)$address['country_id']."' + AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')" + ); if ($query->num_rows) { $status = true; } else { @@ -65,29 +67,42 @@ function getQuote($address) } $weight = 0.0; if ($product_ids) { - $weight = $this->weight->convert($this->cart->getWeight($product_ids), $this->config->get('config_weight_class'), 'kgs'); + $weight = $this->weight->convert( + $this->cart->getWeight($product_ids), + $this->config->get('config_weight_class'), + 'kgs' + ); } $sub_total = $this->cart->getSubTotal(); $all_free_shipping = $this->cart->areAllFreeShipping(); - $quote_data = $this->_processRate($weight, $sub_total); + $quote_data = $this->processRate($weight, $sub_total); //check if free or fixed shipping $total_fixed_cost = 0; $new_quote_data = array(); $special_ship_products = $this->cart->specialShippingProducts(); foreach ($special_ship_products as $product) { - $weight = $this->weight->convert($this->cart->getWeight(array($product['product_id'])), $this->config->get('config_weight_class'), 'kgs'); + $weight = $this->weight->convert( + $this->cart->getWeight( + array($product['product_id'])), + $this->config->get('config_weight_class'), + 'kgs' + ); if ($product['shipping_price'] > 0) { $fixed_cost = $product['shipping_price']; //If ship individually count every quantity if ($product['ship_individually']) { $fixed_cost = $fixed_cost * $product['quantity']; } - $fixed_cost = $this->currency->convert($fixed_cost, $this->config->get('config_currency'), $this->currency->getCode()); + $fixed_cost = $this->currency->convert( + $fixed_cost, + $this->config->get('config_currency'), + $this->currency->getCode() + ); $total_fixed_cost += $fixed_cost; } else { - $new_quote_data = $this->_processRate($weight, $sub_total); + $new_quote_data = $this->processRate($weight, $sub_total); } } @@ -104,7 +119,11 @@ function getQuote($address) if (!$all_free_shipping) { $quote_data[$key]['text'] = $this->currency->format( $this->tax->calculate( - $this->currency->convert($quote_data[$key]['cost'], $this->config->get('config_currency'), $this->currency->getCode()), + $this->currency->convert( + $quote_data[$key]['cost'], + $this->config->get('config_currency'), + $this->currency->getCode() + ), $this->config->get('default_parcelforce_48_tax'), $this->config->get('config_tax') ) ); @@ -158,10 +177,11 @@ function getQuote($address) return $method_data; } - private function _processRate($weight, $sub_total) + private function processRate($weight, $sub_total) { $language = new ALanguage($this->registry, $this->language->getLanguageCode(), 0); $language->load($language->language_details['directory']); + $language->load('default_parcelforce_48/default_parcelforce_48'); $rates = explode(',', $this->config->get('default_parcelforce_48_rate')); $cost = 0.0; foreach ($rates as $rate) { @@ -191,7 +211,12 @@ private function _processRate($weight, $sub_total) $text = $language->get('text_description'); if ($this->config->get('default_parcelforce_48_display_weight')) { - $text .= ' ('.$language->get('text_weight').' '.$this->weight->format($weight, $this->config->get('config_weight_class')).')'; + $text .= ' ('.$language->get('text_weight') + .' ' + .$this->weight->format( + $weight, + $this->config->get('config_weight_class')) + .')'; } if ($this->config->get('default_parcelforce_48_display_insurance') && (float)$compensation) { @@ -207,7 +232,13 @@ private function _processRate($weight, $sub_total) 'title' => $text, 'cost' => $cost, 'tax_class_id' => $this->config->get('default_parcelforce_48_tax'), - 'text' => $this->currency->format($this->tax->calculate($cost, $this->config->get('default_parcelforce_48_tax'), $this->config->get('config_tax'))), + 'text' => $this->currency->format( + $this->tax->calculate( + $cost, + $this->config->get('default_parcelforce_48_tax'), + $this->config->get('config_tax') + ) + ), ); return $quote_data; From 71ac4e565eacc7814e61eb993c7160e332800350 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 21 Nov 2018 15:05:33 +0200 Subject: [PATCH 02/81] https://github.com/abantecart/abantecart-src/issues/1172 --- .../extensions/2checkout/core/hooks.php | 49 +++++++++++++ public_html/extensions/2checkout/main.php | 8 +-- .../responses/extension/2checkout.php | 72 +++++++++++++++++-- .../template/responses/pending_ipn.tpl | 37 ++++++++++ 4 files changed, 155 insertions(+), 11 deletions(-) create mode 100644 public_html/extensions/2checkout/core/hooks.php create mode 100755 public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl diff --git a/public_html/extensions/2checkout/core/hooks.php b/public_html/extensions/2checkout/core/hooks.php new file mode 100644 index 0000000000..0160680a48 --- /dev/null +++ b/public_html/extensions/2checkout/core/hooks.php @@ -0,0 +1,49 @@ + + + UPGRADE NOTE: + Do not edit or add to this file if you wish to upgrade AbanteCart to newer + versions in the future. If you wish to customize AbanteCart for your + needs please refer to http://www.AbanteCart.com for more information. +------------------------------------------------------------------------------*/ + + +class Extension2Checkout extends Extension +{ + //payment confirmation pending page + public function onControllerPagesCheckoutSuccess_InitData() + { + $that = $this->baseObject; + $order_id = (int)$that->session->data['order_id']; + if (!$order_id || $that->session->data['2checkout_pending_ipn_skip']) { + return null; + } + $that->loadModel('checkout/order'); + $order_info = $that->model_checkout_order->getOrder($order_id); + //do nothing if order confirmed or it's not created with paypal standart + if ((int)$order_info['order_status_id'] != 0 || $order_info['payment_method_key'] != '2checkout') { + return null; + } + //set sign to prevent double redirect (see above) + $that->session->data['2checkout_pending_ipn_skip'] = true; + redirect($that->html->getSecureURL('extension/2checkout/pending_payment')); + } + + //delete sign after success + public function onControllerPagesCheckoutSuccess_UpdateData() + { + unset($this->baseObject->session->data['2checkout_pending_ipn_skip']); + } + +} diff --git a/public_html/extensions/2checkout/main.php b/public_html/extensions/2checkout/main.php index d45c74c9de..50aba9224d 100755 --- a/public_html/extensions/2checkout/main.php +++ b/public_html/extensions/2checkout/main.php @@ -8,7 +8,7 @@ Copyright © 2011-2018 Belavier Commerce LLC This source file is subject to Open Software License (OSL 3.0) - Lincence details is bundled with this package in the file LICENSE.txt. + Licence details is bundled with this package in the file LICENSE.txt. It is also available at this URL: @@ -17,10 +17,7 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} - +require_once(__DIR__.DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR.'hooks.php'); $controllers = array( 'storefront' => array('responses/extension/2checkout'), 'admin' => array(), @@ -43,6 +40,7 @@ $templates = array( 'storefront' => array( 'responses/2checkout.tpl', + 'responses/pending_ipn.tpl' ), 'admin' => array(), ); \ No newline at end of file diff --git a/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php b/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php index 1bced582f0..1262635688 100755 --- a/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php +++ b/public_html/extensions/2checkout/storefront/controller/responses/extension/2checkout.php @@ -88,7 +88,12 @@ public function main() 'name' => $product['name'], 'description' => $product['name'], 'quantity' => $product['quantity'], - 'price' => $this->currency->format($product['price'], $order_info['currency'], $order_info['value'], false), + 'price' => $this->currency->format( + $product['price'], + $order_info['currency'], + $order_info['value'], + false + ), ); } @@ -115,7 +120,12 @@ public function callback() } $post = $this->request->post; // hash check - if (!md5($post['sale_id'].$this->config->get('2checkout_account').$post['invoice_id'].$this->config->get('2checkout_secret')) == strtolower($post['md5_hash'])) { + if (!md5( + $post['sale_id'] + .$this->config->get('2checkout_account') + .$post['invoice_id'] + .$this->config->get('2checkout_secret')) == strtolower($post['md5_hash']) + ){ exit; } @@ -128,18 +138,68 @@ public function callback() } $this->load->model('extension/2checkout'); if ($post['message_type'] == 'ORDER_CREATED') { - $this->model_checkout_order->confirm((int)$post['vendor_order_id'], $this->config->get('2checkout_order_status_id')); + $this->model_checkout_order->confirm( + (int)$post['vendor_order_id'], + $this->config->get('2checkout_order_status_id') + ); } elseif ($post['message_type'] == 'REFUND_ISSUED') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('failed'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } elseif ($post['message_type'] == 'FRAUD_STATUS_CHANGED' && $post['fraud_status'] == 'pass') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('processing'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } elseif ($post['message_type'] == 'SHIP_STATUS_CHANGED' && $post['ship_status'] == 'shipped') { $order_status_id = $this->model_extension_2checkout->getOrderStatusIdByName('complete'); - $this->model_checkout_order->update((int)$post['vendor_order_id'], $order_status_id, 'Status changed by 2Checkout INS'); + $this->model_checkout_order->update( + (int)$post['vendor_order_id'], + $order_status_id, + 'Status changed by 2Checkout INS' + ); } else { redirect($this->html->getSecureURL('checkout/confirm')); } } + + public function pending_payment() + { + $this->addChild('common/head', 'head', 'common/head.tpl'); + $this->addChild('common/footer', 'footer', 'common/footer.tpl'); + $this->document->setTitle('waiting for payment'); + $this->view->assign('text_message', 'waiting for payment confirmation'); + $this->view->assign('text_redirecting', 'redirecting'); + $this->view->assign('test_url', $this->html->getSecureURL('r/extension/2checkout/is_confirmed')); + $this->view->assign('success_url', $this->html->getSecureURL('checkout/success')); + $this->processTemplate('responses/pending_ipn.tpl'); + } + + public function is_confirmed() + { + $order_id = (int)$this->session->data['order_id']; + if (!$order_id) { + $result = true; + } else { + $this->loadModel('checkout/order'); + $order_info = $this->model_checkout_order->getOrder($order_id); + //do nothing if order confirmed or it's not created with paypal standart + if ((int)$order_info['order_status_id'] != 0 + || $order_info['payment_method_key'] != '2checkout' + ) { + $result = true; + } else { + $result = false; + } + } + + $this->load->library('json'); + $this->response->addJSONHeader(); + $this->response->setOutput(AJson::encode(array('result' => $result))); + } } \ No newline at end of file diff --git a/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl b/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl new file mode 100755 index 0000000000..7a22855b9e --- /dev/null +++ b/public_html/extensions/2checkout/storefront/view/default/template/responses/pending_ipn.tpl @@ -0,0 +1,37 @@ + +getHookVar('hk_html_attribute'); ?>> + + +
+
+

+
+
+ + + + \ No newline at end of file From 2d3ca49dca50916c29f43e21e6b3e9fece972381 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 5 Dec 2018 18:51:45 +0200 Subject: [PATCH 03/81] #1175 fix --- public_html/storefront/controller/pages/checkout/payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/storefront/controller/pages/checkout/payment.php b/public_html/storefront/controller/pages/checkout/payment.php index 00cbd68bda..b120497a0e 100755 --- a/public_html/storefront/controller/pages/checkout/payment.php +++ b/public_html/storefront/controller/pages/checkout/payment.php @@ -481,7 +481,7 @@ private function _process_balance($action) } } //if balance enough to cover order amount - if ($this->session->data['used_balance_full']) { + if ($order_total['total'] == 0 && $this->session->data['used_balance_full']) { $this->session->data['payment_method'] = array( 'id' => 'no_payment_required', 'title' => $this->language->get('no_payment_required'), From f58553b2bbf77082b1f897d098ec99f52c0fa61f Mon Sep 17 00:00:00 2001 From: BasaraABC Date: Fri, 7 Dec 2018 14:27:12 +0700 Subject: [PATCH 04/81] new version --- public_html/core/version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/core/version.php b/public_html/core/version.php index 2ee3cd39a7..02d40fce84 100755 --- a/public_html/core/version.php +++ b/public_html/core/version.php @@ -1,4 +1,4 @@ Date: Fri, 7 Dec 2018 11:17:02 +0200 Subject: [PATCH 05/81] #1175 fix --- public_html/storefront/controller/pages/checkout/payment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/storefront/controller/pages/checkout/payment.php b/public_html/storefront/controller/pages/checkout/payment.php index b120497a0e..c3e0161e25 100755 --- a/public_html/storefront/controller/pages/checkout/payment.php +++ b/public_html/storefront/controller/pages/checkout/payment.php @@ -481,7 +481,7 @@ private function _process_balance($action) } } //if balance enough to cover order amount - if ($order_total['total'] == 0 && $this->session->data['used_balance_full']) { + if ($order_total == 0 && $this->session->data['used_balance_full']) { $this->session->data['payment_method'] = array( 'id' => 'no_payment_required', 'title' => $this->language->get('no_payment_required'), From ca1f9a869bd0968412e5a890741da7d0df75a8e5 Mon Sep 17 00:00:00 2001 From: abolabo Date: Fri, 7 Dec 2018 11:18:17 +0200 Subject: [PATCH 06/81] install sql version change --- public_html/install/abantecart_database.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/install/abantecart_database.sql b/public_html/install/abantecart_database.sql index e423fc8b68..eab52773bd 100755 --- a/public_html/install/abantecart_database.sql +++ b/public_html/install/abantecart_database.sql @@ -12059,7 +12059,7 @@ VALUES (20, NOW(),'1'); INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`) VALUES (21,'AbanteCart','1'); INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`) -VALUES (22,'1.2.12','1'); +VALUES (22,'1.2.14','1'); INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`) VALUES (23,'','1'); INSERT INTO `ac_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`) From b47f4aed21bc4053c0b5944d8f488f989c7e4250 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 12 Dec 2018 14:41:30 +0200 Subject: [PATCH 07/81] Storefront: category products sorting fix. Added ability to change it via hooks --- .../controller/pages/product/category.php | 158 ++++++++---------- 1 file changed, 74 insertions(+), 84 deletions(-) diff --git a/public_html/storefront/controller/pages/product/category.php b/public_html/storefront/controller/pages/product/category.php index 5b6df74631..cf922bfc31 100755 --- a/public_html/storefront/controller/pages/product/category.php +++ b/public_html/storefront/controller/pages/product/category.php @@ -17,14 +17,28 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} class ControllerPagesProductCategory extends AController { public $data = array(); + public function __construct(Registry $registry, $instance_id, $controller, $parent_controller = '') + { + parent::__construct($registry, $instance_id, $controller, $parent_controller); + $this->loadLanguage('product/category'); + $this->data['sorts'] = array( + 'p.sort_order-ASC' => $this->language->get('text_default'), + 'pd.name-ASC' => $this->language->get('text_sorting_name_asc'), + 'pd.name-DESC' => $this->language->get('text_sorting_name_desc'), + 'p.price-ASC' => $this->language->get('text_sorting_price_asc'), + 'p.price-DESC' => $this->language->get('text_sorting_price_desc'), + 'rating-DESC' => $this->language->get('text_sorting_rating_desc'), + 'rating-ASC' => $this->language->get('text_sorting_rating_asc'), + 'date_modified-DESC' => $this->language->get('text_sorting_date_desc'), + 'date_modified-ASC' => $this->language->get('text_sorting_date_asc'), + ); + } + /** * Check if HTML Cache is enabled for the method * @@ -121,9 +135,8 @@ public function main() $limit = $this->config->get('config_catalog_limit'); } - $url = $sort = $order = ''; $sorting_href = $request['sort']; - if (!$sorting_href) { + if (!$sorting_href || !isset($this->data['sorts'][$request['sort']])) { $sorting_href = $this->config->get('config_product_default_sort_order'); } list($sort, $order) = explode("-", $sorting_href); @@ -133,9 +146,8 @@ public function main() $sort = 'p.'.$sort; } - if (isset($request['sort'])) { - $url = '&sort='.$sort."-".$order; - } + $url = '&sort='.$sorting_href; + if (isset($request['order'])) { $url .= '&order='.$request['order']; } @@ -165,7 +177,11 @@ public function main() $thumbnail = $thumbnails[$result['category_id']]; $categories[] = array( 'name' => $result['name'], - 'href' => $this->html->getSEOURL('product/category', '&path='.$request['path'].'_'.$result['category_id'].$url, '&encode'), + 'href' => $this->html->getSEOURL( + 'product/category', + '&path='.$request['path'].'_'.$result['category_id'].$url, + '&encode' + ), 'thumb' => $thumbnail, ); } @@ -197,17 +213,38 @@ public function main() $special = false; $discount = $products_info[$result['product_id']]['discount']; if ($discount) { - $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $discount, + $result['tax_class_id'], + $this->config->get('config_tax')) + ); } else { - $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $result['price'], + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); $special = $products_info[$result['product_id']]['special']; if ($special) { - $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax'))); + $special = $this->currency->format( + $this->tax->calculate( + $special, + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); } } if ($products_info[$result['product_id']]['options']) { - $add = $this->html->getSEOURL('product/product', '&product_id='.$result['product_id'], '&encode'); + $add = $this->html->getSEOURL( + 'product/product', + '&product_id='.$result['product_id'], + '&encode' + ); } else { if ($this->config->get('config_cart_ajax')) { $add = '#'; @@ -220,7 +257,9 @@ public function main() $in_stock = false; $no_stock_text = $this->language->get('text_out_of_stock'); $total_quantity = 0; - $stock_checkout = $result['stock_checkout'] === '' ? $this->config->get('config_stock_checkout') : $result['stock_checkout']; + $stock_checkout = $result['stock_checkout'] === '' + ? $this->config->get('config_stock_checkout') + : $result['stock_checkout']; if ($stock_info[$result['product_id']]['subtract']) { $track_stock = true; $total_quantity = $this->model_catalog_product->hasAnyStock($result['product_id']); @@ -243,7 +282,11 @@ public function main() 'call_to_order' => $result['call_to_order'], 'options' => $products_info[$result['product_id']]['options'], 'special' => $special, - 'href' => $this->html->getSEOURL('product/product', '&path='.$request['path'].'&product_id='.$result['product_id'], '&encode'), + 'href' => $this->html->getSEOURL( + 'product/product', + '&path='.$request['path'].'&product_id='.$result['product_id'], + '&encode' + ), 'add' => $add, 'description' => html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'), 'track_stock' => $track_stock, @@ -264,72 +307,9 @@ public function main() } $this->view->assign('display_price', $display_price); - $url = ''; - if (isset($request['page'])) { - $url .= '&page='.$request['page']; - } - if (isset($request['limit'])) { - $url .= '&limit='.$request['limit']; - } - - $sorts = array(); - $sorts[] = array( - 'text' => $this->language->get('text_default'), - 'value' => 'p.sort_order-ASC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=p.sort_order&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_asc'), - 'value' => 'pd.name-ASC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=pd.name&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_desc'), - 'value' => 'pd.name-DESC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=pd.name&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_asc'), - 'value' => 'p.price-ASC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=p.price&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_desc'), - 'value' => 'p.price-DESC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=p.price&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_desc'), - 'value' => 'rating-DESC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=rating&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_asc'), - 'value' => 'rating-ASC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=rating&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_desc'), - 'value' => 'date_modified-DESC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=date_modified&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_asc'), - 'value' => 'date_modified-ASC', - 'href' => $this->html->getSEOURL('product/category', $url.'&path='.$request['path'].'&sort=date_modified&order=ASC', '&encode'), - ); - $sort_options = array(); - foreach ($sorts as $item) { - $sort_options[$item['value']] = $item['text']; + foreach ($this->data['sorts'] as $item => $text) { + $sort_options[$item] = $text; } $sorting = $this->html->buildSelectbox(array( 'name' => 'sort', @@ -339,7 +319,11 @@ public function main() $this->view->assign('sorting', $sorting); $this->view->assign('url', $this->html->getSEOURL('product/category', '&path='.$request['path'])); - $pagination_url = $this->html->getSEOURL('product/category', '&path='.$request['path'].'&sort='.$sorting_href.'&page={page}'.'&limit='.$limit, '&encode'); + $pagination_url = $this->html->getSEOURL( + 'product/category', + '&path='.$request['path'].'&sort='.$sorting_href.'&page={page}'.'&limit='.$limit, + '&encode' + ); $this->view->assign( 'pagination_bootstrap', @@ -388,11 +372,17 @@ public function main() } if (isset($request['path'])) { - $this->document->addBreadcrumb(array( - 'href' => $this->html->getSEOURL('product/category', '&path='.$request['path'].$url, '&encode'), + $this->document->addBreadcrumb( + array( + 'href' => $this->html->getSEOURL( + 'product/category', + '&path='.$request['path'].$url, + '&encode' + ), 'text' => $this->language->get('text_error'), 'separator' => $this->language->get('text_separator'), - )); + ) + ); } $this->document->setTitle($this->language->get('text_error')); From 9402965d841d360904846736f92e1c5937716711 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 12 Dec 2018 18:07:49 +0200 Subject: [PATCH 08/81] Storefront: products listing sorting fix. Added ability to change it via hooks --- .../controller/pages/product/category.php | 7 - .../controller/pages/product/manufacturer.php | 174 +++++++++--------- .../controller/pages/product/search.php | 170 +++++++++-------- .../controller/pages/product/special.php | 85 +++------ 4 files changed, 197 insertions(+), 239 deletions(-) diff --git a/public_html/storefront/controller/pages/product/category.php b/public_html/storefront/controller/pages/product/category.php index cf922bfc31..e4b4151b7b 100755 --- a/public_html/storefront/controller/pages/product/category.php +++ b/public_html/storefront/controller/pages/product/category.php @@ -25,7 +25,6 @@ class ControllerPagesProductCategory extends AController public function __construct(Registry $registry, $instance_id, $controller, $parent_controller = '') { parent::__construct($registry, $instance_id, $controller, $parent_controller); - $this->loadLanguage('product/category'); $this->data['sorts'] = array( 'p.sort_order-ASC' => $this->language->get('text_default'), 'pd.name-ASC' => $this->language->get('text_sorting_name_asc'), @@ -146,12 +145,6 @@ public function main() $sort = 'p.'.$sort; } - $url = '&sort='.$sorting_href; - - if (isset($request['order'])) { - $url .= '&order='.$request['order']; - } - $this->loadModel('catalog/product'); $category_total = $this->model_catalog_category->getTotalCategoriesByCategoryId($category_id); $product_total = $this->model_catalog_product->getTotalProductsByCategoryId($category_id); diff --git a/public_html/storefront/controller/pages/product/manufacturer.php b/public_html/storefront/controller/pages/product/manufacturer.php index 9ad102ef17..ef7717514a 100755 --- a/public_html/storefront/controller/pages/product/manufacturer.php +++ b/public_html/storefront/controller/pages/product/manufacturer.php @@ -17,14 +17,27 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} class ControllerPagesProductManufacturer extends AController { public $data = array(); + public function __construct(Registry $registry, $instance_id, $controller, $parent_controller = '') + { + parent::__construct($registry, $instance_id, $controller, $parent_controller); + $this->data['sorts'] = array( + 'p.sort_order-ASC' => $this->language->get('text_default'), + 'pd.name-ASC' => $this->language->get('text_sorting_name_asc'), + 'pd.name-DESC' => $this->language->get('text_sorting_name_desc'), + 'p.price-ASC' => $this->language->get('text_sorting_price_asc'), + 'p.price-DESC' => $this->language->get('text_sorting_price_desc'), + 'rating-DESC' => $this->language->get('text_sorting_rating_desc'), + 'rating-ASC' => $this->language->get('text_sorting_rating_asc'), + 'date_modified-DESC' => $this->language->get('text_sorting_date_desc'), + 'date_modified-ASC' => $this->language->get('text_sorting_date_asc'), + ); + } + /** * Check if HTML Cache is enabled for the method * @@ -75,7 +88,11 @@ public function main() $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($manufacturer_id); if ($manufacturer_info) { $this->document->addBreadcrumb(array( - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'], '&encode'), + 'href' => $this->html->getSEOURL( + 'product/manufacturer', + '&manufacturer_id='.$request['manufacturer_id'], + '&encode' + ), 'text' => $manufacturer_info['name'], 'separator' => $this->language->get('text_separator'), )); @@ -94,7 +111,10 @@ public function main() $this->view->assign('manufacturer_icon', $thumbnail['thumb_url']); } - $product_total = $this->model_catalog_product->getTotalProductsByManufacturerId($request['manufacturer_id']); + $product_total = $this->model_catalog_product->getTotalProductsByManufacturerId( + $request['manufacturer_id'] + ); + if ($product_total) { if (isset($request['page'])) { $page = $request['page']; @@ -108,12 +128,10 @@ public function main() $limit = $this->config->get('config_catalog_limit'); } - if (isset($request['sort'])) { - $sorting_href = $request['sort']; - } else { + $sorting_href = $request['sort']; + if (!$sorting_href || !isset($this->data['sorts'][$request['sort']])) { $sorting_href = $this->config->get('config_product_default_sort_order'); } - list($sort, $order) = explode("-", $sorting_href); if ($sort == 'name') { $sort = 'pd.'.$sort; @@ -121,15 +139,18 @@ public function main() $sort = 'p.'.$sort; } + $this->loadModel('catalog/review'); $this->view->assign('button_add_to_cart', $this->language->get('button_add_to_cart')); $product_ids = $products = array(); - $products_result = $this->model_catalog_product->getProductsByManufacturerId($request['manufacturer_id'], + $products_result = $this->model_catalog_product->getProductsByManufacturerId( + $request['manufacturer_id'], $sort, $order, ($page - 1) * $limit, - $limit); + $limit + ); foreach ($products_result as $result) { $product_ids[] = (int)$result['product_id']; } @@ -147,17 +168,39 @@ public function main() $special = false; $discount = $products_info[$result['product_id']]['discount']; if ($discount) { - $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $discount, + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); } else { - $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $result['price'], + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); $special = $products_info[$result['product_id']]['special']; if ($special) { - $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax'))); + $special = $this->currency->format( + $this->tax->calculate( + $special, + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); } } if ($products_info[$result['product_id']]['options']) { - $add = $this->html->getSEOURL('product/product', '&product_id='.$result['product_id'], '&encode'); + $add = $this->html->getSEOURL( + 'product/product', + '&product_id='.$result['product_id'], + '&encode' + ); } else { if ($this->config->get('config_cart_ajax')) { $add = '#'; @@ -170,7 +213,9 @@ public function main() $track_stock = false; $in_stock = false; $no_stock_text = $this->language->get('text_out_of_stock'); - $stock_checkout = $result['stock_checkout'] === '' ? $this->config->get('config_stock_checkout') : $result['stock_checkout']; + $stock_checkout = $result['stock_checkout'] === '' + ? $this->config->get('config_stock_checkout') + : $result['stock_checkout']; $total_quantity = 0; if ($stock_info[$result['product_id']]['subtract']) { $track_stock = true; @@ -194,7 +239,12 @@ public function main() 'call_to_order' => $result['call_to_order'], 'options' => $products_info[$result['product_id']]['options'], 'special' => $special, - 'href' => $this->html->getSEOURL('product/product', '&manufacturer_id='.$request['manufacturer_id'].'&product_id='.$result['product_id'], '&encode'), + 'href' => + $this->html->getSEOURL( + 'product/product', + '&manufacturer_id='.$request['manufacturer_id'].'&product_id='.$result['product_id'], + '&encode' + ), 'add' => $add, 'description' => html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'), 'track_stock' => $track_stock, @@ -215,73 +265,10 @@ public function main() } $this->view->assign('display_price', $display_price); - $url = ''; - - if (isset($request['page'])) { - $url .= '&page='.$request['page']; - } - if (isset($request['limit'])) { - $url .= '&limit='.$request['limit']; - } - - $sorts = array(); - - $sorts[] = array( - 'text' => $this->language->get('text_default'), - 'value' => 'p.sort_order-ASC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&path='.$request['manufacturer_id'].'&sort=p.sort_order&order=ASC'.$url, '&encode'), - ); - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_asc'), - 'value' => 'pd.name-ASC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=pd.name&order=ASC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_desc'), - 'value' => 'pd.name-DESC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=pd.name&order=DESC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_asc'), - 'value' => 'p.price-ASC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=p.price&order=ASC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_desc'), - 'value' => 'p.price-DESC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=p.price&order=DESC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_desc'), - 'value' => 'rating-DESC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=rating&order=DESC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_asc'), - 'value' => 'rating-ASC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=rating&order=ASC'.$url, '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_desc'), - 'value' => 'date_modified-DESC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=date_modified&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_asc'), - 'value' => 'date_modified-ASC', - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort=date_modified&order=ASC', '&encode'), - ); $sort_options = array(); - foreach ($sorts as $item) { - $sort_options[$item['value']] = $item['text']; + foreach ($this->data['sorts'] as $item => $text) { + $sort_options[$item] = $text; } $sorting = $this->html->buildSelectbox( array( @@ -290,9 +277,22 @@ public function main() 'value' => $sort.'-'.$order, )); $this->view->assign('sorting', $sorting); - $this->view->assign('url', $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'])); + $this->view->assign( + 'url', + $this->html->getSEOURL( + 'product/manufacturer', + '&manufacturer_id='.$request['manufacturer_id'] + ) + ); - $pagination_url = $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$request['manufacturer_id'].'&sort='.$sorting_href.'&page={page}'.'&limit='.$limit, '&encode'); + $pagination_url = $this->html->getSEOURL( + 'product/manufacturer', + '&manufacturer_id='.$request['manufacturer_id'] + .'&sort='.$sorting_href + .'&page={page}' + .'&limit='.$limit, + '&encode' + ); $this->view->assign('pagination_bootstrap', $this->html->buildElement( array( @@ -341,7 +341,11 @@ public function main() } $this->document->addBreadcrumb(array( - 'href' => $this->html->getSEOURL('product/manufacturer', '&manufacturer_id='.$manufacturer_id.$url, '&encode'), + 'href' => $this->html->getSEOURL( + 'product/manufacturer', + '&manufacturer_id='.$manufacturer_id.$url, + '&encode' + ), 'text' => $this->language->get('text_error'), 'separator' => $this->language->get('text_separator'), )); diff --git a/public_html/storefront/controller/pages/product/search.php b/public_html/storefront/controller/pages/product/search.php index 4ee51718a0..cbb5ea825b 100755 --- a/public_html/storefront/controller/pages/product/search.php +++ b/public_html/storefront/controller/pages/product/search.php @@ -17,16 +17,32 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} +/** + * Class ControllerPagesProductSearch + */ class ControllerPagesProductSearch extends AController { protected $category; protected $path; public $data = array(); + public function __construct(Registry $registry, $instance_id, $controller, $parent_controller = '') + { + parent::__construct($registry, $instance_id, $controller, $parent_controller); + $this->data['sorts'] = array( + 'p.sort_order-ASC' => $this->language->get('text_default'), + 'pd.name-ASC' => $this->language->get('text_sorting_name_asc'), + 'pd.name-DESC' => $this->language->get('text_sorting_name_desc'), + 'p.price-ASC' => $this->language->get('text_sorting_price_asc'), + 'p.price-DESC' => $this->language->get('text_sorting_price_desc'), + 'rating-DESC' => $this->language->get('text_sorting_rating_desc'), + 'rating-ASC' => $this->language->get('text_sorting_rating_asc'), + 'date_modified-DESC' => $this->language->get('text_sorting_date_desc'), + 'date_modified-ASC' => $this->language->get('text_sorting_date_asc'), + ); + } + public function main() { $request = $this->request->get; @@ -95,12 +111,10 @@ public function main() $page = 1; } - if (isset($request['sort'])) { - $sorting_href = $request['sort']; - } else { + $sorting_href = $request['sort']; + if (!$sorting_href || !isset($this->data['sorts'][$request['sort']])) { $sorting_href = $this->config->get('config_product_default_sort_order'); } - list($sort, $order) = explode("-", $sorting_href); if ($sort == 'name') { $sort = 'pd.'.$sort; @@ -117,7 +131,7 @@ public function main() ); $this->loadModel('catalog/category'); - $categories = $this->_getCategories(0); + $categories = $this->getCategories(0); $options = array(0 => $this->language->get('text_category')); if ($categories) { foreach ($categories as $item) { @@ -213,7 +227,13 @@ public function main() //if single result, redirect to the product if (count($products_result) == 1) { - $this->redirect($this->html->getSEOURL('product/product', '&product_id='.key($products_result), '&encode')); + redirect( + $this->html->getSEOURL( + 'product/product', + '&product_id='.key($products_result), + '&encode' + ) + ); } if (is_array($products_result) && $products_result) { @@ -245,23 +265,49 @@ public function main() $discount = $promotion->getProductDiscount($result['product_id']); if ($discount) { - $price = $this->currency->format($this->tax->calculate($discount, $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $discount, + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); } else { - $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); + $price = $this->currency->format( + $this->tax->calculate( + $result['price'], + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); $special = $promotion->getProductSpecial($result['product_id']); if ($special) { - $special = $this->currency->format($this->tax->calculate($special, $result['tax_class_id'], $this->config->get('config_tax'))); + $special = $this->currency->format( + $this->tax->calculate( + $special, + $result['tax_class_id'], + $this->config->get('config_tax') + ) + ); } } $options = $this->model_catalog_product->getProductOptions($result['product_id']); if ($options) { - $add = $this->html->getSEOURL('product/product', '&product_id='.$result['product_id'], '&encode'); + $add = $this->html->getSEOURL( + 'product/product', + '&product_id='.$result['product_id'], + '&encode' + ); } else { if ($this->config->get('config_cart_ajax')) { $add = '#'; } else { - $add = $this->html->getSecureURL($cart_rt, '&product_id='.$result['product_id'], '&encode'); + $add = $this->html->getSecureURL( + $cart_rt, + '&product_id='.$result['product_id'], + '&encode' + ); } } @@ -269,7 +315,9 @@ public function main() $track_stock = false; $in_stock = false; $no_stock_text = $this->language->get('text_out_of_stock'); - $stock_checkout = $result['stock_checkout'] === '' ? $this->config->get('config_stock_checkout') : $result['stock_checkout']; + $stock_checkout = $result['stock_checkout'] === '' + ? $this->config->get('config_stock_checkout') + : $result['stock_checkout']; $total_quantity = 0; if ($stock_info[$result['product_id']]['subtract']) { $track_stock = true; @@ -293,7 +341,12 @@ public function main() 'call_to_order' => $result['call_to_order'], 'options' => $options, 'special' => $special, - 'href' => $this->html->getSEOURL('product/product', '&keyword='.$request['keyword'].$url.'&product_id='.$result['product_id'], '&encode'), + 'href' => + $this->html->getSEOURL( + 'product/product', + '&keyword='.$request['keyword'].$url.'&product_id='.$result['product_id'], + '&encode' + ), 'add' => $add, 'description' => html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'), 'track_stock' => $track_stock, @@ -340,72 +393,23 @@ public function main() $url .= '&limit='.$request['limit']; } - $sorts = array(); - $sorts[] = array( - 'text' => $this->language->get('text_default'), - 'value' => 'p.sort_order-ASC', - 'href' => $this->html->getURL('product/search', $url.'&sort=p.sort_order&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_asc'), - 'value' => 'pd.name-ASC', - 'href' => $this->html->getURL('product/search', $url.'&sort=pd.name&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_desc'), - 'value' => 'pd.name-DESC', - 'href' => $this->html->getURL('product/search', $url.'&sort=pd.name&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_asc'), - 'value' => 'p.price-ASC', - 'href' => $this->html->getURL('product/search', $url.'&sort=p.price&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_desc'), - 'value' => 'p.price-DESC', - 'href' => $this->html->getURL('product/search', $url.'&sort=p.price&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_desc'), - 'value' => 'rating-DESC', - 'href' => $this->html->getURL('product/search', $url.'&sort=rating&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_asc'), - 'value' => 'rating-ASC', - 'href' => $this->html->getURL('product/search', $url.'&sort=rating&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_desc'), - 'value' => 'date_modified-DESC', - 'href' => $this->html->getSEOURL('product/search', $url.'&sort=date_modified&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_asc'), - 'value' => 'date_modified-ASC', - 'href' => $this->html->getSEOURL('product/search', $url.'&sort=date_modified&order=ASC', '&encode'), - ); - - $this->data['sorts'] = $sorts; $sort_options = array(); - foreach ($sorts as $item) { - $sort_options[$item['value']] = $item['text']; + + foreach($this->data['sorts'] as $item => &$text){ + $sort_options[$item] = $text; + list($s,$o) = explode('-', $item); + $text = array( + 'text' => $text, + 'value' => $item, + 'href' => $this->html->getURL('product/search', $url.'&sort='.$s.'&order='.$o, '&encode'), + ); } $sorting = $this->html->buildElement(array( 'type' => 'selectbox', 'name' => 'sort', 'options' => $sort_options, - 'value' => $sort.'-'.$order, + 'value' => $sorting_href, )); $this->data['sorting'] = $sorting; @@ -425,16 +429,8 @@ public function main() $url .= '&model='.$request['model']; } - if (isset($request['sort'])) { - $url .= '&sort='.$request['sort']; - } - - if (isset($request['order'])) { - $url .= '&order='.$request['order']; - } - if (isset($request['limit'])) { - $url .= '&limit='.$request['limit']; - } + $url .= '&sort='.$sorting_href; + $url .= '&limit='.$limit; $this->data['pagination_bootstrap'] = $this->html->buildElement(array( 'type' => 'Pagination', @@ -460,7 +456,7 @@ public function main() $this->extensions->hk_UpdateData($this, __FUNCTION__); } - protected function _getCategories($parent_id, $level = 0) + protected function getCategories($parent_id, $level = 0) { $level++; $data = array(); @@ -481,7 +477,7 @@ protected function _getCategories($parent_id, $level = 0) ); $children = array(); if ($this->category) { - $children = $this->_getCategories($parent_id.','.$result['category_id'], $level); + $children = $this->getCategories($parent_id.','.$result['category_id'], $level); } if ($children) { diff --git a/public_html/storefront/controller/pages/product/special.php b/public_html/storefront/controller/pages/product/special.php index 30707cb41c..417c812f80 100755 --- a/public_html/storefront/controller/pages/product/special.php +++ b/public_html/storefront/controller/pages/product/special.php @@ -17,15 +17,31 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} +/** + * Class ControllerPagesProductSpecial + */ class ControllerPagesProductSpecial extends AController { public $data = array(); + public function __construct(Registry $registry, $instance_id, $controller, $parent_controller = '') + { + parent::__construct($registry, $instance_id, $controller, $parent_controller); + $this->data['sorts'] = array( + 'p.sort_order-ASC' => $this->language->get('text_default'), + 'pd.name-ASC' => $this->language->get('text_sorting_name_asc'), + 'pd.name-DESC' => $this->language->get('text_sorting_name_desc'), + 'p.price-ASC' => $this->language->get('text_sorting_price_asc'), + 'p.price-DESC' => $this->language->get('text_sorting_price_desc'), + 'rating-DESC' => $this->language->get('text_sorting_rating_desc'), + 'rating-ASC' => $this->language->get('text_sorting_rating_asc'), + 'date_modified-DESC' => $this->language->get('text_sorting_date_desc'), + 'date_modified-ASC' => $this->language->get('text_sorting_date_asc'), + ); + } + /** * Check if HTML Cache is enabled for the method * @@ -76,11 +92,11 @@ public function main() $limit = $this->config->get('config_catalog_limit'); } - if (isset($request['sort'])) { - $sorting_href = $request['sort']; - } else { + $sorting_href = $request['sort']; + if (!$sorting_href || !isset($this->data['sorts'][$request['sort']])) { $sorting_href = $this->config->get('config_product_default_sort_order'); } + list($sort, $order) = explode("-", $sorting_href); if ($sort == 'name') { $sort = 'pd.'.$sort; @@ -220,73 +236,22 @@ public function main() } $this->data['display_price'] = $display_price; - $sorts = array(); - $sorts[] = array( - 'text' => $this->language->get('text_default'), - 'value' => 'p.sort_order-ASC', - 'href' => $this->html->getURL('product/special', $url.'&sort=p.sort_order&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_asc'), - 'value' => 'pd.name-ASC', - 'href' => $this->html->getURL('product/special', $url.'&sort=pd.name&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_name_desc'), - 'value' => 'pd.name-DESC', - 'href' => $this->html->getURL('product/special', $url.'&sort=pd.name&order=DESC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_asc'), - 'value' => 'ps.price-ASC', - 'href' => $this->html->getURL('product/special', $url.'&sort=price&order=ASC', '&encode'), - ); - - $sorts[] = array( - 'text' => $this->language->get('text_sorting_price_desc'), - 'value' => 'ps.price-DESC', - 'href' => $this->html->getURL('product/special', $url.'&sort=price&order=DESC', '&encode'), - ); - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_desc'), - 'value' => 'rating-DESC', - 'href' => $this->html->getURL('product/special', $url.'&sort=rating&order=DESC', '&encode'), - ); - $sorts[] = array( - 'text' => $this->language->get('text_sorting_rating_asc'), - 'value' => 'rating-ASC', - 'href' => $this->html->getURL('product/special', $url.'&sort=rating&order=ASC', '&encode'), - ); - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_desc'), - 'value' => 'date_modified-DESC', - 'href' => $this->html->getSEOURL('product/special', $url.'&sort=date_modified&order=DESC', '&encode'), - ); - $sorts[] = array( - 'text' => $this->language->get('text_sorting_date_asc'), - 'value' => 'date_modified-ASC', - 'href' => $this->html->getSEOURL('product/special', $url.'&sort=date_modified&order=ASC', '&encode'), - ); $sort_options = array(); - foreach ($sorts as $item) { - $sort_options[$item['value']] = $item['text']; + foreach ($this->data['sorts'] as $item => $text) { + $sort_options[$item] = $text; } $sorting = $this->html->buildElement( array( 'type' => 'selectbox', 'name' => 'sort', 'options' => $sort_options, - 'value' => $sort.'-'.$order, + 'value' => $sorting_href, ) ); $this->view->assign('sorting', $sorting); $this->view->assign('url', $this->html->getURL('product/special')); - $this->data['sorts'] = $sorts; $pagination_url = $this->html->getURL( 'product/special', '&sort='.$sorting_href.'&page={page}'.'&limit='.$limit, From 54041c9aec56a2a2b2e0cf5ce61a5c56a11862b6 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 19 Dec 2018 11:13:04 +0200 Subject: [PATCH 09/81] #1186 --- public_html/core/lib/request.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public_html/core/lib/request.php b/public_html/core/lib/request.php index da52494588..6d33387385 100755 --- a/public_html/core/lib/request.php +++ b/public_html/core/lib/request.php @@ -222,11 +222,18 @@ public function getVersion() public function getRemoteIP() { - if (!empty($this->server['HTTP_CLIENT_IP'])) { + + if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) + { //if user behind cloudflare proxy + $ip = $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; + }elseif(!empty($this->server['HTTP_CLIENT_IP'])) + { $ip = $this->server['HTTP_CLIENT_IP']; - } elseif (!empty($this->server['HTTP_X_FORWARDED_FOR'])) { + }elseif(!empty($this->server['HTTP_X_FORWARDED_FOR'])) + { $ip = $this->server['HTTP_X_FORWARDED_FOR']; - } else { + }else + { $ip = $this->server['REMOTE_ADDR']; } return $ip; From 24c77deea1a930d1f0ba431a3d61e85de850395f Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 24 Dec 2018 17:19:29 +0200 Subject: [PATCH 10/81] storefront: added privacy policy modal into account details edit page --- .../default/template/pages/account/edit.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public_html/storefront/view/default/template/pages/account/edit.tpl b/public_html/storefront/view/default/template/pages/account/edit.tpl index 9482a3ab43..4b33610081 100755 --- a/public_html/storefront/view/default/template/pages/account/edit.tpl +++ b/public_html/storefront/view/default/template/pages/account/edit.tpl @@ -52,4 +52,19 @@ - \ No newline at end of file + + \ No newline at end of file From feba1b508895a2089ad192fff1087db3f9fae06e Mon Sep 17 00:00:00 2001 From: denis Date: Wed, 2 Jan 2019 11:40:01 +0300 Subject: [PATCH 11/81] Fix image loading by options value --- .../controller/api/checkout/cart.php | 21 +++++ .../storefront/controller/blocks/cart.php | 21 +++++ .../controller/pages/account/invoice.php | 21 +++++ .../controller/pages/checkout/cart.php | 21 +++++ .../controller/pages/checkout/confirm.php | 25 +++++- .../controller/pages/product/product.php | 88 +++++++++++++++---- .../controller/responses/product/product.php | 34 ++++--- .../template/pages/product/product.tpl | 8 +- 8 files changed, 209 insertions(+), 30 deletions(-) diff --git a/public_html/storefront/controller/api/checkout/cart.php b/public_html/storefront/controller/api/checkout/cart.php index 8d86850240..50df7f6233 100755 --- a/public_html/storefront/controller/api/checkout/cart.php +++ b/public_html/storefront/controller/api/checkout/cart.php @@ -159,6 +159,27 @@ private function _prepare_cart_data() 'name' => $option['name'], 'value' => $option['value'], ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $price_with_tax = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')); diff --git a/public_html/storefront/controller/blocks/cart.php b/public_html/storefront/controller/blocks/cart.php index bdbcbcd236..4a3a868ee7 100644 --- a/public_html/storefront/controller/blocks/cart.php +++ b/public_html/storefront/controller/blocks/cart.php @@ -93,6 +93,27 @@ public function main() 'value' => $value, 'title' => $title, ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $qty += $result['quantity']; diff --git a/public_html/storefront/controller/pages/account/invoice.php b/public_html/storefront/controller/pages/account/invoice.php index a07902e873..537cfcd51e 100755 --- a/public_html/storefront/controller/pages/account/invoice.php +++ b/public_html/storefront/controller/pages/account/invoice.php @@ -219,6 +219,27 @@ public function main() 'value' => $value, 'title' => $title, ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $products[] = array( diff --git a/public_html/storefront/controller/pages/checkout/cart.php b/public_html/storefront/controller/pages/checkout/cart.php index a09ad7c804..4b769a70fd 100755 --- a/public_html/storefront/controller/pages/checkout/cart.php +++ b/public_html/storefront/controller/pages/checkout/cart.php @@ -307,6 +307,27 @@ public function main() 'value' => $value, 'title' => $title, ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $price_with_tax = $this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')); diff --git a/public_html/storefront/controller/pages/checkout/confirm.php b/public_html/storefront/controller/pages/checkout/confirm.php index 4b4a7d52b6..15c8a5fee9 100755 --- a/public_html/storefront/controller/pages/checkout/confirm.php +++ b/public_html/storefront/controller/pages/checkout/confirm.php @@ -212,6 +212,9 @@ public function main() $product_id = $this->data['products'][$i]['product_id']; $opts = $this->data['products'][$i]['option']; $options = array(); + + $thumbnail = $thumbnails[$product_id]; + foreach ($opts as $option) { //hide hidden options if ($option['element_type'] == 'H') { @@ -237,11 +240,31 @@ public function main() 'value' => $value, 'title' => $title, ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $this->data['products'][$i]['option'] = $options; - $thumbnail = $thumbnails[$product_id]; $tax = $this->tax->calcTotalTaxAmount($this->data['products'][$i]['total'], $this->data['products'][$i]['tax_class_id']); $price = $this->data['products'][$i]['price']; $qty = $this->data['products'][$i]['quantity']; diff --git a/public_html/storefront/controller/pages/product/product.php b/public_html/storefront/controller/pages/product/product.php index 6119f0443c..930b50a5c1 100755 --- a/public_html/storefront/controller/pages/product/product.php +++ b/public_html/storefront/controller/pages/product/product.php @@ -512,6 +512,46 @@ public function main() 'html' => $this->html->buildElement($option_data), // not a string!!! it's object! ); } + // main product image + $mSizes = array( + 'main' => [ + 'width' => $this->config->get('config_image_popup_width'), + 'height' => $this->config->get('config_image_popup_height'), + ], + 'thumb' => [ + 'width' => $this->config->get('config_image_thumb_width'), + 'height' => $this->config->get('config_image_thumb_height'), + ], + ); + $option_images['main'] = + $resource->getResourceAllObjects('product_option_value', $option_data['value'], $mSizes, 1, false); + if (!$option_images['main']) { + unset($option_images['main']); + } + // additional images + $oSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_popup_width'), + 'height' => $this->config->get('config_image_popup_height'), + ), + 'thumb' => + array( + 'width' => $this->config->get('config_image_additional_width'), + 'height' => $this->config->get('config_image_additional_height'), + ), + //product image zoom related thumbnail + 'thumb2' => + array( + 'width' => $this->config->get('config_image_thumb_width'), + 'height' => $this->config->get('config_image_thumb_height'), + ), + ); + $option_images['images'] = + $resource->getResourceAllObjects('product_option_value', $option_data['value'], $oSizes, 0, false); + if (!$option_images['images']) { + unset($option_images['images']); + } } $this->data['options'] = $options; @@ -567,37 +607,49 @@ public function main() } // main product image - $sizes = array( - 'main' => array( + $sizes = [ + 'main' => [ 'width' => $this->config->get('config_image_popup_width'), 'height' => $this->config->get('config_image_popup_height'), - ), - 'thumb' => array( + ], + 'thumb' => [ 'width' => $this->config->get('config_image_thumb_width'), 'height' => $this->config->get('config_image_thumb_height'), - ), - ); - $this->data['image_main'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 1, false); - if ($this->data['image_main']) { - $this->data['image_main']['sizes'] = $sizes; + ], + ]; + if (!$option_images['main']) { + $this->data['image_main'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 1, false); + if ($this->data['image_main']) { + $this->data['image_main']['sizes'] = $sizes; + } + } else { + $this->data['image_main'] = $option_images['main']; + if ($this->data['image_main']) { + $this->data['image_main']['sizes'] = $sizes; + } + unset($option_images['main']); } // additional images - $sizes = array( - 'main' => array( + $sizes = [ + 'main' => [ 'width' => $this->config->get('config_image_popup_width'), 'height' => $this->config->get('config_image_popup_height'), - ), - 'thumb' => array( + ], + 'thumb' => [ 'width' => $this->config->get('config_image_additional_width'), 'height' => $this->config->get('config_image_additional_height'), - ), - 'thumb2' => array( + ], + 'thumb2' => [ 'width' => $this->config->get('config_image_thumb_width'), 'height' => $this->config->get('config_image_thumb_height'), - ), - ); - $this->data['images'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 0, false); + ], + ]; + if (!$option_images['images']) { + $this->data['images'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 0, false); + } else { + $this->data['images'] = $option_images['images']; + } $products = array(); $results = $this->model_catalog_product->getProductRelated($product_id); diff --git a/public_html/storefront/controller/responses/product/product.php b/public_html/storefront/controller/responses/product/product.php index 831e2423d1..9abac958ee 100755 --- a/public_html/storefront/controller/responses/product/product.php +++ b/public_html/storefront/controller/responses/product/product.php @@ -79,8 +79,8 @@ public function get_option_resources() { //init controller data $this->extensions->hk_InitData($this, __FUNCTION__); - $product_id = (int)$this->request->get['product_id']; - $attribute_value_id = (int)$this->request->get['attribute_value_id']; + $product_id = (int)$this->request->post['product_id']; + $attribute_value_id = (int)$this->request->post['attribute_value_id']; $output = array(); if ($attribute_value_id && is_int($attribute_value_id)) { $resource = new AResource('image'); @@ -130,14 +130,7 @@ public function get_option_resources() //no image? return main product images if (!count($output) && $product_id) { - $output['main'] = $resource->getResourceAllObjects('products', $product_id, $msizes, 1, false); - if (!$output['main']) { - unset($output['main']); - } - $output['images'] = $resource->getResourceAllObjects('products', $product_id, $osizes, 0, false); - if (!$output['images']) { - unset($output['images']); - } + $output = []; } } @@ -234,6 +227,27 @@ public function get_cart_details($totals) 'value' => $value, 'title' => $title, ); + // product image by option value + $mSizes = array( + 'main' => + array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + 'thumb' => array( + 'width' => $this->config->get('config_image_cart_width'), + 'height' => $this->config->get('config_image_cart_height') + ), + ); + $main_image = + $resource->getResourceAllObjects('product_option_value', $option['product_option_value_id'], $mSizes, 1, false); + if (!empty($main_image)) { + $thumbnail['origin'] = $main_image['origin']; + $thumbnail['title'] = $main_image['title']; + $thumbnail['description'] = $main_image['description']; + $thumbnail['thumb_html'] = $main_image['thumb_html']; + $thumbnail['thumb_url'] = $main_image['thumb_url']; + } } $qty += $result['quantity']; diff --git a/public_html/storefront/view/default/template/pages/product/product.tpl b/public_html/storefront/view/default/template/pages/product/product.tpl index 5d22853a58..4cf5c10a13 100755 --- a/public_html/storefront/view/default/template/pages/product/product.tpl +++ b/public_html/storefront/view/default/template/pages/product/product.tpl @@ -522,9 +522,15 @@ if ($error){ ?> } function load_option_images(attribute_value_id, product_id) { + var data = { + attribute_value_id: attribute_value_id, + product_id: product_id, + }; + $.ajax({ type: 'POST', - url: '&attribute_value_id=' + attribute_value_id + '&product_id=' + product_id, + url: '', + data: data, dataType: 'json', success: function (data) { if (data.length == 0) { From ae01eb4fd33d11aac618b3573066ba39367db65c Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 10 Jan 2019 16:55:38 +0200 Subject: [PATCH 12/81] admin: category model fix --- public_html/admin/model/catalog/category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/admin/model/catalog/category.php b/public_html/admin/model/catalog/category.php index 6283242262..b4e498ac9c 100755 --- a/public_html/admin/model/catalog/category.php +++ b/public_html/admin/model/catalog/category.php @@ -218,7 +218,7 @@ public function getCategory($category_id) * * @return array */ - public function getCategories($parent_id, $store_id = null) + public function getCategories($parent_id = null, $store_id = null) { $language_id = $this->language->getContentLanguageID(); $cache_key = 'category.'.$parent_id.'.store_'.$store_id.'_lang_'.$language_id; From 5a42d4c0537fc7fadbb09880cdc1879bb20108d8 Mon Sep 17 00:00:00 2001 From: abolabo Date: Tue, 15 Jan 2019 14:08:41 +0200 Subject: [PATCH 13/81] storefront: head.tpl minor fix --- public_html/storefront/view/default/template/common/head.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/storefront/view/default/template/common/head.tpl b/public_html/storefront/view/default/template/common/head.tpl index 24565bf58d..8011ddf278 100755 --- a/public_html/storefront/view/default/template/common/head.tpl +++ b/public_html/storefront/view/default/template/common/head.tpl @@ -1,8 +1,8 @@ -<?php echo $title; ?> +<?php echo $title; ?> From 06b14ddd31728bb3226b640c46b3624e8de4a96e Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 4 Feb 2019 19:19:48 +0200 Subject: [PATCH 14/81] Extensions: default_authorizenet_aim removed as deprecated. Added default_authorizenet instead based on new API SDK --- .../extension/default_authorizenet.php | 208 + .../default_authorizenet.xml | 265 + .../model/extension/default_authorizenet.php | 285 + .../view/default/stylesheet/authorizenet.css | 166 + .../template/pages/sale/payment_details.tpl | 195 + .../default_authorizenet/composer.lock | 63 + .../default_authorizenet/config.xml | 80 + .../default_authorizenet/core/hooks.php | 196 + .../extensions/default_authorizenet/help.txt | 32 + .../image/icon.png | Bin .../default_authorizenet/install.sql | 12 + .../extensions/default_authorizenet/main.php | 31 + .../extension/default_authorizenet.php | 373 ++ .../default_authorizenet.xml | 93 + .../model/extension/default_authorizenet.php | 497 ++ .../view/default/image/securitycode.jpg | Bin .../responses/default_authorizenet.tpl | 241 + .../default_authorizenet_verification.tpl | 117 + .../default_authorizenet/uninstall.sql | 1 + .../authorizenet/authorizenet/.gitignore | 12 + .../authorizenet/authorizenet/.gitmodules | 3 + .../authorizenet/.scrutinizer.yml | 17 + .../authorizenet/authorizenet/.travis.yml | 35 + .../authorizenet/AnetApiSchema.xsd | 4754 +++++++++++++++++ .../authorizenet/authorizenet/CONTRIBUTING.md | 9 + .../authorizenet/authorizenet/LICENSE.txt | 41 + .../authorizenet/authorizenet/MIGRATING.md | 85 + .../authorizenet/authorizenet/README.md | 176 + .../authorizenet/authorizenet/autoload.php | 18 + .../authorizenet/authorizenet/classmap.php | 302 ++ .../authorizenet/authorizenet/composer.json | 23 + .../authorizenet/doc/AIM.markdown | 224 + .../authorizenet/doc/ARB.markdown | 62 + .../authorizenet/doc/CIM.markdown | 275 + .../authorizenet/authorizenet/doc/CP.markdown | 44 + .../authorizenet/doc/DPM.markdown | 24 + .../authorizenet/authorizenet/doc/README.md | 3 + .../authorizenet/doc/SIM.markdown | 79 + .../authorizenet/doc/SOAP.markdown | 10 + .../authorizenet/authorizenet/doc/TD.markdown | 69 + .../api/constants/ANetEnvironment.php | 11 + .../api/contract/v1/ANetApiRequestType.php | 182 + .../api/contract/v1/ANetApiResponseType.php | 180 + .../v1/ARBCancelSubscriptionRequest.php | 75 + .../v1/ARBCancelSubscriptionResponse.php | 61 + .../v1/ARBCreateSubscriptionRequest.php | 75 + .../v1/ARBCreateSubscriptionResponse.php | 115 + .../v1/ARBGetSubscriptionListRequest.php | 130 + .../v1/ARBGetSubscriptionListResponse.php | 151 + .../v1/ARBGetSubscriptionListSortingType.php | 153 + .../contract/v1/ARBGetSubscriptionRequest.php | 102 + .../v1/ARBGetSubscriptionResponse.php | 88 + .../v1/ARBGetSubscriptionStatusRequest.php | 75 + .../v1/ARBGetSubscriptionStatusResponse.php | 88 + .../contract/v1/ARBSubscriptionMaskedType.php | 350 ++ .../api/contract/v1/ARBSubscriptionType.php | 369 ++ .../v1/ARBUpdateSubscriptionRequest.php | 102 + .../v1/ARBUpdateSubscriptionResponse.php | 88 + .../api/contract/v1/ArbTransactionType.php | 234 + .../api/contract/v1/ArrayOfSettingType.php | 160 + .../api/contract/v1/AuDeleteType.php | 126 + .../api/contract/v1/AuDetailsType.php | 288 + .../api/contract/v1/AuResponseType.php | 180 + .../api/contract/v1/AuUpdateType.php | 153 + .../contract/v1/AuthenticateTestRequest.php | 48 + .../contract/v1/AuthenticateTestResponse.php | 61 + .../api/contract/v1/BankAccountMaskedType.php | 261 + .../api/contract/v1/BankAccountType.php | 288 + .../api/contract/v1/BatchDetailsType.php | 349 ++ .../api/contract/v1/BatchStatisticType.php | 666 +++ .../authorize/api/contract/v1/CardArtType.php | 234 + .../api/contract/v1/CcAuthenticationType.php | 153 + .../CreateCustomerPaymentProfileRequest.php | 130 + .../CreateCustomerPaymentProfileResponse.php | 142 + ...eCustomerProfileFromTransactionRequest.php | 210 + .../v1/CreateCustomerProfileRequest.php | 102 + .../v1/CreateCustomerProfileResponse.php | 271 + ...reateCustomerProfileTransactionRequest.php | 102 + ...eateCustomerProfileTransactionResponse.php | 117 + .../CreateCustomerShippingAddressRequest.php | 129 + .../CreateCustomerShippingAddressResponse.php | 115 + .../contract/v1/CreateProfileResponseType.php | 275 + .../contract/v1/CreateTransactionRequest.php | 76 + .../contract/v1/CreateTransactionResponse.php | 118 + .../api/contract/v1/CreditCardMaskedType.php | 261 + .../api/contract/v1/CreditCardSimpleType.php | 153 + .../api/contract/v1/CreditCardTrackType.php | 153 + .../api/contract/v1/CreditCardType.php | 261 + .../api/contract/v1/CustomerAddressExType.php | 126 + .../api/contract/v1/CustomerAddressType.php | 180 + .../api/contract/v1/CustomerDataType.php | 234 + .../v1/CustomerPaymentProfileBaseType.php | 153 + .../v1/CustomerPaymentProfileExType.php | 126 + .../v1/CustomerPaymentProfileListItemType.php | 234 + .../v1/CustomerPaymentProfileMaskedType.php | 323 ++ .../v1/CustomerPaymentProfileSortingType.php | 153 + .../v1/CustomerPaymentProfileType.php | 207 + .../contract/v1/CustomerProfileBaseType.php | 180 + .../api/contract/v1/CustomerProfileExType.php | 126 + .../api/contract/v1/CustomerProfileIdType.php | 180 + .../contract/v1/CustomerProfileInfoExType.php | 126 + .../contract/v1/CustomerProfileMaskedType.php | 251 + .../v1/CustomerProfilePaymentType.php | 207 + .../v1/CustomerProfileSummaryType.php | 234 + .../api/contract/v1/CustomerProfileType.php | 251 + .../api/contract/v1/CustomerType.php | 288 + .../contract/v1/DecryptPaymentDataRequest.php | 102 + .../v1/DecryptPaymentDataResponse.php | 169 + .../DeleteCustomerPaymentProfileRequest.php | 102 + .../DeleteCustomerPaymentProfileResponse.php | 61 + .../v1/DeleteCustomerProfileRequest.php | 75 + .../v1/DeleteCustomerProfileResponse.php | 61 + .../DeleteCustomerShippingAddressRequest.php | 102 + .../DeleteCustomerShippingAddressResponse.php | 61 + .../contract/v1/DriversLicenseMaskedType.php | 180 + .../api/contract/v1/DriversLicenseType.php | 180 + .../api/contract/v1/EmailSettingsType.php | 126 + .../authorize/api/contract/v1/EmvTagType.php | 180 + .../contract/v1/EncryptedTrackDataType.php | 126 + .../api/contract/v1/EnumCollection.php | 285 + .../api/contract/v1/ErrorResponse.php | 61 + .../api/contract/v1/ExtendedAmountType.php | 180 + .../api/contract/v1/FDSFilterType.php | 153 + .../api/contract/v1/FingerPrintType.php | 234 + .../api/contract/v1/FraudInformationType.php | 187 + .../contract/v1/GetAUJobDetailsRequest.php | 129 + .../contract/v1/GetAUJobDetailsResponse.php | 115 + .../contract/v1/GetAUJobSummaryRequest.php | 75 + .../contract/v1/GetAUJobSummaryResponse.php | 122 + .../contract/v1/GetBatchStatisticsRequest.php | 75 + .../v1/GetBatchStatisticsResponse.php | 88 + .../GetCustomerPaymentProfileListRequest.php | 157 + .../GetCustomerPaymentProfileListResponse.php | 152 + .../v1/GetCustomerPaymentProfileRequest.php | 156 + .../v1/GetCustomerPaymentProfileResponse.php | 90 + .../v1/GetCustomerProfileIdsRequest.php | 48 + .../v1/GetCustomerProfileIdsResponse.php | 122 + .../contract/v1/GetCustomerProfileRequest.php | 183 + .../v1/GetCustomerProfileResponse.php | 149 + .../v1/GetCustomerShippingAddressRequest.php | 102 + .../v1/GetCustomerShippingAddressResponse.php | 176 + .../v1/GetHostedPaymentPageRequest.php | 179 + .../v1/GetHostedPaymentPageResponse.php | 88 + .../v1/GetHostedProfilePageRequest.php | 178 + .../v1/GetHostedProfilePageResponse.php | 88 + .../contract/v1/GetMerchantDetailsRequest.php | 48 + .../v1/GetMerchantDetailsResponse.php | 474 ++ .../v1/GetSettledBatchListRequest.php | 129 + .../v1/GetSettledBatchListResponse.php | 122 + .../v1/GetTransactionDetailsRequest.php | 75 + .../v1/GetTransactionDetailsResponse.php | 142 + .../GetTransactionListForCustomerRequest.php | 156 + .../contract/v1/GetTransactionListRequest.php | 129 + .../v1/GetTransactionListResponse.php | 149 + .../v1/GetUnsettledTransactionListRequest.php | 129 + .../GetUnsettledTransactionListResponse.php | 149 + .../v1/HeldTransactionRequestType.php | 153 + .../v1/ImpersonationAuthenticationType.php | 153 + .../api/contract/v1/IsAliveRequest.php | 75 + .../api/contract/v1/IsAliveResponse.php | 61 + .../api/contract/v1/KeyBlockType.php | 126 + .../contract/v1/KeyManagementSchemeType.php | 127 + .../v1/KeyManagementSchemeType/DUKPTAType.php | 219 + .../DUKPTAType/DeviceInfoAType.php | 123 + .../DUKPTAType/EncryptedDataAType.php | 123 + .../DUKPTAType/ModeAType.php | 150 + .../api/contract/v1/KeyValueType.php | 180 + .../api/contract/v1/LineItemType.php | 801 +++ .../api/contract/v1/ListOfAUDetailsType.php | 221 + .../api/contract/v1/LogoutRequest.php | 48 + .../api/contract/v1/LogoutResponse.php | 61 + .../v1/MerchantAuthenticationType.php | 344 ++ .../api/contract/v1/MerchantContactType.php | 261 + .../api/contract/v1/MessagesType.php | 187 + .../contract/v1/MessagesType/MessageAType.php | 150 + .../contract/v1/MobileDeviceLoginRequest.php | 48 + .../contract/v1/MobileDeviceLoginResponse.php | 176 + .../v1/MobileDeviceRegistrationRequest.php | 75 + .../v1/MobileDeviceRegistrationResponse.php | 61 + .../api/contract/v1/MobileDeviceType.php | 234 + .../api/contract/v1/NameAndAddressType.php | 315 ++ .../api/contract/v1/OpaqueDataType.php | 180 + .../authorize/api/contract/v1/OrderExType.php | 126 + .../authorize/api/contract/v1/OrderType.php | 585 ++ .../api/contract/v1/OtherTaxType.php | 261 + .../authorize/api/contract/v1/PagingType.php | 153 + .../authorize/api/contract/v1/PayPalType.php | 261 + .../api/contract/v1/PaymentDetailsType.php | 369 ++ .../api/contract/v1/PaymentEmvType.php | 180 + .../api/contract/v1/PaymentMaskedType.php | 180 + .../api/contract/v1/PaymentProfileType.php | 153 + .../api/contract/v1/PaymentScheduleType.php | 210 + .../v1/PaymentScheduleType/IntervalAType.php | 150 + .../api/contract/v1/PaymentSimpleType.php | 153 + .../authorize/api/contract/v1/PaymentType.php | 316 ++ .../api/contract/v1/PermissionType.php | 126 + .../api/contract/v1/ProcessingOptionsType.php | 207 + .../api/contract/v1/ProcessorType.php | 214 + .../contract/v1/ProfileTransAmountType.php | 268 + .../v1/ProfileTransAuthCaptureType.php | 99 + .../contract/v1/ProfileTransAuthOnlyType.php | 99 + .../v1/ProfileTransCaptureOnlyType.php | 126 + .../api/contract/v1/ProfileTransOrderType.php | 372 ++ .../v1/ProfileTransPriorAuthCaptureType.php | 207 + .../contract/v1/ProfileTransRefundType.php | 315 ++ .../api/contract/v1/ProfileTransVoidType.php | 207 + .../contract/v1/ProfileTransactionType.php | 270 + .../api/contract/v1/ReturnedItemType.php | 234 + .../v1/SecurePaymentContainerErrorType.php | 153 + .../v1/SecurePaymentContainerRequest.php | 75 + .../v1/SecurePaymentContainerResponse.php | 88 + .../SendCustomerTransactionReceiptRequest.php | 129 + ...SendCustomerTransactionReceiptResponse.php | 61 + .../authorize/api/contract/v1/SettingType.php | 153 + .../api/contract/v1/SolutionType.php | 180 + .../api/contract/v1/SubMerchantType.php | 396 ++ .../v1/SubscriptionCustomerProfileType.php | 155 + .../contract/v1/SubscriptionDetailType.php | 531 ++ .../contract/v1/SubscriptionPaymentType.php | 153 + .../v1/SubsequentAuthInformationType.php | 153 + .../api/contract/v1/TokenMaskedType.php | 207 + .../api/contract/v1/TransRetailInfoType.php | 207 + .../contract/v1/TransactionDetailsType.php | 1538 ++++++ .../EmvDetailsAType.php | 164 + .../EmvDetailsAType/TagAType.php | 150 + .../v1/TransactionListSortingType.php | 153 + .../contract/v1/TransactionRequestType.php | 1175 ++++ .../UserFieldsAType.php | 157 + .../contract/v1/TransactionResponseType.php | 942 ++++ .../EmvResponseAType.php | 184 + .../EmvResponseAType/TagsAType.php | 157 + .../TransactionResponseType/ErrorsAType.php | 164 + .../ErrorsAType/ErrorAType.php | 150 + .../TransactionResponseType/MessagesAType.php | 164 + .../MessagesAType/MessageAType.php | 150 + .../PrePaidCardAType.php | 177 + .../SecureAcceptanceAType.php | 177 + .../SplitTenderPaymentsAType.php | 164 + .../SplitTenderPaymentAType.php | 339 ++ .../UserFieldsAType.php | 157 + .../contract/v1/TransactionSummaryType.php | 558 ++ .../UpdateCustomerPaymentProfileRequest.php | 131 + .../UpdateCustomerPaymentProfileResponse.php | 88 + .../v1/UpdateCustomerProfileRequest.php | 75 + .../v1/UpdateCustomerProfileResponse.php | 61 + .../UpdateCustomerShippingAddressRequest.php | 129 + .../UpdateCustomerShippingAddressResponse.php | 61 + .../v1/UpdateHeldTransactionRequest.php | 77 + .../v1/UpdateHeldTransactionResponse.php | 90 + .../v1/UpdateMerchantDetailsRequest.php | 75 + .../v1/UpdateMerchantDetailsResponse.php | 61 + .../v1/UpdateSplitTenderGroupRequest.php | 102 + .../v1/UpdateSplitTenderGroupResponse.php | 61 + .../api/contract/v1/UserFieldType.php | 153 + .../ValidateCustomerPaymentProfileRequest.php | 183 + ...ValidateCustomerPaymentProfileResponse.php | 88 + .../api/contract/v1/WebCheckOutDataType.php | 207 + .../v1/WebCheckOutDataTypeTokenType.php | 234 + .../ARBCancelSubscriptionController.php | 21 + .../ARBCreateSubscriptionController.php | 21 + .../ARBGetSubscriptionController.php | 21 + .../ARBGetSubscriptionListController.php | 21 + .../ARBGetSubscriptionStatusController.php | 21 + .../ARBUpdateSubscriptionController.php | 21 + .../controller/AuthenticateTestController.php | 21 + ...CreateCustomerPaymentProfileController.php | 21 + .../CreateCustomerProfileController.php | 21 + ...stomerProfileFromTransactionController.php | 21 + ...teCustomerProfileTransactionController.php | 21 + ...reateCustomerShippingAddressController.php | 21 + .../CreateTransactionController.php | 21 + .../DecryptPaymentDataController.php | 21 + ...DeleteCustomerPaymentProfileController.php | 21 + .../DeleteCustomerProfileController.php | 21 + ...eleteCustomerShippingAddressController.php | 21 + .../controller/GetAUJobDetailsController.php | 21 + .../controller/GetAUJobSummaryController.php | 21 + .../GetBatchStatisticsController.php | 21 + .../GetCustomerPaymentProfileController.php | 21 + ...etCustomerPaymentProfileListController.php | 21 + .../GetCustomerProfileController.php | 21 + .../GetCustomerProfileIdsController.php | 21 + .../GetCustomerShippingAddressController.php | 21 + .../GetHostedPaymentPageController.php | 21 + .../GetHostedProfilePageController.php | 21 + .../GetMerchantDetailsController.php | 21 + .../GetSettledBatchListController.php | 21 + .../GetTransactionDetailsController.php | 21 + .../GetTransactionListController.php | 21 + ...etTransactionListForCustomerController.php | 21 + .../GetUnsettledTransactionListController.php | 21 + .../api/controller/IsAliveController.php | 21 + .../api/controller/LogoutController.php | 21 + .../MobileDeviceLoginController.php | 21 + .../MobileDeviceRegistrationController.php | 21 + .../SecurePaymentContainerController.php | 21 + ...ndCustomerTransactionReceiptController.php | 21 + ...UpdateCustomerPaymentProfileController.php | 21 + .../UpdateCustomerProfileController.php | 21 + ...pdateCustomerShippingAddressController.php | 21 + .../UpdateHeldTransactionController.php | 21 + .../UpdateMerchantDetailsController.php | 21 + .../UpdateSplitTenderGroupController.php | 21 + ...lidateCustomerPaymentProfileController.php | 21 + .../api/controller/base/ApiOperationBase.php | 172 + .../api/controller/base/IApiOperation.php | 26 + .../api/yml/v1/ANetApiRequestType.yml | 32 + .../api/yml/v1/ANetApiResponseType.yml | 32 + .../yml/v1/ARBCancelSubscriptionRequest.yml | 14 + .../yml/v1/ARBCancelSubscriptionResponse.yml | 4 + .../yml/v1/ARBCreateSubscriptionRequest.yml | 14 + .../yml/v1/ARBCreateSubscriptionResponse.yml | 24 + .../yml/v1/ARBGetSubscriptionListRequest.yml | 34 + .../yml/v1/ARBGetSubscriptionListResponse.yml | 29 + .../v1/ARBGetSubscriptionListSortingType.yml | 22 + .../api/yml/v1/ARBGetSubscriptionRequest.yml | 24 + .../api/yml/v1/ARBGetSubscriptionResponse.yml | 14 + .../v1/ARBGetSubscriptionStatusRequest.yml | 14 + .../v1/ARBGetSubscriptionStatusResponse.yml | 14 + .../api/yml/v1/ARBSubscriptionMaskedType.yml | 87 + .../api/yml/v1/ARBSubscriptionType.yml | 102 + .../yml/v1/ARBUpdateSubscriptionRequest.yml | 24 + .../yml/v1/ARBUpdateSubscriptionResponse.yml | 14 + .../api/yml/v1/ArbTransactionType.yml | 52 + .../api/yml/v1/ArrayOfSettingType.yml | 16 + .../net/authorize/api/yml/v1/AuDeleteType.yml | 12 + .../authorize/api/yml/v1/AuDetailsType.yml | 72 + .../authorize/api/yml/v1/AuResponseType.yml | 32 + .../net/authorize/api/yml/v1/AuUpdateType.yml | 22 + .../api/yml/v1/AuthenticateTestRequest.yml | 4 + .../api/yml/v1/AuthenticateTestResponse.yml | 4 + .../api/yml/v1/BankAccountMaskedType.yml | 62 + .../authorize/api/yml/v1/BankAccountType.yml | 72 + .../authorize/api/yml/v1/BatchDetailsType.yml | 87 + .../api/yml/v1/BatchStatisticType.yml | 212 + .../net/authorize/api/yml/v1/CardArtType.yml | 52 + .../api/yml/v1/CcAuthenticationType.yml | 22 + .../CreateCustomerPaymentProfileRequest.yml | 34 + .../CreateCustomerPaymentProfileResponse.yml | 34 + ...eCustomerProfileFromTransactionRequest.yml | 64 + .../yml/v1/CreateCustomerProfileRequest.yml | 24 + .../yml/v1/CreateCustomerProfileResponse.yml | 59 + ...reateCustomerProfileTransactionRequest.yml | 24 + ...eateCustomerProfileTransactionResponse.yml | 24 + .../CreateCustomerShippingAddressRequest.yml | 34 + .../CreateCustomerShippingAddressResponse.yml | 24 + .../api/yml/v1/CreateProfileResponseType.yml | 52 + .../api/yml/v1/CreateTransactionRequest.yml | 14 + .../api/yml/v1/CreateTransactionResponse.yml | 24 + .../api/yml/v1/CreditCardMaskedType.yml | 62 + .../api/yml/v1/CreditCardSimpleType.yml | 22 + .../api/yml/v1/CreditCardTrackType.yml | 22 + .../authorize/api/yml/v1/CreditCardType.yml | 62 + .../api/yml/v1/CustomerAddressExType.yml | 12 + .../api/yml/v1/CustomerAddressType.yml | 32 + .../authorize/api/yml/v1/CustomerDataType.yml | 52 + .../yml/v1/CustomerPaymentProfileBaseType.yml | 22 + .../yml/v1/CustomerPaymentProfileExType.yml | 12 + .../v1/CustomerPaymentProfileListItemType.yml | 52 + .../v1/CustomerPaymentProfileMaskedType.yml | 77 + .../v1/CustomerPaymentProfileSortingType.yml | 22 + .../api/yml/v1/CustomerPaymentProfileType.yml | 42 + .../api/yml/v1/CustomerProfileBaseType.yml | 32 + .../api/yml/v1/CustomerProfileExType.yml | 12 + .../api/yml/v1/CustomerProfileIdType.yml | 32 + .../api/yml/v1/CustomerProfileInfoExType.yml | 12 + .../api/yml/v1/CustomerProfileMaskedType.yml | 40 + .../api/yml/v1/CustomerProfilePaymentType.yml | 42 + .../api/yml/v1/CustomerProfileSummaryType.yml | 52 + .../api/yml/v1/CustomerProfileType.yml | 40 + .../net/authorize/api/yml/v1/CustomerType.yml | 72 + .../api/yml/v1/DecryptPaymentDataRequest.yml | 24 + .../api/yml/v1/DecryptPaymentDataResponse.yml | 44 + .../DeleteCustomerPaymentProfileRequest.yml | 24 + .../DeleteCustomerPaymentProfileResponse.yml | 4 + .../yml/v1/DeleteCustomerProfileRequest.yml | 14 + .../yml/v1/DeleteCustomerProfileResponse.yml | 4 + .../DeleteCustomerShippingAddressRequest.yml | 24 + .../DeleteCustomerShippingAddressResponse.yml | 4 + .../api/yml/v1/DriversLicenseMaskedType.yml | 32 + .../api/yml/v1/DriversLicenseType.yml | 32 + .../api/yml/v1/EmailSettingsType.yml | 11 + .../net/authorize/api/yml/v1/EmvTagType.yml | 32 + .../api/yml/v1/EncryptedTrackDataType.yml | 12 + .../authorize/api/yml/v1/EnumCollection.yml | 104 + .../authorize/api/yml/v1/ErrorResponse.yml | 3 + .../api/yml/v1/ExtendedAmountType.yml | 32 + .../authorize/api/yml/v1/FDSFilterType.yml | 22 + .../authorize/api/yml/v1/FingerPrintType.yml | 52 + .../api/yml/v1/FraudInformationType.yml | 27 + .../api/yml/v1/GetAUJobDetailsRequest.yml | 34 + .../api/yml/v1/GetAUJobDetailsResponse.yml | 24 + .../api/yml/v1/GetAUJobSummaryRequest.yml | 14 + .../api/yml/v1/GetAUJobSummaryResponse.yml | 19 + .../api/yml/v1/GetBatchStatisticsRequest.yml | 14 + .../api/yml/v1/GetBatchStatisticsResponse.yml | 14 + .../GetCustomerPaymentProfileListRequest.yml | 44 + .../GetCustomerPaymentProfileListResponse.yml | 29 + .../v1/GetCustomerPaymentProfileRequest.yml | 44 + .../v1/GetCustomerPaymentProfileResponse.yml | 14 + .../yml/v1/GetCustomerProfileIdsRequest.yml | 4 + .../yml/v1/GetCustomerProfileIdsResponse.yml | 19 + .../api/yml/v1/GetCustomerProfileRequest.yml | 54 + .../api/yml/v1/GetCustomerProfileResponse.yml | 29 + .../v1/GetCustomerShippingAddressRequest.yml | 24 + .../v1/GetCustomerShippingAddressResponse.yml | 39 + .../yml/v1/GetHostedPaymentPageRequest.yml | 29 + .../yml/v1/GetHostedPaymentPageResponse.yml | 14 + .../yml/v1/GetHostedProfilePageRequest.yml | 29 + .../yml/v1/GetHostedProfilePageResponse.yml | 14 + .../api/yml/v1/GetMerchantDetailsRequest.yml | 4 + .../api/yml/v1/GetMerchantDetailsResponse.yml | 119 + .../api/yml/v1/GetSettledBatchListRequest.yml | 34 + .../yml/v1/GetSettledBatchListResponse.yml | 19 + .../yml/v1/GetTransactionDetailsRequest.yml | 14 + .../yml/v1/GetTransactionDetailsResponse.yml | 34 + .../GetTransactionListForCustomerRequest.yml | 44 + .../api/yml/v1/GetTransactionListRequest.yml | 34 + .../api/yml/v1/GetTransactionListResponse.yml | 29 + .../v1/GetUnsettledTransactionListRequest.yml | 34 + .../GetUnsettledTransactionListResponse.yml | 29 + .../api/yml/v1/HeldTransactionRequestType.yml | 22 + .../v1/ImpersonationAuthenticationType.yml | 22 + .../authorize/api/yml/v1/IsAliveRequest.yml | 14 + .../authorize/api/yml/v1/IsAliveResponse.yml | 4 + .../net/authorize/api/yml/v1/KeyBlockType.yml | 12 + ...tSchemeType.DUKPTAType.DeviceInfoAType.yml | 12 + ...hemeType.DUKPTAType.EncryptedDataAType.yml | 12 + ...agementSchemeType.DUKPTAType.ModeAType.yml | 22 + .../v1/KeyManagementSchemeType.DUKPTAType.yml | 42 + .../api/yml/v1/KeyManagementSchemeType.yml | 12 + .../net/authorize/api/yml/v1/KeyValueType.yml | 32 + .../net/authorize/api/yml/v1/LineItemType.yml | 262 + .../api/yml/v1/ListOfAUDetailsType.yml | 30 + .../authorize/api/yml/v1/LogoutRequest.yml | 4 + .../authorize/api/yml/v1/LogoutResponse.yml | 4 + .../api/yml/v1/MerchantAuthenticationType.yml | 92 + .../api/yml/v1/MerchantContactType.yml | 62 + .../api/yml/v1/MessagesType.MessageAType.yml | 22 + .../net/authorize/api/yml/v1/MessagesType.yml | 26 + .../api/yml/v1/MobileDeviceLoginRequest.yml | 4 + .../api/yml/v1/MobileDeviceLoginResponse.yml | 39 + .../v1/MobileDeviceRegistrationRequest.yml | 14 + .../v1/MobileDeviceRegistrationResponse.yml | 4 + .../authorize/api/yml/v1/MobileDeviceType.yml | 52 + .../api/yml/v1/NameAndAddressType.yml | 82 + .../authorize/api/yml/v1/OpaqueDataType.yml | 32 + .../net/authorize/api/yml/v1/OrderExType.yml | 12 + .../net/authorize/api/yml/v1/OrderType.yml | 182 + .../net/authorize/api/yml/v1/OtherTaxType.yml | 62 + .../net/authorize/api/yml/v1/PagingType.yml | 22 + .../net/authorize/api/yml/v1/PayPalType.yml | 62 + .../api/yml/v1/PaymentDetailsType.yml | 102 + .../authorize/api/yml/v1/PaymentEmvType.yml | 32 + .../api/yml/v1/PaymentMaskedType.yml | 32 + .../api/yml/v1/PaymentProfileType.yml | 22 + .../v1/PaymentScheduleType.IntervalAType.yml | 22 + .../api/yml/v1/PaymentScheduleType.yml | 42 + .../api/yml/v1/PaymentSimpleType.yml | 22 + .../net/authorize/api/yml/v1/PaymentType.yml | 82 + .../authorize/api/yml/v1/PermissionType.yml | 12 + .../api/yml/v1/ProcessingOptionsType.yml | 42 + .../authorize/api/yml/v1/ProcessorType.yml | 37 + .../api/yml/v1/ProfileTransAmountType.yml | 56 + .../yml/v1/ProfileTransAuthCaptureType.yml | 2 + .../api/yml/v1/ProfileTransAuthOnlyType.yml | 2 + .../yml/v1/ProfileTransCaptureOnlyType.yml | 12 + .../api/yml/v1/ProfileTransOrderType.yml | 102 + .../v1/ProfileTransPriorAuthCaptureType.yml | 42 + .../api/yml/v1/ProfileTransRefundType.yml | 82 + .../api/yml/v1/ProfileTransVoidType.yml | 42 + .../api/yml/v1/ProfileTransactionType.yml | 62 + .../authorize/api/yml/v1/ReturnedItemType.yml | 52 + .../v1/SecurePaymentContainerErrorType.yml | 22 + .../yml/v1/SecurePaymentContainerRequest.yml | 14 + .../yml/v1/SecurePaymentContainerResponse.yml | 14 + .../SendCustomerTransactionReceiptRequest.yml | 34 + ...SendCustomerTransactionReceiptResponse.yml | 4 + .../net/authorize/api/yml/v1/SettingType.yml | 22 + .../net/authorize/api/yml/v1/SolutionType.yml | 32 + .../authorize/api/yml/v1/SubMerchantType.yml | 112 + .../v1/SubscriptionCustomerProfileType.yml | 22 + .../api/yml/v1/SubscriptionDetailType.yml | 162 + .../api/yml/v1/SubscriptionPaymentType.yml | 22 + .../yml/v1/SubsequentAuthInformationType.yml | 22 + .../authorize/api/yml/v1/TokenMaskedType.yml | 42 + .../api/yml/v1/TransRetailInfoType.yml | 42 + ...onDetailsType.EmvDetailsAType.TagAType.yml | 22 + ...TransactionDetailsType.EmvDetailsAType.yml | 16 + .../api/yml/v1/TransactionDetailsType.yml | 502 ++ .../api/yml/v1/TransactionListSortingType.yml | 22 + ...TransactionRequestType.UserFieldsAType.yml | 16 + .../api/yml/v1/TransactionRequestType.yml | 367 ++ ...esponseType.EmvResponseAType.TagsAType.yml | 16 + ...ansactionResponseType.EmvResponseAType.yml | 27 + ...ionResponseType.ErrorsAType.ErrorAType.yml | 22 + .../TransactionResponseType.ErrorsAType.yml | 16 + ...esponseType.MessagesAType.MessageAType.yml | 22 + .../TransactionResponseType.MessagesAType.yml | 16 + ...ansactionResponseType.PrePaidCardAType.yml | 32 + ...tionResponseType.SecureAcceptanceAType.yml | 32 + ...rPaymentsAType.SplitTenderPaymentAType.yml | 92 + ...nResponseType.SplitTenderPaymentsAType.yml | 16 + ...ransactionResponseType.UserFieldsAType.yml | 16 + .../api/yml/v1/TransactionResponseType.yml | 272 + .../api/yml/v1/TransactionSummaryType.yml | 172 + .../UpdateCustomerPaymentProfileRequest.yml | 34 + .../UpdateCustomerPaymentProfileResponse.yml | 14 + .../yml/v1/UpdateCustomerProfileRequest.yml | 14 + .../yml/v1/UpdateCustomerProfileResponse.yml | 4 + .../UpdateCustomerShippingAddressRequest.yml | 34 + .../UpdateCustomerShippingAddressResponse.yml | 4 + .../yml/v1/UpdateHeldTransactionRequest.yml | 14 + .../yml/v1/UpdateHeldTransactionResponse.yml | 14 + .../yml/v1/UpdateMerchantDetailsRequest.yml | 14 + .../yml/v1/UpdateMerchantDetailsResponse.yml | 4 + .../yml/v1/UpdateSplitTenderGroupRequest.yml | 24 + .../yml/v1/UpdateSplitTenderGroupResponse.yml | 4 + .../authorize/api/yml/v1/UserFieldType.yml | 22 + .../ValidateCustomerPaymentProfileRequest.yml | 54 + ...ValidateCustomerPaymentProfileResponse.yml | 14 + .../api/yml/v1/WebCheckOutDataType.yml | 42 + .../yml/v1/WebCheckOutDataTypeTokenType.yml | 52 + .../authorize/util/ANetSensitiveFields.php | 85 + .../AuthorizedNetSensitiveTagsConfig.json | 49 + .../lib/net/authorize/util/Helpers.php | 26 + .../lib/net/authorize/util/HttpClient.php | 119 + .../lib/net/authorize/util/Log.php | 369 ++ .../lib/net/authorize/util/LogFactory.php | 17 + .../lib/net/authorize/util/Mapper.php | 122 + .../lib/net/authorize/util/MapperGen.php | 73 + .../lib/net/authorize/util/MapperObj.php | 20 + .../util/SensitiveDataConfigType.php | 20 + .../lib/net/authorize/util/SensitiveTag.php | 43 + .../lib/net/authorize/util/classes.json | 1 + .../authorizenet/lib/ssl/cert.pem | 3338 ++++++++++++ .../authorizenet/phpunit.xml.dist | 49 + .../resources/ControllerTemplate.phpt | 21 + .../scripts/appendJsonSerializeCode.pl | 30 + .../scripts/appendJsonSerializeCode.txt | 36 + .../authorizenet/scripts/appendSetCode.pl | 30 + .../authorizenet/scripts/appendSetCode.txt | 49 + .../authorizenet/scripts/appender.sh | 53 + .../authorizenet/scripts/backup.pl | 31 + .../scripts/composer.json.masterUpdate | 25 + .../authorizenet/scripts/finish.sh | 7 + .../generateControllersFromTemplate.sh | 110 + .../scripts/generateObjectsFromXsd.sh | 53 + .../authorizenet/scripts/masterUpdate.sh | 31 + .../authorizenet/scripts/post-patches.sh | 43 + .../authorizenet/scripts/prepare.sh | 8 + .../authorizenet/test-sample-codes.sh | 6 + .../tests/AuthorizeNetSSL_Test.php | 25 + .../tests/AuthorizeNetTD_Test.php | 172 + .../authorizenet/tests/Controller_Test.php | 183 + .../authorizenet/tests/bootstrap.php | 59 + .../authorizenet/tests/domain.crt | 51 + .../api/controller/ApiCoreTestBase.php | 196 + .../CreateTransactionControllerTest.php | 210 + .../api/controller/LogoutControllerTest.php | 36 + .../authorizenet/tests/report.html | 1 + .../default_authorizenet/vendor/autoload.php | 7 + .../vendor/composer/ClassLoader.php | 445 ++ .../vendor/composer/LICENSE | 21 + .../vendor/composer/autoload_classmap.php | 284 + .../vendor/composer/autoload_namespaces.php | 9 + .../vendor/composer/autoload_psr4.php | 9 + .../vendor/composer/autoload_real.php | 52 + .../vendor/composer/autoload_static.php | 294 + .../vendor/composer/installed.json | 47 + .../default_authorizenet_aim.xml | 87 - .../default_authorizenet_aim.xml | 87 - .../default_authorizenet_aim.xml | 87 - .../default_authorizenet_aim/config.xml | 81 - .../core/default_authorizenet_aim.php | 31 - .../default_authorizenet_aim/main.php | 49 - .../extension/default_authorizenet_aim.php | 425 -- .../default_authorizenet_aim.xml | 56 - .../default_authorizenet_aim.xml | 56 - .../default_authorizenet_aim.xml | 56 - .../extension/default_authorizenet_aim.php | 63 - .../responses/default_authorizenet_aim.tpl | 130 - 582 files changed, 66323 insertions(+), 1208 deletions(-) create mode 100644 public_html/extensions/default_authorizenet/admin/controller/responses/extension/default_authorizenet.php create mode 100644 public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml create mode 100644 public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php create mode 100644 public_html/extensions/default_authorizenet/admin/view/default/stylesheet/authorizenet.css create mode 100644 public_html/extensions/default_authorizenet/admin/view/default/template/pages/sale/payment_details.tpl create mode 100644 public_html/extensions/default_authorizenet/composer.lock create mode 100644 public_html/extensions/default_authorizenet/config.xml create mode 100644 public_html/extensions/default_authorizenet/core/hooks.php create mode 100644 public_html/extensions/default_authorizenet/help.txt rename public_html/extensions/{default_authorizenet_aim => default_authorizenet}/image/icon.png (100%) create mode 100644 public_html/extensions/default_authorizenet/install.sql create mode 100644 public_html/extensions/default_authorizenet/main.php create mode 100644 public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php create mode 100644 public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml create mode 100644 public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php rename public_html/extensions/{default_authorizenet_aim => default_authorizenet}/storefront/view/default/image/securitycode.jpg (100%) create mode 100644 public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl create mode 100644 public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl create mode 100644 public_html/extensions/default_authorizenet/uninstall.sql create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/.gitignore create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/.gitmodules create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/.scrutinizer.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/.travis.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/AnetApiSchema.xsd create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/CONTRIBUTING.md create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/LICENSE.txt create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/MIGRATING.md create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/README.md create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/autoload.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/classmap.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/composer.json create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/AIM.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/ARB.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/CIM.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/CP.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/DPM.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/README.md create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/SIM.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/SOAP.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/doc/TD.markdown create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/constants/ANetEnvironment.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ANetApiRequestType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ANetApiResponseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBCancelSubscriptionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBCancelSubscriptionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBCreateSubscriptionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBCreateSubscriptionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionListSortingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionStatusRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBGetSubscriptionStatusResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBSubscriptionMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBSubscriptionType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBUpdateSubscriptionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ARBUpdateSubscriptionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ArbTransactionType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ArrayOfSettingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuDeleteType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuDetailsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuResponseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuUpdateType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuthenticateTestRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/AuthenticateTestResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/BankAccountMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/BankAccountType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/BatchDetailsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/BatchStatisticType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CardArtType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CcAuthenticationType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerPaymentProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerPaymentProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileFromTransactionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileTransactionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerProfileTransactionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerShippingAddressRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateCustomerShippingAddressResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateProfileResponseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateTransactionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreateTransactionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardSimpleType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardTrackType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerAddressExType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerAddressType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerDataType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileBaseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileExType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileListItemType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileSortingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileBaseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileExType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileIdType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileInfoExType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfilePaymentType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileSummaryType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerProfileType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DecryptPaymentDataRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DecryptPaymentDataResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerPaymentProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerPaymentProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerShippingAddressRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DeleteCustomerShippingAddressResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DriversLicenseMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/DriversLicenseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/EmailSettingsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/EmvTagType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/EncryptedTrackDataType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/EnumCollection.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ErrorResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ExtendedAmountType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/FDSFilterType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/FingerPrintType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/FraudInformationType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetAUJobDetailsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetAUJobDetailsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetAUJobSummaryRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetAUJobSummaryResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetBatchStatisticsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetBatchStatisticsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerPaymentProfileListRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerPaymentProfileListResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerPaymentProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerPaymentProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerProfileIdsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerProfileIdsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerShippingAddressRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetCustomerShippingAddressResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetHostedPaymentPageRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetHostedPaymentPageResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetHostedProfilePageRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetHostedProfilePageResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetMerchantDetailsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetMerchantDetailsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetSettledBatchListRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetSettledBatchListResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetTransactionDetailsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetTransactionDetailsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetTransactionListForCustomerRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetTransactionListRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetTransactionListResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetUnsettledTransactionListRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/GetUnsettledTransactionListResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/HeldTransactionRequestType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ImpersonationAuthenticationType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/IsAliveRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/IsAliveResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyBlockType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyManagementSchemeType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/DeviceInfoAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/EncryptedDataAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyManagementSchemeType/DUKPTAType/ModeAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/KeyValueType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/LineItemType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ListOfAUDetailsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/LogoutRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/LogoutResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantContactType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MessagesType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MessagesType/MessageAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MobileDeviceLoginRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MobileDeviceLoginResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MobileDeviceRegistrationRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MobileDeviceRegistrationResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MobileDeviceType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/NameAndAddressType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/OpaqueDataType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/OrderExType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/OrderType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/OtherTaxType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PagingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PayPalType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentDetailsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentEmvType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentProfileType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentScheduleType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentScheduleType/IntervalAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentSimpleType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PermissionType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProcessingOptionsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProcessorType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransAmountType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransAuthCaptureType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransAuthOnlyType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransCaptureOnlyType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransOrderType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransPriorAuthCaptureType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransRefundType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransVoidType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ProfileTransactionType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ReturnedItemType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SecurePaymentContainerErrorType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SecurePaymentContainerRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SecurePaymentContainerResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SendCustomerTransactionReceiptRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SendCustomerTransactionReceiptResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SettingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SolutionType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SubMerchantType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SubscriptionCustomerProfileType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SubscriptionDetailType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SubscriptionPaymentType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/SubsequentAuthInformationType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TokenMaskedType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransRetailInfoType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionDetailsType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionDetailsType/EmvDetailsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionDetailsType/EmvDetailsAType/TagAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionListSortingType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionRequestType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionRequestType/UserFieldsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/EmvResponseAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/EmvResponseAType/TagsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/ErrorsAType/ErrorAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/MessagesAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/MessagesAType/MessageAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/PrePaidCardAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/SecureAcceptanceAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/SplitTenderPaymentsAType/SplitTenderPaymentAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionResponseType/UserFieldsAType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/TransactionSummaryType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerPaymentProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerPaymentProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerShippingAddressRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateCustomerShippingAddressResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateHeldTransactionRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateHeldTransactionResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateMerchantDetailsRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateMerchantDetailsResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateSplitTenderGroupRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UpdateSplitTenderGroupResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/UserFieldType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ValidateCustomerPaymentProfileRequest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ValidateCustomerPaymentProfileResponse.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/WebCheckOutDataType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/WebCheckOutDataTypeTokenType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBCancelSubscriptionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBCreateSubscriptionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBGetSubscriptionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBGetSubscriptionListController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBGetSubscriptionStatusController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ARBUpdateSubscriptionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/AuthenticateTestController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerPaymentProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerProfileFromTransactionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerProfileTransactionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateCustomerShippingAddressController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/CreateTransactionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/DecryptPaymentDataController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/DeleteCustomerPaymentProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/DeleteCustomerProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/DeleteCustomerShippingAddressController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetAUJobDetailsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetAUJobSummaryController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetBatchStatisticsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetCustomerPaymentProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetCustomerPaymentProfileListController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetCustomerProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetCustomerProfileIdsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetCustomerShippingAddressController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetHostedPaymentPageController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetHostedProfilePageController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetMerchantDetailsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetSettledBatchListController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetTransactionDetailsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetTransactionListController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetTransactionListForCustomerController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/GetUnsettledTransactionListController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/IsAliveController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/LogoutController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/MobileDeviceLoginController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/MobileDeviceRegistrationController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/SecurePaymentContainerController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/SendCustomerTransactionReceiptController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateCustomerPaymentProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateCustomerProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateCustomerShippingAddressController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateHeldTransactionController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateMerchantDetailsController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/UpdateSplitTenderGroupController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/ValidateCustomerPaymentProfileController.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/ApiOperationBase.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/controller/base/IApiOperation.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ANetApiRequestType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ANetApiResponseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBCancelSubscriptionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBCancelSubscriptionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBCreateSubscriptionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBCreateSubscriptionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionListRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionListResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionListSortingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionStatusRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBGetSubscriptionStatusResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBSubscriptionMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBSubscriptionType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBUpdateSubscriptionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ARBUpdateSubscriptionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ArbTransactionType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ArrayOfSettingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuDeleteType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuDetailsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuResponseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuUpdateType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuthenticateTestRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/AuthenticateTestResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/BankAccountMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/BankAccountType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/BatchDetailsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/BatchStatisticType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CardArtType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CcAuthenticationType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerPaymentProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerPaymentProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerProfileFromTransactionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerProfileTransactionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerProfileTransactionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerShippingAddressRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateCustomerShippingAddressResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateProfileResponseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateTransactionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreateTransactionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreditCardMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreditCardSimpleType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreditCardTrackType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CreditCardType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerAddressExType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerAddressType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerDataType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileBaseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileExType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileListItemType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileSortingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerPaymentProfileType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileBaseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileExType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileIdType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileInfoExType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfilePaymentType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileSummaryType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerProfileType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/CustomerType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DecryptPaymentDataRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DecryptPaymentDataResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerPaymentProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerPaymentProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerShippingAddressRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DeleteCustomerShippingAddressResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DriversLicenseMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/DriversLicenseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/EmailSettingsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/EmvTagType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/EncryptedTrackDataType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/EnumCollection.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ErrorResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ExtendedAmountType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/FDSFilterType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/FingerPrintType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/FraudInformationType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetAUJobDetailsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetAUJobDetailsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetAUJobSummaryRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetAUJobSummaryResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetBatchStatisticsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetBatchStatisticsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerPaymentProfileListRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerPaymentProfileListResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerPaymentProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerPaymentProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerProfileIdsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerProfileIdsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerShippingAddressRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetCustomerShippingAddressResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetHostedPaymentPageRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetHostedPaymentPageResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetHostedProfilePageRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetHostedProfilePageResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetMerchantDetailsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetMerchantDetailsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetSettledBatchListRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetSettledBatchListResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetTransactionDetailsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetTransactionDetailsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetTransactionListForCustomerRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetTransactionListRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetTransactionListResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetUnsettledTransactionListRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/GetUnsettledTransactionListResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/HeldTransactionRequestType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ImpersonationAuthenticationType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/IsAliveRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/IsAliveResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyBlockType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyManagementSchemeType.DUKPTAType.DeviceInfoAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyManagementSchemeType.DUKPTAType.EncryptedDataAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyManagementSchemeType.DUKPTAType.ModeAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyManagementSchemeType.DUKPTAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyManagementSchemeType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/KeyValueType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/LineItemType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ListOfAUDetailsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/LogoutRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/LogoutResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MerchantAuthenticationType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MerchantContactType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MessagesType.MessageAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MessagesType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MobileDeviceLoginRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MobileDeviceLoginResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MobileDeviceRegistrationRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MobileDeviceRegistrationResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/MobileDeviceType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/NameAndAddressType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/OpaqueDataType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/OrderExType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/OrderType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/OtherTaxType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PagingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PayPalType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentDetailsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentEmvType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentProfileType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentScheduleType.IntervalAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentScheduleType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentSimpleType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PaymentType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/PermissionType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProcessingOptionsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProcessorType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransAmountType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransAuthCaptureType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransAuthOnlyType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransCaptureOnlyType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransOrderType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransPriorAuthCaptureType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransRefundType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransVoidType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ProfileTransactionType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ReturnedItemType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SecurePaymentContainerErrorType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SecurePaymentContainerRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SecurePaymentContainerResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SendCustomerTransactionReceiptRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SendCustomerTransactionReceiptResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SettingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SolutionType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SubMerchantType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SubscriptionCustomerProfileType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SubscriptionDetailType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SubscriptionPaymentType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/SubsequentAuthInformationType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TokenMaskedType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransRetailInfoType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionDetailsType.EmvDetailsAType.TagAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionDetailsType.EmvDetailsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionDetailsType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionListSortingType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionRequestType.UserFieldsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionRequestType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.EmvResponseAType.TagsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.EmvResponseAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.ErrorsAType.ErrorAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.ErrorsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.MessagesAType.MessageAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.MessagesAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.PrePaidCardAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.SecureAcceptanceAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.SplitTenderPaymentsAType.SplitTenderPaymentAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.SplitTenderPaymentsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.UserFieldsAType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionResponseType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/TransactionSummaryType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerPaymentProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerPaymentProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerShippingAddressRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateCustomerShippingAddressResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateHeldTransactionRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateHeldTransactionResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateMerchantDetailsRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateMerchantDetailsResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateSplitTenderGroupRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UpdateSplitTenderGroupResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/UserFieldType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ValidateCustomerPaymentProfileRequest.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/ValidateCustomerPaymentProfileResponse.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/WebCheckOutDataType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/api/yml/v1/WebCheckOutDataTypeTokenType.yml create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/ANetSensitiveFields.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/AuthorizedNetSensitiveTagsConfig.json create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/Helpers.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/Log.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/LogFactory.php create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/Mapper.php create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/MapperGen.php create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/MapperObj.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/SensitiveDataConfigType.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/SensitiveTag.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/net/authorize/util/classes.json create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/lib/ssl/cert.pem create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/phpunit.xml.dist create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/resources/ControllerTemplate.phpt create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/appendJsonSerializeCode.pl create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/appendJsonSerializeCode.txt create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/appendSetCode.pl create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/appendSetCode.txt create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/appender.sh create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/backup.pl create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/composer.json.masterUpdate create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/finish.sh create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/generateControllersFromTemplate.sh create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/generateObjectsFromXsd.sh create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/masterUpdate.sh create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/post-patches.sh create mode 100755 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/scripts/prepare.sh create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/test-sample-codes.sh create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/AuthorizeNetSSL_Test.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/AuthorizeNetTD_Test.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/Controller_Test.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/bootstrap.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/domain.crt create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/net/authorize/api/controller/ApiCoreTestBase.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/net/authorize/api/controller/CreateTransactionControllerTest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/net/authorize/api/controller/LogoutControllerTest.php create mode 100644 public_html/extensions/default_authorizenet/vendor/authorizenet/authorizenet/tests/report.html create mode 100644 public_html/extensions/default_authorizenet/vendor/autoload.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/ClassLoader.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/LICENSE create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/autoload_classmap.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/autoload_namespaces.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/autoload_psr4.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/autoload_real.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/autoload_static.php create mode 100644 public_html/extensions/default_authorizenet/vendor/composer/installed.json delete mode 100755 public_html/extensions/default_authorizenet_aim/admin/language/english/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/admin/language/russian/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/admin/language/spanish/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/config.xml delete mode 100644 public_html/extensions/default_authorizenet_aim/core/default_authorizenet_aim.php delete mode 100755 public_html/extensions/default_authorizenet_aim/main.php delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/controller/responses/extension/default_authorizenet_aim.php delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/language/english/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/language/russian/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/language/spanish/default_authorizenet_aim/default_authorizenet_aim.xml delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/model/extension/default_authorizenet_aim.php delete mode 100755 public_html/extensions/default_authorizenet_aim/storefront/view/default/template/responses/default_authorizenet_aim.tpl diff --git a/public_html/extensions/default_authorizenet/admin/controller/responses/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/admin/controller/responses/extension/default_authorizenet.php new file mode 100644 index 0000000000..c2e35c2c02 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/controller/responses/extension/default_authorizenet.php @@ -0,0 +1,208 @@ +extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + $json = array(); + + if (has_value($this->request->post['order_id']) && $this->request->post['amount'] > 0) { + $order_id = $this->request->post['order_id']; + $amount = preformatFloat($this->request->post['amount']); + $this->loadModel('extension/default_authorizenet'); + $authorizenet_order = $this->model_extension_default_authorizenet->getAuthorizeNetOrder($order_id); + try { + //get current order + $ch_data = $this->model_extension_default_authorizenet->getAuthorizeNetTransaction( + $authorizenet_order['charge_id'] + ); + $ch_data['authAmount'] = round($ch_data['authAmount'], 2); + + //validate if captured + if ( ! $ch_data['captured'] && $ch_data['authAmount'] >= $amount) { + $capture = $this->model_extension_default_authorizenet->captureAuthorizeNet( + $authorizenet_order['charge_id'], + $amount + ); + if ( ! $capture['error']) { + $json['msg'] = $this->language->get('text_captured_order'); + $json['msg'] .= "\n".$capture['description']; + + // update main order status + $this->loadModel('sale/order'); + $this->model_sale_order->addOrderHistory($order_id, array( + 'order_status_id' => $this->config->get('default_authorizenet_status_success_settled'), + 'notify' => 0, + 'append' => 1, + 'comment' => $amount.' '.$this->language->get('text_captured_ok'), + )); + } else { + $json['error'] = true; + $json['msg'] = $capture['error']; + } + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_unable_to_capture'); + } + } catch (AException $e) { + $json['error'] = true; + $json['msg'] = $e->getMessage(); + } + } else { + if ($this->request->post['amount'] <= 0) { + $json['error'] = true; + $json['msg'] = $this->language->get('error_missing_amount'); + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_system'); + } + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } + + public function refund() + { + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + $json = array(); + + if (has_value($this->request->post['order_id']) && $this->request->post['amount'] > 0) { + $order_id = (int)$this->request->post['order_id']; + $amount = preformatFloat($this->request->post['amount']); + $this->loadModel('extension/default_authorizenet'); + $authorizenet_order = $this->model_extension_default_authorizenet->getAuthorizeNetOrder($order_id); + try { + //get current order + $ch_data = $this->model_extension_default_authorizenet->getAuthorizeNetTransaction( + $authorizenet_order['charge_id'] + ); + if (in_array($ch_data['transactionStatus'], array('settledSuccessfully'))) { + $ch_data['captured'] = true; + } + $ch_data['authAmount'] = round($ch_data['authAmount'], 2); + $ch_data['amount_refunded'] = round($ch_data['amount_refunded'], 2); + $remainder = $ch_data['authAmount'] - $ch_data['amount_refunded']; + + //validate if captured + if ($ch_data['captured'] && $remainder >= $amount) { + $refund = $this->model_extension_default_authorizenet->refundAuthorizeNet($ch_data, $amount); + + if ( ! $refund['error']) { + $json['msg'] = $this->language->get('text_refund_order'); + // update main order status + $this->loadModel('sale/order'); + $this->model_sale_order->addOrderHistory($order_id, array( + 'order_status_id' => $this->config->get('default_authorizenet_status_refund'), + 'notify' => 0, + 'append' => 1, + 'comment' => $amount.' '.$this->language->get('text_refunded_ok'), + )); + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_unable_to_refund'); + $json['msg'] .= "\n".$refund['error']; + } + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_unable_to_refund'); + } + } catch (Exception $e) { + $json['error'] = true; + $json['msg'] = $e->getMessage(); + } + } else { + if ($this->request->post['amount'] <= 0) { + $json['error'] = true; + $json['msg'] = $this->language->get('error_missing_amount'); + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_system'); + } + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } + + public function void() + { + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + $json = array(); + if (has_value($this->request->post['order_id'])) { + $order_id = (int)$this->request->post['order_id']; + $this->loadModel('extension/default_authorizenet'); + $authorizenet_order = $this->model_extension_default_authorizenet->getAuthorizeNetOrder($order_id); + try { + //get current order + $ch_data = $this->model_extension_default_authorizenet->getAuthorizeNetTransaction( + $authorizenet_order['charge_id'] + ); + $can_void = false; + if (in_array($ch_data['transactionStatus'], + array('authorizedPendingCapture','capturedPendingSettlement')) + ) { + $can_void = true; + } + + //validate if captured + if ( $can_void ) { + //refund with full amount + $ch_data['amount'] = round($ch_data['amount'], 2); + $void = $this->model_extension_default_authorizenet->voidAuthorizeNet( + $authorizenet_order['charge_id'] + ); + + if ( ! $void['error']) { + $json['msg'] = $this->language->get('text_voided'); + $json['msg'] .= "\n".$void['description']; + // update main order status + $this->loadModel('sale/order'); + $this->model_sale_order->addOrderHistory($order_id, array( + 'order_status_id' => $this->config->get('default_authorizenet_status_void'), + 'notify' => 0, + 'append' => 1, + 'comment' => $this->language->get('text_voided'), + )); + } + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_unable_to_void'); + } + } catch (Exception $e) { + $json['error'] = true; + $json['msg'] = $e->getMessage(); + } + + } else { + $json['error'] = true; + $json['msg'] = $this->language->get('error_system'); + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml b/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml new file mode 100644 index 0000000000..c68ee0a2a5 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/language/english/default_authorizenet/default_authorizenet.xml @@ -0,0 +1,265 @@ + + + + default_authorizenet_name + + + + default_authorizenet_note + + + + text_payment + + + + text_success + + + + default_authorizenet_location_id + + + + default_authorizenet_location_id_0 + + + + default_authorizenet_api_login_id + + + + default_authorizenet_test_mode + + + + default_authorizenet_api_transaction_key + + + + default_authorizenet_api_public_key + + + + default_authorizenet_autoselect + + You can set to skip payment selection page if there is only one payment option. This payment method will be selected automatically]]> + + + default_authorizenet_save_cards_limit + + Set maximum number of credit cards to be saved by customers (up to 100). If set to 0 or blank saving of cards will not be allowed. Security note: Customer credit card details are saved on authorizenet secure servers to ensure maximum data security measures. No credit card details will be saved on your site.]]> + + + + text_authorizenet_connect + + + + + text_authorizenet_settings + + + + text_connect + + + + text_disconnect + + + + text_skip_connect + + + + text_connect_success + + + + text_disconnect_success + + + + default_authorizenet_sort_order + + + + default_authorizenet_test_mode + Set to ON if you want to use test key]]> + + + default_authorizenet_sk_live + Locate this in Authorize.Net API Keys Section. Key starts with sk_live_... ]]> + + + default_authorizenet_pk_live + Locate this in Authorize.Net API Keys Section. Key starts with pk_live_... ]]> + + + default_authorizenet_sk_test + Locate this in Authorize.Net API Keys Section. Key starts with sk_test_... ]]> + + + default_authorizenet_pk_test + Locate this in Authorize.Net API Keys Section. Key starts with pk_test_... ]]> + + + default_authorizenet_settlement + + + + default_authorizenet_settlement_auth + + + + default_authorizenet_settlement_authcapture + + + + default_authorizenet_status_success_settled + Select main order status you want to set in responce to payment processor status]]> + + + default_authorizenet_status_success_unsettled + Select main order status you want to set in responce to payment processor status]]> + + + text_column_date_added + + + + text_column_amount + + + + text_captured_ok + + + + text_captured_order + + + + text_refunded_ok + + + + text_refund_order + + + + text_voided + + + + default_authorizenet_settlement_auto + + + + default_authorizenet_settlement_delayed + + + + text_payment_info + + + + text_capture_status + + + + text_void_status + + + + text_refund_status + + + + text_capture_amount + + + + text_refund_amount + + + + text_order_ref + + + + text_transaction_status + + + + text_order_total + + + + text_balance + + + + + text_transactions + + + + text_confirm_void + + + + text_confirm_capture + + + + text_confirm_refund + + + + button_refund + + + + button_void + + + + button_capture + + + + error_system + + + + error_missing_amount + + + + error_unable_to_capture + + + + error_unable_to_void + + + + error_unable_to_refund + + + + error_authorizenet_sk_test + + + + error_authorizenet_sk_live + + + + + error_permission + + + diff --git a/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php new file mode 100644 index 0000000000..562709d5c0 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/model/extension/default_authorizenet.php @@ -0,0 +1,285 @@ +setName($this->config->get('default_authorizenet_api_login_id')); + $merchantAuthentication->setTransactionKey($this->config->get('default_authorizenet_api_transaction_key')); + + return $merchantAuthentication; + } + + /** + * @param int $order_id + * + * @return bool + */ + public function getAuthorizeNetOrder($order_id) + { + $qry = $this->db->query("SELECT ao.* + FROM ".$this->db->table("authorizenet_orders")." ao + WHERE ao.order_id = '".(int)$order_id."' + LIMIT 1"); + if ($qry->num_rows) { + $order = $qry->row; + return $order; + } else { + return false; + } + } + + /** + * @param $ch_id + * + * @return array|null + */ + public function getAuthorizeNetTransaction($ch_id) + { + if (!has_value($ch_id)) { + return array(); + } + + try { + + $merchantAuthentication = $this->getAccess(); + + $request = new AnetAPI\GetTransactionDetailsRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setTransId($ch_id); + + $controller = new AnetController\GetTransactionDetailsController($request); + + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + + if (($response != null) && ($response->getMessages()->getResultCode() == "Ok")) { + $transaction = $response->getTransaction(); + + $output['transId'] = $transaction->getTransId(); + $output['cardNumber'] = $transaction->getPayment()->getCreditCard()->getCardNumber(); + $output['authAmount'] = $transaction->getAuthAmount(); + $output['settleAmount'] = $transaction->getSettleAmount(); + $output['transactionStatus'] = $transaction->getTransactionStatus(); + return $output; + } else { + return $this->processApiResponse($response, false); + } + } catch (Exception $e) { + //log in AException + $ae = new AException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine()); + ac_exception_handler($ae); + + return null; + } + } + + /** + * @param array $ch_data + * @param float $amount + * + * @return array|AnetAPI\ANetApiResponseType + * @throws AException + */ + public function refundAuthorizeNet($ch_data, $amount) + { + + $merchantAuthentication = $this->getAccess(); + $refTransId = $ch_data['transId']; + + // Set the transaction's refId + $refId = 'ref'.time(); + + // Create the payment data for a credit card + $creditCard = new AnetAPI\CreditCardType(); + $cc_number = substr($ch_data['cardNumber'], -4); + $creditCard->setCardNumber($cc_number); + $creditCard->setExpirationDate("XXXX"); + $paymentOne = new AnetAPI\PaymentType(); + $paymentOne->setCreditCard($creditCard); + //create a transaction + $transactionRequest = new AnetAPI\TransactionRequestType(); + $transactionRequest->setTransactionType("refundTransaction"); + $transactionRequest->setAmount($amount); + $transactionRequest->setPayment($paymentOne); + $transactionRequest->setRefTransId($refTransId); + + $request = new AnetAPI\CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($transactionRequest); + $controller = new AnetController\CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + if ($response != null) { + $tresponse = $response->getTransactionResponse(); + if ($response->getMessages()->getResultCode() == 'Ok') { + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + $output = array( + 'transId' => $tresponse->getTransId(), + 'responseCode' => $tresponse->getResponseCode(), + 'code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + if ($output['transId']) { + $sql = "UPDATE ".$this->db->table('authorizenet_orders')." + SET charge_id='".(int)$output['transId']."' + WHERE charge_id='".(int)$ch_data['transId']."'"; + $this->db->query($sql); + } + + return $output; + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + } + + /** + * @param int $transaction_id + * @param float $amount + * + * @return array + * @throws AException + */ + public function captureAuthorizeNet($transaction_id, $amount) + { + $merchantAuthentication = $this->getAccess(); + $transactionRequestType = new AnetAPI\TransactionRequestType(); + $transactionRequestType->setTransactionType("priorAuthCaptureTransaction"); + $transactionRequestType->setRefTransId($transaction_id); + $transactionRequestType->setAmount($amount); + + $request = new AnetAPI\CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setTransactionRequest($transactionRequestType); + $controller = new AnetController\CreateTransactionController($request); + $response = $controller->executeWithApiResponse(\net\authorize\api\constants\ANetEnvironment::SANDBOX); + if ($response != null) { + $tresponse = $response->getTransactionResponse(); + if ($response->getMessages()->getResultCode() == 'Ok') { + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'transId' => $tresponse->getRefTransId(), + 'responseCode' => $tresponse->getResponseCode(), + 'code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + } + + /** + * @param int $transaction_id + * + * @return array + * @throws AException + */ + public function voidAuthorizeNet($transaction_id) + { + $merchantAuthentication = $this->getAccess(); + //create a transaction + $refId = 'ref'.time(); + $transactionRequestType = new AnetAPI\TransactionRequestType(); + $transactionRequestType->setTransactionType("voidTransaction"); + $transactionRequestType->setRefTransId($transaction_id); + $request = new AnetAPI\CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($transactionRequestType); + $controller = new AnetController\CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + + if ($response != null) { + $tresponse = $response->getTransactionResponse(); + if ($response->getMessages()->getResultCode() == 'Ok') { + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'transId' => $tresponse->getRefTransId(), + 'responseCode' => $tresponse->getResponseCode(), + 'authCode' => $tresponse->getAuthCode(), + 'code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + } + + /** + * @param \net\authorize\api\contract\v1\TransactionResponseType $api_response + * @param string $mode + * + * @return array + * @throws AException + */ + private function processApiResponse($api_response, $mode = 'exception') + { + $output = array(); + if (method_exists($api_response, 'getErrors') && $api_response->getErrors() != null) { + $errors = $api_response->getErrors(); + $output['error'] = $errors[0]->getErrorText().' ('.$errors[0]->getErrorCode().')'; + $output['code'] = $errors[0]->getErrorCode(); + } else { + $messages = $api_response->getMessages(); + if (!is_array($messages)) { + $messages = $messages->getMessage(); + } + if ($messages) { + $output['error'] = $messages[0]->getText().' ('.$messages[0]->getCode().')'; + $output['code'] = $messages[0]->getCode(); + } + } + + if ($output) { + $err = new AError('Authorize.net:'.var_export($output, true)); + $err->toDebug()->toLog(); + } + + if ($output && $mode == 'exception') { + throw new AException (AC_ERR_LOAD, 'Error: '.$output['error']); + } + + return $output; + } + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/admin/view/default/stylesheet/authorizenet.css b/public_html/extensions/default_authorizenet/admin/view/default/stylesheet/authorizenet.css new file mode 100644 index 0000000000..4f2b626557 --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/view/default/stylesheet/authorizenet.css @@ -0,0 +1,166 @@ +.authorizenet-connect:hover { + text-decoration: none; +} +.authorizenet-connect { + display: inline-block; + margin-bottom: 1px; + + background-image: -webkit-linear-gradient(#28A0E5, #015E94); + background-image: -moz-linear-gradient(#28A0E5, #015E94); + background-image: -ms-linear-gradient(#28A0E5, #015E94); + background-image: linear-gradient(#28A0E5, #015E94); + + -webkit-font-smoothing: antialiased; + border: 0; + padding: 1px; + text-decoration: none; + + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + + -moz-box-shadow: 0 1px 0 rgba(0,0,0,0.2); + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); + + cursor: pointer; + + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.authorizenet-connect span { + display: block; + position: relative; + padding: 0 12px 0 44px; + height: 30px; + + background: #1275FF; + background-image: -webkit-linear-gradient(#7DC5EE, #008CDD 85%, #30A2E4); + background-image: -moz-linear-gradient(#7DC5EE, #008CDD 85%, #30A2E4); + background-image: -ms-linear-gradient(#7DC5EE, #008CDD 85%, #30A2E4); + background-image: linear-gradient(#7DC5EE, #008CDD 85%, #30A2E4); + + font-size: 14px; + line-height: 30px; + color: white; + font-weight: bold; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + + -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.authorizenet-connect span:before { + content: ''; + display: block; + position: absolute; + left: 11px; + top: 50%; + width: 23px; + height: 24px; + margin-top: -12px; + background-repeat: no-repeat; + background-size: 23px 24px; +} + +.authorizenet-connect:active { + background: #005D93; +} + +.authorizenet-connect:active span { + color: #EEE; + + background: #008CDD; + background-image: -webkit-linear-gradient(#008CDD, #008CDD 85%, #239ADF); + background-image: -moz-linear-gradient(#008CDD, #008CDD 85%, #239ADF); + background-image: -ms-linear-gradient(#008CDD, #008CDD 85%, #239ADF); + background-image: linear-gradient(#008CDD, #008CDD 85%, #239ADF); + + -moz-box-shadow: inset 0 1px 0 rgba(0,0,0,0.1); + -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.1); +} + +.authorizenet-connect.light-blue { + background: #b5c3d8; + background-image: -webkit-linear-gradient(#b5c3d8, #9cabc2); + background-image: -moz-linear-gradient(#b5c3d8, #9cabc2); + background-image: -ms-linear-gradient(#b5c3d8, #9cabc2); + background-image: linear-gradient(#b5c3d8, #9cabc2); + + -moz-box-shadow: 0 1px 0 rgba(0,0,0,0.1); + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1); +} + +.authorizenet-connect.light-blue span { + color: #556F88; + text-shadow: 0 1px rgba(255, 255, 255, 0.8); + + background: #f0f5fa; + background-image: -webkit-linear-gradient(#f0f5fa, #e4ecf5 85%, #e7eef6); + background-image: -moz-linear-gradient(#f0f5fa, #e4ecf5 85%, #e7eef6); + background-image: -ms-linear-gradient(#f0f5fa, #e4ecf5 85%, #e7eef6); + background-image: linear-gradient(#f0f5fa, #e4ecf5 85%, #e7eef6); + + -moz-box-shadow: inset 0 1px 0 #fff; + -webkit-box-shadow: inset 0 1px 0 #fff; + box-shadow: inset 0 1px 0 #fff; +} + +.authorizenet-connect.light-blue:active { + background: #9babc2; +} + +.authorizenet-connect.light-blue:active span { + color: #556F88; + text-shadow: 0 1px rgba(255, 255, 255, 0.8); + + background: #d7dee8; + background-image: -webkit-linear-gradient(#d7dee8, #e7eef6); + background-image: -moz-linear-gradient(#d7dee8, #e7eef6); + background-image: -ms-linear-gradient(#d7dee8, #e7eef6); + background-image: linear-gradient(#d7dee8, #e7eef6); + + -moz-box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); + -webkit-box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); + box-shadow: inset 0 1px 0 rgba(0,0,0,0.05); +} + +.authorizenet-connect.dark { + background: #252525; + background: rgba(0,0,0,0.5) !important; +} + +/* Images*/ + +.authorizenet-connect span:before, .authorizenet-connect.blue span:before { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAYAAAARfGZ1AAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUUb3/7T/YeAy9BXOFaQxZTI7MprJlYrzZIzeCZnBAhKQB3SgBrSAHjAGFsAWOAFX4Al8QRAIA9EgHiwCXJAOsoEY5IPlYA0oAiVgC9gOqsFeUAcaQBM4BtrASXAOXARXwTVwE9wDQ2AUPAOT4DWYgSAID1EhGqQGaUMGkBlkC7Egd8gXCoEioXgoGUqDhJAUWg6tg0qgcqga2g81QN9DJ6Bz0GWoH7oDDUPj0O/QOxiBKTAd1oQNYSuYBXvBwXA0vBBOgxfDS+FCeDNcBdfCR+BW+Bx8Fb4JD8HP4CkEIGSEgeggFggLYSNhSAKSioiRlUgxUonUIk1IB9KNXEeGkAnkLQaHoWGYGAuMKyYAMx/DxSzGrMSUYqoxhzCtmC7MdcwwZhLzEUvFamDNsC7YQGwcNg2bjy3CVmLrsS3YC9ib2FHsaxwOx8AZ4ZxwAbh4XAZuGa4UtxvXjDuL68eN4KbweLwa3gzvhg/Dc/ASfBF+J/4I/gx+AD+Kf0MgE7QJtgQ/QgJBSFhLqCQcJpwmDBDGCDNEBaIB0YUYRuQRlxDLiHXEDmIfcZQ4Q1IkGZHcSNGkDNIaUhWpiXSBdJ/0kkwm65KdyRFkAXk1uYp8lHyJPEx+S1GimFLYlESKlLKZcpBylnKH8pJKpRpSPakJVAl1M7WBep76kPpGjiZnKRcox5NbJVcj1yo3IPdcnihvIO8lv0h+qXyl/HH5PvkJBaKCoQJbgaOwUqFG4YTCoMKUIk3RRjFMMVuxVPGw4mXFJ0p4JUMlXyWeUqHSAaXzSiM0hKZHY9O4tHW0OtoF2igdRzeiB9Iz6CX07+i99EllJWV75RjlAuUa5VPKQwyEYcgIZGQxyhjHGLcY71Q0VbxU+CqbVJpUBlSmVeeoeqryVYtVm1Vvqr5TY6r5qmWqbVVrU3ugjlE3VY9Qz1ffo35BfWIOfY7rHO6c4jnH5tzVgDVMNSI1lmkc0OjRmNLU0vTXFGnu1DyvOaHF0PLUytCq0DqtNa5N03bXFmhXaJ/RfspUZnoxs5hVzC7mpI6GToCOVGe/Tq/OjK6R7nzdtbrNug/0SHosvVS9Cr1OvUl9bf1Q/eX6jfp3DYgGLIN0gx0G3QbThkaGsYYbDNsMnxipGgUaLTVqNLpvTDX2MF5sXGt8wwRnwjLJNNltcs0UNnUwTTetMe0zg80czQRmu836zbHmzuZC81rzQQuKhZdFnkWjxbAlwzLEcq1lm+VzK32rBKutVt1WH60drLOs66zv2SjZBNmstemw+d3W1JZrW2N7w45q52e3yq7d7oW9mT3ffo/9bQeaQ6jDBodOhw+OTo5ixybHcSd9p2SnXU6DLDornFXKuuSMdfZ2XuV80vmti6OLxOWYy2+uFq6Zroddn8w1msufWzd3xE3XjeO2323Ineme7L7PfchDx4PjUevxyFPPk+dZ7znmZeKV4XXE67m3tbfYu8V7mu3CXsE+64P4+PsU+/T6KvnO9632fein65fm1+g36e/gv8z/bAA2IDhga8BgoGYgN7AhcDLIKWhFUFcwJTgquDr4UYhpiDikIxQODQrdFnp/nsE84by2MBAWGLYt7EG4Ufji8B8jcBHhETURjyNtIpdHdkfRopKiDke9jvaOLou+N994vnR+Z4x8TGJMQ8x0rE9seexQnFXcirir8erxgvj2BHxCTEJ9wtQC3wXbF4wmOiQWJd5aaLSwYOHlReqLshadSpJP4iQdT8YmxyYfTn7PCePUcqZSAlN2pUxy2dwd3Gc8T14Fb5zvxi/nj6W6pZanPklzS9uWNp7ukV6ZPiFgC6oFLzICMvZmTGeGZR7MnM2KzWrOJmQnZ58QKgkzhV05WjkFOf0iM1GRaGixy+LtiyfFweL6XCh3YW67hI7+TPVIjaXrpcN57nk1eW/yY/KPFygWCAt6lpgu2bRkbKnf0m+XYZZxl3Uu11m+ZvnwCq8V+1dCK1NWdq7SW1W4anS1/+pDa0hrMtf8tNZ6bfnaV+ti13UUahauLhxZ77++sUiuSFw0uMF1w96NmI2Cjb2b7Dbt3PSxmFd8pcS6pLLkfSm39Mo3Nt9UfTO7OXVzb5lj2Z4tuC3CLbe2emw9VK5YvrR8ZFvottYKZkVxxavtSdsvV9pX7t1B2iHdMVQVUtW+U3/nlp3vq9Orb9Z41zTv0ti1adf0bt7ugT2ee5r2au4t2ftun2Df7f3++1trDWsrD+AO5B14XBdT1/0t69uGevX6kvoPB4UHhw5FHupqcGpoOKxxuKwRbpQ2jh9JPHLtO5/v2pssmvY3M5pLjoKj0qNPv0/+/tax4GOdx1nHm34w+GFXC62luBVqXdI62ZbeNtQe395/IuhEZ4drR8uPlj8ePKlzsuaU8qmy06TThadnzyw9M3VWdHbiXNq5kc6kznvn487f6Iro6r0QfOHSRb+L57u9us9ccrt08rLL5RNXWFfarjpebe1x6Gn5yeGnll7H3tY+p772a87XOvrn9p8e8Bg4d93n+sUbgTeu3px3s//W/Fu3BxMHh27zbj+5k3Xnxd28uzP3Vt/H3i9+oPCg8qHGw9qfTX5uHnIcOjXsM9zzKOrRvRHuyLNfcn95P1r4mPq4ckx7rOGJ7ZOT437j154ueDr6TPRsZqLoV8Vfdz03fv7Db56/9UzGTY6+EL+Y/b30pdrLg6/sX3VOhU89fJ39ema6+I3am0NvWW+738W+G5vJf49/X/XB5EPHx+CP92ezZ2f/AAOY8/wRDtFgAAADQklEQVRIDbWVaUiUQRjHZ96dXY/d1fYQj1U03dJSw9YkFgy6DIkILRArQSSC7PjQjQQqVH7oQ0GHQUWgpQhKHzoNSqiUwpXcsrwIjzVtPVrzbPV9Z6bZhYV3N3WXYAeGmWeeZ37z8J95GEgpBf5oeXn1Es4fYAdzPDlM6je4RBYhR+LMU89UxiCBGiCgkUwsBYSA+SlPKLQBQAYEAZm+3j42K96z3NyOF7VOeMrp62opRcacjPW5+43rDTpNSKQ8QKZAEg7xmPCTs/O27uGJgXuNbW0pxyvLfTmAEBzthEsFZLxRvPdi5rpYo2cmUiQJDA4IVeo0obGdlvGfXUPj0Sym2zPuHxvzcWjDyVupJ/YYizKTGNjLw/HiduNTAqIRIUJ6Vpp+ky8bCSFgwQ2xgkGxFi1ioNWEBGuJB31gbLIv/2pd7SpFoGxtpCYkLSEq4ptlzIYFO7tc7w0TKkeEYg5ADnrWkkYhD8s26GPq3nW0WKxTptftPYBI4Mj3O2fHvKNZBMVSDmMwarXNjDkSF3d5kExZeiCr8M2VI+VFu9IvsPcYtzAvkfoEZkEEE45jMppq3ppbCNPFIY1nD1cpo07lbMmvOXeoDCF8BLKy9uUAAjDkBh+c6bz78mNtVVP7MwET7JBnqb4xXpdWVpC1OVzWn+ELHLCsneX/s7rkRWl1463cy1U3WroG21jhCGKJXPOtKQnpAuENvsAppgDB3TcDVIrpDHbK5Kd+y7W8iodNybHh22rOHyxUK+UaMYjZaoyp25rYL54TSihSKmwZ14v3lc3ZFxdbeywjn/tGJnkmzrydX1ApxOEACKymmXLYfXVpi1JMEOGxPi1ep18doY4r2J7uFumQQ9yGf01bMcZW8dpyc0oIjxxpuC5wuUDX+ovWrnYeg3aXvdLIqnmOvXPsfH6uA5YbTb1DX8ofvTLzTy6ZV4K6fAw+gXiATfdffmjeaUgc1UdpdWplsCooQBrEnqUw82dhdnjit/Vxc4f59tP3DRjzJvYteqrl4rmNlJIfrOwpgNklesDRNQBCHYtQAQqD2CgACNjHAJnG1EyfV/S67fZiJB5t2OGEe4n7L3fS4fpEv/2hUEATfoPbuam5v8N7nps70YTbAAAAAElFTkSuQmCC"); +} + +.authorizenet-connect.light-blue span:before { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAYCAYAAAARfGZ1AAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUUb3/7T/YeAy9BXOFaQxZTI7MprJlYrzZIzeCZnBAhKQB3SgBrSAHjAGFsAWOAFX4Al8QRAIA9EgHiwCXJAOsoEY5IPlYA0oAiVgC9gOqsFeUAcaQBM4BtrASXAOXARXwTVwE9wDQ2AUPAOT4DWYgSAID1EhGqQGaUMGkBlkC7Egd8gXCoEioXgoGUqDhJAUWg6tg0qgcqga2g81QN9DJ6Bz0GWoH7oDDUPj0O/QOxiBKTAd1oQNYSuYBXvBwXA0vBBOgxfDS+FCeDNcBdfCR+BW+Bx8Fb4JD8HP4CkEIGSEgeggFggLYSNhSAKSioiRlUgxUonUIk1IB9KNXEeGkAnkLQaHoWGYGAuMKyYAMx/DxSzGrMSUYqoxhzCtmC7MdcwwZhLzEUvFamDNsC7YQGwcNg2bjy3CVmLrsS3YC9ib2FHsaxwOx8AZ4ZxwAbh4XAZuGa4UtxvXjDuL68eN4KbweLwa3gzvhg/Dc/ASfBF+J/4I/gx+AD+Kf0MgE7QJtgQ/QgJBSFhLqCQcJpwmDBDGCDNEBaIB0YUYRuQRlxDLiHXEDmIfcZQ4Q1IkGZHcSNGkDNIaUhWpiXSBdJ/0kkwm65KdyRFkAXk1uYp8lHyJPEx+S1GimFLYlESKlLKZcpBylnKH8pJKpRpSPakJVAl1M7WBep76kPpGjiZnKRcox5NbJVcj1yo3IPdcnihvIO8lv0h+qXyl/HH5PvkJBaKCoQJbgaOwUqFG4YTCoMKUIk3RRjFMMVuxVPGw4mXFJ0p4JUMlXyWeUqHSAaXzSiM0hKZHY9O4tHW0OtoF2igdRzeiB9Iz6CX07+i99EllJWV75RjlAuUa5VPKQwyEYcgIZGQxyhjHGLcY71Q0VbxU+CqbVJpUBlSmVeeoeqryVYtVm1Vvqr5TY6r5qmWqbVVrU3ugjlE3VY9Qz1ffo35BfWIOfY7rHO6c4jnH5tzVgDVMNSI1lmkc0OjRmNLU0vTXFGnu1DyvOaHF0PLUytCq0DqtNa5N03bXFmhXaJ/RfspUZnoxs5hVzC7mpI6GToCOVGe/Tq/OjK6R7nzdtbrNug/0SHosvVS9Cr1OvUl9bf1Q/eX6jfp3DYgGLIN0gx0G3QbThkaGsYYbDNsMnxipGgUaLTVqNLpvTDX2MF5sXGt8wwRnwjLJNNltcs0UNnUwTTetMe0zg80czQRmu836zbHmzuZC81rzQQuKhZdFnkWjxbAlwzLEcq1lm+VzK32rBKutVt1WH60drLOs66zv2SjZBNmstemw+d3W1JZrW2N7w45q52e3yq7d7oW9mT3ffo/9bQeaQ6jDBodOhw+OTo5ixybHcSd9p2SnXU6DLDornFXKuuSMdfZ2XuV80vmti6OLxOWYy2+uFq6Zroddn8w1msufWzd3xE3XjeO2323Ineme7L7PfchDx4PjUevxyFPPk+dZ7znmZeKV4XXE67m3tbfYu8V7mu3CXsE+64P4+PsU+/T6KvnO9632fein65fm1+g36e/gv8z/bAA2IDhga8BgoGYgN7AhcDLIKWhFUFcwJTgquDr4UYhpiDikIxQODQrdFnp/nsE84by2MBAWGLYt7EG4Ufji8B8jcBHhETURjyNtIpdHdkfRopKiDke9jvaOLou+N994vnR+Z4x8TGJMQ8x0rE9seexQnFXcirir8erxgvj2BHxCTEJ9wtQC3wXbF4wmOiQWJd5aaLSwYOHlReqLshadSpJP4iQdT8YmxyYfTn7PCePUcqZSAlN2pUxy2dwd3Gc8T14Fb5zvxi/nj6W6pZanPklzS9uWNp7ukV6ZPiFgC6oFLzICMvZmTGeGZR7MnM2KzWrOJmQnZ58QKgkzhV05WjkFOf0iM1GRaGixy+LtiyfFweL6XCh3YW67hI7+TPVIjaXrpcN57nk1eW/yY/KPFygWCAt6lpgu2bRkbKnf0m+XYZZxl3Uu11m+ZvnwCq8V+1dCK1NWdq7SW1W4anS1/+pDa0hrMtf8tNZ6bfnaV+ti13UUahauLhxZ77++sUiuSFw0uMF1w96NmI2Cjb2b7Dbt3PSxmFd8pcS6pLLkfSm39Mo3Nt9UfTO7OXVzb5lj2Z4tuC3CLbe2emw9VK5YvrR8ZFvottYKZkVxxavtSdsvV9pX7t1B2iHdMVQVUtW+U3/nlp3vq9Orb9Z41zTv0ti1adf0bt7ugT2ee5r2au4t2ftun2Df7f3++1trDWsrD+AO5B14XBdT1/0t69uGevX6kvoPB4UHhw5FHupqcGpoOKxxuKwRbpQ2jh9JPHLtO5/v2pssmvY3M5pLjoKj0qNPv0/+/tax4GOdx1nHm34w+GFXC62luBVqXdI62ZbeNtQe395/IuhEZ4drR8uPlj8ePKlzsuaU8qmy06TThadnzyw9M3VWdHbiXNq5kc6kznvn487f6Iro6r0QfOHSRb+L57u9us9ccrt08rLL5RNXWFfarjpebe1x6Gn5yeGnll7H3tY+p772a87XOvrn9p8e8Bg4d93n+sUbgTeu3px3s//W/Fu3BxMHh27zbj+5k3Xnxd28uzP3Vt/H3i9+oPCg8qHGw9qfTX5uHnIcOjXsM9zzKOrRvRHuyLNfcn95P1r4mPq4ckx7rOGJ7ZOT437j154ueDr6TPRsZqLoV8Vfdz03fv7Db56/9UzGTY6+EL+Y/b30pdrLg6/sX3VOhU89fJ39ema6+I3am0NvWW+738W+G5vJf49/X/XB5EPHx+CP92ezZ2f/AAOY8/wRDtFgAAADIElEQVRIDbWVTWgTQRTHZ2Z3s5vdpsm2aZp+iKKNCgZsK4iWik0tClqwHozS9iYo4nfw0KNU8ebBm+JNESktBfEgWg+KB0FbiqhFMS1SKyk0lTY1zcd+jG82TSkNoXtoXngk+2bm92b/780EU0pRKWxwcJAjpQAzZrKqSigZ3G3ISsnguka8/FpZWrrOtwi8cI4jpJkiuodgTKAkhqbrC9lM5ms6o936/ObJ+7Vriv3GHFe/Cm8LX76nejwR2elEgsOBOI5DGD6UmpyuG750OtWuZbNLALMFp4axzYK3h690V6oVkXJ3ORJF0QITDIphQMHWTdNEqZSE3IroK7bT9XFMSG7n1T7vDaXMhWRZRhBcPw8ReAuHYVhJCwaLBGBPOc1FSdopSU4Lwuay3ve45FTfhdMfE8ll4U8srkxMTquLC4s/irAKwvDSiiWLw+HgeB40xkyHHHwu/lfouXZ7ePjhnafVlWptczAQhKFfbNyWYZTrc9XtikFjIOiOFSfIoAjyCfeP9kR+tp662AXAZ+AfbIFhEqUrAu8LNjw32SMksJLAwWVd4/V6UW1Njeqv9vW3n7n6JRQKrXbXRkkwMrE1OXyi7YFJcWDs29RxaBGetSDhCQKtkCiJVqHhOzhLyGOAdm8Ezo/ndxI923m4f3/jru8v346GpmPzTXCd5ZJA9/AcD8W2ZGPy2LY8nC0Y217vj17q7Xw3HZs79Gjg9c2sbkACMA4jSZJQRnJK7NGOUUSoBT/WG+mDWv4jFI8ih/ip4+DeqK5p16HpeVYDZjwkYBLZNYypacHravzhjKY3GXBQTPDxiSnkUVWkyMpqe0L9kbtMztiFw3TNgleoHqdOWRmhxtREBHR2CIKlM4sxM0yKAlv9UbtwqFnSggsAEggPx9t6LFgPlxfyV7oTvSc77hYMFgmAzHGLdqBp94vZ+aWFxUSyPpXRVN0wnHAEsMARw6VI6WBgS6yjpXEIOANFWAVhapozeOU/dAeMNoDXgXvAneCt4Anw3+CvwEfAbdvQyPiRvA6TsIr5phnc5zOF9+sm4XnBjJcMvsgtJ/8DyYLwNvinaNYAAAAASUVORK5CYII="); +} + +/* Retina support */ +@media only screen and (-webkit-min-device-pixel-ratio: 1.5), + only screen and (min--moz-device-pixel-ratio: 1.5), + only screen and (min-device-pixel-ratio: 1.5) { + + .authorizenet-connect span:before, .authorizenet-connect.blue span:before { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUUb3/7T/YeAy9BXOFaQxZTI7MprJlYrzZIzeCZnBAhKQB3SgBrSAHjAGFsAWOAFX4Al8QRAIA9EgHiwCXJAOsoEY5IPlYA0oAiVgC9gOqsFeUAcaQBM4BtrASXAOXARXwTVwE9wDQ2AUPAOT4DWYgSAID1EhGqQGaUMGkBlkC7Egd8gXCoEioXgoGUqDhJAUWg6tg0qgcqga2g81QN9DJ6Bz0GWoH7oDDUPj0O/QOxiBKTAd1oQNYSuYBXvBwXA0vBBOgxfDS+FCeDNcBdfCR+BW+Bx8Fb4JD8HP4CkEIGSEgeggFggLYSNhSAKSioiRlUgxUonUIk1IB9KNXEeGkAnkLQaHoWGYGAuMKyYAMx/DxSzGrMSUYqoxhzCtmC7MdcwwZhLzEUvFamDNsC7YQGwcNg2bjy3CVmLrsS3YC9ib2FHsaxwOx8AZ4ZxwAbh4XAZuGa4UtxvXjDuL68eN4KbweLwa3gzvhg/Dc/ASfBF+J/4I/gx+AD+Kf0MgE7QJtgQ/QgJBSFhLqCQcJpwmDBDGCDNEBaIB0YUYRuQRlxDLiHXEDmIfcZQ4Q1IkGZHcSNGkDNIaUhWpiXSBdJ/0kkwm65KdyRFkAXk1uYp8lHyJPEx+S1GimFLYlESKlLKZcpBylnKH8pJKpRpSPakJVAl1M7WBep76kPpGjiZnKRcox5NbJVcj1yo3IPdcnihvIO8lv0h+qXyl/HH5PvkJBaKCoQJbgaOwUqFG4YTCoMKUIk3RRjFMMVuxVPGw4mXFJ0p4JUMlXyWeUqHSAaXzSiM0hKZHY9O4tHW0OtoF2igdRzeiB9Iz6CX07+i99EllJWV75RjlAuUa5VPKQwyEYcgIZGQxyhjHGLcY71Q0VbxU+CqbVJpUBlSmVeeoeqryVYtVm1Vvqr5TY6r5qmWqbVVrU3ugjlE3VY9Qz1ffo35BfWIOfY7rHO6c4jnH5tzVgDVMNSI1lmkc0OjRmNLU0vTXFGnu1DyvOaHF0PLUytCq0DqtNa5N03bXFmhXaJ/RfspUZnoxs5hVzC7mpI6GToCOVGe/Tq/OjK6R7nzdtbrNug/0SHosvVS9Cr1OvUl9bf1Q/eX6jfp3DYgGLIN0gx0G3QbThkaGsYYbDNsMnxipGgUaLTVqNLpvTDX2MF5sXGt8wwRnwjLJNNltcs0UNnUwTTetMe0zg80czQRmu836zbHmzuZC81rzQQuKhZdFnkWjxbAlwzLEcq1lm+VzK32rBKutVt1WH60drLOs66zv2SjZBNmstemw+d3W1JZrW2N7w45q52e3yq7d7oW9mT3ffo/9bQeaQ6jDBodOhw+OTo5ixybHcSd9p2SnXU6DLDornFXKuuSMdfZ2XuV80vmti6OLxOWYy2+uFq6Zroddn8w1msufWzd3xE3XjeO2323Ineme7L7PfchDx4PjUevxyFPPk+dZ7znmZeKV4XXE67m3tbfYu8V7mu3CXsE+64P4+PsU+/T6KvnO9632fein65fm1+g36e/gv8z/bAA2IDhga8BgoGYgN7AhcDLIKWhFUFcwJTgquDr4UYhpiDikIxQODQrdFnp/nsE84by2MBAWGLYt7EG4Ufji8B8jcBHhETURjyNtIpdHdkfRopKiDke9jvaOLou+N994vnR+Z4x8TGJMQ8x0rE9seexQnFXcirir8erxgvj2BHxCTEJ9wtQC3wXbF4wmOiQWJd5aaLSwYOHlReqLshadSpJP4iQdT8YmxyYfTn7PCePUcqZSAlN2pUxy2dwd3Gc8T14Fb5zvxi/nj6W6pZanPklzS9uWNp7ukV6ZPiFgC6oFLzICMvZmTGeGZR7MnM2KzWrOJmQnZ58QKgkzhV05WjkFOf0iM1GRaGixy+LtiyfFweL6XCh3YW67hI7+TPVIjaXrpcN57nk1eW/yY/KPFygWCAt6lpgu2bRkbKnf0m+XYZZxl3Uu11m+ZvnwCq8V+1dCK1NWdq7SW1W4anS1/+pDa0hrMtf8tNZ6bfnaV+ti13UUahauLhxZ77++sUiuSFw0uMF1w96NmI2Cjb2b7Dbt3PSxmFd8pcS6pLLkfSm39Mo3Nt9UfTO7OXVzb5lj2Z4tuC3CLbe2emw9VK5YvrR8ZFvottYKZkVxxavtSdsvV9pX7t1B2iHdMVQVUtW+U3/nlp3vq9Orb9Z41zTv0ti1adf0bt7ugT2ee5r2au4t2ftun2Df7f3++1trDWsrD+AO5B14XBdT1/0t69uGevX6kvoPB4UHhw5FHupqcGpoOKxxuKwRbpQ2jh9JPHLtO5/v2pssmvY3M5pLjoKj0qNPv0/+/tax4GOdx1nHm34w+GFXC62luBVqXdI62ZbeNtQe395/IuhEZ4drR8uPlj8ePKlzsuaU8qmy06TThadnzyw9M3VWdHbiXNq5kc6kznvn487f6Iro6r0QfOHSRb+L57u9us9ccrt08rLL5RNXWFfarjpebe1x6Gn5yeGnll7H3tY+p772a87XOvrn9p8e8Bg4d93n+sUbgTeu3px3s//W/Fu3BxMHh27zbj+5k3Xnxd28uzP3Vt/H3i9+oPCg8qHGw9qfTX5uHnIcOjXsM9zzKOrRvRHuyLNfcn95P1r4mPq4ckx7rOGJ7ZOT437j154ueDr6TPRsZqLoV8Vfdz03fv7Db56/9UzGTY6+EL+Y/b30pdrLg6/sX3VOhU89fJ39ema6+I3am0NvWW+738W+G5vJf49/X/XB5EPHx+CP92ezZ2f/AAOY8/wRDtFgAAAIbklEQVRoBdVZa5BURxU+fZ9z57mzs7PvF4i7srAQSCifMVDERC0jYlzUlJalKeGPlCnL/NEfywpWacoiVZRVJIYfGjGUu5bxj5qHFSAYyQOBEsJzYSHDvnd2dp535j66PX1vNgsULDPs1cr2Vs+9e7v79NfnnnP663MJYwwWYxEWI2iOedEClxabxgkBwjEvOuA9PQOOlSw64JMr4vK8GidYYMcOES4tVSEAAZ8FAUqon1GiAJEEEG0CjFB8cTaxZUMAo1gEqQA0UABprAjPbrUwXnkesgqKP8CBk5vDIenrE+BKmwI+MawA1MbCkdV10cBDflXuVmSxQRbFkCAQZ9U2ZTaONyxKcyXDHjMs83ImV3rz6njmDRPMUZB80zAJOuvvsflkXpTP7DrWyeXcYCqk75AEieawrEoty1vrvlcV0ja3VQdb1rVUQVd9EFqqNIj5ZfDJooPBsCnohq2ldDMynC42XZnW7z09lu25lMxDMl34y0gyvTsBwyewc84Z4MEPpWIzF/MBcLLtNzJISmxZU+PmWETbtqGzfvVja5uguyF02+kCIEJUk6Ex4oMV9XP9ZnQT/nZ24it7XrtoJ5LZ7SjAM+Bg2+0ckAOcbBkQIaZFVzY1bGurjezYfn87PNQZ5+13ZaQRXMzH26Lg8ymfUokQdAR59INOc53GQ6q/Jiiua6oJ7+h9uAPua47cHeLrwHEmQRmTGLHV6x4v+JYwWsOFCGRDn6RKem1rPPrkN9Y0uqAXLN4VwCgjYGEE8rBgMAjwKsF9S9WgLa9qjYcf+Po9jXdlGrfC5Wj8Vg0Lf+ZENAFmpGB9TWTLhmUxUD1UDg/gtudRnK+a4RtkgqQyO+RT5LVrmiLgJcN19gcGNojUWriS5yRQm7pcBTc/vyCKdW1RrWwzOTiYhGf+dRUmcgZosgDVfgWaMCS2V2tO+OzG0MiVjdUwiFiYm9a7O4kJAoZEooV9H4T0O0ofODkKr5+6+nY6V3heVZQpv6ZWaz55qSJJnXjtUBW5pT7k8xeK5u+B0PQdBVbQgTLq9HbQYthyNVSmTT6A/nB0aGpF0K99+trY1F7TNI9PZGXkKUVRtYjGZCIOV1dHR4Ynz8FSLV8BrjK6uiAlpLcmco1ipmgpAaU8rfesboCuumBg31uJbx6+qH0uX9D/em0i85xFhaslKZKA8/82RtYDhd/1MkCuBnjxrLgKB0EQSb5oWO+9O1bZrsy3+Kc3dcH+b99b07NuyXe6P9r8z/am+C9lkuqCjo4qGGkQES76qJcuz/2GOlUoFuVsQS+98frlaSeq8Gkqqctrg7Dz853wwrfugUfXtj3W3tJ8oCletRUEXy1SCSSYHhdu41gFqILcZCrzwkvnJmE0U3JtHefiL7eS2l7th11f7IQ9j65aVh+r+nlzbd2TELJrHPLmIXZX3wyBX8MTQMm8PJ0u9Pe9chGQYy9omvXouHu/thJqI+Ef1sZDm0AMBmfPiQsSPDuY2zhWwSH5ISU5Pjm98x9nRo7+7JVBB3wl5nJz35Vo/z/esBQUVf2+QlkD9Aw42/Ts3Au7ushdAhQ5UzJoOjE+OrV9/1tDR7cNnIax7N2bDX9nm1bUQXdz9Rp/MLwRoqAtDOzcaO7rvDrAWW8vhcatWVNjF6cmJre9embkz1947h3YfXgIUgVzblQldxgFH0ZOr/qULwM15k4Zlci4Vd9ZU5ltY71oObHBnBFQBidmUk8kEsOP7Hntwqsb974NfS8PAh7LKoo23Hw+2R4FQcSzKlDPgFOEyf8kx3HW94kQ7xJgRRdAJG7CyIWxgiXNUN0+k5nJLN83k3n8D8eHN3+1ux5+8uBHIKiWt1G1Rn3IJkiUCcQzU3G0h9qWHMeJdoSrwtr9dl6I6DNjFwRRyxiKnStSqkPJPsGSmZ+mp1P9z2dzOy3Klj31yMdmX9S8V75APEsomMZwT9fz9i6vkW9AvEgQyqrBQM2Dq9rrD0gCgXfHA0jpjIRm2Zcw+3CR2tZl27SnMZFSZ1lWcRwZITeDckresAEXaoKwwBh7/WQubgTOQj5BVjdv7KiBJz7bztMNcHIk03JiONNyfiK/ntv2VMHAMx6BjpoA/Gj9Emdjul7W7e6TeQNDK9WJLRm361P5c1drEmAaymaYoXpfjZoiOk7FHWuh5dxEHmzLHiXM9oyTz9FawRZw65f5yyzXBMpd0JGhFKB5nSwRMVvumDv2cxm4m1f5X4AuWhRePDUOtqEPQJVVGfWcBz1ahmPlTlxzqaJLquYZU1HTvjcTMD6dOULM0n+g5nKposHzdWbo7FgEkDBviWlYx++53XtQ33kvDU8dHAJm6L8usdwEZn09S3qiPed5lcCSLUpI0eEA8620zLbDl6bh8T+egkI+/7Rl6kegcTSPst1QUKaM+brhrjnF2yUQJNxnrGMnR7KbTw5nYFVjyAl98w2+VdvVlA67Dw3BgROjAKa+yyrpz0BKTbJnez1NT6AKrrnA1bEi1av2v3xaiL90dnxL2Kc0rsXc4WpcQEc8AEtiGrRiejmK6WWeMDIxtVwwKExijB5KFuBYIg1cy8dx0dTQ/yQVc78yBXMIqJ5i/VvvkqHdSjXuM/THKy7w2LQJ6fpJms38QiHGvlzBt+RwJv2JQ2elbjyRtjIi1AIRMAsKPuQduHVzr2YW+kIBE5BTwOzzxLKOiMX8QVuWh00IpqD+S0WHtLlzefpLBOZo/IYvEqQPnTX5dxmy4xookqaCjRuT4mMi8g3bxs2KCkj3GFj4+QSzA0RkeskU8iCJeUiBDv09Jt8OPEV6k7DlP3gxxh/dAPymPh/Kf5d897dIOd9P7H8oEd4G1JV8wPGbRadx52sgLmrRAZ99EZ5+LZgV+v+4Llrg/wX6HRCxgvzAAwAAAABJRU5ErkJggg=="); + } + + .authorizenet-connect.light-blue span:before { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAwCAYAAABuZUjcAAAKRGlDQ1BJQ0MgUHJvZmlsZQAASA2dlndUFNcXx9/MbC+0XZYiZem9twWkLr1IlSYKy+4CS1nWZRewN0QFIoqICFYkKGLAaCgSK6JYCAgW7AEJIkoMRhEVlczGHPX3Oyf5/U7eH3c+8333nnfn3vvOGQAoASECYQ6sAEC2UCKO9PdmxsUnMPG9AAZEgAM2AHC4uaLQKL9ogK5AXzYzF3WS8V8LAuD1LYBaAK5bBIQzmX/p/+9DkSsSSwCAwtEAOx4/l4tyIcpZ+RKRTJ9EmZ6SKWMYI2MxmiDKqjJO+8Tmf/p8Yk8Z87KFPNRHlrOIl82TcRfKG/OkfJSREJSL8gT8fJRvoKyfJc0WoPwGZXo2n5MLAIYi0yV8bjrK1ihTxNGRbJTnAkCgpH3FKV+xhF+A5gkAO0e0RCxIS5cwjbkmTBtnZxYzgJ+fxZdILMI53EyOmMdk52SLOMIlAHz6ZlkUUJLVlokW2dHG2dHRwtYSLf/n9Y+bn73+GWS9/eTxMuLPnkGMni/al9gvWk4tAKwptDZbvmgpOwFoWw+A6t0vmv4+AOQLAWjt++p7GLJ5SZdIRC5WVvn5+ZYCPtdSVtDP6386fPb8e/jqPEvZeZ9rx/Thp3KkWRKmrKjcnKwcqZiZK+Jw+UyL/x7ifx34VVpf5WEeyU/li/lC9KgYdMoEwjS03UKeQCLIETIFwr/r8L8M+yoHGX6aaxRodR8BPckSKPTRAfJrD8DQyABJ3IPuQJ/7FkKMAbKbF6s99mnuUUb3/7T/YeAy9BXOFaQxZTI7MprJlYrzZIzeCZnBAhKQB3SgBrSAHjAGFsAWOAFX4Al8QRAIA9EgHiwCXJAOsoEY5IPlYA0oAiVgC9gOqsFeUAcaQBM4BtrASXAOXARXwTVwE9wDQ2AUPAOT4DWYgSAID1EhGqQGaUMGkBlkC7Egd8gXCoEioXgoGUqDhJAUWg6tg0qgcqga2g81QN9DJ6Bz0GWoH7oDDUPj0O/QOxiBKTAd1oQNYSuYBXvBwXA0vBBOgxfDS+FCeDNcBdfCR+BW+Bx8Fb4JD8HP4CkEIGSEgeggFggLYSNhSAKSioiRlUgxUonUIk1IB9KNXEeGkAnkLQaHoWGYGAuMKyYAMx/DxSzGrMSUYqoxhzCtmC7MdcwwZhLzEUvFamDNsC7YQGwcNg2bjy3CVmLrsS3YC9ib2FHsaxwOx8AZ4ZxwAbh4XAZuGa4UtxvXjDuL68eN4KbweLwa3gzvhg/Dc/ASfBF+J/4I/gx+AD+Kf0MgE7QJtgQ/QgJBSFhLqCQcJpwmDBDGCDNEBaIB0YUYRuQRlxDLiHXEDmIfcZQ4Q1IkGZHcSNGkDNIaUhWpiXSBdJ/0kkwm65KdyRFkAXk1uYp8lHyJPEx+S1GimFLYlESKlLKZcpBylnKH8pJKpRpSPakJVAl1M7WBep76kPpGjiZnKRcox5NbJVcj1yo3IPdcnihvIO8lv0h+qXyl/HH5PvkJBaKCoQJbgaOwUqFG4YTCoMKUIk3RRjFMMVuxVPGw4mXFJ0p4JUMlXyWeUqHSAaXzSiM0hKZHY9O4tHW0OtoF2igdRzeiB9Iz6CX07+i99EllJWV75RjlAuUa5VPKQwyEYcgIZGQxyhjHGLcY71Q0VbxU+CqbVJpUBlSmVeeoeqryVYtVm1Vvqr5TY6r5qmWqbVVrU3ugjlE3VY9Qz1ffo35BfWIOfY7rHO6c4jnH5tzVgDVMNSI1lmkc0OjRmNLU0vTXFGnu1DyvOaHF0PLUytCq0DqtNa5N03bXFmhXaJ/RfspUZnoxs5hVzC7mpI6GToCOVGe/Tq/OjK6R7nzdtbrNug/0SHosvVS9Cr1OvUl9bf1Q/eX6jfp3DYgGLIN0gx0G3QbThkaGsYYbDNsMnxipGgUaLTVqNLpvTDX2MF5sXGt8wwRnwjLJNNltcs0UNnUwTTetMe0zg80czQRmu836zbHmzuZC81rzQQuKhZdFnkWjxbAlwzLEcq1lm+VzK32rBKutVt1WH60drLOs66zv2SjZBNmstemw+d3W1JZrW2N7w45q52e3yq7d7oW9mT3ffo/9bQeaQ6jDBodOhw+OTo5ixybHcSd9p2SnXU6DLDornFXKuuSMdfZ2XuV80vmti6OLxOWYy2+uFq6Zroddn8w1msufWzd3xE3XjeO2323Ineme7L7PfchDx4PjUevxyFPPk+dZ7znmZeKV4XXE67m3tbfYu8V7mu3CXsE+64P4+PsU+/T6KvnO9632fein65fm1+g36e/gv8z/bAA2IDhga8BgoGYgN7AhcDLIKWhFUFcwJTgquDr4UYhpiDikIxQODQrdFnp/nsE84by2MBAWGLYt7EG4Ufji8B8jcBHhETURjyNtIpdHdkfRopKiDke9jvaOLou+N994vnR+Z4x8TGJMQ8x0rE9seexQnFXcirir8erxgvj2BHxCTEJ9wtQC3wXbF4wmOiQWJd5aaLSwYOHlReqLshadSpJP4iQdT8YmxyYfTn7PCePUcqZSAlN2pUxy2dwd3Gc8T14Fb5zvxi/nj6W6pZanPklzS9uWNp7ukV6ZPiFgC6oFLzICMvZmTGeGZR7MnM2KzWrOJmQnZ58QKgkzhV05WjkFOf0iM1GRaGixy+LtiyfFweL6XCh3YW67hI7+TPVIjaXrpcN57nk1eW/yY/KPFygWCAt6lpgu2bRkbKnf0m+XYZZxl3Uu11m+ZvnwCq8V+1dCK1NWdq7SW1W4anS1/+pDa0hrMtf8tNZ6bfnaV+ti13UUahauLhxZ77++sUiuSFw0uMF1w96NmI2Cjb2b7Dbt3PSxmFd8pcS6pLLkfSm39Mo3Nt9UfTO7OXVzb5lj2Z4tuC3CLbe2emw9VK5YvrR8ZFvottYKZkVxxavtSdsvV9pX7t1B2iHdMVQVUtW+U3/nlp3vq9Orb9Z41zTv0ti1adf0bt7ugT2ee5r2au4t2ftun2Df7f3++1trDWsrD+AO5B14XBdT1/0t69uGevX6kvoPB4UHhw5FHupqcGpoOKxxuKwRbpQ2jh9JPHLtO5/v2pssmvY3M5pLjoKj0qNPv0/+/tax4GOdx1nHm34w+GFXC62luBVqXdI62ZbeNtQe395/IuhEZ4drR8uPlj8ePKlzsuaU8qmy06TThadnzyw9M3VWdHbiXNq5kc6kznvn487f6Iro6r0QfOHSRb+L57u9us9ccrt08rLL5RNXWFfarjpebe1x6Gn5yeGnll7H3tY+p772a87XOvrn9p8e8Bg4d93n+sUbgTeu3px3s//W/Fu3BxMHh27zbj+5k3Xnxd28uzP3Vt/H3i9+oPCg8qHGw9qfTX5uHnIcOjXsM9zzKOrRvRHuyLNfcn95P1r4mPq4ckx7rOGJ7ZOT437j154ueDr6TPRsZqLoV8Vfdz03fv7Db56/9UzGTY6+EL+Y/b30pdrLg6/sX3VOhU89fJ39ema6+I3am0NvWW+738W+G5vJf49/X/XB5EPHx+CP92ezZ2f/AAOY8/wRDtFgAAAHH0lEQVRoBdVZ628UVRS/857dme3strvblpaXCiI+WkCkpFAoECAgr0oqxASjiAZMiF9MiI80/AfqB+WD3/xABOMrKCgRJCBSLCACQUEIEai8ywJ97GNm/J3ZbizM7C7trpG9m7N39t5z7/2dM+eec+5dzrZtVoqFL0XQhLlkgYulpnGOYxxhLjngW7Zsdayk5IB3RyJSSWrcMP1aSQJPJfnwoIA3LFhTy3hrAdx+IzbIOMbsGkQAR3pM1Icdcxv1ZZtxf+D5OGPm3vbJo4/YbW0WLVSswglCLc3F5QtAzyx6ZbbA7Hc5jp8hCAIj4nmecTy2NyRwCqShOEZzWZbFTMtkpmky27Ku2Da36cC2j9vSjIV/b93RsZpmybo5n2htlct6yz6SReFlWZaZIitMURRGz6IkMoEXHPAOFAewnQacSrFkMsUSiTgoEU0kk4vBUzTgHM87GvcE3traKgTjxleyT5mvaTrTdY2pqo9JBNjReBp0v0sFLtI4tA2ClqFtIpPF43EIEdcd4Yr0hSWy23hnIvi2T/PPDwaDLBAIMFVRmSACbMY0XCDSImTCsOOvYDr0hqxUQnGxF9AA4/T2Ks2LXwsD9Iby8nIWNIJMVmTGZwWcAwFW4AWIYmfEycE7mC6OZfHjqviCYZT5gobhaIw24VALjRz6aO9Vsdm9I6eu6XN1mIcC8+ALAO0sS28qvY43iiG0csxydOHanJqm1ZFNk8vLp67hVeHjLfMbvx9ZHY7Fbvco17pi2vlL1youXemKXLh8Y8SV610jelPJIcDLP8QFXJHlELm77BsxPaltW6xx4vgDo2uiN6klZOh9RGNG1VzHz1Ogn6j99LkLcaqLXVzA4acRnIS82k6lTLbjx/aqhgmPvglQMZAMItcXAkVAw4nGjKq9hbroxQVcVeVenuN9//po7zUpQp44ffbZOSvWb48nEhv3fr5pBzhJu6TxP0E/g6iUpavifrt8VUXIuEC27eyrHDVFTtoLiqo2SKK4vem5tQebWl5dwW3ceO+c/4nG712EwUaPIhDmRU5RtMwoY5FwhIXg83VNmyxJ6uamY5ePNbWsXVFc/bpncwFfMnvqN4oi3iRTyfXh+zVO0bUyGmXRykpWXkEC6ONlWdo8c/m6L+atWpXJHt0rF9jiAq7rvpPzGuu/hqlYjjskr5mFKDiRB/Ijtw8FQywaibJKCEBvwOf3L032lf0wbcnqQIEYPYe7gIPrRPPU+kONk8Z/jVAPb38fH0gpiiLA+lgwaDgCRMJhJGf6FFXV3vNcucBGL+Am5ty2dM6UjkWzp3ziU+Vb+TZqpp9yGhLADwFCoXKYTgVD3vPSrBXr6wrE6RruBZyYzoK+nT7psdMb1rS8P+Hxh3bKstiT19X0S4CcGSmDzAzkO9gDHHL5510rF9jg8uMD5juC55jfry5aubBpb+xOz8Fd+3+rO3bqr6ndvX0VA/i8HyEEHT4CeoAl4/GFYHrLm3Fordk0npmNNP8haJeh+7uWzW04+M665R9MmzT+S0kU+jImkq2mJE1RFab6fA9nJixWnUvjmTUoS6K84xfQU0i+piya9fRhjrftfR2/L3M8TobToxYFEScnqehu0QW8ufX1eoGXJPNy6Mju3W2pAVgSeO4AHQLV+SR5pIVES+CQ1+QolPeoqlr0RMsFXJTkpXDbbVxVV/eclW+04wjTDod4HGe907aQuiImOV7RfbXVVdWNeqCMCUpu4ORM4Zl6csg2pC4X8GHRsNbdl6BrBs1MpWbh4DuLrhvoEGzZODVJHA7GPOuLJ5iG0ELAchUcn5mh63/n4hlKnwt4bW11uCvW65x+cLXAkgkQDgMpXDtQRkhAydXRKQnJVTqq5liZTv/V0dDJHCyD6rIZT5mU+15Fgk36/X7n/oQ0beGawQTgtMZxT4UP2a1zt4I6n8bxPlLNU+u+GxS6HMwch43lBZzu+tHpXPaIPDRKWi2gPDKi6sDo2sqjBUxx91CbOWdBN6r+hCqfJu+ezfuXEfCdX7lw+k70nvDmGHwr7KSbRrmA9+POa7v5lgwHA2debJn5KSIvxQBnsXxj7qcfwe4a8bmAD4tWnLp6s7uzN2lWw33kdhkeK/lUpat+3Kg9C2ZMPIzuC6A9HmxDbsJeozndwNesXLCf2mO376gnz3TW4Jph2I3Y7cidnr7ynt54MJky/ZZli8jFTZHnE7Ikdmt+9Ua0wjg/bvSwM0+OHXER0ZV2PqULn4EGBjH8LKzgJH+OZnBpHG3kczuNgF7dUD/2DJ6JBlO6wLwP9OtgBt0vr22a3hrHBHQnQkSXlTWgahBlg+WgIMgHIoEpb6cdTvZ7A3QRRFruBDm+FnXRiyhZ3jY+YCXKLwgI0QNTYkKPt1d5YBBmAaJdver48bx/pWQZ/781wx06nq7kgGc0lu8ElOF74OqSBf4P9hj31KSAw4AAAAAASUVORK5CYII="); + } +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/admin/view/default/template/pages/sale/payment_details.tpl b/public_html/extensions/default_authorizenet/admin/view/default/template/pages/sale/payment_details.tpl new file mode 100644 index 0000000000..eac20d196d --- /dev/null +++ b/public_html/extensions/default_authorizenet/admin/view/default/template/pages/sale/payment_details.tpl @@ -0,0 +1,195 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
+
+ + + + +
+
+ +
+
+ +
+
+ + + + +
+ + +
+
+ +
+
+ +
+ + + +
+
+ +
+
+ +
+
+ + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/composer.lock b/public_html/extensions/default_authorizenet/composer.lock new file mode 100644 index 0000000000..2c95f0a9f0 --- /dev/null +++ b/public_html/extensions/default_authorizenet/composer.lock @@ -0,0 +1,63 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "8cf1d470a25f973992ba90d6e6ee6ca3", + "packages": [ + { + "name": "authorizenet/authorizenet", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/AuthorizeNet/sdk-php.git", + "reference": "7fa78e6397d363296e462c3b348573c17175b7a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/AuthorizeNet/sdk-php/zipball/7fa78e6397d363296e462c3b348573c17175b7a8", + "reference": "7fa78e6397d363296e462c3b348573c17175b7a8", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpmd/phpmd": "~2.0", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "proprietary" + ], + "description": "Official PHP SDK for Authorize.Net", + "homepage": "http://developer.authorize.net", + "keywords": [ + "authorize.net", + "authorizenet", + "ecommerce", + "payment" + ], + "time": "2019-01-14T13:32:41+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.6" + }, + "platform-dev": [] +} diff --git a/public_html/extensions/default_authorizenet/config.xml b/public_html/extensions/default_authorizenet/config.xml new file mode 100644 index 0000000000..5f34472cda --- /dev/null +++ b/public_html/extensions/default_authorizenet/config.xml @@ -0,0 +1,80 @@ + + + default_authorizenet + 1.2.0 + payment + payment + + 1.2 + + + 10 + + + input + + + + input + + + + input + + + + checkbox + 1 + + + selectbox + + auth + authcapture + + auth + + + checkbox + 0 + + + selectbox + + + localisation/order_status + getOrderStatuses + + + order_status_id + name + + + 2 + + + selectbox + + 0 + + localisation/location + getLocations + + + location_id + name + + + + + + + + install.sql + install.php + + + uninstall.sql + uninstall.php + + diff --git a/public_html/extensions/default_authorizenet/core/hooks.php b/public_html/extensions/default_authorizenet/core/hooks.php new file mode 100644 index 0000000000..928a8e19ee --- /dev/null +++ b/public_html/extensions/default_authorizenet/core/hooks.php @@ -0,0 +1,196 @@ +registry = Registry::getInstance(); + } + + //Hook to extension edit in the admin + public function onControllerPagesExtensionExtensions_UpdateData() + { + $that = $this->baseObject; + $current_ext_id = $that->request->get['extension']; + if (IS_ADMIN && $current_ext_id == 'authorizenet' && $this->baseObject_method == 'edit') { + $html = ' + + '; + $that->view->addHookVar('extension_toolbar_buttons', $html); + } + } + + //Hook to extension edit in the admin + public function onControllerPagesSaleOrderSummary_UpdateData() + { + $that = $this->baseObject; + $that->loadModel('extension/default_authorizenet'); + $order = $that->model_extension_default_authorizenet->getAuthorizeNetOrder($that->request->get['order_id']); + if ( ! $order || IS_ADMIN !== true) { + return null; + } + $view_order_details = $that->view->getData('order'); + $view_order_details['payment_method'] = $view_order_details['payment_method'] + .'
' + .($order['charge_id'] ? 'Transaction ID: '.$order['charge_id'] : ''); + $that->view->assign('order', $view_order_details); + } + + //Hook to enable payment details tab in admin + public function onControllerPagesSaleOrderTabs_UpdateData() + { + $that = $this->baseObject; + $order_id = $that->data['order_id']; + $order_info = $that->model_sale_order->getOrder($order_id); + //are we logged in and in admin? + if (IS_ADMIN && $that->user->isLogged()) { + if ($order_info['payment_method_key'] != 'default_authorizenet') { + return null; + } + //check if tab is not yet enabled. + if (in_array('payment_details', $that->data['groups'])) { + return null; + } + + $that->data['groups'][] = 'payment_details'; + $that->data['link_payment_details'] = $that->html->getSecureURL( + 'sale/order/payment_details', + '&order_id='.$order_id.'&extension=default_authorizenet' + ); + //reload main view data with updated tab + $that->view->batchAssign($that->data); + } + } + + //Hook to payment details page to show information + public function onControllerPagesSaleOrder_UpdateData() + { + $that = $this->baseObject; + $order_id = $that->request->get['order_id']; + //are we logged to admin and correct method called? + if (IS_ADMIN && $that->user->isLogged() && $this->baseObject_method == 'payment_details') { + //build HTML to show + $that->loadLanguage('default_authorizenet/default_authorizenet'); + $that->loadModel('extension/default_authorizenet'); + + if ( ! $this->r_data) { + //no local authorizenet order data yet. load it. + $this->loadAuthorizenetOrderData($order_id, $that); + } + + if ( ! $this->r_data) { + $this->baseObject->view->addHookVar('extension_payment_details', + '
AuthorizeNet transaction details not found.
'); + + return null; + } + + $view = new AView($this->registry, 0); + //get remote charge data + $ch_data = $that->model_extension_default_authorizenet->getAuthorizeNetTransaction($this->r_data['charge_id']); + if ( ! $ch_data || $ch_data['error']) { + $view->assign('error_warning', "Transaction ID ".$this->r_data['charge_id']." not found."); + } else { + + $ch_data['authAmount'] = round($ch_data['authAmount'], 2); + $ch_data['amount_refunded'] = round($ch_data['amount_refunded'], 2); + $ch_data['amount_formatted'] = $that->currency->format( + $ch_data['authAmount'], + strtoupper($ch_data['currency']), + 1 + ); + if (in_array( + $ch_data['transactionStatus'], + array( + 'capturedPendingSettlement', + 'settledSuccessfully', + 'refundSettledSuccessfully', + 'refundPendingSettlement' + ) + ) + ) { + $ch_data['captured'] = true; + } + + if (in_array( + $ch_data['transactionStatus'], + array('refundSettledSuccessfully', 'refundPendingSettlement') + ) + ) { + $ch_data['refunded'] = true; + $ch_data['settleAmount'] = ''; + } + + if (in_array($ch_data['transactionStatus'], array('settledSuccessfully'))) { + $ch_data['can_refund'] = true; + } + + //check a void status. + //Not captured and refunded + if (in_array( + $ch_data['transactionStatus'], + array('authorizedPendingCapture','capturedPendingSettlement')) + ){ + $ch_data['can_void'] = true; + } + + if ($ch_data['transactionStatus'] == 'voided') { + $ch_data['void_status'] = true; + } + //if + if($this->r_data['charge_id'] != $this->r_data['charge_id_previous']){ + $view->assign('previous_transaction_id', $this->r_data['charge_id_previous']); + $orig_transaction = $that + ->model_extension_default_authorizenet + ->getAuthorizeNetTransaction( + $this->r_data['charge_id_previous'] + ); + $balance = $orig_transaction['authAmount'] - $ch_data['authAmount']; + }else { + $balance = $ch_data['transactionStatus'] == 'voided' + ? 0.0 + : ($ch_data['authAmount'] - $ch_data['settleAmount'] - $ch_data['amount_refunded']); + } + $ch_data['balance_formatted'] = $that->currency->format($balance, strtoupper($ch_data['currency']), 1); + } + + $view->assign('order_id', $order_id); + $test_mode = $this->r_data['authorizenet_test_mode']; + $view->assign('test_mode', $test_mode); + if ($test_mode) { + $view->assign( + 'external_url', + 'https://sandbox.authorize.net/UI/themes/sandbox/merch.aspx?page=search&transId=' + ); + } else { + $view->assign('external_url', 'https://dashboard.authorize.net/payments/'); + } + + $view->assign('void_url', $that->html->getSecureURL('r/extension/default_authorizenet/void')); + $view->assign('capture_url', $that->html->getSecureURL('r/extension/default_authorizenet/capture')); + $view->assign('refund_url', $that->html->getSecureURL('r/extension/default_authorizenet/refund')); + $view->assign('authorizenet_order', $ch_data); + + $view->batchAssign($that->language->getASet('default_authorizenet/default_authorizenet')); + $this->baseObject->view->addHookVar( + 'extension_payment_details', $view->fetch('pages/sale/payment_details.tpl')); + } + } + + protected function loadAuthorizenetOrderData($order_id, $that) + { + //data already loaded, return + if ($this->r_data) { + return null; + } + //load local authorizenet data + $this->r_data = $that->model_extension_default_authorizenet->getauthorizenetOrder($order_id); + } +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/help.txt b/public_html/extensions/default_authorizenet/help.txt new file mode 100644 index 0000000000..2d8224c2e6 --- /dev/null +++ b/public_html/extensions/default_authorizenet/help.txt @@ -0,0 +1,32 @@ +Authorize.Net Payment Configuration +

+1. To use this extension, you need to get API credentials (API Login ID & Transaction Key and Public Client Key) from new or existing Authorize.Net account
+If you do not have Authorize.Net account, please visit page http://www.authorize.net/
+
    +
  • Get API login id and key in Account > Security Settings > API Credentials & Keys
  • +
  • Get Client key in Account > Security Settings > Manage Public Client Key
  • +
+

+2. Fill in required fields with information provided in Authorize.Net dashboard.
+When you signed up you can use test or live mode connect button. +Important to know!: Test and live mode do not share customer, cards and transaction information. If you switch connection between modes, existing customers and order payment details from prior mode will not be available in new mode.
+To obtain sandbox credentials please go to https://sandbox.authorize.net +
+Sandbox testing notes: +
    +
  • Enable Transaction Details API setting on Account > Settings > Security Settings inside your Authorize.Net account.
  • +
  • Sandbox account have some delay when process transactions.
  • +
  • When you test card save feature use different cards for different customers
  • +
  • In sandbox account you need to enable Live mode for testing! (Sandbox > Account > Settings > Test Mode > switch to Live)
  • +
+

+3. Set up Order Status that will be applied when customer successfully payed with Authorize.Net payment option.

+4. Authorize.Net payment option will appear at customer's checkout at storefront. You can add custom icon or image in the setting to be displayed to customers.

+5. Once orders with authorize.net are created, you can perform capture, void or refund in order Payment Details section of AbanteCart admin.

+6. To test how Authorize.Net works go to storefront, add products to cart and follow checkout process. Payment option will be available at payment's details page. For testing you, can enable test mode and save in the extension your sandbox API credentials. +

+ +For more details about Authorize.Net service and details about transactions you need to access Authorize.Net dashboard. +

+For more details about affiliate program please visit http://reseller.authorize.net/application/?resellerId=34073 + diff --git a/public_html/extensions/default_authorizenet_aim/image/icon.png b/public_html/extensions/default_authorizenet/image/icon.png similarity index 100% rename from public_html/extensions/default_authorizenet_aim/image/icon.png rename to public_html/extensions/default_authorizenet/image/icon.png diff --git a/public_html/extensions/default_authorizenet/install.sql b/public_html/extensions/default_authorizenet/install.sql new file mode 100644 index 0000000000..a4d3e7dbfd --- /dev/null +++ b/public_html/extensions/default_authorizenet/install.sql @@ -0,0 +1,12 @@ +CREATE TABLE IF NOT EXISTS `ac_authorizenet_orders` ( + `authorizenet_order_id` INT(11) NOT NULL AUTO_INCREMENT, + `authorizenet_test_mode` tinyint(1) DEFAULT 0, + `order_id` INT(11) NOT NULL, + `charge_id` CHAR(50) NOT NULL, + `charge_id_previous` CHAR(50) NOT NULL DEFAULT '', + `date_added` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `date_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`authorizenet_order_id`), + INDEX `ac_authorizenet_order_idx` (`authorizenet_order_id`, `order_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; + diff --git a/public_html/extensions/default_authorizenet/main.php b/public_html/extensions/default_authorizenet/main.php new file mode 100644 index 0000000000..e63d30f476 --- /dev/null +++ b/public_html/extensions/default_authorizenet/main.php @@ -0,0 +1,31 @@ + array('responses/extension/default_authorizenet'), + 'admin' => array( + 'responses/extension/default_authorizenet' + ), +); + +$models = array( + 'storefront' => array('extension/default_authorizenet'), + 'admin' => array('extension/default_authorizenet'), +); + +$languages = array( + 'storefront' => array( + 'default_authorizenet/default_authorizenet', + ), + 'admin' => array( + 'default_authorizenet/default_authorizenet', + ), +); + +$templates = array( + 'storefront' => array( + 'responses/default_authorizenet.tpl', + ), + 'admin' => array(), +); \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php new file mode 100644 index 0000000000..82d72c311d --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php @@ -0,0 +1,373 @@ +extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $data = $this->buildCCForm(); + $this->view->batchAssign($data); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + //load creditcard input validation + $this->document->addScriptBottom($this->view->templateResource('/javascript/credit_card_validation.js')); + + $this->processTemplate('responses/default_authorizenet.tpl'); + } + + public function form_verification() + { + + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $data = $this->buildCCForm(); + $this->view->batchAssign($data); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + //load creditcard input validation + $this->document->addScriptBottom($this->view->templateResource('/javascript/credit_card_validation.js')); + + $this->processTemplate('responses/default_authorizenet_verification.tpl'); + } + + public function buildCCForm() + { + $data = array(); + //need an order details + $this->loadModel('checkout/order'); + $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); + $data['payment_address'] = $order_info['payment_address_1']." ".$order_info['payment_address_2']; + $data['edit_address'] = $this->html->getSecureURL('checkout/address/payment'); + + $data['text_credit_card'] = $this->language->get('text_credit_card'); + $data['text_wait'] = $this->language->get('text_wait'); + + $csrftoken = $this->registry->get('csrftoken'); + $data['csrfinstance'] = HtmlElementFactory::create(array( + 'type' => 'hidden', + 'name' => 'csrfinstance', + 'value' => $csrftoken->setInstance(), + )); + $data['csrftoken'] = HtmlElementFactory::create(array( + 'type' => 'hidden', + 'name' => 'csrftoken', + 'value' => $csrftoken->setToken(), + )); + + $data['entry_cc_owner'] = $this->language->get('entry_cc_owner'); + $data['cc_owner_firstname'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_owner_firstname', + 'placeholder' => 'First name', + 'value' => $order_info['payment_firstname'], + )); + + $data['cc_owner_lastname'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_owner_lastname', + 'placeholder' => 'Last name', + 'value' => $order_info['payment_lastname'], + )); + + $data['entry_cc_number'] = $this->language->get('entry_cc_number'); + $data['cc_number'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_number', + 'attr' => 'autocomplete="off"', + 'placeholder' => $this->language->get('entry_cc_number'), + 'value' => '', + )); + + $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date'); + + $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2'); + $data['entry_cc_cvv2_short'] = $this->language->get('entry_cc_cvv2_short'); + $data['cc_cvv2_help_url'] = $this->html->getURL('r/extension/default_authorizenet/cvv2_help'); + + $data['cc_cvv2'] = HtmlElementFactory::create(array( + 'type' => 'input', + 'name' => 'cc_cvv2', + 'value' => '', + 'style' => 'short', + 'attr' => ' autocomplete="off" ', + )); + + $data['button_confirm'] = $this->language->get('button_confirm'); + $data['button_back'] = $this->language->get('button_back'); + + $months = array(); + + for ($i = 1; $i <= 12; $i++) { + $months[sprintf('%02d', $i)] = sprintf('%02d - ', $i).strftime('%B', mktime(0, 0, 0, $i, 1, 2000)); + } + $data['cc_expire_date_month'] = HtmlElementFactory::create( + array( + 'type' => 'selectbox', + 'name' => 'cc_expire_date_month', + 'value' => sprintf('%02d', date('m')), + 'options' => $months, + 'style' => 'input-medium short', + )); + + $today = getdate(); + $years = array(); + for ($i = $today['year']; $i < $today['year'] + 11; $i++) { + $years[strftime('%Y', mktime(0, 0, 0, 1, 1, $i))] = strftime('%Y', mktime(0, 0, 0, 1, 1, $i)); + } + $data['cc_expire_date_year'] = HtmlElementFactory::create(array( + 'type' => 'selectbox', + 'name' => 'cc_expire_date_year', + 'value' => sprintf('%02d', date('Y') + 1), + 'options' => $years, + 'style' => 'short', + )); + + $back = $this->request->get['rt'] != 'checkout/guest_step_3' + ? $this->html->getSecureURL('checkout/payment') + : $this->html->getSecureURL('checkout/guest_step_2'); + $data['back'] = HtmlElementFactory::create(array( + 'type' => 'button', + 'name' => 'back', + 'text' => $this->language->get('button_back'), + 'style' => 'button', + 'href' => $back, + 'icon' => 'icon-arrow-left', + )); + + $data['submit'] = HtmlElementFactory::create(array( + 'type' => 'button', + 'name' => 'authorizenet_button', + 'text' => $this->language->get('button_confirm'), + 'style' => 'button btn-orange pull-right', + 'icon' => 'icon-ok icon-white', + )); + + $this->loadModel('extension/default_authorizenet'); + $cust_ccs = array(); + if ($this->config->get('default_authorizenet_save_cards_limit') != 0) { + //if customer see if we have authorizenet customer object created for credit card saving + if ($this->customer->getId() > 0){ + $customer_authorizenet_id = $this + ->model_extension_default_authorizenet + ->getAuthorizeNetCustomerID($this->customer->getId()); + + //load credit cards list + if ($customer_authorizenet_id) { + try { + $cc_list = $this->model_extension_default_authorizenet->getAuthorizeNetCustomerCCs( + $customer_authorizenet_id, + $this->customer->getId(), + $order_info + ); + if ($cc_list) { + $data['saved_cc_list'] = HtmlElementFactory::create(array( + 'type' => 'selectbox', + 'name' => 'use_saved_cc', + 'value' => '', + 'options' => $cc_list, + )); + } + }catch(AException $e){ + + } + + } + } + //build credit card selector + //option to save creditcard if limit is not reached + if ($this->customer->isLogged() + && count($cust_ccs) < $this->config->get('default_authorizenet_save_cards_limit') + ) { + $data['save_cc'] = HtmlElementFactory::create(array( + 'type' => 'checkbox', + 'name' => 'save_cc', + 'value' => '0', + 'checked' => false, + )); + } + } + + return $data; + } + + public function cvv2_help() + { + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + $image = ''.$this->language->get('entry_what_cvv2').''; + + $this->view->assign('title', ''); + $this->view->assign('description', $image); + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + $this->processTemplate('responses/content/content.tpl'); + } + + public function send() + { + if ( ! $this->csrftoken->isTokenValid()) { + $json['error'] = $this->language->get('error_unknown'); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + + return; + } + + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + //validate input + $post = $this->request->post; + //check if saved cc mode is used + if ( ! $post['use_saved_cc']) { + if (empty($post['cc_owner_firstname']) && empty($post['cc_owner_lastname'])) { + $json['error'] = $this->language->get('error_incorrect_name'); + } + if (empty($post['dataValue']) || empty($post['dataDescriptor'])) { + $json['error'] = $this->language->get('error_system'); + } + } + + if (isset($json['error'])) { + $csrftoken = $this->registry->get('csrftoken'); + $json['csrfinstance'] = $csrftoken->setInstance(); + $json['csrftoken'] = $csrftoken->setToken(); + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + + return null; + } + + $this->loadModel('checkout/order'); + $this->loadModel('extension/default_authorizenet'); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + $order_id = $this->session->data['order_id']; + + $order_info = $this->model_checkout_order->getOrder($order_id); + // currency code + $currency = $this->currency->getCode(); + // order amount without decimal delimiter + $amount = round($order_info['total'], 2); + + // Card owner name + $card_firstname = html_entity_decode($post['cc_owner_firstname'], ENT_QUOTES, 'UTF-8'); + $card_lastname = html_entity_decode($post['cc_owner_lastname'], ENT_QUOTES, 'UTF-8'); + + ADebug::checkpoint('AuthorizeNet Payment: Order ID '.$order_id); + + $pd = array( + 'amount' => $amount, + 'currency' => $currency, + 'order_id' => $order_id, + 'cc_owner_firstname' => $card_firstname, + 'cc_owner_lastname' => $card_lastname, + 'save_cc' => $post['save_cc'], + 'use_saved_cc' => $post['use_saved_cc'], + 'dataDescriptor' => $post['dataDescriptor'], + 'dataValue' => $post['dataValue'], + ); + + $p_result = $this->model_extension_default_authorizenet->processPayment($pd); + + ADebug::variable('Processing payment result: ', $p_result); + if ($p_result['error']) { + // transaction failed + $json['error'] = (string)$p_result['error']; + if ($p_result['code']) { + $json['error'] .= ' ('.$p_result['code'].')'; + } + + } else { + if ($p_result['paid']) { + $json['success'] = $this->html->getSecureURL('checkout/success'); + } else { + //Unexpected result + $json['error'] = $this->language->get('error_system').'(abc)'; + } + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + if (isset($json['error']) && $json['error']) { + $csrftoken = $this->registry->get('csrftoken'); + $json['csrfinstance'] = $csrftoken->setInstance(); + $json['csrftoken'] = $csrftoken->setToken(); + } + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } + + public function delete_card() + { + //init controller data + $this->extensions->hk_InitData($this, __FUNCTION__); + $this->loadLanguage('default_authorizenet/default_authorizenet'); + + //validate input + $post = $this->request->post; + $json = array(); + if (empty($post['use_saved_cc'])) { + $json['error'] = $this->language->get('error_system'); + } + if ( ! $this->customer->getId()) { + $json['error'] = $this->language->get('error_system'); + } + if (isset($json['error'])) { + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + + return null; + } + + $this->loadModel('extension/default_authorizenet'); + + $customer_authorizenet_id = $this + ->model_extension_default_authorizenet + ->getAuthorizeNetCustomerID($this->customer->getId()); + $deleted = $this + ->model_extension_default_authorizenet + ->deleteCreditCard( + $post['use_saved_cc'], + $customer_authorizenet_id + ); + + if ( ! $deleted) { + // transaction failed + $json['error'] = $this->language->get('error_system'); + } else { + //basically reload the page + $json['success'] = $this->html->getSecureURL('checkout/confirm'); + } + + //init controller data + $this->extensions->hk_UpdateData($this, __FUNCTION__); + + $this->load->library('json'); + $this->response->setOutput(AJson::encode($json)); + } +} + diff --git a/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml b/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml new file mode 100644 index 0000000000..1fc991302a --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/language/english/default_authorizenet/default_authorizenet.xml @@ -0,0 +1,93 @@ + + + + text_title + + + + text_credit_card + + + + text_wait + + + + entry_cc_owner + + + + entry_cc_number + + + + entry_cc_expire_date + + + + entry_cc_cvv2 + + + + entry_cc_cvv2_short + + + + entry_what_cvv2 + + + + entry_cc_type + + + + entry_cc_save + + + + entry_cc_save_details + + + + + entry_billing_address + + + + entry_edit + + + + text_saved_credit_card + + + + text_delete_saved_credit_card + + + + text_new_credit_card + + + + error_incorrect_number + + + + error_incorrect_name + + + + error_incorrect_expiration + + + + error_incorrect_cvv + + + + error_system + + + + diff --git a/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php new file mode 100644 index 0000000000..dc6e8e5121 --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/model/extension/default_authorizenet.php @@ -0,0 +1,497 @@ +setName($this->config->get('default_authorizenet_api_login_id')); + $merchantAuthentication->setTransactionKey($this->config->get('default_authorizenet_api_transaction_key')); + return $merchantAuthentication; + } + + /** + * @param $address + * + * @return array + * @throws AException + */ + public function getMethod($address) + { + //create new instance of language for case when model called from admin-side + $language = new ALanguage($this->registry, $this->language->getLanguageCode(), 0); + $language->load($language->language_details['directory']); + $language->load('default_authorizenet/default_authorizenet'); + if ($this->config->get('default_authorizenet_status')) { + $query = $this->db->query( + "SELECT * + FROM `".$this->db->table("zones_to_locations")."` + WHERE location_id = '".(int)$this->config->get('default_authorizenet_location_id')."' + AND country_id = '".(int)$address['country_id']."' + AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')"); + + if ( ! $this->config->get('default_authorizenet_location_id')) { + $status = true; + } elseif ($query->num_rows) { + $status = true; + } else { + $status = false; + } + } else { + $status = false; + } + + $payment_data = array(); + if ($status) { + $payment_data = array( + 'id' => 'default_authorizenet', + 'title' => $language->get('text_title'), + 'sort_order' => $this->config->get('default_authorizenet_sort_order'), + ); + } + + return $payment_data; + } + + /** + * @param $pd + * + * @return array + * @throws AException + */ + public function processPayment($pd) + { + $output = array(); + $this->load->model('checkout/order'); + $this->load->language('default_authorizenet/default_authorizenet'); + $order_info = $this->model_checkout_order->getOrder($pd['order_id']); + + try { + $customer_authorizenet_id = $this->getAuthorizeNetCustomerID($this->customer->getId()); + + //grab price from order total + $amount = round($order_info['total'], 2); + //build charge data array + $charge_data = array( + 'amount' => $amount, + 'currency' => $pd['currency'], + 'description' => $this->config->get('store_name').' Order #'.$pd['order_id'], + 'statement_descriptor' => 'Order #'.$pd['order_id'], + 'receipt_email' => $order_info['email'], + 'capture' => ($this->config->get('default_authorizenet_settlement') == 'auth' + ? false + : true), + ); + + //build cc details + $cc_details = array( + 'first_name' => $pd['cc_owner_firstname'], + 'last_name' => $pd['cc_owner_lastname'], + 'address_line1' => trim($order_info['payment_address_1']), + 'address_line2' => trim($order_info['payment_address_2']), + 'address_city' => $order_info['payment_city'], + 'address_zip' => $order_info['payment_postcode'], + 'address_state' => $order_info['payment_zone'], + 'address_country' => $order_info['payment_iso_code_2'], + ); + + if ($order_info['shipping_method']) { + $charge_data['shipping'] = array( + 'name' => $order_info['firstname'].' '.$order_info['lastname'], + 'phone' => $order_info['telephone'], + 'address' => array( + 'line1' => $order_info['shipping_address_1'], + 'line2' => $order_info['shipping_address_2'], + 'city' => $order_info['shipping_city'], + 'postal_code' => $order_info['shipping_postcode'], + 'state' => $order_info['shipping_zone'], + 'country' => $order_info['shipping_iso_code_2'], + ), + ); + } + + $charge_data['metadata'] = array(); + $charge_data['metadata']['order_id'] = $pd['order_id']; + if ($this->customer->getId() > 0) { + $charge_data['metadata']['customer_id'] = (int)$this->customer->getId(); + } + $amount = $pd['amount']; + + ADebug::variable('Processing authorizenet payment request: ', $charge_data); + + $payment_details = $pd + $cc_details + $charge_data + $order_info; + $tr_details = $this->processPaymentByToken($payment_details, $amount); + + + } catch (AException $e) { + $output = array(); + // Something else happened, completely unrelated to AuthorizeNet + $msg = new AMessage(); + $msg->saveError( + 'Unexpected error in authorizenet payment!', + 'Authorize.Net processing failed.
'.$e->getMessage()."(".$e->getCode().")" + ); + + $output['error'] = $e->getMessage(); + + return $output; + } + + //we still have no result. something unexpected happened + if (empty($tr_details)) { + $output['error'] = $this->language->get('error_system').'(**)'; + + return $output; + } + + $responseCode = $tr_details['response_code']; + //we allow only 1 = Approved & 4 = Held for Review + if ($responseCode == 1 || $responseCode == 4) { + //get credit cart type from directResponse + $transaction_id = $tr_details['refTransId']; + $order_info['transaction_id'] = $transaction_id; + $card_type = $tr_details['accountType']; + + $message = 'Order id: '.(string)$pd['order_id']."\n"; + $message .= 'Order total: '.(string)$amount."\n"; + $message .= 'Transaction ID: '.(string)$transaction_id."\n"; + $message .= 'Transaction Timestamp: '.(string)date('m/d/Y H:i:s'); + + //update authorizenet_transaction_id and CC type in the order table + $this->db->query( + "UPDATE ".$this->db->table('orders')." + SET payment_method_data = '".$this->db->escape( + serialize(array('authorizenet_transaction_id' => $transaction_id, 'cc_type' => $card_type)) + )."' + WHERE order_id = '".(int)$pd['order_id']."'" + ); + + //finalize order only if payment is a success + $this->recordOrder($order_info); + $this->model_checkout_order->confirm($pd['order_id'], + $this->config->get('default_authorizenet_status_success_settled')); + if ($order_info['shipping_method'] == 'Pickup From Store') { + $comment = '
'. + 'You will be contacted by an account representative ' + .'when your order is available for pickup.
'."\n"; + $this->model_checkout_order->update($pd['order_id'], + $this->config->get('default_authorizenet_status_success_settled'), $comment); + } + $order_status = $this->config->get('default_authorizenet_status_success_settled'); + //diff order status for pending review + if ($responseCode == 4) { + $order_status = 1; + } + $this->model_checkout_order->update($pd['order_id'], $order_status, $message, false); + $output['paid'] = true; + } else { + // Some other error, assume payment declined + $message = 'Timestamp: '.(string)date('m/d/Y H:i:s')."\n"; + $message .= 'Authorize.net status: '.(string)$tr_details['resultCode']."\n"; + $message .= 'Authorize.net message: '.(string)$tr_details['description']."\n"; + $this->model_checkout_order->update( + $pd['order_id'], + $this->config->get('default_authorizenet_status_decline'), + $message, + false + ); + + if ($tr_details['error']) { + $output['error'] = "Payment has failed! ".$tr_details['error']; + $output['code'] = $tr_details['code']; + } + } + + return $output; + } + + protected function processPaymentByToken($payment_data, $amount) + { + + $merchantAuthentication = $this->getAccess(); + // Set the transaction's refId + $refId = 'refpbt'.$payment_data['order_id']; + // Create the payment object for a payment nonce + $opaqueData = new OpaqueDataType(); + $opaqueData->setDataDescriptor($payment_data['dataDescriptor']); + $opaqueData->setDataValue($payment_data['dataValue']); + + // Add the payment data to a paymentType object + $paymentOne = new PaymentType(); + $paymentOne->setOpaqueData($opaqueData); + // Create order information + $order = new OrderType(); + $order->setInvoiceNumber($payment_data['order_id']); + $order->setDescription($payment_data['description']); + // Set the customer's Bill To address + $customerAddress = new CustomerAddressType(); + $customerAddress->setFirstName($payment_data['first_name']); + $customerAddress->setLastName($payment_data['last_name']); + $customerAddress->setAddress($payment_data['address_line1'].' '.$payment_data['address_line2']); + $customerAddress->setCity($payment_data['payment_city']); + $customerAddress->setState($payment_data['payment_zone']); + $customerAddress->setZip($payment_data['payment_postcode']); + $customerAddress->setCountry($payment_data['payment_iso_code_2']); + $customerAddress->setPhoneNumber($payment_data['telephone']); + + // Set the customer's Ship To address + $ship_address_obj = new AnetAPI\CustomerAddressType(); + $ship_address_obj->setFirstName($payment_data['first_name']); + $ship_address_obj->setLastName($payment_data['last_name']); + $ship_address_obj->setAddress($payment_data['shipping_address_1'].' '.$payment_data['shipping_address_2']); + $ship_address_obj->setCity($payment_data['shipping_city']); + $ship_address_obj->setState($payment_data['shipping_zone']); + $ship_address_obj->setZip($payment_data['shipping_postcode']); + $ship_address_obj->setCountry($payment_data['shipping_iso_code_2']); + // Set the customer's identifying information + $customerData = new CustomerDataType(); + $customerData->setType("individual"); + $customerData->setId($this->customer->getId()); + $customerData->setEmail($payment_data['email']); + // Add values for transaction settings + $duplicateWindowSetting = new SettingType(); + $duplicateWindowSetting->setSettingName("duplicateWindow"); + $duplicateWindowSetting->setSettingValue("60"); + // Create a TransactionRequestType object and add the previous objects to it + $transactionRequestType = new TransactionRequestType(); + $t_type = $this->config->get('default_authorizenet_settlement') == 'authcapture' + ? "authCaptureTransaction" + : 'authOnlyTransaction'; + $transactionRequestType->setTransactionType($t_type); + $transactionRequestType->setAmount($amount); + $transactionRequestType->setOrder($order); + $transactionRequestType->setPayment($paymentOne); + $transactionRequestType->setBillTo($customerAddress); + $transactionRequestType->setShipTo($ship_address_obj); + $transactionRequestType->setCustomer($customerData); + $transactionRequestType->addToTransactionSettings($duplicateWindowSetting); + /*$transactionRequestType->addToUserFields($merchantDefinedField1); + $transactionRequestType->addToUserFields($merchantDefinedField2);*/ + // Assemble the complete transaction request + $request = new CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($transactionRequestType); + // Create the controller and get the response + $controller = new AnetController\CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + /** + * @var AnetApiResponseType $response + */ + $response = $controller->executeWithApiResponse($endpoint_url); + if ($response != null) { + // Check to see if the API request was successfully received and acted upon + $tresponse = $response->getTransactionResponse(); + if ( ! $tresponse && $this->config->get('default_authorizenet_test_mode')) { + $this->log->write(var_export($response, true)); + } + if ($response->getMessages()->getResultCode() == 'Ok') { + // Since the API request was successful, look for a transaction response + // and parse it to display the results of authorizing the card + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'response_object' => $tresponse, + 'refId' => $refId, + 'refTransId' => $tresponse->getTransId(), + 'auth_code' => $tresponse->getAuthCode(), + 'accountNumber' => $tresponse->getAccountNumber(), + 'accountType' => $tresponse->getAccountType(), + 'response_code' => $tresponse->getResponseCode(), + 'message_code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + // Or, print errors if the API request wasn't successful + } else { + return $this->processApiResponse($tresponse, false); + } + } + + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + + /** + * @param int $customer_authorizenet_id + * @param int $payment_profile_id + * @param float $amount + * @param array $payment_data + * + * @return array|ANetApiResponseType + * @throws AException + */ + protected function chargeCustomerProfile( + $customer_authorizenet_id, + $payment_profile_id, + $amount, + $payment_data + ){ + $merchantAuthentication = $this->getAccess(); + + // Set the transaction's refId + $refId = 'refcpp'.$payment_data['order_id']; + $profile_2_charge = new CustomerProfilePaymentType(); + $profile_2_charge->setCustomerProfileId($customer_authorizenet_id); + $payment_profile = new PaymentProfileType(); + $payment_profile->setPaymentProfileId($payment_profile_id); + $profile_2_charge->setPaymentProfile($payment_profile); + $t_request_type = new TransactionRequestType(); + $t_type = $this->config->get('default_authorizenet_settlement') == 'authcapture' + ? "authCaptureTransaction" + : 'authOnlyTransaction'; + $t_request_type->setTransactionType($t_type); + $t_request_type->setAmount($amount); + $t_request_type->setProfile($profile_2_charge); + + // Set the customer's Ship To address + $ship_address_obj = new CustomerAddressType(); + $ship_address_obj->setFirstName($payment_data['first_name']); + $ship_address_obj->setLastName($payment_data['last_name']); + $ship_address_obj->setAddress($payment_data['shipping_address_1'].' '.$payment_data['shipping_address_2']); + $ship_address_obj->setCity($payment_data['shipping_city']); + $ship_address_obj->setState($payment_data['shipping_zone']); + $ship_address_obj->setZip($payment_data['shipping_postcode']); + $ship_address_obj->setCountry($payment_data['shipping_iso_code_2']); + + $t_request_type->setShipTo($ship_address_obj); + $t_request_type->setPoNumber($payment_data['order_id']); + + $request = new CreateTransactionRequest(); + $request->setMerchantAuthentication($merchantAuthentication); + $request->setRefId($refId); + $request->setTransactionRequest($t_request_type); + $controller = new CreateTransactionController($request); + $endpoint_url = $this->config->get('default_authorizenet_test_mode') + ? \net\authorize\api\constants\ANetEnvironment::SANDBOX + : \net\authorize\api\constants\ANetEnvironment::PRODUCTION; + $response = $controller->executeWithApiResponse($endpoint_url); + if ($response != null) { + if ($response->getMessages()->getResultCode() == 'Ok') { + /** + * @var \net\authorize\api\contract\v1\TransactionResponseType $tresponse + */ + $tresponse = $response->getTransactionResponse(); + if ($tresponse != null && $tresponse->getMessages() != null) { + $messages = $tresponse->getMessages(); + + return array( + 'response_object' => $tresponse, + 'refId' => $refId, + 'refTransId' => $tresponse->getTransId(), + 'auth_code' => $tresponse->getAuthCode(), + 'accountNumber' => $tresponse->getAccountNumber(), + 'accountType' => $tresponse->getAccountType(), + 'response_code' => $tresponse->getResponseCode(), + 'message_code' => $messages[0]->getCode(), + 'description' => $messages[0]->getDescription(), + ); + } else { + return $this->processApiResponse($tresponse, false); + } + } else { + $tresponse = $response->getTransactionResponse(); + + return $this->processApiResponse($tresponse, false); + } + } + + return array('error' => 'Error: Method '.__METHOD__.' result. No response returned.'); + } + + /** + * @param TransactionResponseType | AnetApiResponseType $api_response + * @param string $mode + * + * @return array + * @throws AException + */ + private function processApiResponse($api_response, $mode = 'exception') + { + $output = array(); + + if (method_exists($api_response, 'getErrors') && $api_response->getErrors() != null) { + $errors = $api_response->getErrors(); + $output['error'] = $errors[0]->getErrorText(); + $output['code'] = $errors[0]->getErrorCode(); + } else { + $messages = $api_response->getMessages(); + if ( ! is_array($messages)) { + $messages = $messages->getMessage(); + } + if ($messages) { + $output['error'] = $messages[0]->getText(); + $output['code'] = $messages[0]->getCode(); + } + } + + + if ($output) { + $err = new AError('Authorize.net:'.var_export($output, true)); + $err->toDebug()->toLog(); + } + + if ($output && $mode == 'exception') { + throw new AException (AC_ERR_LOAD, 'Error: '.$output['error']); + } + + return $output; + } + + //record order with authorizenet database + public function recordOrder($order_info) + { + $transaction_id = $order_info['transaction_id']; + $test_mode = $this->config->get('default_authorizenet_test_mode') ? 1 : 0; + $this->db->query("INSERT INTO `".$this->db->table("authorizenet_orders")."` + SET `order_id` = '".(int)$order_info['order_id']."', + `charge_id` = '".(int)$transaction_id."', + `charge_id_previous` = '".(int)$transaction_id."', + `authorizenet_test_mode` = '".(int)$test_mode."', + `date_added` = now() + "); + + return $this->db->getLastId(); + } + +} \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet_aim/storefront/view/default/image/securitycode.jpg b/public_html/extensions/default_authorizenet/storefront/view/default/image/securitycode.jpg similarity index 100% rename from public_html/extensions/default_authorizenet_aim/storefront/view/default/image/securitycode.jpg rename to public_html/extensions/default_authorizenet/storefront/view/default/image/securitycode.jpg diff --git a/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl new file mode 100644 index 0000000000..c48af2105c --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet.tpl @@ -0,0 +1,241 @@ + +
+ +
+ +

+ + getHookVar('payment_table_pre'); ?> + +
+ : ... + +
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ +
+ + +
+ + +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+ + + +
+ + getHookVar('payment_table_post'); ?> + +
+ + + text ?> + + +
+ +
+ +
+ + + +config->get('default_authorizenet_test_mode') + ? 'https://jstest.authorize.net/v1/Accept.js' + : 'https://js.authorize.net/v1/Accept.js'; +?> + + + \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl new file mode 100644 index 0000000000..e154dffdbc --- /dev/null +++ b/public_html/extensions/default_authorizenet/storefront/view/default/template/responses/default_authorizenet_verification.tpl @@ -0,0 +1,117 @@ +
+ + + + + + +
+ Please provide a Credit Card to complete the order. There will be no charge to your card unless it is necessary to initiate our Market Loss Policy in the event of you canceling or defaulting on payment. +
+
+ + +
+
+

+ + + + + +
: ... + + + +
+
+ + + + + + + +
+ +   + + + +
+ + + + +
+
+ +
+
+ + \ No newline at end of file diff --git a/public_html/admin/view/default/template/responses/product/option_value_row.tpl b/public_html/admin/view/default/template/responses/product/option_value_row.tpl index d6cc195965..7d93a27d5c 100755 --- a/public_html/admin/view/default/template/responses/product/option_value_row.tpl +++ b/public_html/admin/view/default/template/responses/product/option_value_row.tpl @@ -51,6 +51,11 @@
+
+ +
+
diff --git a/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl b/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl new file mode 100755 index 0000000000..a61c3c30d3 --- /dev/null +++ b/public_html/admin/view/default/template/responses/product/product_stock_locations.tpl @@ -0,0 +1,104 @@ + + + + + + + + + + + $location) { ?> + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + \ No newline at end of file diff --git a/public_html/install/abantecart_database.sql b/public_html/install/abantecart_database.sql index eab52773bd..67e2b735a5 100755 --- a/public_html/install/abantecart_database.sql +++ b/public_html/install/abantecart_database.sql @@ -12566,3 +12566,27 @@ CREATE TABLE `ac_task_steps` ( PRIMARY KEY (`step_id`), KEY `task_steps_idx` (`task_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1; + +DROP TABLE IF EXISTS `ac_product_stock_locations`; +CREATE TABLE `ac_product_stock_locations` ( + `product_id` int(11) NOT NULL, + `product_option_value_id` int(11) DEFAULT NULL, + `location_id` int(11) NOT NULL, + `quantity` int(11) NOT NULL DEFAULT '0', + `sort_order` int(11) NOT NULL DEFAULT '0', + UNIQUE KEY `ac_product_stock_locations_idx` (`product_id`,`product_option_value_id`,`location_id`), + KEY `ac_product_stock_locations_idx2` (`product_option_value_id`) +); + +DROP TABLE IF EXISTS `ac_order_product_stock_locations`; +CREATE TABLE `ac_order_product_stock_locations` ( + `order_product_id` int(11) NOT NULL, + `product_id` int(11) NOT NULL, + `product_option_value_id` int(11) DEFAULT NULL, + `location_id` int(11) NOT NULL, + `location_name` varchar(255) NOT NULL, + `quantity` int(11) NOT NULL DEFAULT '0', + `sort_order` int(11) DEFAULT '0', + KEY `ac_product_options_value_idx` (`product_option_value_id`), + KEY `ac_product_options_value_idx2` (`order_product_id`,`product_id`,`product_option_value_id`,`location_id`) +); \ No newline at end of file diff --git a/public_html/install/abantecart_database_upgrade.sql b/public_html/install/abantecart_database_upgrade.sql index 0771e2e13b..11a85394b6 100755 --- a/public_html/install/abantecart_database_upgrade.sql +++ b/public_html/install/abantecart_database_upgrade.sql @@ -6,4 +6,28 @@ CHANGE COLUMN `meta_keywords` `meta_keywords` LONGTEXT NULL DEFAULT '' COMMENT ' ALTER TABLE `ac_customer_transactions` CHANGE COLUMN `credit` `credit` DECIMAL(15,4) NULL DEFAULT '0', - CHANGE COLUMN `debit` `debit` DECIMAL(15,4) NULL DEFAULT '0'; \ No newline at end of file + CHANGE COLUMN `debit` `debit` DECIMAL(15,4) NULL DEFAULT '0'; + +DROP TABLE IF EXISTS `ac_product_stock_locations`; +CREATE TABLE `ac_product_stock_locations` ( + `product_id` int(11) NOT NULL, + `product_option_value_id` int(11) DEFAULT NULL, + `location_id` int(11) NOT NULL, + `quantity` int(11) NOT NULL DEFAULT '0', + `sort_order` int(11) NOT NULL DEFAULT '0', + UNIQUE KEY `ac_product_stock_locations_idx` (`product_id`,`product_option_value_id`,`location_id`), + KEY `ac_product_stock_locations_idx2` (`product_option_value_id`) +); + +DROP TABLE IF EXISTS `ac_order_product_stock_locations`; +CREATE TABLE `ac_order_product_stock_locations` ( + `order_product_id` int(11) NOT NULL, + `product_id` int(11) NOT NULL, + `product_option_value_id` int(11) DEFAULT NULL, + `location_id` int(11) NOT NULL, + `location_name` varchar(255) NOT NULL, + `quantity` int(11) NOT NULL DEFAULT '0', + `sort_order` int(11) DEFAULT '0', + KEY `ac_product_options_value_idx` (`product_option_value_id`), + KEY `ac_product_options_value_idx2` (`order_product_id`,`product_id`,`product_option_value_id`,`location_id`) +); \ No newline at end of file diff --git a/public_html/storefront/model/checkout/order.php b/public_html/storefront/model/checkout/order.php index 184aed81b7..2f7e5e6a7b 100755 --- a/public_html/storefront/model/checkout/order.php +++ b/public_html/storefront/model/checkout/order.php @@ -393,6 +393,14 @@ public function _confirm($order_id, $order_status_id, $comment = '') SET quantity = (quantity - ".(int)$product['quantity'].") WHERE product_option_value_id = '".(int)$option['product_option_value_id']."' AND subtract = 1"); + + $this->saveOrderProductStocks( + $product['order_product_id'], + $product['product_id'], + $option['product_option_value_id'], + $product['quantity'] + ); + $stock_updated = true; $sql = "SELECT quantity FROM ".$this->db->table("product_option_values")." @@ -415,6 +423,12 @@ public function _confirm($order_id, $order_status_id, $comment = '') $this->db->query("UPDATE ".$this->db->table("products")." SET quantity = (quantity - ".(int)$product['quantity'].") WHERE product_id = '".(int)$product['product_id']."' AND subtract = 1"); + $this->saveOrderProductStocks( + $product['order_product_id'], + $product['product_id'], + null, + $product['quantity'] + ); //check quantity and send notification when 0 or less $sql = "SELECT quantity @@ -943,4 +957,107 @@ protected function _remove_order($order_id) return true; } + + public function saveOrderProductStocks($order_product_id, $product_id, $product_option_value_id, $order_quantity) + { + if(!$order_quantity){ + return false; + } + $stock_locations = $this->getProductStockLocations($product_id, $product_option_value_id); + + if(!$stock_locations){ + return false; + } + $remains = $order_quantity; + $available_quantity = array_sum(array_column($stock_locations,'quantity')); + + //do not save when zero stock on all locations + if(!$available_quantity){ + return false; + } + + foreach($stock_locations as $row){ + //skip zero stock locations or non-trackable + if( + ($available_quantity && !$row['quantity']) + || (!$product_option_value_id && !$row['product_subtract']) + || ($product_option_value_id && !$row['product_option_value_subtract']) + ){ + continue; + } + + if($row['quantity']>=$remains){ + $new_qnty = $row['quantity'] - $remains; + $quantity = $remains; + $remains = 0; + }else{ + $new_qnty = 0; + $quantity = $row['quantity']; + $remains -= $row['quantity']; + } + //update stocks + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = ".(int)$new_qnty." + WHERE location_id= ".(int)$row['location_id']." + AND product_id = ".(int)$product_id + .((int)$product_option_value_id ? " AND product_option_value_id='".(int)$product_option_value_id."' " : ""); + $this->db->query($sql); + //save stocks into order details + $this->db->query( + "INSERT INTO ".$this->db->table("order_product_stock_locations")." + (order_product_id, product_id, product_option_value_id, location_id, location_name, quantity, sort_order) + VALUES( + ".(int)$order_product_id.", + ".(int)$product_id.", + ".( (int)$product_option_value_id + ? (int)$product_option_value_id + : 'NULL' ).", + ".(int)$row['location_id'].", + '".$this->db->escape($row['location_name'])."', + ".(int)$quantity.", + ".(int)$row['sort_order']." + );" + ); + + if(!$remains){ + break; + } + } + return true; + } + + /** + * @param int $product_id + * + * @param int $product_option_value_id + * + * @return array + */ + public function getProductStockLocations($product_id, $product_option_value_id = 0) + { + $sql = "SELECT psl.*, + CONCAT(l.name,' ', l.description) as location_name, + p.subtract as product_subtract, + pov.subtract as product_option_value_subtract + FROM ".$this->db->table('product_stock_locations')." psl + LEFT JOIN ".$this->db->table('products')." p + ON p.product_id = psl.product_id "; + + if($product_option_value_id) { + $sql .= " LEFT JOIN ".$this->db->table('product_option_values')." pov + ON pov.product_option_value_id = psl.product_option_value_id"; + } + $sql .= " LEFT JOIN ".$this->db->table('locations')." l + ON l.location_id = psl.location_id + WHERE psl.product_id=".(int)$product_id; + if($product_option_value_id){ + $sql .= " AND psl.product_option_value_id = ".(int)$product_option_value_id; + }else{ + $sql .= " AND psl.product_option_value_id IS NULL"; + } + $sql .= " ORDER BY psl.sort_order ASC"; + + $result = $this->db->query($sql); + return $result->rows; + } } \ No newline at end of file From 1256303c32d4f6169fa76f4ec47bc3f3f6be05e3 Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 11 Feb 2019 19:04:38 +0200 Subject: [PATCH 18/81] core: minor fixes of stock locations support for products --- .../controller/pages/catalog/product.php | 11 +++-- .../controller/responses/product/product.php | 11 ++++- public_html/admin/model/catalog/product.php | 40 ++++++++----------- .../responses/product/option_value_row.tpl | 6 +-- .../product/product_stock_locations.tpl | 26 ++++++++++-- 5 files changed, 59 insertions(+), 35 deletions(-) diff --git a/public_html/admin/controller/pages/catalog/product.php b/public_html/admin/controller/pages/catalog/product.php index 826e517936..b296b55eee 100755 --- a/public_html/admin/controller/pages/catalog/product.php +++ b/public_html/admin/controller/pages/catalog/product.php @@ -382,6 +382,7 @@ private function _getForm($args = array()) $product_info = $this->model_catalog_product->getProduct($product_id); $product_info['featured'] = $product_info['featured'] ? 1 : 0; $product_info['has_track_options'] = $this->model_catalog_product->hasTrackOptions($product_id); + $product_info['stock_locations'] = $this->model_catalog_product->getProductStockLocations($product_id); if ($product_info['has_track_options']) { $product_info['quantity'] = $this->model_catalog_product->hasAnyStock($product_id); } @@ -778,6 +779,7 @@ private function _getForm($args = array()) ), 'help_url' => $this->gen_help_url('product_inventory'), 'style' => 'medium-field', + 'attr' => 'reload_on_save="true" ', 'disabled' => ($product_info['has_track_options'] ? true : false), )); @@ -787,11 +789,14 @@ private function _getForm($args = array()) 'value' => (int)$this->data['quantity'], 'style' => 'col-xs-1 small-field', 'help_url' => $this->gen_help_url('product_inventory'), - 'attr' => ($product_info['has_track_options'] ? 'disabled' : ''), + 'attr' => ($product_info['has_track_options'] || $product_info['stock_locations'] ? 'disabled' : ''), )); - $dd = new ADispatcher('responses/product/product/stockLocations', array($product_info['product_id']) ); - $this->data['form']['fields']['data']['stock_locations'] = $dd->dispatchGetOutput('responses/product/product/stockLocations'); + if($this->data['subtract'] && !$product_info['has_track_options']) { + $dd = new ADispatcher('responses/product/product/stockLocations', array($product_info['product_id'])); + $this->data['form']['fields']['data']['stock_locations'] = + $dd->dispatchGetOutput('responses/product/product/stockLocations'); + } $this->data['form']['fields']['data']['minimum'] = $form->getFieldHtml(array( 'type' => 'input', diff --git a/public_html/admin/controller/responses/product/product.php b/public_html/admin/controller/responses/product/product.php index e9a495f686..887b7e3a4d 100755 --- a/public_html/admin/controller/responses/product/product.php +++ b/public_html/admin/controller/responses/product/product.php @@ -758,11 +758,19 @@ private function _option_value_form($form) 'name' => 'sku['.$product_option_value_id.']', 'value' => $this->data['sku'], )); + $stock_locations = null; + if($this->data['subtract']){ + $stock_locations = $this->model_catalog_product->getProductStockLocations( + (int)$this->request->get['product_id'], + $product_option_value_id + ); + } $this->data['form']['fields']['quantity'] = $form->getFieldHtml(array( 'type' => 'input', 'name' => 'quantity['.$product_option_value_id.']', 'value' => $this->data['quantity'], 'style' => 'small-field', + 'attr' => ($stock_locations && $this->data['subtract'] ? 'disabled':'') )); $this->data['form']['fields']['subtract'] = $form->getFieldHtml(array( 'type' => 'selectbox', @@ -843,7 +851,7 @@ private function _option_value_form($form) $dd = new ADispatcher( 'responses/product/product/stockLocations', - array($product_id = (int)$this->request->get['product_id'],$product_option_value_id) + array((int)$this->request->get['product_id'],$product_option_value_id) ); $this->data['form']['fields']['stock_locations'] = $dd->dispatchGetOutput('responses/product/product/stockLocations'); @@ -1683,6 +1691,7 @@ public function stockLocations($product_id = 0, $product_option_value_id = null) $product_id = $product_id ? (int)$product_id : $this->request->get['product_id']; $product_option_value_id = $product_option_value_id ? (int)$product_option_value_id : $this->request->get['product_option_value_id']; $this->data['product_option_value_id'] = $product_option_value_id; + if(!$product_option_value_id){ $this->data['save_url'] = $this->html->getSecureURL('listing_grid/product/update_field', '&id='.$product_id); } diff --git a/public_html/admin/model/catalog/product.php b/public_html/admin/model/catalog/product.php index 1bab7acfb2..4a274654ce 100755 --- a/public_html/admin/model/catalog/product.php +++ b/public_html/admin/model/catalog/product.php @@ -370,30 +370,7 @@ public function updateProduct($product_id, $data) } if (isset($data['stock_location'])) { - $this->db->query( - "DELETE - FROM ".$this->db->table("product_stock_locations")." - WHERE product_id = ".(int)$product_id - ); - - foreach($data['stock_location'] as $location_id=>$location_details){ - if(!(int)$location_id){ - continue; - } - $this->db->query( - "INSERT INTO ".$this->db->table("product_stock_locations")." - (product_id, product_option_value_id, location_id, quantity, sort_order) - VALUES( - ".(int)$product_id.", - ".( (int)$location_details['product_option_value_id'] - ? (int)$location_details['product_option_value_id'] - : 'NULL' ).", - ".(int)$location_id.", - ".(int)$location_details['quantity'].", - ".(int)$location_details['sort_order']." - );" - ); - } + $this->updateProductStockLocations($data['stock_location'], (int)$product_id); } $this->_touch_product($product_id); @@ -2686,6 +2663,7 @@ public function updateProductStockLocations($locations, $product_id, $product_op : "") ); + $totals = array(); foreach($locations as $location_id=>$location_details){ if(!(int)$location_id){ continue; @@ -2703,6 +2681,20 @@ public function updateProductStockLocations($locations, $product_id, $product_op ".(int)$location_details['sort_order']." );" ); + + $totals[] = (int)$location_details['quantity']; + } + + + //update_total_quantity + if (!$product_option_value_id) { + $this->db->query("UPDATE `".$this->db->table("products`")." SET quantity= '".(int)array_sum($totals)."'"); + }elseif(array_sum($totals)){ + $this->db->query( + "UPDATE `".$this->db->table("product_option_values`")." + SET quantity= '".(int)array_sum($totals)."' + WHERE product_option_value_id=".(int)$product_option_value_id + ); } return true; } diff --git a/public_html/admin/view/default/template/responses/product/option_value_row.tpl b/public_html/admin/view/default/template/responses/product/option_value_row.tpl index 7d93a27d5c..db7d733cfd 100755 --- a/public_html/admin/view/default/template/responses/product/option_value_row.tpl +++ b/public_html/admin/view/default/template/responses/product/option_value_row.tpl @@ -51,10 +51,10 @@
-
-
- - -
'.$this->html->buildElement( array( - 'type' => 'textarea', - 'id' => 'option_textarea_value', - 'name' => 'option_textarea_value', - 'value' => $form['fields']['option_value']->value, - 'style' => 'col-sm-12', - 'attr' => 'row="10"' + 'type' => 'textarea', + 'id' => 'option_textarea_value', + 'name' => 'option_textarea_value', + 'value' => $form['fields']['option_value']->value, + 'style' => 'col-sm-12', + 'attr' => 'row="10"' )).'
From ac622fc819c55789b233e1bdc1336efb4f405665 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 13 Feb 2019 18:17:49 +0200 Subject: [PATCH 20/81] #1205 --- public_html/storefront/model/checkout/order.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public_html/storefront/model/checkout/order.php b/public_html/storefront/model/checkout/order.php index 2f7e5e6a7b..f6f9aa27f6 100755 --- a/public_html/storefront/model/checkout/order.php +++ b/public_html/storefront/model/checkout/order.php @@ -1037,9 +1037,12 @@ public function getProductStockLocations($product_id, $product_option_value_id = { $sql = "SELECT psl.*, CONCAT(l.name,' ', l.description) as location_name, - p.subtract as product_subtract, - pov.subtract as product_option_value_subtract - FROM ".$this->db->table('product_stock_locations')." psl + p.subtract as product_subtract"; + + if($product_option_value_id) { + $sql .= ", pov.subtract as product_option_value_subtract"; + } + $sql .= " FROM ".$this->db->table('product_stock_locations')." psl LEFT JOIN ".$this->db->table('products')." p ON p.product_id = psl.product_id "; From a03f70365888d708d50141afb34ff34e603babfa Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 13 Feb 2019 18:41:18 +0200 Subject: [PATCH 21/81] #1208 fix --- .../view/default/template/pages/catalog/product_options.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public_html/admin/view/default/template/pages/catalog/product_options.tpl b/public_html/admin/view/default/template/pages/catalog/product_options.tpl index 9ca1afaf5b..9134be2e1d 100755 --- a/public_html/admin/view/default/template/pages/catalog/product_options.tpl +++ b/public_html/admin/view/default/template/pages/catalog/product_options.tpl @@ -306,8 +306,10 @@ jQuery(function ($) { $('#option_values_tbl>tbody>tr:last-child').after(new_row); } else { //we insert first row - $('#option_values_tbl>tr:last-child').after(new_row); + $('#option_values_tbl>thead').after(''); + $('#option_values_tbl>tbody').append(new_row); } + bindAform($("input, textarea, select", new_row)); //Mark rows to be new $('#new' + row_id + ' input[name=default_value]').last() From 1a8506be701fe5c455ae94f15a89957aae26e10d Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 14 Feb 2019 14:39:36 +0200 Subject: [PATCH 22/81] core: minor fixes of stock locations support for products --- .../admin/controller/responses/product/product.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/public_html/admin/controller/responses/product/product.php b/public_html/admin/controller/responses/product/product.php index ddd03b181c..5bf71881d4 100755 --- a/public_html/admin/controller/responses/product/product.php +++ b/public_html/admin/controller/responses/product/product.php @@ -17,11 +17,8 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE') || !IS_ADMIN) { - header('Location: static_pages/'); -} -/** @noinspection PhpUndefinedClassInspection */ + class ControllerResponsesProductProduct extends AController { public $error = array(); @@ -593,8 +590,8 @@ public function update_option_values() $this->model_catalog_product->updateProductOptionValues($this->request->get['product_id'], $this->request->get['option_id'], $this->request->post); - foreach($this->request->post['stock_location'] as $product_option_value_id=>$stock_locations) { - $result = $this->model_catalog_product->updateProductStockLocations( + foreach((array)$this->request->post['stock_location'] as $product_option_value_id => $stock_locations) { + $this->model_catalog_product->updateProductStockLocations( $stock_locations, $this->request->get['product_id'], $product_option_value_id); From 64b107cc097bd4e72701c2e2ddfcc0b5ceb5240e Mon Sep 17 00:00:00 2001 From: abolabo Date: Sat, 16 Feb 2019 11:02:49 +0200 Subject: [PATCH 23/81] extensions: banner_manager config.xml reformat --- .../extensions/banner_manager/config.xml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/public_html/extensions/banner_manager/config.xml b/public_html/extensions/banner_manager/config.xml index a6fe8faa74..89cc85fd34 100644 --- a/public_html/extensions/banner_manager/config.xml +++ b/public_html/extensions/banner_manager/config.xml @@ -1,27 +1,27 @@ - banner_manager - 1.0.1 + banner_manager + 1.0.1 extensions extensions - - 1.2 - - - 10 - - - preview.png - - - - true - - install.sql - install.php + + 1.2 + + + 10 + + + preview.png + + + + true + + install.sql + install.php - uninstall.sql - uninstall.php + uninstall.sql + uninstall.php From df815dbc1bfea946200d2d32eaa1577d5282b792 Mon Sep 17 00:00:00 2001 From: nataniko Date: Wed, 20 Feb 2019 17:24:06 +0700 Subject: [PATCH 24/81] seo alt fix alt attribute main image fix --- .../default/template/pages/product/product.tpl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public_html/storefront/view/default/template/pages/product/product.tpl b/public_html/storefront/view/default/template/pages/product/product.tpl index 4cf5c10a13..f7a78eaf17 100755 --- a/public_html/storefront/view/default/template/pages/product/product.tpl +++ b/public_html/storefront/view/default/template/pages/product/product.tpl @@ -39,7 +39,7 @@ if ($error){ ?> @@ -47,8 +47,8 @@ if ($error){ ?> title=""> <?php echo $image['title']; ?> + alt="" + title=""/> @@ -228,14 +228,14 @@ if ($error){ ?> getHookVar('buttons'); ?> -
@@ -717,4 +717,4 @@ if ($error){ ?> } }); } - \ No newline at end of file + From e105fcb81fe979b7faf4ba23e6100aa0d6f4ec52 Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 4 Mar 2019 16:18:19 +0200 Subject: [PATCH 25/81] #1183 --- .../extensions/default_stripe/composer.json | 5 + .../extensions/default_stripe/composer.lock | 74 +++ .../default_stripe/core/default_stripe.php | 5 +- .../default_stripe/core/lib/init.php | 105 --- .../default_stripe/core/lib/lib/Charge.php | 140 ---- .../core/lib/lib/CountrySpec.php | 33 - .../default_stripe/core/lib/lib/Coupon.php | 32 - .../default_stripe/core/lib/lib/Dispute.php | 76 --- .../default_stripe/core/lib/lib/Event.php | 116 ---- .../core/lib/lib/ExchangeRate.php | 25 - .../core/lib/lib/FileUpload.php | 32 - .../lib/lib/HttpClient/ClientInterface.php | 19 - .../default_stripe/core/lib/lib/Invoice.php | 80 --- .../core/lib/lib/InvoiceItem.php | 35 - .../default_stripe/core/lib/lib/LoginLink.php | 13 - .../default_stripe/core/lib/lib/Order.php | 61 -- .../core/lib/lib/OrderReturn.php | 25 - .../default_stripe/core/lib/lib/Payout.php | 47 -- .../default_stripe/core/lib/lib/Plan.php | 30 - .../default_stripe/core/lib/lib/Product.php | 37 -- .../core/lib/lib/RecipientTransfer.php | 38 -- .../default_stripe/core/lib/lib/Refund.php | 30 - .../default_stripe/core/lib/lib/SKU.php | 32 - .../core/lib/lib/SourceTransaction.php | 13 - .../core/lib/lib/SubscriptionItem.php | 36 - .../default_stripe/core/lib/lib/Topup.php | 32 - .../default_stripe/core/lib/lib/Util/Util.php | 242 ------- .../default_stripe/core/stripe_modules.php | 6 +- .../extensions/default_stripe/main.php | 6 +- .../default_stripe/vendor/autoload.php | 7 + .../vendor/composer/ClassLoader.php | 445 +++++++++++++ .../default_stripe/vendor/composer/LICENSE | 21 + .../vendor/composer/autoload_classmap.php | 9 + .../vendor/composer/autoload_namespaces.php | 9 + .../vendor/composer/autoload_psr4.php | 10 + .../vendor/composer/autoload_real.php | 52 ++ .../vendor/composer/autoload_static.php | 31 + .../vendor/composer/installed.json | 60 ++ .../vendor/stripe/stripe-php/.gitignore | 17 + .../vendor/stripe/stripe-php/CHANGELOG.md | 618 ++++++++++++++++++ .../vendor/stripe/stripe-php/LICENSE | 21 + .../vendor/stripe/stripe-php/README.md | 242 +++++++ .../vendor/stripe/stripe-php/VERSION | 1 + .../vendor/stripe/stripe-php/build.php | 36 + .../vendor/stripe/stripe-php/composer.json | 37 ++ .../stripe-php}/data/ca-certificates.crt | 0 .../vendor/stripe/stripe-php/init.php | 137 ++++ .../stripe/stripe-php}/lib/Account.php | 180 +++-- .../stripe/stripe-php/lib/AccountLink.php | 21 + .../stripe/stripe-php}/lib/AlipayAccount.php | 25 +- .../stripe-php}/lib/ApiOperations/All.php | 4 +- .../stripe-php}/lib/ApiOperations/Create.php | 2 +- .../stripe-php}/lib/ApiOperations/Delete.php | 2 +- .../lib/ApiOperations/NestedResource.php | 45 +- .../stripe-php}/lib/ApiOperations/Request.php | 21 +- .../lib/ApiOperations/Retrieve.php | 4 +- .../stripe-php}/lib/ApiOperations/Update.php | 4 +- .../stripe/stripe-php}/lib/ApiRequestor.php | 225 ++++++- .../stripe/stripe-php}/lib/ApiResource.php | 35 +- .../stripe/stripe-php}/lib/ApiResponse.php | 4 +- .../stripe/stripe-php}/lib/ApplePayDomain.php | 3 + .../stripe/stripe-php}/lib/ApplicationFee.php | 62 +- .../stripe-php}/lib/ApplicationFeeRefund.php | 19 +- .../stripe/stripe-php}/lib/Balance.php | 10 +- .../stripe-php}/lib/BalanceTransaction.php | 17 +- .../stripe/stripe-php}/lib/BankAccount.php | 55 +- .../stripe-php}/lib/BitcoinReceiver.php | 7 +- .../stripe-php}/lib/BitcoinTransaction.php | 1 + .../stripe/stripe-php}/lib/Card.php | 74 ++- .../vendor/stripe/stripe-php/lib/Charge.php | 194 ++++++ .../stripe-php/lib/Checkout/Session.php | 20 + .../stripe/stripe-php}/lib/Collection.php | 18 +- .../stripe/stripe-php/lib/CountrySpec.php | 26 + .../vendor/stripe/stripe-php/lib/Coupon.php | 36 + .../stripe/stripe-php}/lib/Customer.php | 68 +- .../vendor/stripe/stripe-php/lib/Discount.php | 21 + .../vendor/stripe/stripe-php/lib/Dispute.php | 77 +++ .../stripe/stripe-php}/lib/EphemeralKey.php | 24 +- .../stripe/stripe-php}/lib/Error/Api.php | 0 .../stripe-php}/lib/Error/ApiConnection.php | 0 .../stripe-php}/lib/Error/Authentication.php | 0 .../stripe/stripe-php}/lib/Error/Base.php | 2 +- .../stripe/stripe-php}/lib/Error/Card.php | 0 .../stripe-php}/lib/Error/Idempotency.php | 0 .../stripe-php}/lib/Error/InvalidRequest.php | 0 .../lib/Error/OAuth/InvalidClient.php | 0 .../lib/Error/OAuth/InvalidGrant.php | 0 .../lib/Error/OAuth/InvalidRequest.php | 0 .../lib/Error/OAuth/InvalidScope.php | 0 .../stripe-php}/lib/Error/OAuth/OAuthBase.php | 4 +- .../lib/Error/OAuth/UnsupportedGrantType.php | 0 .../Error/OAuth/UnsupportedResponseType.php | 0 .../stripe-php}/lib/Error/Permission.php | 0 .../stripe-php}/lib/Error/RateLimit.php | 0 .../lib/Error/SignatureVerification.php | 0 .../vendor/stripe/stripe-php/lib/Event.php | 151 +++++ .../stripe/stripe-php/lib/ExchangeRate.php | 17 + .../vendor/stripe/stripe-php/lib/File.php | 55 ++ .../vendor/stripe/stripe-php/lib/FileLink.php | 29 + .../stripe/stripe-php/lib/FileUpload.php | 6 + .../lib/HttpClient/ClientInterface.php | 21 + .../stripe-php}/lib/HttpClient/CurlClient.php | 129 +++- .../vendor/stripe/stripe-php/lib/Invoice.php | 151 +++++ .../stripe/stripe-php/lib/InvoiceItem.php | 39 ++ .../stripe/stripe-php/lib/InvoiceLineItem.php | 30 + .../stripe-php/lib/IssuerFraudRecord.php | 25 + .../stripe-php/lib/Issuing/Authorization.php | 68 ++ .../stripe/stripe-php/lib/Issuing/Card.php | 51 ++ .../stripe-php/lib/Issuing/CardDetails.php | 21 + .../stripe-php/lib/Issuing/Cardholder.php | 30 + .../stripe/stripe-php/lib/Issuing/Dispute.php | 30 + .../stripe-php/lib/Issuing/Transaction.php | 33 + .../stripe/stripe-php/lib/LoginLink.php | 18 + .../stripe/stripe-php}/lib/OAuth.php | 16 +- .../vendor/stripe/stripe-php/lib/Order.php | 64 ++ .../stripe/stripe-php/lib/OrderItem.php | 22 + .../stripe/stripe-php/lib/OrderReturn.php | 27 + .../stripe/stripe-php/lib/PaymentIntent.php | 93 +++ .../vendor/stripe/stripe-php/lib/Payout.php | 69 ++ .../vendor/stripe/stripe-php/lib/Person.php | 93 +++ .../vendor/stripe/stripe-php/lib/Plan.php | 40 ++ .../vendor/stripe/stripe-php/lib/Product.php | 40 ++ .../stripe/stripe-php/lib/Radar/ValueList.php | 32 + .../stripe-php/lib/Radar/ValueListItem.php | 26 + .../stripe/stripe-php}/lib/Recipient.php | 18 + .../stripe-php/lib/RecipientTransfer.php | 39 ++ .../vendor/stripe/stripe-php/lib/Refund.php | 36 + .../stripe-php/lib/Reporting/ReportRun.php | 28 + .../stripe-php/lib/Reporting/ReportType.php | 24 + .../stripe-php/lib/RequestTelemetry.php | 27 + .../vendor/stripe/stripe-php/lib/Review.php | 44 ++ .../vendor/stripe/stripe-php/lib/SKU.php | 35 + .../lib/Sigma/ScheduledQueryRun.php | 33 + .../stripe-php}/lib/SingletonApiResource.php | 4 +- .../stripe/stripe-php}/lib/Source.php | 94 ++- .../stripe-php/lib/SourceTransaction.php | 23 + .../stripe/stripe-php}/lib/Stripe.php | 42 +- .../stripe/stripe-php}/lib/StripeObject.php | 70 +- .../stripe/stripe-php}/lib/Subscription.php | 58 +- .../stripe-php/lib/SubscriptionItem.php | 44 ++ .../stripe-php/lib/SubscriptionSchedule.php | 111 ++++ .../lib/SubscriptionScheduleRevision.php | 77 +++ .../lib/Terminal/ConnectionToken.php | 17 + .../stripe-php/lib/Terminal/Location.php | 28 + .../stripe/stripe-php/lib/Terminal/Reader.php | 25 + .../stripe/stripe-php}/lib/ThreeDSecure.php | 3 + .../stripe/stripe-php}/lib/Token.php | 13 +- .../vendor/stripe/stripe-php/lib/Topup.php | 50 ++ .../stripe/stripe-php}/lib/Transfer.php | 58 +- .../stripe-php}/lib/TransferReversal.php | 21 +- .../stripe/stripe-php/lib/UsageRecord.php | 44 ++ .../stripe-php/lib/UsageRecordSummary.php | 22 + .../lib/Util/AutoPagingIterator.php | 0 .../lib/Util/CaseInsensitiveArray.php | 62 ++ .../stripe-php}/lib/Util/DefaultLogger.php | 0 .../stripe-php}/lib/Util/LoggerInterface.php | 3 +- .../stripe-php}/lib/Util/RandomGenerator.php | 1 - .../stripe-php}/lib/Util/RequestOptions.php | 25 +- .../stripe/stripe-php}/lib/Util/Set.php | 0 .../stripe/stripe-php/lib/Util/Util.php | 353 ++++++++++ .../stripe/stripe-php}/lib/Webhook.php | 13 +- .../stripe/stripe-php/lib/WebhookEndpoint.php | 29 + .../stripe-php}/lib/WebhookSignature.php | 18 +- .../vendor/stripe/stripe-php/update_certs.php | 19 + 164 files changed, 5668 insertions(+), 1857 deletions(-) create mode 100644 public_html/extensions/default_stripe/composer.json create mode 100644 public_html/extensions/default_stripe/composer.lock delete mode 100644 public_html/extensions/default_stripe/core/lib/init.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Charge.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/CountrySpec.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Coupon.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Dispute.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Event.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/ExchangeRate.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/FileUpload.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/HttpClient/ClientInterface.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Invoice.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/InvoiceItem.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/LoginLink.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Order.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/OrderReturn.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Payout.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Plan.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Product.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/RecipientTransfer.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Refund.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/SKU.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/SourceTransaction.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/SubscriptionItem.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Topup.php delete mode 100644 public_html/extensions/default_stripe/core/lib/lib/Util/Util.php create mode 100644 public_html/extensions/default_stripe/vendor/autoload.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/ClassLoader.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/LICENSE create mode 100644 public_html/extensions/default_stripe/vendor/composer/autoload_classmap.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/autoload_namespaces.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/autoload_psr4.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/autoload_real.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/autoload_static.php create mode 100644 public_html/extensions/default_stripe/vendor/composer/installed.json create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/.gitignore create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/CHANGELOG.md create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/LICENSE create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/README.md create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/VERSION create mode 100755 public_html/extensions/default_stripe/vendor/stripe/stripe-php/build.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/composer.json rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/data/ca-certificates.crt (100%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/init.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Account.php (51%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/AccountLink.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/AlipayAccount.php (76%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/All.php (91%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/Create.php (94%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/Delete.php (94%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/NestedResource.php (77%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/Request.php (69%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/Retrieve.php (78%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiOperations/Update.php (91%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiRequestor.php (63%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiResource.php (74%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApiResponse.php (88%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApplePayDomain.php (91%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApplicationFee.php (53%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ApplicationFeeRefund.php (76%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Balance.php (68%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/BalanceTransaction.php (72%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/BankAccount.php (63%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/BitcoinReceiver.php (91%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/BitcoinTransaction.php (74%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Card.php (55%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Charge.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Collection.php (87%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/CountrySpec.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Coupon.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Customer.php (73%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Discount.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Dispute.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/EphemeralKey.php (59%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Api.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/ApiConnection.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Authentication.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Base.php (98%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Card.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Idempotency.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/InvalidRequest.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/InvalidClient.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/InvalidGrant.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/InvalidRequest.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/InvalidScope.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/OAuthBase.php (86%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/UnsupportedGrantType.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/OAuth/UnsupportedResponseType.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/Permission.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/RateLimit.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Error/SignatureVerification.php (100%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Event.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ExchangeRate.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/File.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/FileLink.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/FileUpload.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/HttpClient/ClientInterface.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/HttpClient/CurlClient.php (74%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Invoice.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/InvoiceLineItem.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/IssuerFraudRecord.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Authorization.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Cardholder.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Dispute.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Transaction.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/LoginLink.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/OAuth.php (83%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Order.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/OrderItem.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/OrderReturn.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/PaymentIntent.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Payout.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Person.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Plan.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Product.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Radar/ValueList.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Radar/ValueListItem.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Recipient.php (56%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/RecipientTransfer.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Refund.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Reporting/ReportRun.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Reporting/ReportType.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/RequestTelemetry.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Review.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SKU.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Sigma/ScheduledQueryRun.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/SingletonApiResource.php (77%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Source.php (51%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Stripe.php (82%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/StripeObject.php (89%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Subscription.php (57%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/Location.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/Reader.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/ThreeDSecure.php (86%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Token.php (61%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Topup.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Transfer.php (59%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/TransferReversal.php (72%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecord.php create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/AutoPagingIterator.php (100%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/CaseInsensitiveArray.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/DefaultLogger.php (100%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/LoggerInterface.php (96%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/RandomGenerator.php (99%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/RequestOptions.php (76%) rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Util/Set.php (100%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Util.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/Webhook.php (75%) create mode 100644 public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/WebhookEndpoint.php rename public_html/extensions/default_stripe/{core/lib => vendor/stripe/stripe-php}/lib/WebhookSignature.php (88%) create mode 100755 public_html/extensions/default_stripe/vendor/stripe/stripe-php/update_certs.php diff --git a/public_html/extensions/default_stripe/composer.json b/public_html/extensions/default_stripe/composer.json new file mode 100644 index 0000000000..d4cd2a7177 --- /dev/null +++ b/public_html/extensions/default_stripe/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "stripe/stripe-php": "^6.30" + } +} diff --git a/public_html/extensions/default_stripe/composer.lock b/public_html/extensions/default_stripe/composer.lock new file mode 100644 index 0000000000..3267951491 --- /dev/null +++ b/public_html/extensions/default_stripe/composer.lock @@ -0,0 +1,74 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "d094e90e0d7bdfcfee5f8f872d0b9e0c", + "packages": [ + { + "name": "stripe/stripe-php", + "version": "v6.30.4", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "1.*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ], + "time": "2019-02-27T18:07:30+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/public_html/extensions/default_stripe/core/default_stripe.php b/public_html/extensions/default_stripe/core/default_stripe.php index 6b60a1580d..b067242147 100644 --- a/public_html/extensions/default_stripe/core/default_stripe.php +++ b/public_html/extensions/default_stripe/core/default_stripe.php @@ -1,9 +1,6 @@ instanceUrl().'/refund'; - list($response, $opts) = $this->_request('post', $url, $params, $options); - $this->refreshFrom($response, $opts); - return $this; - } - - /** - * @param array|null $params - * @param array|string|null $options - * - * @return Charge The captured charge. - */ - public function capture($params = null, $options = null) - { - $url = $this->instanceUrl().'/capture'; - list($response, $opts) = $this->_request('post', $url, $params, $options); - $this->refreshFrom($response, $opts); - return $this; - } - - /** - * @param array|null $params - * @param array|string|null $options - * - * @deprecated Use the `save` method on the Dispute object - * - * @return array The updated dispute. - */ - public function updateDispute($params = null, $options = null) - { - $url = $this->instanceUrl().'/dispute'; - list($response, $opts) = $this->_request('post', $url, $params, $options); - $this->refreshFrom(['dispute' => $response], $opts, true); - return $this->dispute; - } - - /** - * @param array|string|null $options - * - * @deprecated Use the `close` method on the Dispute object - * - * @return Charge The updated charge. - */ - public function closeDispute($options = null) - { - $url = $this->instanceUrl().'/dispute/close'; - list($response, $opts) = $this->_request('post', $url, null, $options); - $this->refreshFrom($response, $opts); - return $this; - } - - /** - * @param array|string|null $opts - * - * @return Charge The updated charge. - */ - public function markAsFraudulent($opts = null) - { - $params = ['fraud_details' => ['user_report' => 'fraudulent']]; - $url = $this->instanceUrl(); - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - return $this; - } - - /** - * @param array|string|null $opts - * - * @return Charge The updated charge. - */ - public function markAsSafe($opts = null) - { - $params = ['fraud_details' => ['user_report' => 'safe']]; - $url = $this->instanceUrl(); - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - return $this; - } -} diff --git a/public_html/extensions/default_stripe/core/lib/lib/CountrySpec.php b/public_html/extensions/default_stripe/core/lib/lib/CountrySpec.php deleted file mode 100644 index 5673237810..0000000000 --- a/public_html/extensions/default_stripe/core/lib/lib/CountrySpec.php +++ /dev/null @@ -1,33 +0,0 @@ -instanceUrl().'/close'; - list($response, $opts) = $this->_request('post', $url, null, $options); - $this->refreshFrom($response, $opts); - return $this; - } -} diff --git a/public_html/extensions/default_stripe/core/lib/lib/Event.php b/public_html/extensions/default_stripe/core/lib/lib/Event.php deleted file mode 100644 index 5b1d43d4e9..0000000000 --- a/public_html/extensions/default_stripe/core/lib/lib/Event.php +++ /dev/null @@ -1,116 +0,0 @@ -json, $opts); - $obj->setLastResponse($response); - return $obj; - } - - /** - * @return Invoice The paid invoice. - */ - public function pay($params = null, $opts = null) - { - $url = $this->instanceUrl().'/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - return $this; - } -} diff --git a/public_html/extensions/default_stripe/core/lib/lib/InvoiceItem.php b/public_html/extensions/default_stripe/core/lib/lib/InvoiceItem.php deleted file mode 100644 index 75bcba5af4..0000000000 --- a/public_html/extensions/default_stripe/core/lib/lib/InvoiceItem.php +++ /dev/null @@ -1,35 +0,0 @@ -instanceUrl().'/pay'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - $this->refreshFrom($response, $opts); - return $this; - } - - /** - * @return OrderReturn The newly created return. - */ - public function returnOrder($params = null, $opts = null) - { - $url = $this->instanceUrl().'/returns'; - list($response, $opts) = $this->_request('post', $url, $params, $opts); - return Util\Util::convertToStripeObject($response, $opts); - } -} diff --git a/public_html/extensions/default_stripe/core/lib/lib/OrderReturn.php b/public_html/extensions/default_stripe/core/lib/lib/OrderReturn.php deleted file mode 100644 index 45a69e3783..0000000000 --- a/public_html/extensions/default_stripe/core/lib/lib/OrderReturn.php +++ /dev/null @@ -1,25 +0,0 @@ -instanceUrl().'/cancel'; - list($response, $opts) = $this->_request('post', $url); - $this->refreshFrom($response, $opts); - return $this; - } -} diff --git a/public_html/extensions/default_stripe/core/lib/lib/Plan.php b/public_html/extensions/default_stripe/core/lib/lib/Plan.php deleted file mode 100644 index 842da20fbc..0000000000 --- a/public_html/extensions/default_stripe/core/lib/lib/Plan.php +++ /dev/null @@ -1,30 +0,0 @@ - $v) { - // FIXME: this is an encapsulation violation - if ($k[0] == '_') { - continue; - } - if ($v instanceof StripeObject) { - $results[$k] = $v->__toArray(true); - } elseif (is_array($v)) { - $results[$k] = self::convertStripeObjectToArray($v); - } else { - $results[$k] = $v; - } - } - return $results; - } - - /** - * Converts a response from the Stripe API to the corresponding PHP object. - * - * @param array $resp The response from the Stripe API. - * @param array $opts - * - * @return StripeObject|array - */ - public static function convertToStripeObject($resp, $opts) - { - $types = [ - // data structures - 'list' => 'Stripe\\Collection', - - // business objects - 'account' => 'Stripe\\Account', - 'alipay_account' => 'Stripe\\AlipayAccount', - 'apple_pay_domain' => 'Stripe\\ApplePayDomain', - 'application_fee' => 'Stripe\\ApplicationFee', - 'balance' => 'Stripe\\Balance', - 'balance_transaction' => 'Stripe\\BalanceTransaction', - 'bank_account' => 'Stripe\\BankAccount', - 'bitcoin_receiver' => 'Stripe\\BitcoinReceiver', - 'bitcoin_transaction' => 'Stripe\\BitcoinTransaction', - 'card' => 'Stripe\\Card', - 'charge' => 'Stripe\\Charge', - 'country_spec' => 'Stripe\\CountrySpec', - 'coupon' => 'Stripe\\Coupon', - 'customer' => 'Stripe\\Customer', - 'dispute' => 'Stripe\\Dispute', - 'ephemeral_key' => 'Stripe\\EphemeralKey', - 'event' => 'Stripe\\Event', - 'exchange_rate' => 'Stripe\\ExchangeRate', - 'fee_refund' => 'Stripe\\ApplicationFeeRefund', - 'file_upload' => 'Stripe\\FileUpload', - 'invoice' => 'Stripe\\Invoice', - 'invoiceitem' => 'Stripe\\InvoiceItem', - 'login_link' => 'Stripe\\LoginLink', - 'order' => 'Stripe\\Order', - 'order_return' => 'Stripe\\OrderReturn', - 'payout' => 'Stripe\\Payout', - 'plan' => 'Stripe\\Plan', - 'product' => 'Stripe\\Product', - 'recipient' => 'Stripe\\Recipient', - 'recipient_transfer' => 'Stripe\\RecipientTransfer', - 'refund' => 'Stripe\\Refund', - 'sku' => 'Stripe\\SKU', - 'source' => 'Stripe\\Source', - 'source_transaction' => 'Stripe\\SourceTransaction', - 'subscription' => 'Stripe\\Subscription', - 'subscription_item' => 'Stripe\\SubscriptionItem', - 'three_d_secure' => 'Stripe\\ThreeDSecure', - 'token' => 'Stripe\\Token', - 'topup' => 'Stripe\\Topup', - 'transfer' => 'Stripe\\Transfer', - 'transfer_reversal' => 'Stripe\\TransferReversal', - ]; - if (self::isList($resp)) { - $mapped = []; - foreach ($resp as $i) { - array_push($mapped, self::convertToStripeObject($i, $opts)); - } - return $mapped; - } elseif (is_array($resp)) { - if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) { - $class = $types[$resp['object']]; - } else { - $class = 'Stripe\\StripeObject'; - } - return $class::constructFrom($resp, $opts); - } else { - return $resp; - } - } - - /** - * @param string|mixed $value A string to UTF8-encode. - * - * @return string|mixed The UTF8-encoded string, or the object passed in if - * it wasn't a string. - */ - public static function utf8($value) - { - if (self::$isMbstringAvailable === null) { - self::$isMbstringAvailable = function_exists('mb_detect_encoding'); - - if (!self::$isMbstringAvailable) { - trigger_error("It looks like the mbstring extension is not enabled. ". - "UTF-8 strings will not properly be encoded. Ask your system ". - "administrator to enable the mbstring extension, or write to ". - "support@stripe.com if you have any questions.", E_USER_WARNING); - } - } - - if (is_string($value) && self::$isMbstringAvailable && mb_detect_encoding($value, "UTF-8", true) != "UTF-8") { - return utf8_encode($value); - } else { - return $value; - } - } - - /** - * Compares two strings for equality. The time taken is independent of the - * number of characters that match. - * - * @param string $a one of the strings to compare. - * @param string $b the other string to compare. - * - * @return bool true if the strings are equal, false otherwise. - */ - public static function secureCompare($a, $b) - { - if (self::$isHashEqualsAvailable === null) { - self::$isHashEqualsAvailable = function_exists('hash_equals'); - } - - if (self::$isHashEqualsAvailable) { - return hash_equals($a, $b); - } else { - if (strlen($a) != strlen($b)) { - return false; - } - - $result = 0; - for ($i = 0; $i < strlen($a); $i++) { - $result |= ord($a[$i]) ^ ord($b[$i]); - } - return ($result == 0); - } - } - - /** - * @param array $arr A map of param keys to values. - * @param string|null $prefix - * - * @return string A querystring, essentially. - */ - public static function urlEncode($arr, $prefix = null) - { - if (!is_array($arr)) { - return $arr; - } - - $r = []; - foreach ($arr as $k => $v) { - if (is_null($v)) { - continue; - } - - if ($prefix) { - if ($k !== null && (!is_int($k) || is_array($v))) { - $k = $prefix."[".$k."]"; - } else { - $k = $prefix."[]"; - } - } - - if (is_array($v)) { - $enc = self::urlEncode($v, $k); - if ($enc) { - $r[] = $enc; - } - } else { - $r[] = urlencode($k)."=".urlencode($v); - } - } - - return implode("&", $r); - } - - public static function normalizeId($id) - { - if (is_array($id)) { - $params = $id; - $id = $params['id']; - unset($params['id']); - } else { - $params = []; - } - return [$id, $params]; - } -} diff --git a/public_html/extensions/default_stripe/core/stripe_modules.php b/public_html/extensions/default_stripe/core/stripe_modules.php index ce527d9567..7a2e08361d 100644 --- a/public_html/extensions/default_stripe/core/stripe_modules.php +++ b/public_html/extensions/default_stripe/core/stripe_modules.php @@ -1,10 +1,5 @@ get('default_stripe_sk_live')); } } + \Stripe\Stripe::setApiVersion("2019-02-19"); } \ No newline at end of file diff --git a/public_html/extensions/default_stripe/main.php b/public_html/extensions/default_stripe/main.php index ba73ceadde..cd9f790c40 100644 --- a/public_html/extensions/default_stripe/main.php +++ b/public_html/extensions/default_stripe/main.php @@ -1,8 +1,6 @@ array('responses/extension/default_stripe'), diff --git a/public_html/extensions/default_stripe/vendor/autoload.php b/public_html/extensions/default_stripe/vendor/autoload.php new file mode 100644 index 0000000000..629a07a269 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/autoload.php @@ -0,0 +1,7 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see http://www.php-fig.org/psr/psr-0/ + * @see http://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + // PSR-4 + private $prefixLengthsPsr4 = array(); + private $prefixDirsPsr4 = array(); + private $fallbackDirsPsr4 = array(); + + // PSR-0 + private $prefixesPsr0 = array(); + private $fallbackDirsPsr0 = array(); + + private $useIncludePath = false; + private $classMap = array(); + private $classMapAuthoritative = false; + private $missingClasses = array(); + private $apcuPrefix; + + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', $this->prefixesPsr0); + } + + return array(); + } + + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + } + + /** + * Unregisters this instance as an autoloader. + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return bool|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath.'\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + */ +function includeFile($file) +{ + include $file; +} diff --git a/public_html/extensions/default_stripe/vendor/composer/LICENSE b/public_html/extensions/default_stripe/vendor/composer/LICENSE new file mode 100644 index 0000000000..f27399a042 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/public_html/extensions/default_stripe/vendor/composer/autoload_classmap.php b/public_html/extensions/default_stripe/vendor/composer/autoload_classmap.php new file mode 100644 index 0000000000..7a91153b0d --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/composer/autoload_classmap.php @@ -0,0 +1,9 @@ + array($vendorDir . '/stripe/stripe-php/lib'), +); diff --git a/public_html/extensions/default_stripe/vendor/composer/autoload_real.php b/public_html/extensions/default_stripe/vendor/composer/autoload_real.php new file mode 100644 index 0000000000..9290ce1440 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/composer/autoload_real.php @@ -0,0 +1,52 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit674397a3e1452772de92194159db1985::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + return $loader; + } +} diff --git a/public_html/extensions/default_stripe/vendor/composer/autoload_static.php b/public_html/extensions/default_stripe/vendor/composer/autoload_static.php new file mode 100644 index 0000000000..ebbdfefb34 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/composer/autoload_static.php @@ -0,0 +1,31 @@ + + array ( + 'Stripe\\' => 7, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'Stripe\\' => + array ( + 0 => __DIR__ . '/..' . '/stripe/stripe-php/lib', + ), + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit674397a3e1452772de92194159db1985::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit674397a3e1452772de92194159db1985::$prefixDirsPsr4; + + }, null, ClassLoader::class); + } +} diff --git a/public_html/extensions/default_stripe/vendor/composer/installed.json b/public_html/extensions/default_stripe/vendor/composer/installed.json new file mode 100644 index 0000000000..de060d03d5 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/composer/installed.json @@ -0,0 +1,60 @@ +[ + { + "name": "stripe/stripe-php", + "version": "v6.30.4", + "version_normalized": "6.30.4.0", + "source": { + "type": "git", + "url": "https://github.com/stripe/stripe-php.git", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "reference": "0d9e2773b1df27d4f0c590b15bed3a1433e0414c", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "1.*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" + }, + "time": "2019-02-27T18:07:30+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Stripe\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Stripe and contributors", + "homepage": "https://github.com/stripe/stripe-php/contributors" + } + ], + "description": "Stripe PHP Library", + "homepage": "https://stripe.com/", + "keywords": [ + "api", + "payment processing", + "stripe" + ] + } +] diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/.gitignore b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/.gitignore new file mode 100644 index 0000000000..17b94183ba --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/.gitignore @@ -0,0 +1,17 @@ +# Mac OS X dumps these all over the place. +.DS_Store + +# Ignore the SimpleTest library if it is installed to /test/. +/test/simpletest/ + +# Ignore the /vendor/ directory for people using composer +/vendor/ + +# If the vendor directory isn't being commited the composer.lock file should also be ignored +composer.lock + +# Ignore PHPUnit coverage file +clover.xml + +# Ignore IDE's configuration files +.idea diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/CHANGELOG.md b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/CHANGELOG.md new file mode 100644 index 0000000000..7d90527c17 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/CHANGELOG.md @@ -0,0 +1,618 @@ +# Changelog + +## 6.30.4 - 2019-02-27 +* [#602](https://github.com/stripe/stripe-php/pull/602) Add `subscription_schedule` to `Subscription` for PHPDoc. + +## 6.30.3 - 2019-02-26 +* [#603](https://github.com/stripe/stripe-php/pull/603) Improve PHPDoc on the `Source` object to cover all types of Sources currently supported. + +## 6.30.2 - 2019-02-25 +* [#601](https://github.com/stripe/stripe-php/pull/601) Fix PHPDoc across multiple resources and add support for new events. + +## 6.30.1 - 2019-02-16 +* [#599](https://github.com/stripe/stripe-php/pull/599) Fix PHPDoc for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.30.0 - 2019-02-12 +* [#590](https://github.com/stripe/stripe-php/pull/590) Add support for `SubscriptionSchedule` and `SubscriptionScheduleRevision` + +## 6.29.3 - 2019-01-31 +* [#592](https://github.com/stripe/stripe-php/pull/592) Some more PHPDoc fixes + +## 6.29.2 - 2019-01-31 +* [#591](https://github.com/stripe/stripe-php/pull/591) Fix PHPDoc for nested resources + +## 6.29.1 - 2019-01-25 +* [#566](https://github.com/stripe/stripe-php/pull/566) Fix dangling message contents +* [#586](https://github.com/stripe/stripe-php/pull/586) Don't overwrite `CURLOPT_HTTP_VERSION` option + +## 6.29.0 - 2019-01-23 +* [#579](https://github.com/stripe/stripe-php/pull/579) Rename `CheckoutSession` to `Session` and move it under the `Checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach. + +## 6.28.1 - 2019-01-21 +* [#580](https://github.com/stripe/stripe-php/pull/580) Properly serialize `individual` on `Account` objects + +## 6.28.0 - 2019-01-03 +* [#576](https://github.com/stripe/stripe-php/pull/576) Add support for iterating directly over `Collection` instances + +## 6.27.0 - 2018-12-21 +* [#571](https://github.com/stripe/stripe-php/pull/571) Add support for the `CheckoutSession` resource + +## 6.26.0 - 2018-12-11 +* [#568](https://github.com/stripe/stripe-php/pull/568) Enable persistent connections + +## 6.25.0 - 2018-12-10 +* [#567](https://github.com/stripe/stripe-php/pull/567) Add support for account links + +## 6.24.0 - 2018-11-28 +* [#562](https://github.com/stripe/stripe-php/pull/562) Add support for the Review resource +* [#564](https://github.com/stripe/stripe-php/pull/564) Add event name constants for subscription schedule aborted/expiring + +## 6.23.0 - 2018-11-27 +* [#542](https://github.com/stripe/stripe-php/pull/542) Add support for `ValueList` and `ValueListItem` for Radar + +## 6.22.1 - 2018-11-20 +* [#561](https://github.com/stripe/stripe-php/pull/561) Add cast and some docs to telemetry introduced in 6.22.0/#549 + +## 6.22.0 - 2018-11-15 +* [#549](https://github.com/stripe/stripe-php/pull/549) Add support for client telemetry + +## 6.21.1 - 2018-11-12 +* [#548](https://github.com/stripe/stripe-php/pull/548) Don't mutate `Exception` class properties from `OAuthBase` error + +## 6.21.0 - 2018-11-08 +* [#537](https://github.com/stripe/stripe-php/pull/537) Add new API endpoints for the `Invoice` resource. + +## 6.20.1 - 2018-11-07 +* [#546](https://github.com/stripe/stripe-php/pull/546) Drop files from the Composer package that aren't needed in the release + +## 6.20.0 - 2018-10-30 +* [#536](https://github.com/stripe/stripe-php/pull/536) Add support for the `Person` resource +* [#541](https://github.com/stripe/stripe-php/pull/541) Add support for the `WebhookEndpoint` resource + +## 6.19.5 - 2018-10-17 +* [#539](https://github.com/stripe/stripe-php/pull/539) Fix methods on `\Stripe\PaymentIntent` to properly pass arguments to the API. + +## 6.19.4 - 2018-10-11 +* [#534](https://github.com/stripe/stripe-php/pull/534) Fix PSR-4 autoloading for `\Stripe\FileUpload` class alias + +## 6.19.3 - 2018-10-09 +* [#530](https://github.com/stripe/stripe-php/pull/530) Add constants for `flow` (`FLOW_*`), `status` (`STATUS_*`) and `usage` (`USAGE_*`) on `\Stripe\Source` + +## 6.19.2 - 2018-10-08 +* [#531](https://github.com/stripe/stripe-php/pull/531) Store HTTP response headers in case-insensitive array + +## 6.19.1 - 2018-09-25 +* [#526](https://github.com/stripe/stripe-php/pull/526) Ignore null values in request parameters + +## 6.19.0 - 2018-09-24 +* [#523](https://github.com/stripe/stripe-php/pull/523) Add support for Stripe Terminal + +## 6.18.0 - 2018-09-24 +* [#520](https://github.com/stripe/stripe-php/pull/520) Rename `\Stripe\FileUpload` to `\Stripe\File` + +## 6.17.2 - 2018-09-18 +* [#522](https://github.com/stripe/stripe-php/pull/522) Fix warning when adding a new additional owner to an existing array + +## 6.17.1 - 2018-09-14 +* [#517](https://github.com/stripe/stripe-php/pull/517) Integer-index encode all sequential arrays + +## 6.17.0 - 2018-09-05 +* [#514](https://github.com/stripe/stripe-php/pull/514) Add support for reporting resources + +## 6.16.0 - 2018-08-23 +* [#509](https://github.com/stripe/stripe-php/pull/509) Add support for usage record summaries + +## 6.15.0 - 2018-08-03 +* [#504](https://github.com/stripe/stripe-php/pull/504) Add cancel support for topups + +## 6.14.0 - 2018-08-02 +* [#505](https://github.com/stripe/stripe-php/pull/505) Add support for file links + +## 6.13.0 - 2018-07-31 +* [#502](https://github.com/stripe/stripe-php/pull/502) Add `isDeleted()` method to `\Stripe\StripeObject` + +## 6.12.0 - 2018-07-28 +* [#501](https://github.com/stripe/stripe-php/pull/501) Add support for scheduled query runs (`\Stripe\Sigma\ScheduledQueryRun`) for Sigma + +## 6.11.0 - 2018-07-26 +* [#500](https://github.com/stripe/stripe-php/pull/500) Add support for Stripe Issuing + +## 6.10.4 - 2018-07-19 +* [#498](https://github.com/stripe/stripe-php/pull/498) Internal improvements to the `\Stripe\ApiResource.classUrl()` method + +## 6.10.3 - 2018-07-16 +* [#497](https://github.com/stripe/stripe-php/pull/497) Use HTTP/2 only for HTTPS requests + +## 6.10.2 - 2018-07-11 +* [#494](https://github.com/stripe/stripe-php/pull/494) Enable HTTP/2 support + +## 6.10.1 - 2018-07-10 +* [#493](https://github.com/stripe/stripe-php/pull/493) Add PHPDoc for `auto_advance` on `\Stripe\Invoice` + +## 6.10.0 - 2018-06-28 +* [#488](https://github.com/stripe/stripe-php/pull/488) Add support for `$appPartnerId` to `Stripe::setAppInfo()` + +## 6.9.0 - 2018-06-28 +* [#487](https://github.com/stripe/stripe-php/pull/487) Add support for payment intents + +## 6.8.2 - 2018-06-24 +* [#486](https://github.com/stripe/stripe-php/pull/486) Make `Account.deauthorize()` return the `StripeObject` from the API + +## 6.8.1 - 2018-06-13 +* [#472](https://github.com/stripe/stripe-php/pull/472) Added phpDoc for `ApiRequestor` and others, especially regarding thrown errors + +## 6.8.0 - 2018-06-13 +* [#481](https://github.com/stripe/stripe-php/pull/481) Add new `\Stripe\Discount` and `\Stripe\OrderItem` classes, add more PHPDoc describing object attributes + +## 6.7.4 - 2018-05-29 +* [#480](https://github.com/stripe/stripe-php/pull/480) PHPDoc changes for API version 2018-05-21 and the addition of the new `CHARGE_EXPIRED` event type + +## 6.7.3 - 2018-05-28 +* [#479](https://github.com/stripe/stripe-php/pull/479) Fix unnecessary traits on `\Stripe\InvoiceLineItem` + +## 6.7.2 - 2018-05-28 +* [#471](https://github.com/stripe/stripe-php/pull/471) Add `OBJECT_NAME` constant to all API resource classes, add `\Stripe\InvoiceLineItem` class + +## 6.7.1 - 2018-05-13 +* [#468](https://github.com/stripe/stripe-php/pull/468) Update fields in PHP docs for accuracy + +## 6.7.0 - 2018-05-09 +* [#466](https://github.com/stripe/stripe-php/pull/466) Add support for issuer fraud records + +## 6.6.0 - 2018-04-11 +* [#460](https://github.com/stripe/stripe-php/pull/460) Add support for flexible billing primitives + +## 6.5.0 - 2018-04-05 +* [#461](https://github.com/stripe/stripe-php/pull/461) Don't zero keys on non-`metadata` subobjects + +## 6.4.2 - 2018-03-17 +* [#458](https://github.com/stripe/stripe-php/pull/458) Add PHPDoc for `account` on `\Stripe\Event` + +## 6.4.1 - 2018-03-02 +* [#455](https://github.com/stripe/stripe-php/pull/455) Fix namespaces in PHPDoc +* [#456](https://github.com/stripe/stripe-php/pull/456) Fix namespaces for some exceptions + +## 6.4.0 - 2018-02-28 +* [#453](https://github.com/stripe/stripe-php/pull/453) Add constants for `reason` (`REASON_*`) and `status` (`STATUS_*`) on `\Stripe\Dispute` + +## 6.3.2 - 2018-02-27 +* [#452](https://github.com/stripe/stripe-php/pull/452) Add PHPDoc for `amount_paid` and `amount_remaining` on `\Stripe\Invoice` + +## 6.3.1 - 2018-02-26 +* [#443](https://github.com/stripe/stripe-php/pull/443) Add event types as constants to `\Stripe\Event` class + +## 6.3.0 - 2018-02-23 +* [#450](https://github.com/stripe/stripe-php/pull/450) Add support for `code` attribute on all Stripe exceptions + +## 6.2.0 - 2018-02-21 +* [#440](https://github.com/stripe/stripe-php/pull/440) Add support for topups +* [#442](https://github.com/stripe/stripe-php/pull/442) Fix PHPDoc for `\Stripe\Error\SignatureVerification` + +## 6.1.0 - 2018-02-12 +* [#435](https://github.com/stripe/stripe-php/pull/435) Fix header persistence on `Collection` objects +* [#436](https://github.com/stripe/stripe-php/pull/436) Introduce new `Idempotency` error class + +## 6.0.0 - 2018-02-07 +Major version release. List of backwards incompatible changes to watch out for: ++ The minimum PHP version is now 5.4.0. If you're using PHP 5.3 or older, consider upgrading to a more recent version. +* `\Stripe\AttachedObject` no longer exists. Attributes that used to be instances of `\Stripe\AttachedObject` (such as `metadata`) are now instances of `\Stripe\StripeObject`. ++ Attributes that used to be PHP arrays (such as `legal_entity->additional_owners` on `\Stripe\Account` instances) are now instances of `\Stripe\StripeObject`, except when they are empty. `\Stripe\StripeObject` has array semantics so this should not be an issue unless you are actively checking types. +* `\Stripe\Collection` now derives from `\Stripe\StripeObject` rather than from `\Stripe\ApiResource`. + +Pull requests included in this release: +* [#410](https://github.com/stripe/stripe-php/pull/410) Drop support for PHP 5.3 +* [#411](https://github.com/stripe/stripe-php/pull/411) Use traits for common API operations +* [#414](https://github.com/stripe/stripe-php/pull/414) Use short array syntax +* [#404](https://github.com/stripe/stripe-php/pull/404) Fix serialization logic +* [#417](https://github.com/stripe/stripe-php/pull/417) Remove `ExternalAccount` class +* [#418](https://github.com/stripe/stripe-php/pull/418) Increase test coverage +* [#421](https://github.com/stripe/stripe-php/pull/421) Update CA bundle and add script for future updates +* [#422](https://github.com/stripe/stripe-php/pull/422) Use vendored CA bundle for all requests +* [#428](https://github.com/stripe/stripe-php/pull/428) Support for automatic request retries + +## 5.9.2 - 2018-02-07 +* [#431](https://github.com/stripe/stripe-php/pull/431) Update PHPDoc @property tags for latest API version + +## 5.9.1 - 2018-02-06 +* [#427](https://github.com/stripe/stripe-php/pull/427) Add and update PHPDoc @property tags on all API resources + +## 5.9.0 - 2018-01-17 +* [#421](https://github.com/stripe/stripe-php/pull/421) Updated bundled CA certificates +* [#423](https://github.com/stripe/stripe-php/pull/423) Escape unsanitized input in OAuth example + +## 5.8.0 - 2017-12-20 +* [#403](https://github.com/stripe/stripe-php/pull/403) Add `__debugInfo()` magic method to `StripeObject` + +## 5.7.0 - 2017-11-28 +* [#390](https://github.com/stripe/stripe-php/pull/390) Remove some unsupported API methods +* [#391](https://github.com/stripe/stripe-php/pull/391) Alphabetize the list of API resources in `Util::convertToStripeObject()` and add missing resources +* [#393](https://github.com/stripe/stripe-php/pull/393) Fix expiry date update for card sources + +## 5.6.0 - 2017-10-31 +* [#386](https://github.com/stripe/stripe-php/pull/386) Support for exchange rates APIs + +## 5.5.1 - 2017-10-30 +* [#387](https://github.com/stripe/stripe-php/pull/387) Allow `personal_address_kana` and `personal_address_kanji` to be updated on an account + +## 5.5.0 - 2017-10-27 +* [#385](https://github.com/stripe/stripe-php/pull/385) Support for listing source transactions + +## 5.4.0 - 2017-10-24 +* [#383](https://github.com/stripe/stripe-php/pull/383) Add static methods to manipulate resources from parent + * `Account` gains methods for external accounts and login links (e.g. `createExternalAccount`, `createLoginLink`) + * `ApplicationFee` gains methods for refunds + * `Customer` gains methods for sources + * `Transfer` gains methods for reversals + +## 5.3.0 - 2017-10-11 +* [#378](https://github.com/stripe/stripe-php/pull/378) Rename source `delete` to `detach` (and deprecate the former) + +## 5.2.3 - 2017-09-27 +* Add PHPDoc for `Card` + +## 5.2.2 - 2017-09-20 +* Fix deserialization mapping of `FileUpload` objects + +## 5.2.1 - 2017-09-14 +* Serialized `shipping` nested attribute + +## 5.2.0 - 2017-08-29 +* Add support for `InvalidClient` OAuth error + +## 5.1.3 - 2017-08-14 +* Allow `address_kana` and `address_kanji` to be updated for custom accounts + +## 5.1.2 - 2017-08-01 +* Fix documented return type of `autoPagingIterator()` (was missing namespace) + +## 5.1.1 - 2017-07-03 +* Fix order returns to use the right URL `/v1/order_returns` + +## 5.1.0 - 2017-06-30 +* Add support for OAuth + +## 5.0.0 - 2017-06-27 +* `pay` on invoice now takes params as well as opts + +## 4.13.0 - 2017-06-19 +* Add support for ephemeral keys + +## 4.12.0 - 2017-06-05 +* Clients can implement `getUserAgentInfo()` to add additional user agent information + +## 4.11.0 - 2017-06-05 +* Implement `Countable` for `AttachedObject` (`metadata` and `additional_owners`) + +## 4.10.0 - 2017-05-25 +* Add support for login links + +## 4.9.1 - 2017-05-10 +* Fix docs to include arrays on `$id` parameter for retrieve methods + +## 4.9.0 - 2017-04-28 +* Support for checking webhook signatures + +## 4.8.1 - 2017-04-24 +* Allow nested field `payout_schedule` to be updated + +## 4.8.0 - 2017-04-20 +* Add `\Stripe\Stripe::setLogger()` to support an external PSR-3 compatible logger + +## 4.7.0 - 2017-04-10 +* Add support for payouts and recipient transfers + +## 4.6.0 - 2017-04-06 +* Please see 4.7.0 instead (no-op release) + +## 4.5.1 - 2017-03-22 +* Remove hard dependency on cURL + +## 4.5.0 - 2017-03-20 +* Support for detaching sources from customers + +## 4.4.2 - 2017-02-27 +* Correct handling of `owner` parameter when updating sources + +## 4.4.1 - 2017-02-24 +* Correct the error check on a bad JSON decoding + +## 4.4.0 - 2017-01-18 +* Add support for updating sources + +## 4.3.0 - 2016-11-30 +* Add support for verifying sources + +## 4.2.0 - 2016-11-21 +* Add retrieve method for 3-D Secure resources + +## 4.1.1 - 2016-10-21 +* Add docblock with model properties for `Plan` + +## 4.1.0 - 2016-10-18 +* Support for 403 status codes (permission denied) + +## 4.0.1 - 2016-10-17 +* Fix transfer reversal materialization +* Fixes for some property definitions in docblocks + +## 4.0.0 - 2016-09-28 +* Support for subscription items +* Drop attempt to force TLS 1.2: please note that this could be breaking if you're using old OS distributions or packages and upgraded recently (so please make sure to test your integration!) + +## 3.23.0 - 2016-09-15 +* Add support for Apple Pay domains + +## 3.22.0 - 2016-09-13 +* Add `Stripe::setAppInfo` to allow plugins to register user agent information + +## 3.21.0 - 2016-08-25 +* Add `Source` model for generic payment sources + +## 3.20.0 - 2016-08-08 +* Add `getDeclineCode` to card errors + +## 3.19.0 - 2016-07-29 +* Opt requests directly into TLS 1.2 where OpenSSL >= 1.0.1 (see #277 for context) + +## 3.18.0 - 2016-07-28 +* Add new `STATUS_` constants for subscriptions + +## 3.17.1 - 2016-07-28 +* Fix auto-paging iterator so that it plays nicely with `iterator_to_array` + +## 3.17.0 - 2016-07-14 +* Add field annotations to model classes for better editor hinting + +## 3.16.0 - 2016-07-12 +* Add `ThreeDSecure` model for 3-D secure payments + +## 3.15.0 - 2016-06-29 +* Add static `update` method to all resources that can be changed. + +## 3.14.3 - 2016-06-20 +* Make sure that cURL never sends `Expects: 100-continue`, even on large request bodies + +## 3.14.2 - 2016-06-03 +* Add `inventory` under `SKU` to list of keys that have nested data and can be updated + +## 3.14.1 - 2016-05-27 +* Fix some inconsistencies in PHPDoc + +## 3.14.0 - 2016-05-25 +* Add support for returning Relay orders + +## 3.13.0 - 2016-05-04 +* Add `list`, `create`, `update`, `retrieve`, and `delete` methods to the Subscription class + +## 3.12.1 - 2016-04-07 +* Additional check on value arrays for some extra safety + +## 3.12.0 - 2016-03-31 +* Fix bug `refreshFrom` on `StripeObject` would not take an `$opts` array +* Fix bug where `$opts` not passed to parent `save` method in `Account` +* Fix bug where non-existent variable was referenced in `reverse` in `Transfer` +* Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1 + +## 3.11.0 - 2016-03-22 +* Allow `CurlClient` to be initialized with default `CURLOPT_*` options + +## 3.10.1 - 2016-03-22 +* Fix bug where request params and options were ignored in `ApplicationFee`'s `refund.` + +## 3.10.0 - 2016-03-15 +* Add `reject` on `Account` to support the new API feature + +## 3.9.2 - 2016-03-04 +* Fix error when an object's metadata is set more than once + +## 3.9.1 - 2016-02-24 +* Fix encoding behavior of nested arrays for requests (see #227) + +## 3.9.0 - 2016-02-09 +* Add automatic pagination mechanism with `autoPagingIterator()` +* Allow global account ID to be set with `Stripe::setAccountId()` + +## 3.8.0 - 2016-02-08 +* Add `CountrySpec` model for looking up country payment information + +## 3.7.1 - 2016-02-01 +* Update bundled CA certs + +## 3.7.0 - 2016-01-27 +* Support deleting Relay products and SKUs + +## 3.6.0 - 2016-01-05 +* Allow configuration of HTTP client timeouts + +## 3.5.0 - 2015-12-01 +* Add a verification routine for external accounts + +## 3.4.0 - 2015-09-14 +* Products, SKUs, and Orders -- https://stripe.com/relay + +## 3.3.0 - 2015-09-11 +* Add support for 429 Rate Limit response + +## 3.2.0 - 2015-08-17 +* Add refund listing and retrieval without an associated charge + +## 3.1.0 - 2015-08-03 +* Add dispute listing and retrieval +* Add support for manage account deletion + +## 3.0.0 - 2015-07-28 +* Rename `\Stripe\Object` to `\Stripe\StripeObject` (PHP 7 compatibility) +* Rename `getCode` and `getParam` in exceptions to `getStripeCode` and `getStripeParam` +* Add support for calling `json_encode` on Stripe objects in PHP 5.4+ +* Start supporting/testing PHP 7 + +## 2.3.0 - 2015-07-06 +* Add request ID to all Stripe exceptions + +## 2.2.0 - 2015-06-01 +* Add support for Alipay accounts as sources +* Add support for bank accounts as sources (private beta) +* Add support for bank accounts and cards as external_accounts on Account objects + +## 2.1.4 - 2015-05-13 +* Fix CA certificate file path (thanks @lphilps & @matthewarkin) + +## 2.1.3 - 2015-05-12 +* Fix to account updating to permit `tos_acceptance` and `personal_address` to be set properly +* Fix to Transfer reversal creation (thanks @neatness!) +* Network requests are now done through a swappable class for easier mocking + +## 2.1.2 - 2015-04-10 +* Remove SSL cert revokation checking (all pre-Heartbleed certs have expired) +* Bug fixes to account updating + +## 2.1.1 - 2015-02-27 +* Support transfer reversals + +## 2.1.0 - 2015-02-19 +* Support new API version (2015-02-18) +* Added Bitcoin Receiever update and delete actions +* Edited tests to prefer "source" over "card" as per new API version + +## 2.0.1 - 2015-02-16 +* Fix to fetching endpoints that use a non-default baseUrl (`FileUpload`) + +## 2.0.0 - 2015-02-14 +* Bumped minimum version to 5.3.3 +* Switched to Stripe namespace instead of Stripe_ class name prefiexes (thanks @chadicus!) +* Switched tests to PHPUnit (thanks @chadicus!) +* Switched style guide to PSR2 (thanks @chadicus!) +* Added $opts hash to the end of most methods: this permits passing 'idempotency_key', 'stripe_account', or 'stripe_version'. The last 2 will persist across multiple object loads. +* Added support for retrieving Account by ID + +## 1.18.0 - 2015-01-21 +* Support making bitcoin charges through BitcoinReceiver source object + +## 1.17.5 - 2014-12-23 +* Adding support for creating file uploads. + +## 1.17.4 - 2014-12-15 +* Saving objects fetched with a custom key now works (thanks @JustinHook & @jpasilan) +* Added methods for reporting charges as safe or fraudulent and for specifying the reason for refunds + +## 1.17.3 - 2014-11-06 +* Better handling of HHVM support for SSL certificate blacklist checking. + +## 1.17.2 - 2014-09-23 +* Coupons now are backed by a `Stripe_Coupon` instead of `Stripe_Object`, and support updating metadata +* Running operations (`create`, `retrieve`, `all`) on upcoming invoice items now works + +## 1.17.1 - 2014-07-31 +* Requests now send Content-Type header + +## 1.17.0 - 2014-07-29 +* Application Fee refunds now a list instead of array +* HHVM now works +* Small bug fixes (thanks @bencromwell & @fastest963) +* `__toString` now returns the name of the object in addition to its JSON representation + +## 1.16.0 - 2014-06-17 +* Add metadata for refunds and disputes + +## 1.15.0 - 2014-05-28 +* Support canceling transfers + +## 1.14.1 - 2014-05-21 +* Support cards for recipients. + +## 1.13.1 - 2014-05-15 +* Fix bug in account resource where `id` wasn't in the result + +## 1.13.0 - 2014-04-10 +* Add support for certificate blacklisting +* Update ca bundle +* Drop support for HHVM (Temporarily) + +## 1.12.0 - 2014-04-01 +* Add Stripe_RateLimitError for catching rate limit errors. +* Update to Zend coding style (thanks, @jpiasetz) + +## 1.11.0 - 2014-01-29 +* Add support for multiple subscriptions per customer + +## 1.10.1 - 2013-12-02 +* Add new ApplicationFee + +## 1.9.1 - 2013-11-08 +* Fix a bug where a null nestable object causes warnings to fire. + +## 1.9.0 - 2013-10-16 +* Add support for metadata API. + +## 1.8.4 - 2013-09-18 +* Add support for closing disputes. + +## 1.8.3 - 2013-08-13 +* Add new Balance and BalanceTransaction + +## 1.8.2 - 2013-08-12 +* Add support for unsetting attributes by updating to NULL. Setting properties to a blank string is now an error. + +## 1.8.1 - 2013-07-12 +* Add support for multiple cards API (Stripe API version 2013-07-12: https://stripe.com/docs/upgrades#2013-07-05) + +## 1.8.0 - 2013-04-11 +* Allow Transfers to be creatable +* Add new Recipient resource + +## 1.7.15 - 2013-02-21 +* Add 'id' to the list of permanent object attributes + +## 1.7.14 - 2013-02-20 + +* Don't re-encode strings that are already encoded in UTF-8. If you were previously using plan or coupon objects with UTF-8 IDs, they may have been treated as ISO-8859-1 (Latin-1) and encoded to UTF-8 a 2nd time. You may now need to pass the IDs to utf8_encode before passing them to Stripe_Plan::retrieve or Stripe_Coupon::retrieve. +* Ensure that all input is encoded in UTF-8 before submitting it to Stripe's servers. (github issue #27) + +## 1.7.13 - 2013-02-01 +* Add support for passing options when retrieving Stripe objects e.g., Stripe_Charge::retrieve(array("id"=>"foo", "expand" => array("customer"))); Stripe_Charge::retrieve("foo") will continue to work + +## 1.7.12 - 2013-01-15 +* Add support for setting a Stripe API version override + +## 1.7.11 - 2012-12-30 +* Version bump to cleanup constants and such (fix issue #26) + +## 1.7.10 - 2012-11-08 +* Add support for updating charge disputes. +* Fix bug preventing retrieval of null attributes + +## 1.7.9 - 2012-11-08 +* Fix usage under autoloaders such as the one generated by composer (fix issue #22) + +## 1.7.8 - 2012-10-30 +* Add support for creating invoices. +* Add support for new invoice lines return format +* Add support for new list objects + +## 1.7.7 - 2012-09-14 +* Get all of the various version numbers in the repo in sync (no other changes) + +## 1.7.6 - 2012-08-31 +* Add update and pay methods to Invoice resource + +## 1.7.5 - 2012-08-23 +* Change internal function names so that Stripe_SingletonApiRequest is E_STRICT-clean (github issue #16) + +## 1.7.4 - 2012-08-21 +* Bugfix so that Stripe objects (e.g. Customer, Charge objects) used in API calls are transparently converted to their object IDs + +## 1.7.3 - 2012-08-15 +* Add new Account resource + +## 1.7.2 - 2012-06-26 +* Make clearer that you should be including lib/Stripe.php, not test/Stripe.php (github issue #14) + +## 1.7.1 - 2012-05-24 +* Add missing argument to Stripe_InvalidRequestError constructor in Stripe_ApiResource::instanceUrl. Fixes a warning when Stripe_ApiResource::instanceUrl is called on a resource with no ID (fix issue #12) + +## 1.7.0 - 2012-05-17 +* Support Composer and Packagist (github issue #9) +* Add new deleteDiscount method to Stripe_Customer +* Add new Transfer resource +* Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward) +* Numerous test suite improvements diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/LICENSE b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/LICENSE new file mode 100644 index 0000000000..847c705ad3 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2010-2019 Stripe, Inc. (https://stripe.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/README.md b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/README.md new file mode 100644 index 0000000000..8dca764d7d --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/README.md @@ -0,0 +1,242 @@ +# Stripe PHP bindings + +[![Build Status](https://travis-ci.org/stripe/stripe-php.svg?branch=master)](https://travis-ci.org/stripe/stripe-php) +[![Latest Stable Version](https://poser.pugx.org/stripe/stripe-php/v/stable.svg)](https://packagist.org/packages/stripe/stripe-php) +[![Total Downloads](https://poser.pugx.org/stripe/stripe-php/downloads.svg)](https://packagist.org/packages/stripe/stripe-php) +[![License](https://poser.pugx.org/stripe/stripe-php/license.svg)](https://packagist.org/packages/stripe/stripe-php) +[![Code Coverage](https://coveralls.io/repos/stripe/stripe-php/badge.svg?branch=master)](https://coveralls.io/r/stripe/stripe-php?branch=master) + +You can sign up for a Stripe account at https://stripe.com. + +## Requirements + +PHP 5.4.0 and later. + +## Composer + +You can install the bindings via [Composer](http://getcomposer.org/). Run the following command: + +```bash +composer require stripe/stripe-php +``` + +To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): + +```php +require_once('vendor/autoload.php'); +``` + +## Manual Installation + +If you do not wish to use Composer, you can download the [latest release](https://github.com/stripe/stripe-php/releases). Then, to use the bindings, include the `init.php` file. + +```php +require_once('/path/to/stripe-php/init.php'); +``` + +## Dependencies + +The bindings require the following extensions in order to work properly: + +- [`curl`](https://secure.php.net/manual/en/book.curl.php), although you can use your own non-cURL client if you prefer +- [`json`](https://secure.php.net/manual/en/book.json.php) +- [`mbstring`](https://secure.php.net/manual/en/book.mbstring.php) (Multibyte String) + +If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available. + +## Getting Started + +Simple usage looks like: + +```php +\Stripe\Stripe::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); +$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_189fqt2eZvKYlo2CTGBeg6Uq']); +echo $charge; +``` + +## Documentation + +Please see https://stripe.com/docs/api for up-to-date documentation. + +## Legacy Version Support + +### PHP 5.3 + +If you are using PHP 5.3, you can download v5.9.2 ([zip](https://github.com/stripe/stripe-php/archive/v5.9.2.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v5.9.2.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. + +### PHP 5.2 + +If you are using PHP 5.2, you can download v1.18.0 ([zip](https://github.com/stripe/stripe-php/archive/v1.18.0.zip), [tar.gz](https://github.com/stripe/stripe-php/archive/v1.18.0.tar.gz)) from our [releases page](https://github.com/stripe/stripe-php/releases). This version will continue to work with new versions of the Stripe API for all common uses. + +This legacy version may be included via `require_once("/path/to/stripe-php/lib/Stripe.php");`, and used like: + +```php +Stripe::setApiKey('d8e8fca2dc0f896fd7cb4cb0031ba249'); +$charge = Stripe_Charge::create(array('source' => 'tok_XXXXXXXX', 'amount' => 2000, 'currency' => 'usd')); +echo $charge; +``` + +## Custom Request Timeouts + +*NOTE:* We do not recommend decreasing the timeout for non-read-only calls (e.g. charge creation), since even if you locally timeout, the request on Stripe's side can still complete. If you are decreasing timeouts on these calls, make sure to use [idempotency tokens](https://stripe.com/docs/api/php#idempotent_requests) to avoid executing the same transaction twice as a result of timeout retry logic. + +To modify request timeouts (connect or total, in seconds) you'll need to tell the API client to use a CurlClient other than its default. You'll set the timeouts in that CurlClient. + +```php +// set up your tweaked Curl client +$curl = new \Stripe\HttpClient\CurlClient(); +$curl->setTimeout(10); // default is \Stripe\HttpClient\CurlClient::DEFAULT_TIMEOUT +$curl->setConnectTimeout(5); // default is \Stripe\HttpClient\CurlClient::DEFAULT_CONNECT_TIMEOUT + +echo $curl->getTimeout(); // 10 +echo $curl->getConnectTimeout(); // 5 + +// tell Stripe to use the tweaked client +\Stripe\ApiRequestor::setHttpClient($curl); + +// use the Stripe API client as you normally would +``` + +## Custom cURL Options (e.g. proxies) + +Need to set a proxy for your requests? Pass in the requisite `CURLOPT_*` array to the CurlClient constructor, using the same syntax as `curl_stopt_array()`. This will set the default cURL options for each HTTP request made by the SDK, though many more common options (e.g. timeouts; see above on how to set those) will be overridden by the client even if set here. + +```php +// set up your tweaked Curl client +$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_PROXY => 'proxy.local:80']); +// tell Stripe to use the tweaked client +\Stripe\ApiRequestor::setHttpClient($curl); +``` + +Alternately, a callable can be passed to the CurlClient constructor that returns the above array based on request inputs. See `testDefaultOptions()` in `tests/CurlClientTest.php` for an example of this behavior. Note that the callable is called at the beginning of every API request, before the request is sent. + +### Configuring a Logger + +The library does minimal logging, but it can be configured +with a [`PSR-3` compatible logger][psr3] so that messages +end up there instead of `error_log`: + +```php +\Stripe\Stripe::setLogger($logger); +``` + +### Accessing response data + +You can access the data from the last API response on any object via `getLastResponse()`. + +```php +$charge = \Stripe\Charge::create(['amount' => 2000, 'currency' => 'usd', 'source' => 'tok_visa']); +echo $charge->getLastResponse()->headers['Request-Id']; +``` + +### SSL / TLS compatibility issues + +Stripe's API now requires that [all connections use TLS 1.2](https://stripe.com/blog/upgrading-tls). Some systems (most notably some older CentOS and RHEL versions) are capable of using TLS 1.2 but will use TLS 1.0 or 1.1 by default. In this case, you'd get an `invalid_request_error` with the following error message: "Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at [https://stripe.com/blog/upgrading-tls](https://stripe.com/blog/upgrading-tls).". + +The recommended course of action is to [upgrade your cURL and OpenSSL packages](https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php) so that TLS 1.2 is used by default, but if that is not possible, you might be able to solve the issue by setting the `CURLOPT_SSLVERSION` option to either `CURL_SSLVERSION_TLSv1` or `CURL_SSLVERSION_TLSv1_2`: + +```php +$curl = new \Stripe\HttpClient\CurlClient([CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1]); +\Stripe\ApiRequestor::setHttpClient($curl); +``` + +### Per-request Configuration + +For apps that need to use multiple keys during the lifetime of a process, like +one that uses [Stripe Connect][connect], it's also possible to set a +per-request key and/or account: + +```php +\Stripe\Charge::all([], [ + 'api_key' => 'sk_test_...', + 'stripe_account' => 'acct_...' +]); + +\Stripe\Charge::retrieve("ch_18atAXCdGbJFKhCuBAa4532Z", [ + 'api_key' => 'sk_test_...', + 'stripe_account' => 'acct_...' +]); +``` + +### Configuring CA Bundles + +By default, the library will use its own internal bundle of known CA +certificates, but it's possible to configure your own: + +```php +\Stripe\Stripe::setCABundlePath("path/to/ca/bundle"); +``` + +### Configuring Automatic Retries + +The library can be configured to automatically retry requests that fail due to +an intermittent network problem: + +```php +\Stripe\Stripe::setMaxNetworkRetries(2); +``` + +[Idempotency keys][idempotency-keys] are added to requests to guarantee that +retries are safe. + +## Development + +Get [Composer][composer]. For example, on Mac OS: + +```bash +brew install composer +``` + +Install dependencies: + +```bash +composer install +``` + +The test suite depends on [stripe-mock], so make sure to fetch and run it from a +background terminal ([stripe-mock's README][stripe-mock] also contains +instructions for installing via Homebrew and other methods): + +```bash +go get -u github.com/stripe/stripe-mock +stripe-mock +``` + +Install dependencies as mentioned above (which will resolve [PHPUnit](http://packagist.org/packages/phpunit/phpunit)), then you can run the test suite: + +```bash +./vendor/bin/phpunit +``` + +Or to run an individual test file: + +```bash +./vendor/bin/phpunit tests/UtilTest.php +``` + +Update bundled CA certificates from the [Mozilla cURL release][curl]: + +```bash +./update_certs.php +``` + +## Attention plugin developers + +Are you writing a plugin that integrates Stripe and embeds our library? Then please use the `setAppInfo` function to identify your plugin. For example: + +```php +\Stripe\Stripe::setAppInfo("MyAwesomePlugin", "1.2.34", "https://myawesomeplugin.info"); +``` + +The method should be called once, before any request is sent to the API. The second and third parameters are optional. + +### SSL / TLS configuration option + +See the "SSL / TLS compatibility issues" paragraph above for full context. If you want to ensure that your plugin can be used on all systems, you should add a configuration option to let your users choose between different values for `CURLOPT_SSLVERSION`: none (default), `CURL_SSLVERSION_TLSv1` and `CURL_SSLVERSION_TLSv1_2`. + +[composer]: https://getcomposer.org/ +[connect]: https://stripe.com/connect +[curl]: http://curl.haxx.se/docs/caextract.html +[psr3]: http://www.php-fig.org/psr/psr-3/ +[idempotency-keys]: https://stripe.com/docs/api/php#idempotent_requests +[stripe-mock]: https://github.com/stripe/stripe-mock diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/VERSION b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/VERSION new file mode 100644 index 0000000000..ae24c9040f --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/VERSION @@ -0,0 +1 @@ +6.30.4 diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/build.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/build.php new file mode 100755 index 0000000000..6ce0ca38d1 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/build.php @@ -0,0 +1,36 @@ +#!/usr/bin/env php +=5.4.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "php-coveralls/php-coveralls": "1.*", + "squizlabs/php_codesniffer": "~2.0", + "symfony/process": "~2.8" + }, + "autoload": { + "psr-4": { "Stripe\\" : "lib/" } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + } +} diff --git a/public_html/extensions/default_stripe/core/lib/data/ca-certificates.crt b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/data/ca-certificates.crt similarity index 100% rename from public_html/extensions/default_stripe/core/lib/data/ca-certificates.crt rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/data/ca-certificates.crt diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/init.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/init.php new file mode 100644 index 0000000000..1d4d1c3625 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/init.php @@ -0,0 +1,137 @@ +instanceUrl().'/reject'; + $url = $this->instanceUrl() . '/reject'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; } /** - * @param array|null $clientId + * @param array|null $params + * @param array|string|null $options + * + * @return Collection The list of persons. + */ + public function persons($params = null, $options = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } + + /** + * @param array|null $clientId * @param array|string|null $opts * * @return StripeObject Object containing the response from the API. @@ -110,15 +121,15 @@ public function reject($params = null, $opts = null) public function deauthorize($clientId = null, $opts = null) { $params = [ - 'client_id' => $clientId, + 'client_id' => $clientId, 'stripe_user_id' => $this->id, ]; - OAuth::deauthorize($params, $opts); + return OAuth::deauthorize($params, $opts); } /** - * @param array|null $id The ID of the account on which to create the external account. - * @param array|null $params + * @param string|null $id The ID of the account on which to create the external account. + * @param array|null $params * @param array|string|null $opts * * @return BankAccount|Card @@ -129,9 +140,9 @@ public static function createExternalAccount($id, $params = null, $opts = null) } /** - * @param array|null $id The ID of the account to which the external account belongs. - * @param array|null $externalAccountId The ID of the external account to retrieve. - * @param array|null $params + * @param string|null $id The ID of the account to which the external account belongs. + * @param array|null $externalAccountId The ID of the external account to retrieve. + * @param array|null $params * @param array|string|null $opts * * @return BankAccount|Card @@ -142,9 +153,9 @@ public static function retrieveExternalAccount($id, $externalAccountId, $params } /** - * @param array|null $id The ID of the account to which the external account belongs. - * @param array|null $externalAccountId The ID of the external account to update. - * @param array|null $params + * @param string|null $id The ID of the account to which the external account belongs. + * @param array|null $externalAccountId The ID of the external account to update. + * @param array|null $params * @param array|string|null $opts * * @return BankAccount|Card @@ -155,9 +166,9 @@ public static function updateExternalAccount($id, $externalAccountId, $params = } /** - * @param array|null $id The ID of the account to which the external account belongs. - * @param array|null $externalAccountId The ID of the external account to delete. - * @param array|null $params + * @param string|null $id The ID of the account to which the external account belongs. + * @param array|null $externalAccountId The ID of the external account to delete. + * @param array|null $params * @param array|string|null $opts * * @return BankAccount|Card @@ -168,8 +179,8 @@ public static function deleteExternalAccount($id, $externalAccountId, $params = } /** - * @param array|null $id The ID of the account on which to retrieve the external accounts. - * @param array|null $params + * @param string|null $id The ID of the account on which to retrieve the external accounts. + * @param array|null $params * @param array|string|null $opts * * @return BankAccount|Card @@ -180,8 +191,8 @@ public static function allExternalAccounts($id, $params = null, $opts = null) } /** - * @param array|null $id The ID of the account on which to create the login link. - * @param array|null $params + * @param string|null $id The ID of the account on which to create the login link. + * @param array|null $params * @param array|string|null $opts * * @return LoginLink @@ -191,6 +202,69 @@ public static function createLoginLink($id, $params = null, $opts = null) return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); } + /** + * @param string|null $id The ID of the account on which to create the person. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function createPerson($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to retrieve. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function retrievePerson($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to update. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function updatePerson($id, $personId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account to which the person belongs. + * @param array|null $personId The ID of the person to delete. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function deletePerson($id, $personId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string|null $id The ID of the account on which to retrieve the persons. + * @param array|null $params + * @param array|string|null $opts + * + * @return Person + */ + public static function allPersons($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); + } + public function serializeParameters($force = false) { $update = parent::serializeParameters($force); @@ -203,6 +277,12 @@ public function serializeParameters($force = false) $update['legal_entity'] = $entityUpdate; } } + if (isset($this->_values['individual'])) { + $individual = $this['individual']; + if (($individual instanceof Person) && !isset($update['individual'])) { + $update['individual'] = $individual->serializeParameters($force); + } + } return $update; } @@ -224,7 +304,9 @@ private function serializeAdditionalOwners($legalEntity, $additionalOwners) $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; if ($update !== []) { - if (!$originalValue || ($update != $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + if (!$originalValue || + !array_key_exists($i, $originalValue) || + ($update != $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { $updateArr[$i] = $update; } } diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/AccountLink.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/AccountLink.php new file mode 100644 index 0000000000..f2975ae383 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/AccountLink.php @@ -0,0 +1,21 @@ +sources->retrieve('alipay_account_id') instead."; + $msg = "Alipay accounts cannot be accessed without a customer ID. " . + "Retrieve an Alipay account using \$customer->sources->retrieve('alipay_account_id') instead."; throw new Error\InvalidRequest($msg, null); } /** - * @param string $_id - * @param array|null $_params + * @param string $_id + * @param array|null $_params * @param array|string|null $_options * * @throws \Stripe\Error\InvalidRequest * * @deprecated Alipay accounts are deprecated. Please use the sources API instead. - * @link https://stripe.com/docs/sources/alipay + * @link https://stripe.com/docs/sources/alipay */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Alipay accounts cannot be accessed without a customer ID. ". - "Call save() on \$customer->sources->retrieve('alipay_account_id') instead."; + $msg = "Alipay accounts cannot be accessed without a customer ID. " . + "Call save() on \$customer->sources->retrieve('alipay_account_id') instead."; throw new Error\InvalidRequest($msg, null); } } diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/All.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/All.php similarity index 91% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/All.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/All.php index 818856e1b6..2762748f95 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/All.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/All.php @@ -10,7 +10,7 @@ trait All { /** - * @param array|null $params + * @param array|null $params * @param array|string|null $opts * * @return \Stripe\Collection of ApiResources @@ -25,7 +25,7 @@ public static function all($params = null, $opts = null) if (!is_a($obj, 'Stripe\\Collection')) { $class = get_class($obj); $message = "Expected type \"Stripe\\Collection\", got \"$class\" instead"; - throw new Error\Api($message); + throw new \Stripe\Error\Api($message); } $obj->setLastResponse($response); $obj->setRequestParams($params); diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Create.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php similarity index 94% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Create.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php index e5ac83aa89..0fb341d029 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Create.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Create.php @@ -10,7 +10,7 @@ trait Create { /** - * @param array|null $params + * @param array|null $params * @param array|string|null $options * * @return \Stripe\ApiResource The created resource. diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Delete.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php similarity index 94% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Delete.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php index 3140ed6286..7df6797919 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Delete.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Delete.php @@ -10,7 +10,7 @@ trait Delete { /** - * @param array|null $params + * @param array|null $params * @param array|string|null $opts * * @return \Stripe\ApiResource The deleted resource. diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/NestedResource.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php similarity index 77% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/NestedResource.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php index dd7d9307dd..2122354362 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/NestedResource.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/NestedResource.php @@ -10,9 +10,9 @@ trait NestedResource { /** - * @param string $method - * @param string $url - * @param array|null $params + * @param string $method + * @param string $url + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject @@ -28,15 +28,15 @@ protected static function _nestedResourceOperation($method, $url, $params = null } /** - * @param string $id - * @param string $nestedPath + * @param string $id + * @param string $nestedPath * @param string|null $nestedId * * @return string */ protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) { - $url = static::resourceUrl($id).$nestedPath; + $url = static::resourceUrl($id) . $nestedPath; if ($nestedId !== null) { $url .= "/$nestedId"; } @@ -44,9 +44,9 @@ protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) } /** - * @param string $id - * @param string $nestedPath - * @param array|null $params + * @param string $id + * @param string $nestedPath + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject @@ -58,9 +58,10 @@ protected static function _createNestedResource($id, $nestedPath, $params = null } /** - * @param string $id - * @param string $nestedPath - * @param array|null $params + * @param string $id + * @param string $nestedPath + * @param string|null $nestedId + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject @@ -72,9 +73,10 @@ protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $ } /** - * @param string $id - * @param string $nestedPath - * @param array|null $params + * @param string $id + * @param string $nestedPath + * @param string|null $nestedId + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject @@ -86,9 +88,10 @@ protected static function _updateNestedResource($id, $nestedPath, $nestedId, $pa } /** - * @param string $id - * @param string $nestedPath - * @param array|null $params + * @param string $id + * @param string $nestedPath + * @param string|null $nestedId + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject @@ -100,9 +103,9 @@ protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $pa } /** - * @param string $id - * @param string $nestedPath - * @param array|null $params + * @param string $id + * @param string $nestedPath + * @param array|null $params * @param array|string|null $options * * @return \Stripe\StripeObject diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Request.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php similarity index 69% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Request.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php index ce1e04843f..dd048dc5f5 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Request.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Request.php @@ -18,17 +18,17 @@ protected static function _validateParams($params = null) { if ($params && !is_array($params)) { $message = "You must pass an array as the first argument to Stripe API " - ."method calls. (HINT: an example call to create a charge " - ."would be: \"Stripe\\Charge::create(['amount' => 100, " - ."'currency' => 'usd', 'source' => 'tok_1234'])\")"; + . "method calls. (HINT: an example call to create a charge " + . "would be: \"Stripe\\Charge::create(['amount' => 100, " + . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; throw new \Stripe\Error\Api($message); } } /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request * @param array|string|null $options * * @return array tuple containing (the JSON response, $options) @@ -42,9 +42,9 @@ protected function _request($method, $url, $params = [], $options = null) } /** - * @param string $method HTTP method ('get', 'post', etc.) - * @param string $url URL for the request - * @param array $params list of parameters for the request + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request * @param array|string|null $options * * @return array tuple containing (the JSON response, $options) @@ -52,7 +52,8 @@ protected function _request($method, $url, $params = [], $options = null) protected static function _staticRequest($method, $url, $params, $options) { $opts = \Stripe\Util\RequestOptions::parse($options); - $requestor = new \Stripe\ApiRequestor($opts->apiKey, static::baseUrl()); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); $opts->discardNonPersistentHeaders(); return [$response, $opts]; diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Retrieve.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php similarity index 78% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Retrieve.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php index 57f015e54e..a037326b3e 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Retrieve.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Retrieve.php @@ -11,8 +11,8 @@ trait Retrieve { /** - * @param array|string $id The ID of the API resource to retrieve, - * or an options array containing an `id` key. + * @param array|string $id The ID of the API resource to retrieve, + * or an options array containing an `id` key. * @param array|string|null $opts * * @return \Stripe\StripeObject diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Update.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php similarity index 91% rename from public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Update.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php index c46c89ec3c..0683e77af1 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiOperations/Update.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiOperations/Update.php @@ -11,8 +11,8 @@ trait Update { /** - * @param string $id The ID of the resource to update. - * @param array|null $params + * @param string $id The ID of the resource to update. + * @param array|null $params * @param array|string|null $opts * * @return \Stripe\ApiResource The updated resource. diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiRequestor.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php similarity index 63% rename from public_html/extensions/default_stripe/core/lib/lib/ApiRequestor.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php index ae5ce32ad6..7cf851877d 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiRequestor.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiRequestor.php @@ -9,12 +9,32 @@ */ class ApiRequestor { + /** + * @var string|null + */ private $_apiKey; + /** + * @var string + */ private $_apiBase; + /** + * @var HttpClient\ClientInterface + */ private static $_httpClient; + /** + * @var RequestTelemetry + */ + private static $requestTelemetry; + + /** + * ApiRequestor constructor. + * + * @param string|null $apiKey + * @param string|null $apiBase + */ public function __construct($apiKey = null, $apiBase = null) { $this->_apiKey = $apiKey; @@ -24,6 +44,37 @@ public function __construct($apiKey = null, $apiBase = null) $this->_apiBase = $apiBase; } + /** + * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers + * @static + * + * @param RequestTelemetry $requestTelemetry + * @return string + */ + private static function _telemetryJson($requestTelemetry) + { + $payload = array( + 'last_request_metrics' => array( + 'request_id' => $requestTelemetry->requestId, + 'request_duration_ms' => $requestTelemetry->requestDuration, + )); + + $result = json_encode($payload); + if ($result != false) { + return $result; + } else { + Stripe::getLogger()->error("Serializing telemetry payload failed!"); + return "{}"; + } + } + + /** + * @static + * + * @param ApiResource|bool|array|mixed $d + * + * @return ApiResource|array|string|mixed + */ private static function _encodeObjects($d) { if ($d instanceof ApiResource) { @@ -51,13 +102,27 @@ private static function _encodeObjects($d) * * @return array An array whose first element is an API response and second * element is the API key used to make the request. + * @throws Error\Api + * @throws Error\Authentication + * @throws Error\Card + * @throws Error\InvalidRequest + * @throws Error\OAuth\InvalidClient + * @throws Error\OAuth\InvalidGrant + * @throws Error\OAuth\InvalidRequest + * @throws Error\OAuth\InvalidScope + * @throws Error\OAuth\UnsupportedGrantType + * @throws Error\OAuth\UnsupportedResponseType + * @throws Error\Permission + * @throws Error\RateLimit + * @throws Error\Idempotency + * @throws Error\ApiConnection */ public function request($method, $url, $params = null, $headers = null) { $params = $params ?: []; $headers = $headers ?: []; list($rbody, $rcode, $rheaders, $myApiKey) = - $this->_requestRaw($method, $url, $params, $headers); + $this->_requestRaw($method, $url, $params, $headers); $json = $this->_interpretResponse($rbody, $rcode, $rheaders); $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); return [$resp, $myApiKey]; @@ -65,18 +130,27 @@ public function request($method, $url, $params = null, $headers = null) /** * @param string $rbody A JSON string. - * @param int $rcode - * @param array $rheaders - * @param array $resp + * @param int $rcode + * @param array $rheaders + * @param array $resp * * @throws Error\InvalidRequest if the error is caused by the user. - * @throws Error\Idempotency if the error is caused by an idempotency key. * @throws Error\Authentication if the error is caused by a lack of * permissions. * @throws Error\Permission if the error is caused by insufficient * permissions. * @throws Error\Card if the error is the error code is 402 (payment * required) + * @throws Error\InvalidRequest if the error is caused by the user. + * @throws Error\Idempotency if the error is caused by an idempotency key. + * @throws Error\OAuth\InvalidClient + * @throws Error\OAuth\InvalidGrant + * @throws Error\OAuth\InvalidRequest + * @throws Error\OAuth\InvalidScope + * @throws Error\OAuth\UnsupportedGrantType + * @throws Error\OAuth\UnsupportedResponseType + * @throws Error\Permission if the error is caused by insufficient + * permissions. * @throws Error\RateLimit if the error is caused by too many requests * hitting the API. * @throws Error\Api otherwise. @@ -85,7 +159,7 @@ public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) { if (!is_array($resp) || !isset($resp['error'])) { $msg = "Invalid response object from API: $rbody " - ."(HTTP response code was $rcode)"; + . "(HTTP response code was $rcode)"; throw new Error\Api($msg, $rcode, $rbody, $resp, $rheaders); } @@ -102,6 +176,17 @@ public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) throw $error; } + /** + * @static + * + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param array $errorData + * + * @return Error\RateLimit|Error\Idempotency|Error\InvalidRequest|Error\Authentication|Error\Card|Error\Permission|Error\Api + */ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) { $msg = isset($errorData['message']) ? $errorData['message'] : null; @@ -120,7 +205,7 @@ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $err return new Error\Idempotency($msg, $rcode, $rbody, $resp, $rheaders); } - // intentional fall-through + // intentional fall-through case 404: return new Error\InvalidRequest($msg, $param, $rcode, $rbody, $resp, $rheaders); case 401: @@ -136,6 +221,17 @@ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $err } } + /** + * @static + * + * @param string|bool $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param string $errorCode + * + * @return null|Error\OAuth\InvalidClient|Error\OAuth\InvalidGrant|Error\OAuth\InvalidRequest|Error\OAuth\InvalidScope|Error\OAuth\UnsupportedGrantType|Error\OAuth\UnsupportedResponseType + */ private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) { $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; @@ -158,15 +254,22 @@ private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $e return null; } + /** + * @static + * + * @param null|array $appInfo + * + * @return null|string + */ private static function _formatAppInfo($appInfo) { if ($appInfo !== null) { $string = $appInfo['name']; if ($appInfo['version'] !== null) { - $string .= '/'.$appInfo['version']; + $string .= '/' . $appInfo['version']; } if ($appInfo['url'] !== null) { - $string .= ' ('.$appInfo['url'].')'; + $string .= ' (' . $appInfo['url'] . ')'; } return $string; } else { @@ -174,9 +277,17 @@ private static function _formatAppInfo($appInfo) } } + /** + * @static + * + * @param string $apiKey + * @param null $clientInfo + * + * @return array + */ private static function _defaultHeaders($apiKey, $clientInfo = null) { - $uaString = 'Stripe/v1 PhpBindings/'.Stripe::VERSION; + $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; $langVersion = phpversion(); $uname = php_uname(); @@ -184,27 +295,38 @@ private static function _defaultHeaders($apiKey, $clientInfo = null) $appInfo = Stripe::getAppInfo(); $ua = [ 'bindings_version' => Stripe::VERSION, - 'lang' => 'php', - 'lang_version' => $langVersion, - 'publisher' => 'stripe', - 'uname' => $uname, + 'lang' => 'php', + 'lang_version' => $langVersion, + 'publisher' => 'stripe', + 'uname' => $uname, ]; if ($clientInfo) { $ua = array_merge($clientInfo, $ua); } if ($appInfo !== null) { - $uaString .= ' '.self::_formatAppInfo($appInfo); + $uaString .= ' ' . self::_formatAppInfo($appInfo); $ua['application'] = $appInfo; } $defaultHeaders = [ 'X-Stripe-Client-User-Agent' => json_encode($ua), - 'User-Agent' => $uaString, - 'Authorization' => 'Bearer '.$apiKey, + 'User-Agent' => $uaString, + 'Authorization' => 'Bearer ' . $apiKey, ]; return $defaultHeaders; } + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * + * @return array + * @throws Error\Api + * @throws Error\ApiConnection + * @throws Error\Authentication + */ private function _requestRaw($method, $url, $params, $headers) { $myApiKey = $this->_apiKey; @@ -214,9 +336,9 @@ private function _requestRaw($method, $url, $params, $headers) if (!$myApiKey) { $msg = 'No API key provided. (HINT: set your API key using ' - .'"Stripe::setApiKey()". You can generate API keys from ' - .'the Stripe web interface. See https://stripe.com/api for ' - .'details, or email support@stripe.com if you have any questions.'; + . '"Stripe::setApiKey()". You can generate API keys from ' + . 'the Stripe web interface. See https://stripe.com/api for ' + . 'details, or email support@stripe.com if you have any questions.'; throw new Error\Authentication($msg); } @@ -239,6 +361,10 @@ private function _requestRaw($method, $url, $params, $headers) $defaultHeaders['Stripe-Account'] = Stripe::$accountId; } + if (Stripe::$enableTelemetry && self::$requestTelemetry != null) { + $defaultHeaders["X-Stripe-Client-Telemetry"] = self::_telemetryJson(self::$requestTelemetry); + } + $hasFile = false; $hasCurlFile = class_exists('\CURLFile', false); foreach ($params as $k => $v) { @@ -260,9 +386,11 @@ private function _requestRaw($method, $url, $params, $headers) $rawHeaders = []; foreach ($combinedHeaders as $header => $value) { - $rawHeaders[] = $header.': '.$value; + $rawHeaders[] = $header . ': ' . $value; } + $requestStartMs = Util\Util::currentTimeMillis(); + list($rbody, $rcode, $rheaders) = $this->httpClient()->request( $method, $absUrl, @@ -270,9 +398,24 @@ private function _requestRaw($method, $url, $params, $headers) $params, $hasFile ); + + if (array_key_exists('request-id', $rheaders)) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + return [$rbody, $rcode, $rheaders, $myApiKey]; } + /** + * @param resource $resource + * @param bool $hasCurlFile + * + * @return \CURLFile|string + * @throws Error\Api + */ private function _processResourceParam($resource, $hasCurlFile) { if (get_resource_type($resource) !== 'stream') { @@ -296,13 +439,33 @@ private function _processResourceParam($resource, $hasCurlFile) } } + /** + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * + * @return mixed + * @throws Error\Api + * @throws Error\Authentication + * @throws Error\Card + * @throws Error\InvalidRequest + * @throws Error\OAuth\InvalidClient + * @throws Error\OAuth\InvalidGrant + * @throws Error\OAuth\InvalidRequest + * @throws Error\OAuth\InvalidScope + * @throws Error\OAuth\UnsupportedGrantType + * @throws Error\OAuth\UnsupportedResponseType + * @throws Error\Permission + * @throws Error\RateLimit + * @throws Error\Idempotency + */ private function _interpretResponse($rbody, $rcode, $rheaders) { $resp = json_decode($rbody, true); $jsonError = json_last_error(); if ($resp === null && $jsonError !== JSON_ERROR_NONE) { $msg = "Invalid response body from API: $rbody " - ."(HTTP response code was $rcode, json_last_error() was $jsonError)"; + . "(HTTP response code was $rcode, json_last_error() was $jsonError)"; throw new Error\Api($msg, $rcode, $rbody); } @@ -312,11 +475,29 @@ private function _interpretResponse($rbody, $rcode, $rheaders) return $resp; } + /** + * @static + * + * @param HttpClient\ClientInterface $client + */ public static function setHttpClient($client) { self::$_httpClient = $client; } + /** + * @static + * + * Resets any stateful telemetry data + */ + public static function resetTelemetry() + { + self::$requestTelemetry = null; + } + + /** + * @return HttpClient\ClientInterface + */ private function httpClient() { if (!self::$_httpClient) { diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiResource.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResource.php similarity index 74% rename from public_html/extensions/default_stripe/core/lib/lib/ApiResource.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResource.php index 47b508915a..fe59432168 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiResource.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResource.php @@ -40,9 +40,8 @@ public function __set($k, $v) { parent::__set($k, $v); $v = $this->$k; - if ((static::getSavedNestedResources()->includes($k)) - && ($v instanceof ApiResource) - ) { + if ((static::getSavedNestedResources()->includes($k)) && + ($v instanceof ApiResource)) { $v->saveWithParent = true; } return $v; @@ -67,30 +66,6 @@ public function refresh() return $this; } - /** - * @return string The name of the class, with namespacing and underscores - * stripped. - */ - public static function className() - { - $class = get_called_class(); - // Useful for namespaces: Foo\Charge - if ($postfixNamespaces = strrchr($class, '\\')) { - $class = substr($postfixNamespaces, 1); - } - // Useful for underscored 'namespaces': Foo_Charge - if ($postfixFakeNamespaces = strrchr($class, '')) { - $class = $postfixFakeNamespaces; - } - if (substr($class, 0, strlen('Stripe')) == 'Stripe') { - $class = substr($class, strlen('Stripe')); - } - $class = str_replace('_', '', $class); - $name = urlencode($class); - $name = strtolower($name); - return $name; - } - /** * @return string The base URL for the given class. */ @@ -104,7 +79,9 @@ public static function baseUrl() */ public static function classUrl() { - $base = static::className(); + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bars". + $base = str_replace('.', '/', static::OBJECT_NAME); return "/v1/${base}s"; } @@ -116,7 +93,7 @@ public static function resourceUrl($id) if ($id === null) { $class = get_called_class(); $message = "Could not determine which URL to request: " - ."$class instance has invalid ID: $id"; + . "$class instance has invalid ID: $id"; throw new Error\InvalidRequest($message, null); } $id = Util\Util::utf8($id); diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApiResponse.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResponse.php similarity index 88% rename from public_html/extensions/default_stripe/core/lib/lib/ApiResponse.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResponse.php index bce3a98044..31f54a50df 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApiResponse.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApiResponse.php @@ -15,8 +15,8 @@ class ApiResponse public $code; /** - * @param string $body - * @param integer $code + * @param string $body + * @param integer $code * @param array|null $headers * @param array|null $json * diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApplePayDomain.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php similarity index 91% rename from public_html/extensions/default_stripe/core/lib/lib/ApplePayDomain.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php index 124c5dc063..ea84220a7a 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApplePayDomain.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplePayDomain.php @@ -9,6 +9,9 @@ */ class ApplePayDomain extends ApiResource { + + const OBJECT_NAME = "apple_pay_domain"; + use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Delete; diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApplicationFee.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php similarity index 53% rename from public_html/extensions/default_stripe/core/lib/lib/ApplicationFee.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php index ebc3cb35c9..49d2393dee 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApplicationFee.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFee.php @@ -5,25 +5,28 @@ /** * Class ApplicationFee * - * @property string $id - * @property string $object - * @property string $account - * @property int $amount - * @property int $amount_refunded - * @property string $application - * @property string $balance_transaction - * @property string $charge - * @property int $created - * @property string $currency - * @property bool $livemode - * @property string $originating_transaction - * @property bool $refunded + * @property string $id + * @property string $object + * @property string $account + * @property int $amount + * @property int $amount_refunded + * @property string $application + * @property string $balance_transaction + * @property string $charge + * @property int $created + * @property string $currency + * @property bool $livemode + * @property string $originating_transaction + * @property bool $refunded * @property Collection $refunds * * @package Stripe */ class ApplicationFee extends ApiResource { + + const OBJECT_NAME = "application_fee"; + use ApiOperations\All; use ApiOperations\NestedResource; use ApiOperations\Retrieve; @@ -31,18 +34,7 @@ class ApplicationFee extends ApiResource const PATH_REFUNDS = '/refunds'; /** - * This is a special case because the application fee endpoint has an - * underscore in it. The parent `className` function strips underscores. - * - * @return string The name of the class. - */ - public static function className() - { - return 'application_fee'; - } - - /** - * @param array|null $params + * @param array|null $params * @param array|string|null $opts * * @return ApplicationFee The refunded application fee. @@ -55,8 +47,8 @@ public function refund($params = null, $opts = null) } /** - * @param array|null $id The ID of the application fee on which to create the refund. - * @param array|null $params + * @param string|null $id The ID of the application fee on which to create the refund. + * @param array|null $params * @param array|string|null $opts * * @return ApplicationFeeRefund @@ -67,9 +59,9 @@ public static function createRefund($id, $params = null, $opts = null) } /** - * @param array|null $id The ID of the application fee to which the refund belongs. - * @param array|null $refundId The ID of the refund to retrieve. - * @param array|null $params + * @param string|null $id The ID of the application fee to which the refund belongs. + * @param array|null $refundId The ID of the refund to retrieve. + * @param array|null $params * @param array|string|null $opts * * @return ApplicationFeeRefund @@ -80,9 +72,9 @@ public static function retrieveRefund($id, $refundId, $params = null, $opts = nu } /** - * @param array|null $id The ID of the application fee to which the refund belongs. - * @param array|null $refundId The ID of the refund to update. - * @param array|null $params + * @param string|null $id The ID of the application fee to which the refund belongs. + * @param array|null $refundId The ID of the refund to update. + * @param array|null $params * @param array|string|null $opts * * @return ApplicationFeeRefund @@ -93,8 +85,8 @@ public static function updateRefund($id, $refundId, $params = null, $opts = null } /** - * @param array|null $id The ID of the application fee on which to retrieve the refunds. - * @param array|null $params + * @param string|null $id The ID of the application fee on which to retrieve the refunds. + * @param array|null $params * @param array|string|null $opts * * @return ApplicationFeeRefund diff --git a/public_html/extensions/default_stripe/core/lib/lib/ApplicationFeeRefund.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php similarity index 76% rename from public_html/extensions/default_stripe/core/lib/lib/ApplicationFeeRefund.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php index cc228b4139..91d7e9d2bc 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/ApplicationFeeRefund.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/ApplicationFeeRefund.php @@ -5,19 +5,22 @@ /** * Class ApplicationFeeRefund * - * @property string $id - * @property string $object - * @property int $amount - * @property string $balance_transaction - * @property int $created - * @property string $currency - * @property string $fee + * @property string $id + * @property string $object + * @property int $amount + * @property string $balance_transaction + * @property int $created + * @property string $currency + * @property string $fee * @property StripeObject $metadata * * @package Stripe */ class ApplicationFeeRefund extends ApiResource { + + const OBJECT_NAME = "fee_refund"; + use ApiOperations\Update { save as protected _save; } @@ -31,7 +34,7 @@ public function instanceUrl() $fee = $this['fee']; if (!$id) { throw new Error\InvalidRequest( - "Could not determine which URL to request: ". + "Could not determine which URL to request: " . "class instance has invalid ID: $id", null ); diff --git a/public_html/extensions/default_stripe/core/lib/lib/Balance.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Balance.php similarity index 68% rename from public_html/extensions/default_stripe/core/lib/lib/Balance.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Balance.php index b94e8586c9..25f88ae74c 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Balance.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Balance.php @@ -6,14 +6,18 @@ * Class Balance * * @property string $object - * @property array $available - * @property bool $livemode - * @property array $pending + * @property array $available + * @property array $connect_reserved + * @property bool $livemode + * @property array $pending * * @package Stripe */ class Balance extends SingletonApiResource { + + const OBJECT_NAME = "balance"; + /** * @param array|string|null $opts * diff --git a/public_html/extensions/default_stripe/core/lib/lib/BalanceTransaction.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php similarity index 72% rename from public_html/extensions/default_stripe/core/lib/lib/BalanceTransaction.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php index 546cd241c5..cd9b79ae67 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/BalanceTransaction.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BalanceTransaction.php @@ -7,15 +7,15 @@ * * @property string $id * @property string $object - * @property int $amount - * @property int $available_on - * @property int $created + * @property int $amount + * @property int $available_on + * @property int $created * @property string $currency * @property string $description - * @property float $exchange_rate - * @property int $fee - * @property mixed $fee_details - * @property int $net + * @property float $exchange_rate + * @property int $fee + * @property mixed $fee_details + * @property int $net * @property string $source * @property string $status * @property string $type @@ -24,6 +24,9 @@ */ class BalanceTransaction extends ApiResource { + + const OBJECT_NAME = "balance_transaction"; + use ApiOperations\All; use ApiOperations\Retrieve; diff --git a/public_html/extensions/default_stripe/core/lib/lib/BankAccount.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BankAccount.php similarity index 63% rename from public_html/extensions/default_stripe/core/lib/lib/BankAccount.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BankAccount.php index c8edc03f7f..019a4d87cb 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/BankAccount.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BankAccount.php @@ -5,26 +5,29 @@ /** * Class BankAccount * - * @property string $id - * @property string $object - * @property string $account - * @property string $account_holder_name - * @property string $account_holder_type - * @property string $bank_name - * @property string $country - * @property string $currency - * @property string $customer - * @property bool $default_for_currency - * @property string $fingerprint - * @property string $last4 + * @property string $id + * @property string $object + * @property string $account + * @property string $account_holder_name + * @property string $account_holder_type + * @property string $bank_name + * @property string $country + * @property string $currency + * @property string $customer + * @property bool $default_for_currency + * @property string $fingerprint + * @property string $last4 * @property StripeObject $metadata - * @property string $routing_number - * @property string $status + * @property string $routing_number + * @property string $status * * @package Stripe */ class BankAccount extends ApiResource { + + const OBJECT_NAME = "bank_account"; + use ApiOperations\Delete; use ApiOperations\Update; @@ -52,43 +55,43 @@ public function instanceUrl() } /** - * @param array|string $_id + * @param array|string $_id * @param array|string|null $_opts * * @throws \Stripe\Error\InvalidRequest */ public static function retrieve($_id, $_opts = null) { - $msg = "Bank accounts cannot be accessed without a customer ID or account ID. ". - "Retrieve a bank account using \$customer->sources->retrieve('bank_account_id') or ". - "\$account->external_accounts->retrieve('bank_account_id') instead."; + $msg = "Bank accounts cannot be accessed without a customer ID or account ID. " . + "Retrieve a bank account using \$customer->sources->retrieve('bank_account_id') or " . + "\$account->external_accounts->retrieve('bank_account_id') instead."; throw new Error\InvalidRequest($msg, null); } /** - * @param string $_id - * @param array|null $_params + * @param string $_id + * @param array|null $_params * @param array|string|null $_options * * @throws \Stripe\Error\InvalidRequest */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Bank accounts cannot be accessed without a customer ID or account ID. ". - "Call save() on \$customer->sources->retrieve('bank_account_id') or ". - "\$account->external_accounts->retrieve('bank_account_id') instead."; + $msg = "Bank accounts cannot be accessed without a customer ID or account ID. " . + "Call save() on \$customer->sources->retrieve('bank_account_id') or " . + "\$account->external_accounts->retrieve('bank_account_id') instead."; throw new Error\InvalidRequest($msg, null); } - /** - * @param array|null $params + /** + * @param array|null $params * @param array|string|null $options * * @return BankAccount The verified bank account. */ public function verify($params = null, $options = null) { - $url = $this->instanceUrl().'/verify'; + $url = $this->instanceUrl() . '/verify'; list($response, $opts) = $this->_request('post', $url, $params, $options); $this->refreshFrom($response, $opts); return $this; diff --git a/public_html/extensions/default_stripe/core/lib/lib/BitcoinReceiver.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php similarity index 91% rename from public_html/extensions/default_stripe/core/lib/lib/BitcoinReceiver.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php index a26da5f3c5..b4cc5291b5 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/BitcoinReceiver.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinReceiver.php @@ -5,13 +5,16 @@ /** * Class BitcoinReceiver * - * @package Stripe + * @package Stripe * * @deprecated Bitcoin receivers are deprecated. Please use the sources API instead. - * @link https://stripe.com/docs/sources/bitcoin + * @link https://stripe.com/docs/sources/bitcoin */ class BitcoinReceiver extends ApiResource { + + const OBJECT_NAME = "bitcoin_receiver"; + use ApiOperations\All; use ApiOperations\Retrieve; diff --git a/public_html/extensions/default_stripe/core/lib/lib/BitcoinTransaction.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php similarity index 74% rename from public_html/extensions/default_stripe/core/lib/lib/BitcoinTransaction.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php index 6b8e542112..8269fd216e 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/BitcoinTransaction.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/BitcoinTransaction.php @@ -10,4 +10,5 @@ class BitcoinTransaction extends ApiResource { + const OBJECT_NAME = "bitcoin_transaction"; } diff --git a/public_html/extensions/default_stripe/core/lib/lib/Card.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Card.php similarity index 55% rename from public_html/extensions/default_stripe/core/lib/lib/Card.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Card.php index 6a8b1a1005..1a18fc5afb 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Card.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Card.php @@ -5,34 +5,42 @@ /** * Class Card * - * @property string $id - * @property string $object - * @property string $address_city - * @property string $address_country - * @property string $address_line1 - * @property string $address_line1_check - * @property string $address_line2 - * @property string $address_state - * @property string $address_zip - * @property string $address_zip_check - * @property string $brand - * @property string $country - * @property string $customer - * @property string $cvc_check - * @property string $dynamic_last4 - * @property int $exp_month - * @property int $exp_year - * @property string $fingerprint - * @property string $funding - * @property string $last4 + * @property string $id + * @property string $object + * @property string $account + * @property string $address_city + * @property string $address_country + * @property string $address_line1 + * @property string $address_line1_check + * @property string $address_line2 + * @property string $address_state + * @property string $address_zip + * @property string $address_zip_check + * @property string[] $available_payout_methods + * @property string $brand + * @property string $country + * @property string $currency + * @property string $customer + * @property string $cvc_check + * @property bool $default_for_currency + * @property string $dynamic_last4 + * @property int $exp_month + * @property int $exp_year + * @property string $fingerprint + * @property string $funding + * @property string $last4 * @property StripeObject $metadata - * @property string $name - * @property string $tokenization_method + * @property string $name + * @property string $recipient + * @property string $tokenization_method * * @package Stripe */ class Card extends ApiResource { + + const OBJECT_NAME = "card"; + use ApiOperations\Delete; use ApiOperations\Update; @@ -65,33 +73,33 @@ public function instanceUrl() } /** - * @param array|string $_id + * @param array|string $_id * @param array|string|null $_opts * * @throws \Stripe\Error\InvalidRequest */ public static function retrieve($_id, $_opts = null) { - $msg = "Cards cannot be accessed without a customer, recipient or account ID. ". - "Retrieve a card using \$customer->sources->retrieve('card_id'), ". - "\$recipient->cards->retrieve('card_id'), or"; - "\$account->external_accounts->retrieve('card_id') instead."; + $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . + "Retrieve a card using \$customer->sources->retrieve('card_id'), " . + "\$recipient->cards->retrieve('card_id'), or " . + "\$account->external_accounts->retrieve('card_id') instead."; throw new Error\InvalidRequest($msg, null); } /** - * @param string $_id - * @param array|null $_params + * @param string $_id + * @param array|null $_params * @param array|string|null $_options * * @throws \Stripe\Error\InvalidRequest */ public static function update($_id, $_params = null, $_options = null) { - $msg = "Cards cannot be accessed without a customer, recipient or account ID. ". - "Call save() on \$customer->sources->retrieve('card_id'), ". - "\$recipient->cards->retrieve('card_id'), or"; - "\$account->external_accounts->retrieve('card_id') instead."; + $msg = "Cards cannot be accessed without a customer, recipient or account ID. " . + "Call save() on \$customer->sources->retrieve('card_id'), " . + "\$recipient->cards->retrieve('card_id'), or " . + "\$account->external_accounts->retrieve('card_id') instead."; throw new Error\InvalidRequest($msg, null); } } diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Charge.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Charge.php new file mode 100644 index 0000000000..00288d6a5c --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Charge.php @@ -0,0 +1,194 @@ +instanceUrl() . '/refund'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return Charge The captured charge. + */ + public function capture($params = null, $options = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @deprecated Use the `save` method on the Dispute object + * + * @return array The updated dispute. + */ + public function updateDispute($params = null, $options = null) + { + $url = $this->instanceUrl() . '/dispute'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom(['dispute' => $response], $opts, true); + return $this->dispute; + } + + /** + * @param array|string|null $options + * + * @deprecated Use the `close` method on the Dispute object + * + * @return Charge The updated charge. + */ + public function closeDispute($options = null) + { + $url = $this->instanceUrl() . '/dispute/close'; + list($response, $opts) = $this->_request('post', $url, null, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|string|null $opts + * + * @return Charge The updated charge. + */ + public function markAsFraudulent($opts = null) + { + $params = ['fraud_details' => ['user_report' => 'fraudulent']]; + $url = $this->instanceUrl(); + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|string|null $opts + * + * @return Charge The updated charge. + */ + public function markAsSafe($opts = null) + { + $params = ['fraud_details' => ['user_report' => 'safe']]; + $url = $this->instanceUrl(); + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php new file mode 100644 index 0000000000..02e88f8d98 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Checkout/Session.php @@ -0,0 +1,20 @@ +data); + } + /** * @return Util\AutoPagingIterator An iterator that can be used to iterate * across all objects across all pages. As page boundaries are diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/CountrySpec.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/CountrySpec.php new file mode 100644 index 0000000000..668bfe62ed --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/CountrySpec.php @@ -0,0 +1,26 @@ +instanceUrl().'/subscription'; + $url = $this->instanceUrl() . '/subscription'; list($response, $opts) = $this->_request('post', $url, $params); $this->refreshFrom(['subscription' => $response], $opts, true); return $this->subscription; @@ -118,7 +124,7 @@ public function updateSubscription($params = null) */ public function cancelSubscription($params = null) { - $url = $this->instanceUrl().'/subscription'; + $url = $this->instanceUrl() . '/subscription'; list($response, $opts) = $this->_request('delete', $url, $params); $this->refreshFrom(['subscription' => $response], $opts, true); return $this->subscription; @@ -129,14 +135,14 @@ public function cancelSubscription($params = null) */ public function deleteDiscount() { - $url = $this->instanceUrl().'/discount'; + $url = $this->instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url); $this->refreshFrom(['discount' => null], $opts, true); } /** - * @param array|null $id The ID of the customer on which to create the source. - * @param array|null $params + * @param string|null $id The ID of the customer on which to create the source. + * @param array|null $params * @param array|string|null $opts * * @return ApiResource @@ -147,9 +153,9 @@ public static function createSource($id, $params = null, $opts = null) } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to retrieve. - * @param array|null $params + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to retrieve. + * @param array|null $params * @param array|string|null $opts * * @return ApiResource @@ -160,9 +166,9 @@ public static function retrieveSource($id, $sourceId, $params = null, $opts = nu } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to update. - * @param array|null $params + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to update. + * @param array|null $params * @param array|string|null $opts * * @return ApiResource @@ -173,9 +179,9 @@ public static function updateSource($id, $sourceId, $params = null, $opts = null } /** - * @param array|null $id The ID of the customer to which the source belongs. - * @param array|null $sourceId The ID of the source to delete. - * @param array|null $params + * @param string|null $id The ID of the customer to which the source belongs. + * @param string|null $sourceId The ID of the source to delete. + * @param array|null $params * @param array|string|null $opts * * @return ApiResource @@ -186,8 +192,8 @@ public static function deleteSource($id, $sourceId, $params = null, $opts = null } /** - * @param array|null $id The ID of the customer on which to retrieve the sources. - * @param array|null $params + * @param string|null $id The ID of the customer on which to retrieve the sources. + * @param array|null $params * @param array|string|null $opts * * @return ApiResource diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Discount.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Discount.php new file mode 100644 index 0000000000..a72d12bc6e --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Discount.php @@ -0,0 +1,21 @@ +instanceUrl() . '/close'; + list($response, $opts) = $this->_request('post', $url, null, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/core/lib/lib/EphemeralKey.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php similarity index 59% rename from public_html/extensions/default_stripe/core/lib/lib/EphemeralKey.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php index edf7d3ea77..5ed4646b4f 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/EphemeralKey.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/EphemeralKey.php @@ -7,34 +7,26 @@ * * @property string $id * @property string $object - * @property int $created - * @property int $expires - * @property bool $livemode + * @property int $created + * @property int $expires + * @property bool $livemode * @property string $secret - * @property array $associated_objects + * @property array $associated_objects * * @package Stripe */ class EphemeralKey extends ApiResource { + + const OBJECT_NAME = "ephemeral_key"; + use ApiOperations\Create { create as protected _create; } use ApiOperations\Delete; /** - * This is a special case because the ephemeral key endpoint has an - * underscore in it. The parent `className` function strips underscores. - * - * @return string The name of the class. - */ - public static function className() - { - return 'ephemeral_key'; - } - - /** - * @param array|null $params + * @param array|null $params * @param array|string|null $opts * * @return EphemeralKey The created key. diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Api.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Api.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Api.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Api.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/ApiConnection.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/ApiConnection.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/ApiConnection.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/ApiConnection.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Authentication.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Authentication.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Authentication.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Authentication.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Base.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Base.php similarity index 98% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Base.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Base.php index 376cad798f..c0051e6a41 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Error/Base.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Base.php @@ -61,7 +61,7 @@ public function getRequestId() public function __toString() { - $id = $this->requestId ? " from API request '{$this->requestId}'" : ""; + $id = $this->requestId ? " from API request '{$this->requestId}'": ""; $message = explode("\n", parent::__toString()); $message[0] .= $id; return implode("\n", $message); diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Card.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Card.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Card.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Card.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Idempotency.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Idempotency.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Idempotency.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Idempotency.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/InvalidRequest.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/InvalidRequest.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/InvalidRequest.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/InvalidRequest.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidClient.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidClient.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidClient.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidGrant.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidGrant.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidGrant.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidGrant.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidRequest.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidRequest.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidRequest.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidRequest.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidScope.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidScope.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/InvalidScope.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/InvalidScope.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/OAuthBase.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php similarity index 86% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/OAuthBase.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php index 2f1721331c..03ada1c7b4 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/OAuthBase.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/OAuthBase.php @@ -13,11 +13,11 @@ public function __construct( $httpHeaders = null ) { parent::__construct($description, $httpStatus, $httpBody, $jsonBody, $httpHeaders); - $this->code = $code; + $this->errorCode = $code; } public function getErrorCode() { - return $this->code; + return $this->errorCode; } } diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/UnsupportedGrantType.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/UnsupportedGrantType.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedGrantType.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/UnsupportedResponseType.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedResponseType.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/OAuth/UnsupportedResponseType.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/OAuth/UnsupportedResponseType.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/Permission.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Permission.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/Permission.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/Permission.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/RateLimit.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/RateLimit.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/RateLimit.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/RateLimit.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Error/SignatureVerification.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/SignatureVerification.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Error/SignatureVerification.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Error/SignatureVerification.php diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Event.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Event.php new file mode 100644 index 0000000000..319cc9db0c --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Event.php @@ -0,0 +1,151 @@ +apiBase)) { + $opts->apiBase = Stripe::$apiUploadBase; + } + return static::_create($params, $opts); + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/FileLink.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/FileLink.php new file mode 100644 index 0000000000..2a012b3610 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/FileLink.php @@ -0,0 +1,29 @@ +defaultOptions = $defaultOptions; $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); $this->initUserAgentInfo(); + + // TODO: curl_reset requires PHP >= 5.5.0. Once we drop support for PHP 5.4, we can simply + // initialize this to true. + $this->enablePersistentConnections = function_exists('curl_reset'); + } + + public function __destruct() + { + $this->closeCurlHandle(); } public function initUserAgentInfo() { $curlVersion = curl_version(); $this->userAgentInfo = [ - 'httplib' => 'curl '.$curlVersion['version'], - 'ssllib' => $curlVersion['ssl_version'], + 'httplib' => 'curl ' . $curlVersion['version'], + 'ssllib' => $curlVersion['ssl_version'], ]; } @@ -78,6 +94,22 @@ public function getUserAgentInfo() return $this->userAgentInfo; } + /** + * @return boolean + */ + public function getEnablePersistentConnections() + { + return $this->enablePersistentConnections; + } + + /** + * @param boolean $enable + */ + public function setEnablePersistentConnections($enable) + { + $this->enablePersistentConnections = $enable; + } + // USER DEFINED TIMEOUTS const DEFAULT_TIMEOUT = 80; @@ -88,13 +120,13 @@ public function getUserAgentInfo() public function setTimeout($seconds) { - $this->timeout = (int)max($seconds, 0); + $this->timeout = (int) max($seconds, 0); return $this; } public function setConnectTimeout($seconds) { - $this->connectTimeout = (int)max($seconds, 0); + $this->connectTimeout = (int) max($seconds, 0); return $this; } @@ -124,6 +156,8 @@ public function request($method, $absUrl, $headers, $params, $hasFile) $opts = $this->defaultOptions; } + $params = Util\Util::objectsToIds($params); + if ($method == 'get') { if ($hasFile) { throw new Error\Api( @@ -132,16 +166,16 @@ public function request($method, $absUrl, $headers, $params, $hasFile) } $opts[CURLOPT_HTTPGET] = 1; if (count($params) > 0) { - $encoded = Util\Util::urlEncode($params); + $encoded = Util\Util::encodeParameters($params); $absUrl = "$absUrl?$encoded"; } } elseif ($method == 'post') { $opts[CURLOPT_POST] = 1; - $opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::urlEncode($params); + $opts[CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); } elseif ($method == 'delete') { $opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; if (count($params) > 0) { - $encoded = Util\Util::urlEncode($params); + $encoded = Util\Util::encodeParameters($params); $absUrl = "$absUrl?$encoded"; } } else { @@ -152,12 +186,12 @@ public function request($method, $absUrl, $headers, $params, $hasFile) // add an Idempotency-Key header if (($method == 'post') && (Stripe::$maxNetworkRetries > 0)) { if (!isset($headers['Idempotency-Key'])) { - array_push($headers, 'Idempotency-Key: '.$this->randomGenerator->uuid()); + array_push($headers, 'Idempotency-Key: ' . $this->randomGenerator->uuid()); } } // Create a callback to capture HTTP headers for the response - $rheaders = []; + $rheaders = new Util\CaseInsensitiveArray(); $headerCallback = function ($curl, $header_line) use (&$rheaders) { // Ignore the HTTP request line (HTTP/1.1 200 OK) if (strpos($header_line, ":") === false) { @@ -194,6 +228,11 @@ public function request($method, $absUrl, $headers, $params, $hasFile) $opts[CURLOPT_SSL_VERIFYPEER] = false; } + if (!isset($opts[CURLOPT_HTTP_VERSION])) { + // For HTTPS requests, enable HTTP/2, if supported + $opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2TLS; + } + list($rbody, $rcode) = $this->executeRequestWithRetries($opts, $absUrl); return [$rbody, $rcode, $rheaders]; @@ -210,17 +249,19 @@ private function executeRequestWithRetries($opts, $absUrl) $rcode = 0; $errno = 0; - $curl = curl_init(); - curl_setopt_array($curl, $opts); - $rbody = curl_exec($curl); + $this->resetCurlHandle(); + curl_setopt_array($this->curlHandle, $opts); + $rbody = curl_exec($this->curlHandle); if ($rbody === false) { - $errno = curl_errno($curl); - $message = curl_error($curl); + $errno = curl_errno($this->curlHandle); + $message = curl_error($this->curlHandle); } else { - $rcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + $rcode = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); } - curl_close($curl); if ($this->shouldRetry($errno, $rcode, $numRetries)) { $numRetries += 1; @@ -240,10 +281,9 @@ private function executeRequestWithRetries($opts, $absUrl) /** * @param string $url - * @param int $errno + * @param int $errno * @param string $message - * @param int $numRetries - * + * @param int $numRetries * @throws Error\ApiConnection */ private function handleCurlError($url, $errno, $message, $numRetries) @@ -253,20 +293,20 @@ private function handleCurlError($url, $errno, $message, $numRetries) case CURLE_COULDNT_RESOLVE_HOST: case CURLE_OPERATION_TIMEOUTED: $msg = "Could not connect to Stripe ($url). Please check your " - ."internet connection and try again. If this problem persists, " - ."you should check Stripe's service status at " - ."https://twitter.com/stripestatus, or"; + . "internet connection and try again. If this problem persists, " + . "you should check Stripe's service status at " + . "https://twitter.com/stripestatus, or"; break; case CURLE_SSL_CACERT: case CURLE_SSL_PEER_CERTIFICATE: $msg = "Could not verify Stripe's SSL certificate. Please make sure " - ."that your network is not intercepting certificates. " - ."(Try going to $url in your browser.) " - ."If this problem persists,"; + . "that your network is not intercepting certificates. " + . "(Try going to $url in your browser.) " + . "If this problem persists,"; break; default: $msg = "Unexpected error communicating with Stripe. " - ."If this problem persists,"; + . "If this problem persists,"; } $msg .= " let us know at support@stripe.com."; @@ -283,11 +323,9 @@ private function handleCurlError($url, $errno, $message, $numRetries) * Checks if an error is a problem that we should retry on. This includes both * socket errors that may represent an intermittent problem and some special * HTTP statuses. - * * @param int $errno * @param int $rcode * @param int $numRetries - * * @return bool */ private function shouldRetry($errno, $rcode, $numRetries) @@ -335,4 +373,37 @@ private function sleepTime($numRetries) return $sleepSeconds; } + + /** + * Initializes the curl handle. If already initialized, the handle is closed first. + */ + private function initCurlHandle() + { + $this->closeCurlHandle(); + $this->curlHandle = curl_init(); + } + + /** + * Closes the curl handle if initialized. Do nothing if already closed. + */ + private function closeCurlHandle() + { + if (!is_null($this->curlHandle)) { + curl_close($this->curlHandle); + $this->curlHandle = null; + } + } + + /** + * Resets the curl handle. If the handle is not already initialized, or if persistent + * connections are disabled, the handle is reinitialized instead. + */ + private function resetCurlHandle() + { + if (!is_null($this->curlHandle) && $this->getEnablePersistentConnections()) { + curl_reset($this->curlHandle); + } else { + $this->initCurlHandle(); + } + } } diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Invoice.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Invoice.php new file mode 100644 index 0000000000..e5b16f37a0 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Invoice.php @@ -0,0 +1,151 @@ +instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The uncollectible invoice. + */ + public function markUncollectible($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/mark_uncollectible'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The paid invoice. + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The sent invoice. + */ + public function sendInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/send'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The upcoming invoice. + */ + public static function upcoming($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + return $obj; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return Invoice The voided invoice. + */ + public function voidInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php new file mode 100644 index 0000000000..1401564bcc --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/InvoiceItem.php @@ -0,0 +1,39 @@ +instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return Authorization The declined authorization. + */ + public function decline($params = null, $options = null) + { + $url = $this->instanceUrl() . '/decline'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php new file mode 100644 index 0000000000..60cc5b4e1b --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/Card.php @@ -0,0 +1,51 @@ +instanceUrl() . '/details'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php new file mode 100644 index 0000000000..65d3919caa --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Issuing/CardDetails.php @@ -0,0 +1,21 @@ +)". You can find your client_ids ' - .'in your Stripe dashboard at ' - .'https://dashboard.stripe.com/account/applications/settings, ' - .'after registering your account as a platform. See ' - .'https://stripe.com/docs/connect/standard-accounts for details, ' - .'or email support@stripe.com if you have any questions.'; + . '"Stripe::setClientId()". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; throw new Error\Authentication($msg); } return $clientId; diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Order.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Order.php new file mode 100644 index 0000000000..06c4ad3466 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Order.php @@ -0,0 +1,64 @@ +instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @return OrderReturn The newly created return. + */ + public function returnOrder($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/returns'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + return Util\Util::convertToStripeObject($response, $opts); + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/OrderItem.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/OrderItem.php new file mode 100644 index 0000000000..26d49b4e75 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/OrderItem.php @@ -0,0 +1,22 @@ +instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return PaymentIntent The captured payment intent. + */ + public function capture($params = null, $options = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return PaymentIntent The confirmed payment intent. + */ + public function confirm($params = null, $options = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Payout.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Payout.php new file mode 100644 index 0000000000..daef97ff9f --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Payout.php @@ -0,0 +1,69 @@ +instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Person.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Person.php new file mode 100644 index 0000000000..500f4915b9 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Person.php @@ -0,0 +1,93 @@ +retrievePerson('person_id') instead."; + throw new Error\InvalidRequest($msg, null); + } + + /** + * @param string $_id + * @param array|null $_params + * @param array|string|null $_options + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = "Persons cannot be accessed without an account ID. " . + "Retrieve a Person using \$account->retrievePerson('person_id') instead."; + throw new Error\InvalidRequest($msg, null); + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Plan.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Plan.php new file mode 100644 index 0000000000..54a2b58eb3 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Plan.php @@ -0,0 +1,40 @@ +requestId = $requestId; + $this->requestDuration = $requestDuration; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Review.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Review.php new file mode 100644 index 0000000000..2698b37fcc --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Review.php @@ -0,0 +1,44 @@ +instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SKU.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SKU.php new file mode 100644 index 0000000000..5b50df8a84 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SKU.php @@ -0,0 +1,35 @@ +instanceUrl().'/source_transactions'; + $url = $this->instanceUrl() . '/source_transactions'; list($response, $opts) = $this->_request('get', $url, $params, $options); $obj = Util\Util::convertToStripeObject($response, $opts); $obj->setLastResponse($response); @@ -94,14 +138,14 @@ public function sourceTransactions($params = null, $options = null) } /** - * @param array|null $params + * @param array|null $params * @param array|string|null $options * * @return Source The verified source. */ public function verify($params = null, $options = null) { - $url = $this->instanceUrl().'/verify'; + $url = $this->instanceUrl() . '/verify'; list($response, $opts) = $this->_request('post', $url, $params, $options); $this->refreshFrom($response, $opts); return $this; diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php new file mode 100644 index 0000000000..018a896240 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SourceTransaction.php @@ -0,0 +1,23 @@ +includes($k)) { throw new \InvalidArgumentException( - "Cannot set $k on this object. HINT: you can't set: ". + "Cannot set $k on this object. HINT: you can't set: " . join(', ', static::getPermanentAttributes()->toArray()) ); } @@ -153,23 +153,21 @@ public function &__get($k) $nullval = null; if (!empty($this->_values) && array_key_exists($k, $this->_values)) { return $this->_values[$k]; + } else if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { + $class = get_class($this); + $attrs = join(', ', array_keys($this->_values)); + $message = "Stripe Notice: Undefined property of $class instance: $k. " + . "HINT: The $k attribute was set in the past, however. " + . "It was then wiped when refreshing the object " + . "with the result returned by Stripe's API, " + . "probably as a result of a save(). The attributes currently " + . "available on this object are: $attrs"; + Stripe::getLogger()->error($message); + return $nullval; } else { - if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { - $class = get_class($this); - $attrs = join(', ', array_keys($this->_values)); - $message = "Stripe Notice: Undefined property of $class instance: $k. " - ."HINT: The $k attribute was set in the past, however. " - ."It was then wiped when refreshing the object " - ."with the result returned by Stripe's API, " - ."probably as a result of a save(). The attributes currently " - ."available on this object are: $attrs"; - Stripe::getLogger()->error($message); - return $nullval; - } else { - $class = get_class($this); - Stripe::getLogger()->error("Stripe Notice: Undefined property of $class instance: $k"); - return $nullval; - } + $class = get_class($this); + Stripe::getLogger()->error("Stripe Notice: Undefined property of $class instance: $k"); + return $nullval; } } @@ -219,10 +217,10 @@ public function values() /** * This unfortunately needs to be public to be used in Util\Util * - * @param array $values + * @param array $values * @param null|string|array|Util\RequestOptions $opts * - * @return StripeObject The object constructed from the given values. + * @return static The object constructed from the given values. */ public static function constructFrom($values, $opts = null) { @@ -234,9 +232,9 @@ public static function constructFrom($values, $opts = null) /** * Refreshes this object using the provided values. * - * @param array $values + * @param array $values * @param null|string|array|Util\RequestOptions $opts - * @param boolean $partial Defaults to false. + * @param boolean $partial Defaults to false. */ public function refreshFrom($values, $opts, $partial = false) { @@ -271,9 +269,9 @@ public function refreshFrom($values, $opts, $partial = false) /** * Mass assigns attributes on the model. * - * @param array $values + * @param array $values * @param null|string|array|Util\RequestOptions $opts - * @param boolean $dirty Defaults to true. + * @param boolean $dirty Defaults to true. */ public function updateAttributes($values, $opts = null, $dirty = true) { @@ -336,6 +334,7 @@ function ($v) { return $updateParams; } + public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) { // The logic here is that essentially any object embedded in another @@ -369,8 +368,8 @@ public function serializeParamsValue($value, $original, $unsaved, $force, $key = return $value; } else { throw new \InvalidArgumentException( - "Cannot save property `$key` containing an API resource of type ". - get_class($value).". It doesn't appear to be persisted and is ". + "Cannot save property `$key` containing an API resource of type " . + get_class($value) . ". It doesn't appear to be persisted and is " . "not marked as `saveWithParent`." ); } @@ -413,7 +412,7 @@ public function __toJSON() public function __toString() { $class = get_class($this); - return $class.' JSON: '.$this->__toJSON(); + return $class . ' JSON: ' . $this->__toJSON(); } public function __toArray($recursive = false) @@ -484,7 +483,7 @@ public static function emptyValues($obj) $values = $obj->_values; } else { throw new \InvalidArgumentException( - "empty_values got got unexpected object type: ".get_class($obj) + "empty_values got got unexpected object type: " . get_class($obj) ); } $update = array_fill_keys(array_keys($values), ""); @@ -500,12 +499,25 @@ public function getLastResponse() } /** - * @param ApiResponse + * Sets the last response from the Stripe API * - * @return void Set the last response from the Stripe API + * @param ApiResponse $resp + * @return void */ public function setLastResponse($resp) { $this->_lastResponse = $resp; } + + /** + * Indicates whether or not the resource has been deleted on the server. + * Note that some, but not all, resources can indicate whether they have + * been deleted. + * + * @return bool Whether the resource is deleted. + */ + public function isDeleted() + { + return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; + } } diff --git a/public_html/extensions/default_stripe/core/lib/lib/Subscription.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Subscription.php similarity index 57% rename from public_html/extensions/default_stripe/core/lib/lib/Subscription.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Subscription.php index 7073a119c6..82aac8e1e9 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Subscription.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Subscription.php @@ -5,34 +5,42 @@ /** * Class Subscription * - * @property string $id - * @property string $object - * @property float $application_fee_percent - * @property string $billing - * @property bool $cancel_at_period_end - * @property int $canceled_at - * @property int $created - * @property int current_period_end - * @property int current_period_start - * @property string $customer - * @property int $days_until_due - * @property mixed $discount - * @property int $ended_at - * @property Collection $items - * @property boolean $livemode + * @property string $id + * @property string $object + * @property float $application_fee_percent + * @property string $billing + * @property int $billing_cycle_anchor + * @property mixed $billing_thresholds + * @property bool $cancel_at_period_end + * @property int $canceled_at + * @property int $created + * @property int $current_period_end + * @property int $current_period_start + * @property string $customer + * @property int $days_until_due + * @property string $default_source + * @property Discount $discount + * @property int $ended_at + * @property Collection $items + * @property string $latest_invoice + * @property boolean $livemode * @property StripeObject $metadata - * @property Plan $plan - * @property int $quantity - * @property int $start - * @property string $status - * @property float $tax_percent - * @property int $trial_end - * @property int $trial_start + * @property Plan $plan + * @property int $quantity + * @property SubscriptionSchedule $schedule + * @property int $start + * @property string $status + * @property float $tax_percent + * @property int $trial_end + * @property int $trial_start * * @package Stripe */ class Subscription extends ApiResource { + + const OBJECT_NAME = "subscription"; + use ApiOperations\All; use ApiOperations\Create; use ApiOperations\Delete { @@ -46,11 +54,11 @@ class Subscription extends ApiResource * * @link https://stripe.com/docs/api#subscription_object-status */ - const STATUS_ACTIVE = 'active'; + const STATUS_ACTIVE = 'active'; const STATUS_CANCELED = 'canceled'; const STATUS_PAST_DUE = 'past_due'; const STATUS_TRIALING = 'trialing'; - const STATUS_UNPAID = 'unpaid'; + const STATUS_UNPAID = 'unpaid'; public static function getSavedNestedResources() { @@ -78,7 +86,7 @@ public function cancel($params = null, $opts = null) */ public function deleteDiscount() { - $url = $this->instanceUrl().'/discount'; + $url = $this->instanceUrl() . '/discount'; list($response, $opts) = $this->_request('delete', $url); $this->refreshFrom(['discount' => null], $opts, true); } diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php new file mode 100644 index 0000000000..22ed8a1d97 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionItem.php @@ -0,0 +1,44 @@ +instanceUrl() . '/usage_record_summaries'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php new file mode 100644 index 0000000000..b8eae1c2c4 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionSchedule.php @@ -0,0 +1,111 @@ +instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $opts + * + * @return SubscriptionSchedule The released subscription schedule. + */ + public function release($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/release'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + return $this; + } + + /** + * @param array|null $params + * @param array|string|null $options + * + * @return Collection The list of subscription schedule revisions. + */ + public function revisions($params = null, $options = null) + { + $url = $this->instanceUrl() . '/revisions'; + list($response, $opts) = $this->_request('get', $url, $params, $options); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + return $obj; + } + + /** + * @param array|null $id The ID of the subscription schedule to which the person belongs. + * @param array|null $personId The ID of the person to retrieve. + * @param array|null $params + * @param array|string|null $opts + * + * @return Revision + */ + public static function retrieveRevision($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REVISIONS, $personId, $params, $opts); + } + + /** + * @param array|null $id The ID of the subscription schedule on which to retrieve the persons. + * @param array|null $params + * @param array|string|null $opts + * + * @return Revision + */ + public static function allRevisions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REVISIONS, $params, $opts); + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php new file mode 100644 index 0000000000..1217723653 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/SubscriptionScheduleRevision.php @@ -0,0 +1,77 @@ +retrieveRevision('revision_id') instead."; + throw new Error\InvalidRequest($msg, null); + } + + /** + * @param array|string $_id + * @param array|string|null $_opts + * + * @throws \Stripe\Error\InvalidRequest + */ + public static function all($params = null, $opts = null) + { + $msg = "Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. " . + "List those using \$schedule->allRevisions('revision_id') instead."; + throw new Error\InvalidRequest($msg, null); + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php new file mode 100644 index 0000000000..92a5b997b9 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Terminal/ConnectionToken.php @@ -0,0 +1,17 @@ +instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $options); + $this->refreshFrom($response, $opts); + return $this; + } +} diff --git a/public_html/extensions/default_stripe/core/lib/lib/Transfer.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Transfer.php similarity index 59% rename from public_html/extensions/default_stripe/core/lib/lib/Transfer.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Transfer.php index 2581e69431..5a173fad2c 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Transfer.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Transfer.php @@ -5,27 +5,31 @@ /** * Class Transfer * - * @property string $id - * @property string $object - * @property int $amount - * @property int $amount_reversed - * @property string $balance_transaction - * @property int $created - * @property string $currency - * @property string $destination - * @property string $destination_payment - * @property bool $livemode + * @property string $id + * @property string $object + * @property int $amount + * @property int $amount_reversed + * @property string $balance_transaction + * @property int $created + * @property string $currency + * @property string $description + * @property string $destination + * @property string $destination_payment + * @property bool $livemode * @property StripeObject $metadata - * @property Collection $reversals - * @property bool $reversed - * @property string $source_transaction - * @property string $source_type - * @property string $transfer_group + * @property Collection $reversals + * @property bool $reversed + * @property string $source_transaction + * @property string $source_type + * @property string $transfer_group * * @package Stripe */ class Transfer extends ApiResource { + + const OBJECT_NAME = "transfer"; + use ApiOperations\All; use ApiOperations\Create; use ApiOperations\NestedResource; @@ -39,7 +43,7 @@ class Transfer extends ApiResource */ public function reverse($params = null, $opts = null) { - $url = $this->instanceUrl().'/reversals'; + $url = $this->instanceUrl() . '/reversals'; list($response, $opts) = $this->_request('post', $url, $params, $opts); $this->refreshFrom($response, $opts); return $this; @@ -50,15 +54,15 @@ public function reverse($params = null, $opts = null) */ public function cancel() { - $url = $this->instanceUrl().'/cancel'; + $url = $this->instanceUrl() . '/cancel'; list($response, $opts) = $this->_request('post', $url); $this->refreshFrom($response, $opts); return $this; } /** - * @param array|null $id The ID of the transfer on which to create the reversal. - * @param array|null $params + * @param string|null $id The ID of the transfer on which to create the reversal. + * @param array|null $params * @param array|string|null $opts * * @return TransferReversal @@ -69,9 +73,9 @@ public static function createReversal($id, $params = null, $opts = null) } /** - * @param array|null $id The ID of the transfer to which the reversal belongs. - * @param array|null $reversalId The ID of the reversal to retrieve. - * @param array|null $params + * @param string|null $id The ID of the transfer to which the reversal belongs. + * @param array|null $reversalId The ID of the reversal to retrieve. + * @param array|null $params * @param array|string|null $opts * * @return TransferReversal @@ -82,9 +86,9 @@ public static function retrieveReversal($id, $reversalId, $params = null, $opts } /** - * @param array|null $id The ID of the transfer to which the reversal belongs. - * @param array|null $reversalId The ID of the reversal to update. - * @param array|null $params + * @param string|null $id The ID of the transfer to which the reversal belongs. + * @param array|null $reversalId The ID of the reversal to update. + * @param array|null $params * @param array|string|null $opts * * @return TransferReversal @@ -95,8 +99,8 @@ public static function updateReversal($id, $reversalId, $params = null, $opts = } /** - * @param array|null $id The ID of the transfer on which to retrieve the reversals. - * @param array|null $params + * @param string|null $id The ID of the transfer on which to retrieve the reversals. + * @param array|null $params * @param array|string|null $opts * * @return TransferReversal diff --git a/public_html/extensions/default_stripe/core/lib/lib/TransferReversal.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/TransferReversal.php similarity index 72% rename from public_html/extensions/default_stripe/core/lib/lib/TransferReversal.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/TransferReversal.php index 2a4cfa710d..c945e5a936 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/TransferReversal.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/TransferReversal.php @@ -5,19 +5,24 @@ /** * Class TransferReversal * - * @property string $id - * @property string $object - * @property int $amount - * @property string $balance_transaction - * @property int $created - * @property string $currency + * @property string $id + * @property string $object + * @property int $amount + * @property string $balance_transaction + * @property int $created + * @property string $currency + * @property string $destination_payment_refund * @property StripeObject $metadata - * @property string $transfer + * @property string $source_refund + * @property string $transfer * * @package Stripe */ class TransferReversal extends ApiResource { + + const OBJECT_NAME = "transfer_reversal"; + use ApiOperations\Update { save as protected _save; } @@ -31,7 +36,7 @@ public function instanceUrl() $transfer = $this['transfer']; if (!$id) { throw new Error\InvalidRequest( - "Could not determine which URL to request: ". + "Could not determine which URL to request: " . "class instance has invalid ID: $id", null ); diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecord.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecord.php new file mode 100644 index 0000000000..a9e3a25e3e --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecord.php @@ -0,0 +1,44 @@ +json, $opts); + $obj->setLastResponse($response); + return $obj; + } +} diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php new file mode 100644 index 0000000000..b8f4aebe97 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/UsageRecordSummary.php @@ -0,0 +1,22 @@ +container = array_map("strtolower", $initial_array); + } + + public function offsetSet($offset, $value) + { + $offset = static::maybeLowercase($offset); + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + public function offsetExists($offset) + { + $offset = static::maybeLowercase($offset); + return isset($this->container[$offset]); + } + + public function offsetUnset($offset) + { + $offset = static::maybeLowercase($offset); + unset($this->container[$offset]); + } + + public function offsetGet($offset) + { + $offset = static::maybeLowercase($offset); + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + private static function maybeLowercase($v) + { + if (is_string($v)) { + return strtolower($v); + } else { + return $v; + } + } +} diff --git a/public_html/extensions/default_stripe/core/lib/lib/Util/DefaultLogger.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Util/DefaultLogger.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php diff --git a/public_html/extensions/default_stripe/core/lib/lib/Util/LoggerInterface.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php similarity index 96% rename from public_html/extensions/default_stripe/core/lib/lib/Util/LoggerInterface.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php index a064c657fa..bbdfc92998 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Util/LoggerInterface.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/LoggerInterface.php @@ -29,8 +29,7 @@ interface LoggerInterface * be logged and monitored. * * @param string $message - * @param array $context - * + * @param array $context * @return null */ public function error($message, array $context = []); diff --git a/public_html/extensions/default_stripe/core/lib/lib/Util/RandomGenerator.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php similarity index 99% rename from public_html/extensions/default_stripe/core/lib/lib/Util/RandomGenerator.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php index 576b9199e1..470f2bce8b 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Util/RandomGenerator.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RandomGenerator.php @@ -12,7 +12,6 @@ class RandomGenerator * Returns a random value between 0 and $max. * * @param float $max (optional) - * * @return float */ public function randFloat($max = 1.0) diff --git a/public_html/extensions/default_stripe/core/lib/lib/Util/RequestOptions.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RequestOptions.php similarity index 76% rename from public_html/extensions/default_stripe/core/lib/lib/Util/RequestOptions.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RequestOptions.php index f81313dec3..495236224d 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Util/RequestOptions.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/RequestOptions.php @@ -16,17 +16,18 @@ class RequestOptions public $headers; public $apiKey; + public $apiBase; - public function __construct($key = null, $headers = []) + public function __construct($key = null, $headers = [], $base = null) { $this->apiKey = $key; $this->headers = $headers; + $this->apiBase = $base; } /** * Unpacks an options array and merges it into the existing RequestOptions * object. - * * @param array|string|null $options a key => value array * * @return RequestOptions @@ -37,6 +38,9 @@ public function merge($options) if ($other_options->apiKey === null) { $other_options->apiKey = $this->apiKey; } + if ($other_options->apiBase === null) { + $other_options->apiBase = $this->apiBase; + } $other_options->headers = array_merge($this->headers, $other_options->headers); return $other_options; } @@ -55,7 +59,6 @@ public function discardNonPersistentHeaders() /** * Unpacks an options array into an RequestOptions object - * * @param array|string|null $options a key => value array * * @return RequestOptions @@ -67,16 +70,17 @@ public static function parse($options) } if (is_null($options)) { - return new RequestOptions(null, []); + return new RequestOptions(null, [], null); } if (is_string($options)) { - return new RequestOptions($options, []); + return new RequestOptions($options, [], null); } if (is_array($options)) { $headers = []; $key = null; + $base = null; if (array_key_exists('api_key', $options)) { $key = $options['api_key']; } @@ -89,13 +93,16 @@ public static function parse($options) if (array_key_exists('stripe_version', $options)) { $headers['Stripe-Version'] = $options['stripe_version']; } - return new RequestOptions($key, $headers); + if (array_key_exists('api_base', $options)) { + $base = $options['api_base']; + } + return new RequestOptions($key, $headers, $base); } $message = 'The second argument to Stripe API method calls is an ' - .'optional per-request apiKey, which must be a string, or ' - .'per-request options, which must be an array. (HINT: you can set ' - .'a global apiKey by "Stripe::setApiKey()")'; + . 'optional per-request apiKey, which must be a string, or ' + . 'per-request options, which must be an array. (HINT: you can set ' + . 'a global apiKey by "Stripe::setApiKey()")'; throw new Error\Api($message); } } diff --git a/public_html/extensions/default_stripe/core/lib/lib/Util/Set.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Set.php similarity index 100% rename from public_html/extensions/default_stripe/core/lib/lib/Util/Set.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Set.php diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Util.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Util.php new file mode 100644 index 0000000000..f4eafc2569 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Util/Util.php @@ -0,0 +1,353 @@ + $v) { + // FIXME: this is an encapsulation violation + if ($k[0] == '_') { + continue; + } + if ($v instanceof StripeObject) { + $results[$k] = $v->__toArray(true); + } elseif (is_array($v)) { + $results[$k] = self::convertStripeObjectToArray($v); + } else { + $results[$k] = $v; + } + } + return $results; + } + + /** + * Converts a response from the Stripe API to the corresponding PHP object. + * + * @param array $resp The response from the Stripe API. + * @param array $opts + * @return StripeObject|array + */ + public static function convertToStripeObject($resp, $opts) + { + $types = [ + // data structures + \Stripe\Collection::OBJECT_NAME => 'Stripe\\Collection', + + // business objects + \Stripe\Account::OBJECT_NAME => 'Stripe\\Account', + \Stripe\AccountLink::OBJECT_NAME => 'Stripe\\AccountLink', + \Stripe\AlipayAccount::OBJECT_NAME => 'Stripe\\AlipayAccount', + \Stripe\ApplePayDomain::OBJECT_NAME => 'Stripe\\ApplePayDomain', + \Stripe\ApplicationFee::OBJECT_NAME => 'Stripe\\ApplicationFee', + \Stripe\Balance::OBJECT_NAME => 'Stripe\\Balance', + \Stripe\BalanceTransaction::OBJECT_NAME => 'Stripe\\BalanceTransaction', + \Stripe\BankAccount::OBJECT_NAME => 'Stripe\\BankAccount', + \Stripe\BitcoinReceiver::OBJECT_NAME => 'Stripe\\BitcoinReceiver', + \Stripe\BitcoinTransaction::OBJECT_NAME => 'Stripe\\BitcoinTransaction', + \Stripe\Card::OBJECT_NAME => 'Stripe\\Card', + \Stripe\Charge::OBJECT_NAME => 'Stripe\\Charge', + \Stripe\Checkout\Session::OBJECT_NAME => 'Stripe\\Checkout\\Session', + \Stripe\CountrySpec::OBJECT_NAME => 'Stripe\\CountrySpec', + \Stripe\Coupon::OBJECT_NAME => 'Stripe\\Coupon', + \Stripe\Customer::OBJECT_NAME => 'Stripe\\Customer', + \Stripe\Discount::OBJECT_NAME => 'Stripe\\Discount', + \Stripe\Dispute::OBJECT_NAME => 'Stripe\\Dispute', + \Stripe\EphemeralKey::OBJECT_NAME => 'Stripe\\EphemeralKey', + \Stripe\Event::OBJECT_NAME => 'Stripe\\Event', + \Stripe\ExchangeRate::OBJECT_NAME => 'Stripe\\ExchangeRate', + \Stripe\ApplicationFeeRefund::OBJECT_NAME => 'Stripe\\ApplicationFeeRefund', + \Stripe\File::OBJECT_NAME => 'Stripe\\File', + \Stripe\File::OBJECT_NAME_ALT => 'Stripe\\File', + \Stripe\FileLink::OBJECT_NAME => 'Stripe\\FileLink', + \Stripe\Invoice::OBJECT_NAME => 'Stripe\\Invoice', + \Stripe\InvoiceItem::OBJECT_NAME => 'Stripe\\InvoiceItem', + \Stripe\InvoiceLineItem::OBJECT_NAME => 'Stripe\\InvoiceLineItem', + \Stripe\IssuerFraudRecord::OBJECT_NAME => 'Stripe\\IssuerFraudRecord', + \Stripe\Issuing\Authorization::OBJECT_NAME => 'Stripe\\Issuing\\Authorization', + \Stripe\Issuing\Card::OBJECT_NAME => 'Stripe\\Issuing\\Card', + \Stripe\Issuing\CardDetails::OBJECT_NAME => 'Stripe\\Issuing\\CardDetails', + \Stripe\Issuing\Cardholder::OBJECT_NAME => 'Stripe\\Issuing\\Cardholder', + \Stripe\Issuing\Dispute::OBJECT_NAME => 'Stripe\\Issuing\\Dispute', + \Stripe\Issuing\Transaction::OBJECT_NAME => 'Stripe\\Issuing\\Transaction', + \Stripe\LoginLink::OBJECT_NAME => 'Stripe\\LoginLink', + \Stripe\Order::OBJECT_NAME => 'Stripe\\Order', + \Stripe\OrderItem::OBJECT_NAME => 'Stripe\\OrderItem', + \Stripe\OrderReturn::OBJECT_NAME => 'Stripe\\OrderReturn', + \Stripe\PaymentIntent::OBJECT_NAME => 'Stripe\\PaymentIntent', + \Stripe\Payout::OBJECT_NAME => 'Stripe\\Payout', + \Stripe\Person::OBJECT_NAME => 'Stripe\\Person', + \Stripe\Plan::OBJECT_NAME => 'Stripe\\Plan', + \Stripe\Product::OBJECT_NAME => 'Stripe\\Product', + \Stripe\Radar\ValueList::OBJECT_NAME => 'Stripe\\Radar\\ValueList', + \Stripe\Radar\ValueListItem::OBJECT_NAME => 'Stripe\\Radar\\ValueListItem', + \Stripe\Recipient::OBJECT_NAME => 'Stripe\\Recipient', + \Stripe\RecipientTransfer::OBJECT_NAME => 'Stripe\\RecipientTransfer', + \Stripe\Refund::OBJECT_NAME => 'Stripe\\Refund', + \Stripe\Reporting\ReportRun::OBJECT_NAME => 'Stripe\\Reporting\\ReportRun', + \Stripe\Reporting\ReportType::OBJECT_NAME => 'Stripe\\Reporting\\ReportType', + \Stripe\Review::OBJECT_NAME => 'Stripe\\Review', + \Stripe\SKU::OBJECT_NAME => 'Stripe\\SKU', + \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => 'Stripe\\Sigma\\ScheduledQueryRun', + \Stripe\Source::OBJECT_NAME => 'Stripe\\Source', + \Stripe\SourceTransaction::OBJECT_NAME => 'Stripe\\SourceTransaction', + \Stripe\Subscription::OBJECT_NAME => 'Stripe\\Subscription', + \Stripe\SubscriptionItem::OBJECT_NAME => 'Stripe\\SubscriptionItem', + \Stripe\SubscriptionSchedule::OBJECT_NAME => 'Stripe\\SubscriptionSchedule', + \Stripe\SubscriptionScheduleRevision::OBJECT_NAME => 'Stripe\\SubscriptionScheduleRevision', + \Stripe\ThreeDSecure::OBJECT_NAME => 'Stripe\\ThreeDSecure', + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => 'Stripe\\Terminal\\ConnectionToken', + \Stripe\Terminal\Location::OBJECT_NAME => 'Stripe\\Terminal\\Location', + \Stripe\Terminal\Reader::OBJECT_NAME => 'Stripe\\Terminal\\Reader', + \Stripe\Token::OBJECT_NAME => 'Stripe\\Token', + \Stripe\Topup::OBJECT_NAME => 'Stripe\\Topup', + \Stripe\Transfer::OBJECT_NAME => 'Stripe\\Transfer', + \Stripe\TransferReversal::OBJECT_NAME => 'Stripe\\TransferReversal', + \Stripe\UsageRecord::OBJECT_NAME => 'Stripe\\UsageRecord', + \Stripe\UsageRecordSummary::OBJECT_NAME => 'Stripe\\UsageRecordSummary', + \Stripe\WebhookEndpoint::OBJECT_NAME => 'Stripe\\WebhookEndpoint', + ]; + if (self::isList($resp)) { + $mapped = []; + foreach ($resp as $i) { + array_push($mapped, self::convertToStripeObject($i, $opts)); + } + return $mapped; + } elseif (is_array($resp)) { + if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) { + $class = $types[$resp['object']]; + } else { + $class = 'Stripe\\StripeObject'; + } + return $class::constructFrom($resp, $opts); + } else { + return $resp; + } + } + + /** + * @param string|mixed $value A string to UTF8-encode. + * + * @return string|mixed The UTF8-encoded string, or the object passed in if + * it wasn't a string. + */ + public static function utf8($value) + { + if (self::$isMbstringAvailable === null) { + self::$isMbstringAvailable = function_exists('mb_detect_encoding'); + + if (!self::$isMbstringAvailable) { + trigger_error("It looks like the mbstring extension is not enabled. " . + "UTF-8 strings will not properly be encoded. Ask your system " . + "administrator to enable the mbstring extension, or write to " . + "support@stripe.com if you have any questions.", E_USER_WARNING); + } + } + + if (is_string($value) && self::$isMbstringAvailable && mb_detect_encoding($value, "UTF-8", true) != "UTF-8") { + return utf8_encode($value); + } else { + return $value; + } + } + + /** + * Compares two strings for equality. The time taken is independent of the + * number of characters that match. + * + * @param string $a one of the strings to compare. + * @param string $b the other string to compare. + * @return bool true if the strings are equal, false otherwise. + */ + public static function secureCompare($a, $b) + { + if (self::$isHashEqualsAvailable === null) { + self::$isHashEqualsAvailable = function_exists('hash_equals'); + } + + if (self::$isHashEqualsAvailable) { + return hash_equals($a, $b); + } else { + if (strlen($a) != strlen($b)) { + return false; + } + + $result = 0; + for ($i = 0; $i < strlen($a); $i++) { + $result |= ord($a[$i]) ^ ord($b[$i]); + } + return ($result == 0); + } + } + + /** + * Recursively goes through an array of parameters. If a parameter is an instance of + * ApiResource, then it is replaced by the resource's ID. + * Also clears out null values. + * + * @param mixed $h + * @return mixed + */ + public static function objectsToIds($h) + { + if ($h instanceof \Stripe\ApiResource) { + return $h->id; + } elseif (static::isList($h)) { + $results = []; + foreach ($h as $v) { + array_push($results, static::objectsToIds($v)); + } + return $results; + } elseif (is_array($h)) { + $results = []; + foreach ($h as $k => $v) { + if (is_null($v)) { + continue; + } + $results[$k] = static::objectsToIds($v); + } + return $results; + } else { + return $h; + } + } + + /** + * @param array $params + * + * @return string + */ + public static function encodeParameters($params) + { + $flattenedParams = self::flattenParams($params); + $pieces = []; + foreach ($flattenedParams as $param) { + list($k, $v) = $param; + array_push($pieces, self::urlEncode($k) . '=' . self::urlEncode($v)); + } + return implode('&', $pieces); + } + + /** + * @param array $params + * @param string|null $parentKey + * + * @return array + */ + public static function flattenParams($params, $parentKey = null) + { + $result = []; + + foreach ($params as $key => $value) { + $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; + + if (self::isList($value)) { + $result = array_merge($result, self::flattenParamsList($value, $calculatedKey)); + } elseif (is_array($value)) { + $result = array_merge($result, self::flattenParams($value, $calculatedKey)); + } else { + array_push($result, [$calculatedKey, $value]); + } + } + + return $result; + } + + /** + * @param array $value + * @param string $calculatedKey + * + * @return array + */ + public static function flattenParamsList($value, $calculatedKey) + { + $result = []; + + foreach ($value as $i => $elem) { + if (self::isList($elem)) { + $result = array_merge($result, self::flattenParamsList($elem, $calculatedKey)); + } elseif (is_array($elem)) { + $result = array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); + } else { + array_push($result, ["{$calculatedKey}[{$i}]", $elem]); + } + } + + return $result; + } + + /** + * @param string $key A string to URL-encode. + * + * @return string The URL-encoded string. + */ + public static function urlEncode($key) + { + $s = urlencode($key); + + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + $s = str_replace('%5B', '[', $s); + $s = str_replace('%5D', ']', $s); + + return $s; + } + + public static function normalizeId($id) + { + if (is_array($id)) { + $params = $id; + $id = $params['id']; + unset($params['id']); + } else { + $params = []; + } + return [$id, $params]; + } + + /** + * Returns UNIX timestamp in milliseconds + * + * @return integer current time in millis + */ + public static function currentTimeMillis() + { + return (int) round(microtime(true) * 1000); + } +} diff --git a/public_html/extensions/default_stripe/core/lib/lib/Webhook.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Webhook.php similarity index 75% rename from public_html/extensions/default_stripe/core/lib/lib/Webhook.php rename to public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Webhook.php index e546fb2c5f..e0ab3021a8 100644 --- a/public_html/extensions/default_stripe/core/lib/lib/Webhook.php +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/Webhook.php @@ -12,13 +12,12 @@ abstract class Webhook * \Stripe\SignatureVerificationException if the signature verification * fails for any reason. * - * @param string $payload the payload sent by Stripe. + * @param string $payload the payload sent by Stripe. * @param string $sigHeader the contents of the signature header sent by - * Stripe. - * @param string $secret secret used to generate the signature. - * @param int $tolerance maximum difference allowed between the header's - * timestamp and the current time - * + * Stripe. + * @param string $secret secret used to generate the signature. + * @param int $tolerance maximum difference allowed between the header's + * timestamp and the current time * @return \Stripe\Event the Event instance * @throws \UnexpectedValueException if the payload is not valid JSON, * @throws \Stripe\Error\SignatureVerification if the verification fails. @@ -29,7 +28,7 @@ public static function constructEvent($payload, $sigHeader, $secret, $tolerance $jsonError = json_last_error(); if ($data === null && $jsonError !== JSON_ERROR_NONE) { $msg = "Invalid payload: $payload " - ."(json_last_error() was $jsonError)"; + . "(json_last_error() was $jsonError)"; throw new \UnexpectedValueException($msg); } $event = Event::constructFrom($data); diff --git a/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/WebhookEndpoint.php b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/WebhookEndpoint.php new file mode 100644 index 0000000000..27ecacf690 --- /dev/null +++ b/public_html/extensions/default_stripe/vendor/stripe/stripe-php/lib/WebhookEndpoint.php @@ -0,0 +1,29 @@ + $fp, + CURLOPT_TIMEOUT => 3600, + CURLOPT_URL => 'https://curl.haxx.se/ca/cacert.pem', +); + +$ch = curl_init(); +curl_setopt_array($ch, $options); +curl_exec($ch); +curl_close($ch); +fclose($fp); From 1293a2176cb3708162d74901e5b2a33754bf6886 Mon Sep 17 00:00:00 2001 From: abolabo Date: Tue, 5 Mar 2019 19:05:45 +0200 Subject: [PATCH 26/81] #1228 --- .../admin/controller/pages/sale/order.php | 26 ++++++++++++------- .../responses/extension/default_pp_pro.php | 6 +---- .../default_pp_pro/core/default_pp_pro.php | 23 +++++++++++----- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/public_html/admin/controller/pages/sale/order.php b/public_html/admin/controller/pages/sale/order.php index 22f1fdfe54..7eca767b97 100755 --- a/public_html/admin/controller/pages/sale/order.php +++ b/public_html/admin/controller/pages/sale/order.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE') || !IS_ADMIN) { - header('Location: static_pages/'); -} class ControllerPagesSaleOrder extends AController { @@ -264,8 +261,10 @@ public function update() //recalc totals and update $this->session->data['success'] = $this->language->get('text_success'); $this->session->data['attention'] = $this->language->get('attention_check_total'); - redirect($this->html->getSecureURL('sale/order/recalc', - '&order_id='.$this->request->get['order_id'])); + redirect($this->html->getSecureURL( + 'sale/order/recalc', + '&order_id='.$this->request->get['order_id']) + ); } redirect($this->html->getSecureURL('sale/order')); @@ -301,8 +300,10 @@ public function details() $this->loadModel('catalog/download'); foreach ($data as $order_download_id => $item) { if ($item['expire_date']) { - $item['expire_date'] = dateDisplay2ISO($item['expire_date'], - $this->language->get('date_format_short')); + $item['expire_date'] = dateDisplay2ISO( + $item['expire_date'], + $this->language->get('date_format_short') + ); } else { $item['expire_date'] = ''; } @@ -324,9 +325,11 @@ public function details() } $enc = new AEncryption($this->config->get('encryption_key')); - redirect($this->html->getSecureURL('sale/order/recalc', - '&order_id='.$order_id.'&skip_recalc='.$enc->encrypt(serialize($skip_recalc)) - ) + redirect( + $this->html->getSecureURL( + 'sale/order/recalc', + '&order_id='.$order_id.'&skip_recalc='.$enc->encrypt(serialize($skip_recalc)) + ) ); } } @@ -1305,6 +1308,9 @@ public function payment_details() //NOTE: This is an empty controller to be hooked from extensions + if( $this->session->data['error'] ){ + $this->data['error_warning'] = $this->session->data['error']; + } $this->view->batchAssign($this->data); $this->addChild('pages/sale/order_summary', 'summary_form', 'pages/sale/order_summary.tpl'); diff --git a/public_html/extensions/default_pp_pro/admin/controller/responses/extension/default_pp_pro.php b/public_html/extensions/default_pp_pro/admin/controller/responses/extension/default_pp_pro.php index ce079bd018..fc7635e5d2 100644 --- a/public_html/extensions/default_pp_pro/admin/controller/responses/extension/default_pp_pro.php +++ b/public_html/extensions/default_pp_pro/admin/controller/responses/extension/default_pp_pro.php @@ -8,7 +8,7 @@ Copyright © 2011-2018 Belavier Commerce LLC This source file is subject to Open Software License (OSL 3.0) - Lincence details is bundled with this package in the file LICENSE.txt. + License details is bundled with this package in the file LICENSE.txt. It is also available at this URL: @@ -100,10 +100,6 @@ public function test() } - public function callback() - { - - } public function capture() { diff --git a/public_html/extensions/default_pp_pro/core/default_pp_pro.php b/public_html/extensions/default_pp_pro/core/default_pp_pro.php index 2772167d44..54b20aa073 100644 --- a/public_html/extensions/default_pp_pro/core/default_pp_pro.php +++ b/public_html/extensions/default_pp_pro/core/default_pp_pro.php @@ -18,10 +18,6 @@ needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} - /** * Class ExtensionDefaultPpPro */ @@ -55,6 +51,9 @@ public function onControllerPagesExtensionExtensions_UpdateData() //Hook to enable payment details tab in admin public function onControllerPagesSaleOrderTabs_UpdateData() { + /** + * @var $that ControllerPagesSaleOrderTabs + */ $that = $this->baseObject; $order_id = $that->data['order_id']; $order_info = $that->model_sale_order->getOrder($order_id); @@ -78,6 +77,9 @@ public function onControllerPagesSaleOrderTabs_UpdateData() //Hook to payment details page to show information public function onControllerPagesSaleOrder_UpdateData() { + /** + * @var $that ControllerPagesSaleOrder + */ $that = $this->baseObject; //are we logged to admin and correct method called? if (IS_ADMIN && $that->user->isLogged() && $this->baseObject_method == 'payment_details' && has_value($that->data['order_info']['payment_method_data'])) { @@ -103,6 +105,7 @@ public function onControllerPagesSaleOrder_UpdateData() $tpl_data = $this->_get_refund_form($data, $payment_method_data); } + $view = new AView($this->registry, 0); $view->batchAssign($that->language->getASet('default_pp_pro/default_pp_pro')); $view->batchAssign($tpl_data); @@ -116,9 +119,13 @@ public function onControllerPagesSaleOrder_UpdateData() * @param array $payment_method_data * * @return array + * @throws AException */ private function _get_capture_form($data = array(), $payment_method_data = array()) { + /** + * @var $that ControllerPagesSaleOrder + */ $that = $this->baseObject; $captured_amount = has_value($payment_method_data['captured_amount']) ? (float)$payment_method_data['captured_amount'] : 0; @@ -160,12 +167,16 @@ private function _get_capture_form($data = array(), $payment_method_data = array /** * @param array $data * @param array $payment_method_data - * @param int $not_refunded + * @param int $not_refunded * * @return array + * @throws AException */ private function _get_refund_form($data = array(), $payment_method_data = array(), $not_refunded = 0) { + /** + * @var $that ControllerPagesSaleOrder + */ $that = $this->baseObject; $refunded_amount = has_value($payment_method_data['refunded_amount']) ? (float)$payment_method_data['refunded_amount'] : 0; @@ -181,7 +192,7 @@ private function _get_refund_form($data = array(), $payment_method_data = array( if ((float)$refunded_amount > 0) { $data['payment_status'] = $that->language->get('text_partially_refunded'); - $data['refunded_amount'] = $that->currency->format($refunded_amount, $that->data['currency']['code'], $that->data['order_info']['value']); + $data['refunded_amount'] = $that->currency->format($refunded_amount, $that->data['order_info']['currency'],1); } if ((float)$refunded_amount < $not_refunded) { From c0b504e2e3dcd052b70f90b0a2f8b3c7d909fd65 Mon Sep 17 00:00:00 2001 From: abolabo Date: Tue, 5 Mar 2019 20:30:26 +0200 Subject: [PATCH 27/81] #1227 + minor fixes --- public_html/admin/controller/pages/sale/order.php | 1 + public_html/extensions/default_authorizenet/core/hooks.php | 7 ++++++- .../controller/responses/extension/default_pp_pro.php | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public_html/admin/controller/pages/sale/order.php b/public_html/admin/controller/pages/sale/order.php index 7eca767b97..d3b6506db4 100755 --- a/public_html/admin/controller/pages/sale/order.php +++ b/public_html/admin/controller/pages/sale/order.php @@ -1310,6 +1310,7 @@ public function payment_details() if( $this->session->data['error'] ){ $this->data['error_warning'] = $this->session->data['error']; + unset($this->session->data['error']); } $this->view->batchAssign($this->data); diff --git a/public_html/extensions/default_authorizenet/core/hooks.php b/public_html/extensions/default_authorizenet/core/hooks.php index cb6e1cea11..b41f623cef 100644 --- a/public_html/extensions/default_authorizenet/core/hooks.php +++ b/public_html/extensions/default_authorizenet/core/hooks.php @@ -81,10 +81,14 @@ public function onControllerPagesSaleOrderTabs_UpdateData() public function onControllerPagesSaleOrder_UpdateData() { $that = $this->baseObject; + $order_id = $that->request->get['order_id']; //are we logged to admin and correct method called? if (IS_ADMIN && $that->user->isLogged() && $this->baseObject_method == 'payment_details') { - //build HTML to show + if($that->request->get['extension'] != 'default_authorizenet'){ + return null; + } + //build HTML to show $that->loadLanguage('default_authorizenet/default_authorizenet'); $that->loadModel('extension/default_authorizenet'); @@ -189,6 +193,7 @@ public function onControllerPagesSaleOrder_UpdateData() $view->batchAssign($that->language->getASet('default_authorizenet/default_authorizenet')); $this->baseObject->view->addHookVar( 'extension_payment_details', $view->fetch('pages/sale/payment_details.tpl')); + } } diff --git a/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php b/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php index f5008a998c..864eed17a2 100755 --- a/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php +++ b/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php @@ -383,6 +383,7 @@ protected function _get_products_data($order_info) $this->data['products'] = array(); $this->data['items_total'] = 0.0; $products = $this->cart->getProducts(); + foreach ($products as $product) { $option_data = array(); @@ -448,7 +449,7 @@ protected function _get_products_data($order_info) $this->data['tax_total'] += $price; } elseif (in_array($total['id'], array('shipping'))) { $this->data['shipping_total'] += $price; - } elseif (in_array($total['id'], array('handling'))) { + } elseif (in_array($total['id'], array('handling', 'fee'))) { $this->data['handling_total'] += $price; } else { $this->data['items_total'] += $price; From 4791b3bcf504d7fd92b249198b2c96f1d1b51c64 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 6 Mar 2019 17:11:10 +0200 Subject: [PATCH 28/81] extensions: default_stripe minor fix --- .../view/default/template/responses/default_stripe.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/extensions/default_stripe/storefront/view/default/template/responses/default_stripe.tpl b/public_html/extensions/default_stripe/storefront/view/default/template/responses/default_stripe.tpl index f70df46ee8..51711df818 100644 --- a/public_html/extensions/default_stripe/storefront/view/default/template/responses/default_stripe.tpl +++ b/public_html/extensions/default_stripe/storefront/view/default/template/responses/default_stripe.tpl @@ -59,8 +59,8 @@ var $form = $(this); var extraDetails = { name: $('input[name=cc_owner]').val(), - address_1: , - address_2: , + address_line1: , + address_line2: , address_city: , address_state: , address_zip: , From 779d019a2c525bbdcc8b31fa640acbfe78c95883 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 6 Mar 2019 18:09:23 +0200 Subject: [PATCH 29/81] #1226 --- public_html/admin/controller/pages/design/blocks.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public_html/admin/controller/pages/design/blocks.php b/public_html/admin/controller/pages/design/blocks.php index 8d40074075..700ec605de 100644 --- a/public_html/admin/controller/pages/design/blocks.php +++ b/public_html/admin/controller/pages/design/blocks.php @@ -442,7 +442,6 @@ public function edit() private function _init_tabs() { - $blocks = array(); $lm = new ALayoutManager(); $default_block_type = ''; @@ -937,7 +936,7 @@ private function _getListingForm() $this->view->batchAssign($this->language->getASet()); $this->view->batchAssign($this->data); $this->view->assign('form_language_switch', $this->html->getContentLanguageSwitcher()); - $this->view->assign('form_store_switch', $this->html->getStoreSwitcher()); + $this->view->assign('language_code', $this->session->data['language']); $this->view->assign('help_url', $this->gen_help_url('block_edit')); $this->view->assign('rl', $this->html->getSecureURL('common/resource_library', '&object_name=custom_block&type=image&mode=url')); From b5f4a82d3ed2cc920a4ba38b70ebfb2773808c34 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 6 Mar 2019 19:46:12 +0200 Subject: [PATCH 30/81] #1225 --- .../admin/controller/responses/listing_grid/content.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public_html/admin/controller/responses/listing_grid/content.php b/public_html/admin/controller/responses/listing_grid/content.php index dae4c62b19..914db34a1b 100755 --- a/public_html/admin/controller/responses/listing_grid/content.php +++ b/public_html/admin/controller/responses/listing_grid/content.php @@ -47,6 +47,9 @@ public function main() ); $filter_grid = new AFilter($filter_data); $filter_array = $filter_grid->getFilterData(); + + $filter_array['store_id'] = $this->config->get('config_store_id'); + if ($this->request->post['nodeid']) { list(, $parent_id) = explode('_', $this->request->post['nodeid']); $filter_array['parent_id'] = $parent_id; From 18260892353844761cb748a882a6307f5e809d47 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 6 Mar 2019 19:50:23 +0200 Subject: [PATCH 31/81] #1223 --- .../extensions/avatax_integration/core/avatax_integration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/extensions/avatax_integration/core/avatax_integration.php b/public_html/extensions/avatax_integration/core/avatax_integration.php index 3ea3a0068c..3216be9788 100644 --- a/public_html/extensions/avatax_integration/core/avatax_integration.php +++ b/public_html/extensions/avatax_integration/core/avatax_integration.php @@ -882,7 +882,7 @@ public function validate_address($address_data) $customerAddress = $that->model_account_address->getAddress($address_data['address_id']); } - if (strpos($countryISO, $customerAddress['iso_code_2']) >= 0) { + if (is_int(strpos($countryISO, (string)$customerAddress['iso_code_2']))) { // Required Request Parameters $address->setLine1($customerAddress['address_1']); $address->setCity($customerAddress['city']); From 7b989f30d3c042821b1e81cbd03e9ae1866321b4 Mon Sep 17 00:00:00 2001 From: abolabo Date: Wed, 6 Mar 2019 20:05:32 +0200 Subject: [PATCH 32/81] #1222 --- .../storefront/controller/pages/content/contact.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public_html/storefront/controller/pages/content/contact.php b/public_html/storefront/controller/pages/content/contact.php index 82e938b26a..37dacfad7a 100755 --- a/public_html/storefront/controller/pages/content/contact.php +++ b/public_html/storefront/controller/pages/content/contact.php @@ -80,9 +80,13 @@ public function main() $this->data['mail_template_data']['form_fields'] = array(); foreach ($form_fields as $field_name => $field_info) { if (has_value($post_data[$field_name]) && !in_array($field_name, array('enquiry', 'captcha'))) { + $field_value = $post_data[$field_name]; + if(is_array($field_value)){ + $field_value = implode("; ",$field_value);; + } $field_details = $this->form->getField($field_name); - $this->data['mail_plain_text'] .= "\r\n".rtrim($field_details['name'], ':').":\t".$post_data[$field_name]; - $this->data['mail_template_data']['form_fields'][rtrim($field_details['name'], ':')] = $post_data[$field_name]; + $this->data['mail_plain_text'] .= "\r\n".rtrim($field_details['name'], ':').":\t".$field_value; + $this->data['mail_template_data']['form_fields'][rtrim($field_details['name'], ':')] = $field_value; } } From 6cf01760f7095a75efdcab5a721bd13c8fa648bb Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 13:28:05 +0200 Subject: [PATCH 33/81] #1213 --- .../controller/responses/product/product.php | 2 +- public_html/core/engine/form.php | 5 +- public_html/core/engine/html.php | 2 +- .../model/extension/default_weight.php | 54 ++++++++++++------- .../view/default/template/form/selectbox.tpl | 2 +- 5 files changed, 38 insertions(+), 27 deletions(-) diff --git a/public_html/admin/controller/responses/product/product.php b/public_html/admin/controller/responses/product/product.php index 5bf71881d4..06ba5780f5 100755 --- a/public_html/admin/controller/responses/product/product.php +++ b/public_html/admin/controller/responses/product/product.php @@ -582,7 +582,7 @@ public function update_option_values() //remove html-code from textarea product option if (in_array($option_info['element_type'], array('T', 'B'))) { - foreach ($this->request->post['name'] as &$v) { + foreach ((array)$this->request->post['name'] as &$v) { $v = strip_tags(html_entity_decode($v, ENT_QUOTES, 'UTF-8')); $v = str_replace('\r\n', "\n", $v); } diff --git a/public_html/core/engine/form.php b/public_html/core/engine/form.php index c26397f433..074a5a329b 100755 --- a/public_html/core/engine/form.php +++ b/public_html/core/engine/form.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} /** * Load form data, render output @@ -630,7 +627,7 @@ public function validateFormData($data = array()) foreach ($this->fields as $field) { // for multivalue required fields if (in_array($field['element_type'], HtmlElementFactory::getMultivalueElements()) - && !sizeof($data[$field['field_name']]) + && !$data[$field['field_name']] && $field['required'] == 'Y' ) { $errors[$field['field_name']] = $field['name'].' '.$this->language->get('text_field_required'); diff --git a/public_html/core/engine/html.php b/public_html/core/engine/html.php index 9e183ff595..135d255ddb 100755 --- a/public_html/core/engine/html.php +++ b/public_html/core/engine/html.php @@ -998,7 +998,7 @@ protected function _validate_options() $this->disabled_options = (array)$this->disabled_options; //check case when all options are disabled $all_disabled = true; - foreach ($this->options as $id => $text) { + foreach ((array)$this->options as $id => $text) { if (!in_array($id, $this->disabled_options)) { $all_disabled = false; break; diff --git a/public_html/extensions/default_weight/storefront/model/extension/default_weight.php b/public_html/extensions/default_weight/storefront/model/extension/default_weight.php index 2ce87c8c04..1577385025 100755 --- a/public_html/extensions/default_weight/storefront/model/extension/default_weight.php +++ b/public_html/extensions/default_weight/storefront/model/extension/default_weight.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} /** * Class ModelExtensionDefaultWeight @@ -39,7 +36,12 @@ public function getQuote($address) $query = $this->db->query("SELECT * FROM ".$this->db->table("locations")." ORDER BY name"); foreach ($query->rows as $result) { if ($this->config->get('default_weight_'.$result['location_id'].'_status')) { - $query2 = $this->db->query("SELECT * FROM ".$this->db->table("zones_to_locations")." WHERE location_id = '".(int)$result['location_id']."' AND country_id = '".(int)$address['country_id']."' AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')"); + $query2 = $this->db->query( + "SELECT * FROM ".$this->db->table("zones_to_locations")." + WHERE location_id = '".(int)$result['location_id']."' + AND country_id = '".(int)$address['country_id']."' + AND (zone_id = '".(int)$address['zone_id']."' OR zone_id = '0')" + ); if ($query2->num_rows) { $status = true; } else { @@ -79,12 +81,12 @@ public function getQuote($address) continue; } else { if ($product['shipping_price'] > 0) { - $fixed_cost = $product['shipping_price']; + $fixed_cost = (float)$product['shipping_price']; //If ship individually count every quantity if ($product['ship_individually']) { - $cost = $cost + $fixed_cost * $product['quantity']; + $cost += $fixed_cost * $product['quantity']; } else { - $cost = $cost + $fixed_cost; + $cost += $fixed_cost; } } else { foreach ($rates as $rate) { @@ -103,25 +105,37 @@ public function getQuote($address) if ((string)$cost != '') { $quote_data['default_weight_'.$result['location_id']] = array( 'id' => 'default_weight.default_weight_'.$result['location_id'], - 'title' => $result['name'].' ('.$language->get('text_weight').' '.$this->weight->format($this->cart->getWeight(), - $this->config->get('config_weight_class')).')', - 'cost' => $this->tax->calculate($cost, - $this->config->get('default_weight_tax_class_id'), - $this->config->get('config_tax')), + 'title' => $result['name'].' ('.$language->get('text_weight') + .' '.$this->weight->format( + $this->cart->getWeight(), + $this->config->get('config_weight_class') + ).')', + 'cost' => $this->tax->calculate( + $cost, + $this->config->get('default_weight_tax_class_id'), + $this->config->get('config_tax') + ), 'tax_class_id' => $this->config->get('default_weight_tax_class_id'), - 'text' => $this->currency->format($this->tax->calculate($cost, - $this->config->get('default_weight_tax_class_id'), - $this->config->get('config_tax'))), + 'text' => $this->currency->format( + $this->tax->calculate($cost, + $this->config->get('default_weight_tax_class_id'), + $this->config->get('config_tax')) + ) ); } if ($this->cart->areAllFreeShipping()) { $quote_data['default_weight_'.$result['location_id']] = array( 'id' => 'default_weight.default_weight_'.$result['location_id'], - 'title' => $result['name'].' ('.$language->get('text_weight').' '.$this->weight->format($this->cart->getWeight(), - $this->config->get('config_weight_class')).')', - 'cost' => $this->tax->calculate($cost, - $this->config->get('default_weight_tax_class_id'), - $this->config->get('config_tax')), + 'title' => $result['name'].' ('.$language->get('text_weight') + .' '.$this->weight->format( + $this->cart->getWeight(), + $this->config->get('config_weight_class') + ).')', + 'cost' => $this->tax->calculate( + $cost, + $this->config->get('default_weight_tax_class_id'), + $this->config->get('config_tax') + ), 'tax_class_id' => $this->config->get('default_weight_tax_class_id'), 'text' => $language->get('text_free'), ); diff --git a/public_html/storefront/view/default/template/form/selectbox.tpl b/public_html/storefront/view/default/template/form/selectbox.tpl index b4501e7cd3..fa7883eca7 100755 --- a/public_html/storefront/view/default/template/form/selectbox.tpl +++ b/public_html/storefront/view/default/template/form/selectbox.tpl @@ -7,7 +7,7 @@ $text ) { ?> + foreach ( (array)$options as $v => $text ) { ?> From 5c726dbd3f795c36a63780a05bc77ad490c8d430 Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 13:30:45 +0200 Subject: [PATCH 34/81] #1230 --- public_html/admin/controller/pages/total/handling.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public_html/admin/controller/pages/total/handling.php b/public_html/admin/controller/pages/total/handling.php index ce42cf17dc..f151381335 100755 --- a/public_html/admin/controller/pages/total/handling.php +++ b/public_html/admin/controller/pages/total/handling.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE') || !IS_ADMIN) { - header('Location: static_pages/'); -} class ControllerPagesTotalHandling extends AController { @@ -189,7 +186,7 @@ public function main() $options[$row['key']] = $row['name']; } } - if (!sizeof($this->data['handling_per_payment']['handling_payment'])) { + if (!$this->data['handling_per_payment']['handling_payment']) { $this->data['handling_per_payment'] = array( 'handling_payment' => array(0 => ''), 'handling_payment_subtotal' => array(0 => ''), From 37a08bf49be5bc4da598a4a72c769eaddd1a896d Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 14:16:17 +0200 Subject: [PATCH 35/81] extensions: default_authorizenet fix --- .../default_authorizenet/core/hooks.php | 145 ------------------ .../extension/default_authorizenet.php | 48 ------ 2 files changed, 193 deletions(-) diff --git a/public_html/extensions/default_authorizenet/core/hooks.php b/public_html/extensions/default_authorizenet/core/hooks.php index b41f623cef..8138b106b4 100644 --- a/public_html/extensions/default_authorizenet/core/hooks.php +++ b/public_html/extensions/default_authorizenet/core/hooks.php @@ -51,150 +51,5 @@ public function onControllerPagesSaleOrderSummary_UpdateData() } } - //Hook to enable payment details tab in admin - public function onControllerPagesSaleOrderTabs_UpdateData() - { - $that = $this->baseObject; - $order_id = $that->data['order_id']; - $order_info = $that->model_sale_order->getOrder($order_id); - //are we logged in and in admin? - if (IS_ADMIN && $that->user->isLogged()) { - if ($order_info['payment_method_key'] != 'default_authorizenet') { - return null; - } - //check if tab is not yet enabled. - if (in_array('payment_details', $that->data['groups'])) { - return null; - } - - $that->data['groups'][] = 'payment_details'; - $that->data['link_payment_details'] = $that->html->getSecureURL( - 'sale/order/payment_details', - '&order_id='.$order_id.'&extension=default_authorizenet' - ); - //reload main view data with updated tab - $that->view->batchAssign($that->data); - } - } - - //Hook to payment details page to show information - public function onControllerPagesSaleOrder_UpdateData() - { - $that = $this->baseObject; - - $order_id = $that->request->get['order_id']; - //are we logged to admin and correct method called? - if (IS_ADMIN && $that->user->isLogged() && $this->baseObject_method == 'payment_details') { - if($that->request->get['extension'] != 'default_authorizenet'){ - return null; - } - //build HTML to show - $that->loadLanguage('default_authorizenet/default_authorizenet'); - $that->loadModel('extension/default_authorizenet'); - - if ( ! $this->r_data) { - //no local authorizenet order data yet. load it. - $this->loadAuthorizenetOrderData($order_id, $that); - } - - if ( ! $this->r_data) { - $this->baseObject->view->addHookVar('extension_payment_details', - '
AuthorizeNet transaction details not found.
'); - - return null; - } - - $view = new AView($this->registry, 0); - //get remote charge data - $ch_data = $that->model_extension_default_authorizenet->getAuthorizeNetTransaction($this->r_data['charge_id']); - if ( ! $ch_data || $ch_data['error']) { - $view->assign('error_warning', "Transaction ID ".$this->r_data['charge_id']." not found."); - } else { - - $ch_data['authAmount'] = round($ch_data['authAmount'], 2); - $ch_data['amount_refunded'] = round($ch_data['amount_refunded'], 2); - $ch_data['amount_formatted'] = $that->currency->format( - $ch_data['authAmount'], - strtoupper($ch_data['currency']), - 1 - ); - if (in_array( - $ch_data['transactionStatus'], - array( - 'capturedPendingSettlement', - 'settledSuccessfully', - 'refundSettledSuccessfully', - 'refundPendingSettlement' - ) - ) - ) { - $ch_data['captured'] = true; - } - - if (in_array( - $ch_data['transactionStatus'], - array('refundSettledSuccessfully', 'refundPendingSettlement') - ) - ) { - $ch_data['refunded'] = true; - $ch_data['settleAmount'] = ''; - } - - if (in_array($ch_data['transactionStatus'], array('settledSuccessfully'))) { - $ch_data['can_refund'] = true; - } - - //check a void status. - //Not captured and refunded - if (in_array( - $ch_data['transactionStatus'], - array('authorizedPendingCapture','capturedPendingSettlement')) - ){ - $ch_data['can_void'] = true; - } - - if ($ch_data['transactionStatus'] == 'voided') { - $ch_data['void_status'] = true; - } - //if - if($this->r_data['charge_id'] != $this->r_data['charge_id_previous']){ - $view->assign('previous_transaction_id', $this->r_data['charge_id_previous']); - $orig_transaction = $that - ->model_extension_default_authorizenet - ->getAuthorizeNetTransaction( - $this->r_data['charge_id_previous'] - ); - $balance = $orig_transaction['authAmount'] - $ch_data['authAmount']; - }else { - $balance = $ch_data['transactionStatus'] == 'voided' - ? 0.0 - : ($ch_data['authAmount'] - $ch_data['settleAmount'] - $ch_data['amount_refunded']); - } - $ch_data['balance_formatted'] = $that->currency->format($balance, strtoupper($ch_data['currency']), 1); - } - - $view->assign('order_id', $order_id); - $test_mode = $this->r_data['authorizenet_test_mode']; - $view->assign('test_mode', $test_mode); - if ($test_mode) { - $view->assign( - 'external_url', - 'https://sandbox.authorize.net/UI/themes/sandbox/merch.aspx?page=search&transId=' - ); - } else { - $view->assign('external_url', 'https://dashboard.authorize.net/payments/'); - } - - $view->assign('void_url', $that->html->getSecureURL('r/extension/default_authorizenet/void')); - $view->assign('capture_url', $that->html->getSecureURL('r/extension/default_authorizenet/capture')); - $view->assign('refund_url', $that->html->getSecureURL('r/extension/default_authorizenet/refund')); - $view->assign('authorizenet_order', $ch_data); - - $view->batchAssign($that->language->getASet('default_authorizenet/default_authorizenet')); - $this->baseObject->view->addHookVar( - 'extension_payment_details', $view->fetch('pages/sale/payment_details.tpl')); - - } - } } \ No newline at end of file diff --git a/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php index c87958e857..352f4cdf31 100644 --- a/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php +++ b/public_html/extensions/default_authorizenet/storefront/controller/responses/extension/default_authorizenet.php @@ -274,53 +274,5 @@ public function send() $this->response->setOutput(AJson::encode($json)); } - public function delete_card() - { - //init controller data - $this->extensions->hk_InitData($this, __FUNCTION__); - $this->loadLanguage('default_authorizenet/default_authorizenet'); - - //validate input - $post = $this->request->post; - $json = array(); - if (empty($post['use_saved_cc'])) { - $json['error'] = $this->language->get('error_system'); - } - if ( ! $this->customer->getId()) { - $json['error'] = $this->language->get('error_system'); - } - if (isset($json['error'])) { - $this->load->library('json'); - $this->response->setOutput(AJson::encode($json)); - - return null; - } - - $this->loadModel('extension/default_authorizenet'); - - $customer_authorizenet_id = $this - ->model_extension_default_authorizenet - ->getAuthorizeNetCustomerID($this->customer->getId()); - $deleted = $this - ->model_extension_default_authorizenet - ->deleteCreditCard( - $post['use_saved_cc'], - $customer_authorizenet_id - ); - - if ( ! $deleted) { - // transaction failed - $json['error'] = $this->language->get('error_system'); - } else { - //basically reload the page - $json['success'] = $this->html->getSecureURL('checkout/confirm'); - } - - //init controller data - $this->extensions->hk_UpdateData($this, __FUNCTION__); - - $this->load->library('json'); - $this->response->setOutput(AJson::encode($json)); - } } From b7bbd53bbaeb08e6b7d2ad00350328fc369fab44 Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 15:57:03 +0200 Subject: [PATCH 36/81] #1231 --- .../view/default/template/common/page.tpl | 30 +++++++++---------- .../view/default/template/embed/footer.tpl | 21 ++++++------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/public_html/storefront/view/default/template/common/page.tpl b/public_html/storefront/view/default/template/common/page.tpl index 8a92361f07..d39d31d50d 100755 --- a/public_html/storefront/view/default/template/common/page.tpl +++ b/public_html/storefront/view/default/template/common/page.tpl @@ -145,26 +145,26 @@ if($scripts_bottom && is_array($scripts_bottom)) { ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { - 'id': '', - 'affiliation': '', - 'revenue': '', - 'shipping': '', - 'tax': '', - 'currency': '', - 'city': '', - 'state': '', - 'country': '' + 'id': , + 'affiliation': , + 'revenue': , + 'shipping': , + 'tax': , + 'currency': , + 'city': , + 'state': , + 'country': }); ga('ecommerce:addItem', { - 'id': '', - 'name': '', - 'sku': '', - 'brand': '', - 'price': '', - 'quantity': '' + 'id': , + 'name': , + 'sku': , + 'brand': , + 'price': , + 'quantity': }); diff --git a/public_html/storefront/view/default/template/embed/footer.tpl b/public_html/storefront/view/default/template/embed/footer.tpl index 3b9ede7e69..6507c5eed6 100644 --- a/public_html/storefront/view/default/template/embed/footer.tpl +++ b/public_html/storefront/view/default/template/embed/footer.tpl @@ -14,14 +14,14 @@ _gaq.push(['_set', 'currencyCode', '']); _gaq.push(['_addTrans', - '', - '', - '', - '', - '', - '', - '', - '' + , + , + , + , + , + , + , + ]); _gaq.push(['_trackTrans']); @@ -30,7 +30,7 @@ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); @@ -43,4 +43,5 @@ - \ No newline at end of file + + From 6c35e7f3bc3ae2acfa8648f3da1c7cb4a94c37ef Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 17:14:53 +0200 Subject: [PATCH 37/81] #1227 --- .../responses/extension/default_pp_pro.php | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php b/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php index 864eed17a2..786c90a157 100755 --- a/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php +++ b/public_html/extensions/default_pp_pro/storefront/controller/responses/extension/default_pp_pro.php @@ -238,8 +238,12 @@ public function send() 'CUSTOM' => $order_info['order_id'], 'INVNUM' => '#'.$order_info['order_id'], 'PAYMENTACTION' => $payment_type, - 'AMT' => $this->currency->format($order_info['total'], $order_info['currency'], - $order_info['value'], false), + 'AMT' => $this->currency->format( + $order_info['total'], + $order_info['currency'], + $order_info['value'], + false + ), 'ITEMAMT' => (float)$this->data['items_total'], 'TAXAMT' => (float)$this->data['tax_total'], 'SHIPPINGAMT' => (float)$this->data['shipping_total'], @@ -248,7 +252,7 @@ public function send() 'ACCT' => str_replace(' ', '', $this->request->post['cc_number']), 'CARDSTART' => $this->request->post['cc_start_date_month'].$this->request->post['cc_start_date_year'], 'EXPDATE' => $this->request->post['cc_expire_date_month'] - .$this->request->post['cc_expire_date_year'], + .$this->request->post['cc_expire_date_year'], 'CVV2' => $this->request->post['cc_cvv2'], 'CARDISSUE' => $this->request->post['cc_issue'], 'FIRSTNAME' => $order_info['payment_firstname'], @@ -258,8 +262,9 @@ public function send() 'IPADDRESS' => $this->request->getRemoteIP(), 'STREET' => $order_info['payment_address_1'], 'CITY' => $order_info['payment_city'], - 'STATE' => ($order_info['payment_iso_code_2'] - != 'US') ? $order_info['payment_zone'] : $order_info['payment_zone_code'], + 'STATE' => ($order_info['payment_iso_code_2'] != 'US') + ? $order_info['payment_zone'] + : $order_info['payment_zone_code'], 'ZIP' => $order_info['payment_postcode'], 'COUNTRYCODE' => $order_info['payment_iso_code_2'], 'CURRENCYCODE' => $order_info['currency'], @@ -272,8 +277,9 @@ public function send() 'SHIPTONAME' => $order_info['shipping_firstname'].' '.$order_info['shipping_lastname'], 'SHIPTOSTREET' => $order_info['shipping_address_1'], 'SHIPTOCITY' => $order_info['shipping_city'], - 'SHIPTOSTATE' => ($order_info['shipping_iso_code_2'] - != 'US') ? $order_info['shipping_zone'] : $order_info['shipping_zone_code'], + 'SHIPTOSTATE' => ($order_info['shipping_iso_code_2'] != 'US') + ? $order_info['shipping_zone'] + : $order_info['shipping_zone_code'], 'SHIPTOCOUNTRYCODE' => $order_info['shipping_iso_code_2'], 'SHIPTOZIP' => $order_info['shipping_postcode'], )); @@ -282,8 +288,9 @@ public function send() 'SHIPTONAME' => $order_info['payment_firstname'].' '.$order_info['payment_lastname'], 'SHIPTOSTREET' => $order_info['payment_address_1'], 'SHIPTOCITY' => $order_info['payment_city'], - 'SHIPTOSTATE' => ($order_info['payment_iso_code_2'] - != 'US') ? $order_info['payment_zone'] : $order_info['payment_zone_code'], + 'SHIPTOSTATE' => ($order_info['payment_iso_code_2'] != 'US') + ? $order_info['payment_zone'] + : $order_info['payment_zone_code'], 'SHIPTOCOUNTRYCODE' => $order_info['payment_iso_code_2'], 'SHIPTOZIP' => $order_info['payment_postcode'], )); @@ -293,6 +300,7 @@ public function send() //check amounts $calc_total = $this->data['items_total'] + $this->data['shipping_total'] + $this->data['tax_total'] + $this->data['handling_total']; + $skip_item_list = false; if (($calc_total - $order_total) !== 0.0) { $skip_item_list = true; @@ -322,7 +330,6 @@ public function send() curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($payment_data)); $response = curl_exec($curl); - if (!$response) { $json['error'] = 'Cannot establish a connection to the server'; $err = new AError('Paypal Pro Error: DoDirectPayment failed: '.curl_error($curl).'('.curl_errno($curl).')'); @@ -421,8 +428,12 @@ protected function _get_products_data($order_info) $this->data['products'][] = array( 'name' => ($virtual['name'] ? $virtual['name'] : 'Virtual Product'), 'model' => '', - 'price' => $this->currency->format($virtual['amount'], $order_info['currency'], - $order_info['value'], false), + 'price' => $this->currency->format( + $virtual['amount'], + $order_info['currency'], + $order_info['value'], + false + ), 'quantity' => ($virtual['quantity'] ? $virtual['quantity'] : 1), 'option' => array(), 'weight' => 0, @@ -439,17 +450,18 @@ protected function _get_products_data($order_info) if (in_array($total['id'], array('subtotal', 'total'))) { continue; } + if (in_array($total['id'], array('promotion', 'coupon'))) { $total['value'] = $total['value'] < 0 ? $total['value'] * -1 : $total['value']; $this->data['discount_amount_cart'] += $total['value']; } else { $price = $this->currency->format($total['value'], $order_info['currency'], $order_info['value'], false); - if (in_array($total['id'], array('tax'))) { + if (in_array($total['total_type'], array('tax'))) { $this->data['tax_total'] += $price; - } elseif (in_array($total['id'], array('shipping'))) { + } elseif (in_array($total['total_type'], array('shipping'))) { $this->data['shipping_total'] += $price; - } elseif (in_array($total['id'], array('handling', 'fee'))) { + } elseif (in_array($total['total_type'], array('handling', 'fee'))) { $this->data['handling_total'] += $price; } else { $this->data['items_total'] += $price; @@ -467,8 +479,10 @@ protected function _get_products_data($order_info) } } - $calc_total = $this->data['items_total'] + $this->data['shipping_total'] - + $this->data['tax_total'] + $this->data['handling_total']; + $calc_total = $this->data['items_total'] + + $this->data['shipping_total'] + + $this->data['tax_total'] + + $this->data['handling_total']; if (($calc_total - $order_info['order_total']) !== 0.0) { foreach ($totals['total_data'] as $total) { From d0705e54544d053e632405d9ab01675ddb60f629 Mon Sep 17 00:00:00 2001 From: abolabo Date: Thu, 7 Mar 2019 19:34:17 +0200 Subject: [PATCH 38/81] #1224 --- public_html/core/engine/resources.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public_html/core/engine/resources.php b/public_html/core/engine/resources.php index fb7240b32a..7a6d9c8c14 100755 --- a/public_html/core/engine/resources.php +++ b/public_html/core/engine/resources.php @@ -638,6 +638,10 @@ public function getResourceAllObjects($object_name, $object_id, $sizes = array(' 'description' => $rsrc_info['description'], ); } + + if($limit && count($resources) == $limit){ + break; + } } if ($limit == 1) { From b032abbd18589097cf53ad0abf473827c1de284e Mon Sep 17 00:00:00 2001 From: abolabo Date: Fri, 8 Mar 2019 13:32:43 +0200 Subject: [PATCH 39/81] #1219 --- .../responses/embed/do_embed_manufacturer_modal.tpl | 2 +- .../template/responses/embed/do_embed_product_modal.tpl | 2 +- public_html/storefront/view/default/template/embed/js.tpl | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl index d868063183..f45fc19dc4 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_manufacturer_modal.tpl @@ -5,7 +5,7 @@
-
+
diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl index ed5168bd83..668e2af065 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_product_modal.tpl @@ -5,7 +5,7 @@
-
+
diff --git a/public_html/storefront/view/default/template/embed/js.tpl b/public_html/storefront/view/default/template/embed/js.tpl index 73bdaa3caf..84403eff95 100644 --- a/public_html/storefront/view/default/template/embed/js.tpl +++ b/public_html/storefront/view/default/template/embed/js.tpl @@ -366,8 +366,10 @@ var init = function() { } var abc_populate_cart = function(w_url, url_params){ + if(!w_url) return; //using local jQuery $ = jQuery; + var url = w_url+'?rt=r/embed/js/cart'+url_params; abc_process_request(url); } @@ -381,8 +383,8 @@ var init = function() { } if(currency && currency.length > 0) { append += '¤cy='+currency; - } - return append; + } + return append; } } }; From 7771d117f6e14e1289c1b02ca4ddd89455d8d92e Mon Sep 17 00:00:00 2001 From: abolabo Date: Fri, 8 Mar 2019 13:39:36 +0200 Subject: [PATCH 40/81] #1219 --- .../template/responses/embed/do_embed_category_modal.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl b/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl index ad68d7c6d4..eb2bb5d488 100755 --- a/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl +++ b/public_html/admin/view/default/template/responses/embed/do_embed_category_modal.tpl @@ -5,7 +5,7 @@
-
+
From 960c10231b79015546001fcfc571c6194cff71c0 Mon Sep 17 00:00:00 2001 From: abolabo Date: Fri, 8 Mar 2019 19:16:20 +0200 Subject: [PATCH 41/81] #1226 --- .../admin/controller/pages/design/blocks.php | 20 ++++++----- .../responses/listing_grid/blocks_grid.php | 12 +++++-- public_html/core/lib/listing.php | 13 ++++++-- public_html/core/lib/listing_manager.php | 33 +++++++++++++------ .../pages/extension/banner_manager.php | 10 +++--- .../controller/pages/tool/forms_manager.php | 26 ++++++++------- public_html/install/abantecart_database.sql | 3 +- .../install/abantecart_database_upgrade.sql | 7 +++- .../controller/blocks/listing_block.php | 2 +- 9 files changed, 82 insertions(+), 44 deletions(-) diff --git a/public_html/admin/controller/pages/design/blocks.php b/public_html/admin/controller/pages/design/blocks.php index 700ec605de..727a5f9ddc 100644 --- a/public_html/admin/controller/pages/design/blocks.php +++ b/public_html/admin/controller/pages/design/blocks.php @@ -232,7 +232,7 @@ public function insert() $content = $this->request->post['block_content']; break; default: - $this->redirect($this->html->getSecureURL('design/blocks')); + redirect($this->html->getSecureURL('design/blocks')); break; } @@ -261,7 +261,7 @@ public function insert() if (strpos($this->request->post['listing_datasource'], 'custom_') !== false) { $listing_manager = new AListingManager($custom_block_id); if ($this->request->post['selected']) { - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); $k = 0; foreach ($this->request->post['selected'] as $id) { $listing_manager->saveCustomListItem( @@ -270,6 +270,7 @@ public function insert() 'id' => $id, 'limit' => $this->request->post['limit'], 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') )); $k++; } @@ -278,7 +279,7 @@ public function insert() $this->session->data ['success'] = $this->language->get('text_success'); unset($this->session->data['custom_list_changes'][$custom_block_id], $this->session->data['layout_params']); - $this->redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id)); + redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id)); } // if we need to save new block in layout - keep parameters in session @@ -347,12 +348,12 @@ public function edit() // if datasource changed - drop custom list if ($block_info['content']['listing_datasource'] != $content['listing_datasource']) { - $listing_manager->deleteCustomListing(); + //$listing_manager->deleteCustomListing(); } if (strpos($content['listing_datasource'], 'custom_') !== false) { if ($this->request->post['selected']) { - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); $k = 0; foreach ($this->request->post['selected'] as $id) { $listing_manager->saveCustomListItem( @@ -361,6 +362,7 @@ public function edit() 'id' => $id, 'limit' => $this->request->post['limit'], 'sort_order' => $k, + 'store_id' => $this->config->get('config_store_id') )); $k++; } @@ -377,7 +379,7 @@ public function edit() $content = $this->request->post['block_content']; break; default: - $this->redirect($this->html->getSecureURL('design/blocks')); + redirect($this->html->getSecureURL('design/blocks')); break; } @@ -394,7 +396,7 @@ public function edit() )); $layout->editBlockStatus((int)$this->request->post['block_status'], 0, $custom_block_id); $this->session->data ['success'] = $this->language->get('text_success'); - $this->redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id)); + redirect($this->html->getSecureURL('design/blocks/edit', '&custom_block_id='.$custom_block_id)); } // end of saving @@ -492,7 +494,7 @@ public function delete() } //update controller data $this->extensions->hk_UpdateData($this, __FUNCTION__); - $this->redirect($this->html->getSecureURL('design/blocks')); + redirect($this->html->getSecureURL('design/blocks')); } private function _getHTMLForm() @@ -936,7 +938,7 @@ private function _getListingForm() $this->view->batchAssign($this->language->getASet()); $this->view->batchAssign($this->data); $this->view->assign('form_language_switch', $this->html->getContentLanguageSwitcher()); - + $this->view->assign('form_store_switch', $this->html->getStoreSwitcher()); $this->view->assign('language_code', $this->session->data['language']); $this->view->assign('help_url', $this->gen_help_url('block_edit')); $this->view->assign('rl', $this->html->getSecureURL('common/resource_library', '&object_name=custom_block&type=image&mode=url')); diff --git a/public_html/admin/controller/responses/listing_grid/blocks_grid.php b/public_html/admin/controller/responses/listing_grid/blocks_grid.php index 9f95b327c3..df018aa3c3 100755 --- a/public_html/admin/controller/responses/listing_grid/blocks_grid.php +++ b/public_html/admin/controller/responses/listing_grid/blocks_grid.php @@ -150,10 +150,16 @@ public function update_field() if (isset($this->request->post['selected']) && is_array($this->request->post['selected'])) { //updating custom list of selected items $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); $k = 0; foreach ($this->request->post['selected'] as $id) { - $listing_manager->saveCustomListItem(array('id' => $id, 'sort_order' => (int)$k)); + $listing_manager->saveCustomListItem( + array( + 'id' => $id, + 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') + ) + ); $k++; } } @@ -332,7 +338,7 @@ public function getCustomListingSubForm() if ($content['listing_datasource'] == $listing_datasource) { $lm = new AListingManager($custom_block_id); - $list = $lm->getCustomList(); + $list = $lm->getCustomList($this->config->get('config_store_id')); if ($list) { foreach ($list as $row) { diff --git a/public_html/core/lib/listing.php b/public_html/core/lib/listing.php index ea5a26fccf..2ed5a7a2fb 100644 --- a/public_html/core/lib/listing.php +++ b/public_html/core/lib/listing.php @@ -169,22 +169,29 @@ public function __set($key, $value) } /** + * @param int $store_id + * * @return array */ - public function getCustomList() + public function getCustomList($store_id=0) { - if (!$this->custom_block_id) { + $store_id = (int)$store_id; + if (!(int)$this->custom_block_id) { return array(); } + $custom_block_id = (int)$this->custom_block_id; - $cache_key = 'blocks.custom.'.$custom_block_id; + $cache_key = 'blocks.custom.'.$custom_block_id.$store_id; $output = $this->cache->pull($cache_key); + if ($output !== false) { return $output; } + $result = $this->db->query("SELECT * FROM `".$this->db->table('custom_lists')."` WHERE custom_block_id = '".$custom_block_id."' + AND store_id = '".$store_id."' ORDER BY sort_order"); $output = $result->rows; $this->cache->push($cache_key, $output); diff --git a/public_html/core/lib/listing_manager.php b/public_html/core/lib/listing_manager.php index da9de086ba..94e56ea77e 100755 --- a/public_html/core/lib/listing_manager.php +++ b/public_html/core/lib/listing_manager.php @@ -62,16 +62,24 @@ public function __construct($custom_block_id) public function saveCustomListItem($data) { $custom_block_id = (int)$this->custom_block_id; + if(!$custom_block_id){ + return false; + } + $data['store_id'] = (int)$data['store_id']; + if (!isset($data['data_type']) && isset($data['listing_datasource'])) { $listing_properties = $this->getListingDataSources(); $data['data_type'] = $listing_properties[$data['listing_datasource']]['data_type']; } - $result = $this->db->query("SELECT * - FROM ".$this->db->table("custom_lists")." - WHERE custom_block_id = '".$custom_block_id."' - AND id='".$data['id']."' - AND data_type='".$data['data_type']."'"); + $result = $this->db->query( + "SELECT * + FROM ".$this->db->table("custom_lists")." + WHERE custom_block_id = '".$custom_block_id."' + AND id='".(int)$data['id']."' + AND data_type='".$this->db->escape($data['data_type'])."' + AND store_id='".(int)$data['store_id']."'" + ); if ($result->num_rows && $custom_block_id) { $this->db->query("UPDATE ".$this->db->table("custom_lists")." @@ -79,22 +87,25 @@ public function saveCustomListItem($data) ".(!is_null($data['sort_order']) ? ", sort_order = '".(int)$data['sort_order']."'" : "")." WHERE custom_block_id = '".$custom_block_id."' AND id='".$data['id']."' - AND data_type='".$data['data_type']."'"); + AND data_type='".$this->db->escape($data['data_type'])."' + AND store_id='".(int)$data['store_id']."'"); } else { $this->db->query("INSERT INTO ".$this->db->table("custom_lists")." ( custom_block_id, data_type, id, sort_order, + store_id, date_added ) VALUES ('".$custom_block_id."', '".$data['data_type']."', '".(int)$data['id']."', '".( int )$data ['sort_order']."', + '".( int )$data ['store_id']."', NOW())"); } - $this->cache->remove('blocks.custom.'.$custom_block_id); + $this->cache->remove('blocks.custom.'.$custom_block_id.$data ['store_id']); return true; } @@ -121,12 +132,14 @@ public function deleteCustomListItem($data) // delete all custom list of custom listing block - public function deleteCustomListing() + public function deleteCustomListing($store_id) { + $store_id = (int)$store_id; $custom_block_id = (int)$this->custom_block_id; $sql = "DELETE FROM ".$this->db->table("custom_lists")." - WHERE custom_block_id = '".$custom_block_id."'"; + WHERE custom_block_id = '".$custom_block_id."' + AND store_id = '".$store_id."'"; $this->db->query($sql); - $this->cache->remove('blocks.custom.'.$custom_block_id); + $this->cache->remove('blocks.custom.'.$custom_block_id.$store_id); } } \ No newline at end of file diff --git a/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php b/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php index f5e68ea2b6..7143386fb3 100644 --- a/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php +++ b/public_html/extensions/banner_manager/admin/controller/pages/extension/banner_manager.php @@ -662,13 +662,14 @@ public function insert_block() if ($this->request->post['block_banners']) { $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); foreach ($this->request->post['block_banners'] as $k => $id) { $listing_manager->saveCustomListItem( array( 'data_type' => 'banner_id', 'id' => (int)$id, 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') )); } @@ -792,7 +793,7 @@ public function edit_block() // save list if it is custom if ($this->request->post['block_banners']) { $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); $k = 0; foreach ($this->request->post['block_banners'] as $id) { $listing_manager->saveCustomListItem( @@ -800,13 +801,14 @@ public function edit_block() 'data_type' => 'banner_id', 'id' => $id, 'sort_order' => (int)$k, + 'store_id' => $this->config->get('config_store_id') )); $k++; } } else { //delete the list as nothing provided $listing_manager = new AListingManager($custom_block_id); - $listing_manager->deleteCustomListing(); + $listing_manager->deleteCustomListing($this->config->get('config_store_id')); } $this->session->data ['success'] = $this->language->get('text_banner_success'); @@ -876,7 +878,7 @@ private function _getBlockForm() $this->data['banner_group_name'] = $content['banner_group_name']; $lm = new AListingManager($this->request->get ['custom_block_id']); - $list = $lm->getCustomList(); + $list = $lm->getCustomList($this->config->get('config_store_id')); $options_list = array(); if ($list) { diff --git a/public_html/extensions/forms_manager/admin/controller/pages/tool/forms_manager.php b/public_html/extensions/forms_manager/admin/controller/pages/tool/forms_manager.php index 2da708a6cd..9739d426b2 100644 --- a/public_html/extensions/forms_manager/admin/controller/pages/tool/forms_manager.php +++ b/public_html/extensions/forms_manager/admin/controller/pages/tool/forms_manager.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} /** * Class ControllerPagesToolFormsManager @@ -48,13 +45,13 @@ public function main() if ($this->model_tool_forms_manager->getFormIdByName($this->request->post['form_name'])) { $this->session->data['warning'] = $this->language->get('error_duplicate_form_name'); - $this->redirect($this->html->getSecureURL('tool/forms_manager')); + redirect($this->html->getSecureURL('tool/forms_manager')); } $this->request->get['form_id'] = $this->model_tool_forms_manager->addForm($this->request->post); } elseif (!$this->model_tool_forms_manager->addField($this->request->get['form_id'], $this->request->post)) { $this->session->data['warning'] = $this->language->get('error_duplicate_field_name'); } - $this->redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$this->request->get['form_id'])); + redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$this->request->get['form_id'])); exit; } @@ -174,7 +171,7 @@ public function update() $form_id = $this->model_tool_forms_manager->addForm($this->request->post); $this->session->data['success'] = $this->language->get('text_success_added_form'); } - $this->redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$form_id)); + redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$form_id)); } $this->view->assign('error', $this->error); @@ -199,7 +196,7 @@ public function removeField() $this->loadModel('tool/forms_manager'); $this->model_tool_forms_manager->removeField($this->request->get['form_id'], $this->request->get['field_id']); $this->session->data['success'] = $this->language->get('text_field_removed'); - $this->redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$this->request->get['form_id'])); + redirect($this->html->getSecureURL('tool/forms_manager/update', '&form_id='.$this->request->get['form_id'])); } private function _getForm() @@ -209,7 +206,7 @@ private function _getForm() if (!$this->config->get('forms_manager_default_sender_name') || !$this->config->get('forms_manager_default_sender_email')) { $this->data['error_warning'] = $this->html->convertLinks($this->language->get('forms_manager_error_empty_sender')); } - + $fields = array(); $this->data['form_data'] = $this->model_tool_forms_manager->getFormById($this->request->get['form_id']); $this->data['form_edit_title'] = isset($this->data['form_data']['description']) ? $this->data['form_data']['description'] : $this->language->get('entry_add_new_form'); @@ -489,6 +486,8 @@ public function insert_block() $lm = new ALayoutManager(); $block = $lm->getBlockByTxtId('custom_form_block'); $this->data['block_id'] = $block['block_id']; + $parent_instance_id = null; + $position = 0; if ($this->request->is_POST() && $this->_validateBlockForm()) { if (isset($this->session->data['layout_params'])) { @@ -557,6 +556,7 @@ public function insert_block() 'data_type' => 'form_id', 'id' => $id, 'sort_order' => (int)$info['sort_order'], + 'store_id' => $this->config->get('config_store_id') ) ); } else { @@ -572,7 +572,7 @@ public function insert_block() } $this->session->data ['success'] = $this->language->get('text_success'); - $this->redirect($this->html->getSecureURL('tool/forms_manager/edit_block', '&custom_block_id='.$custom_block_id)); + redirect($this->html->getSecureURL('tool/forms_manager/edit_block', '&custom_block_id='.$custom_block_id)); } foreach ($this->request->post as $k => $v) { @@ -602,7 +602,7 @@ public function edit_block() $this->data['block_id'] = $block['block_id']; $custom_block_id = (int)$this->request->get['custom_block_id']; if (!$custom_block_id) { - $this->redirect($this->html->getSecureURL('tool/forms_manager/insert_block')); + redirect($this->html->getSecureURL('tool/forms_manager/insert_block')); } $tabs = array( @@ -661,6 +661,7 @@ public function edit_block() 'data_type' => 'form_id', 'id' => $id, 'sort_order' => (int)$info['sort_order'], + 'store_id' => $this->config->get('config_store_id') ) ); } else { @@ -676,7 +677,7 @@ public function edit_block() } $this->session->data ['success'] = $this->language->get('text_success'); - $this->redirect($this->html->getSecureURL('tool/forms_manager/edit_block', '&custom_block_id='.$custom_block_id)); + redirect($this->html->getSecureURL('tool/forms_manager/edit_block', '&custom_block_id='.$custom_block_id)); } $this->_getBlockForm(); @@ -738,7 +739,7 @@ private function _getBlockForm() $this->data['form_id'] = $content['form_id']; $lm = new AListingManager($this->request->get ['custom_block_id']); - $list = $lm->getCustomList(); + $list = $lm->getCustomList($this->config->get('config_store_id')); if ($list) { foreach ($list as $row) { $listing_data[$row['id']] = array( @@ -908,6 +909,7 @@ private function _validateBlockForm() $this->error ['warning'] = $this->session->data['warning'] = 'Block with txt_id "custom_form_block" does not exists in your database!'; } + $required = array(); if ($this->request->post) { $required = array('block_name', 'block_title'); diff --git a/public_html/install/abantecart_database.sql b/public_html/install/abantecart_database.sql index 67e2b735a5..bc329c43dd 100755 --- a/public_html/install/abantecart_database.sql +++ b/public_html/install/abantecart_database.sql @@ -10253,11 +10253,12 @@ CREATE TABLE `ac_custom_lists` ( `custom_block_id` int(10) NOT NULL, `data_type` varchar(70) NOT NULL, `id` int(10) NOT NULL, + `store_id` int(10), `sort_order` int(10) NOT NULL DEFAULT 0, `date_added` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `date_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`rowid`), - INDEX `ac_custom_block_id_list_idx` (`custom_block_id` ) + INDEX `ac_custom_block_id_list_idx` (`custom_block_id`, `store_id` ) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; -- diff --git a/public_html/install/abantecart_database_upgrade.sql b/public_html/install/abantecart_database_upgrade.sql index 11a85394b6..d8d68221ce 100755 --- a/public_html/install/abantecart_database_upgrade.sql +++ b/public_html/install/abantecart_database_upgrade.sql @@ -30,4 +30,9 @@ CREATE TABLE `ac_order_product_stock_locations` ( `sort_order` int(11) DEFAULT '0', KEY `ac_product_options_value_idx` (`product_option_value_id`), KEY `ac_product_options_value_idx2` (`order_product_id`,`product_id`,`product_option_value_id`,`location_id`) -); \ No newline at end of file +); + +ALTER TABLE `ac_custom_lists` +CHANGE COLUMN `store_id` `store_id` INT NULL DEFAULT 0 AFTER `id`, +DROP INDEX `ac_custom_block_id_list_idx` , +ADD INDEX `ac_custom_block_id_list_idx` (`custom_block_id` ASC, `id` ASC, `data_type` ASC, `store_id` ASC); diff --git a/public_html/storefront/controller/blocks/listing_block.php b/public_html/storefront/controller/blocks/listing_block.php index 247bfec858..393e69b3e4 100644 --- a/public_html/storefront/controller/blocks/listing_block.php +++ b/public_html/storefront/controller/blocks/listing_block.php @@ -398,7 +398,7 @@ public function getListing() } } else { // for custom listings - $list = $listing->getCustomList(); + $list = $listing->getCustomList($this->config->get('config_store_id')); if (!$list) { return null; } From 87755478ab1e5d183978a5f7cdc0f6b4ced3c020 Mon Sep 17 00:00:00 2001 From: abolabo Date: Fri, 8 Mar 2019 20:34:44 +0200 Subject: [PATCH 42/81] #1220 --- .../controller/responses/product/product.php | 15 ++++-- public_html/admin/model/catalog/product.php | 24 +++++---- .../controller/pages/product/product.php | 52 +++++++++++-------- .../storefront/model/catalog/product.php | 9 ++-- 4 files changed, 59 insertions(+), 41 deletions(-) diff --git a/public_html/admin/controller/responses/product/product.php b/public_html/admin/controller/responses/product/product.php index 06ba5780f5..d387fb1934 100755 --- a/public_html/admin/controller/responses/product/product.php +++ b/public_html/admin/controller/responses/product/product.php @@ -637,7 +637,10 @@ private function _option_value_form($form) $values = $this->attribute_manager->getAttributeValues($attribute['attribute_id'], $this->language->getContentLanguageID()); foreach ($values as $v) { - $this->data['option_attribute']['group'][$option_id]['values'][$v['attribute_value_id']] = addslashes(html_entity_decode($v['value'], ENT_COMPAT, 'UTF-8')); + $this->data['option_attribute']['group'][$option_id]['values'][$v['attribute_value_id']] = addslashes( + html_entity_decode($v['value'], + ENT_COMPAT, + 'UTF-8')); } } } @@ -664,12 +667,18 @@ private function _option_value_form($form) } - $this->data['cancel'] = $this->html->getSecureURL('product/product/load_option', '&product_id='.$this->request->get['product_id'].'&option_id='.$this->request->get['option_id']); + $this->data['cancel'] = $this->html->getSecureURL( + 'product/product/load_option', + '&product_id='.$this->request->get['product_id'].'&option_id='.$this->request->get['option_id'] + ); if (isset($this->request->get['product_option_value_id'])) { $this->data['row_id'] = 'row'.$product_option_value_id; $this->data['attr_val_id'] = $product_option_value_id; - $item_info = $this->model_catalog_product->getProductOptionValue($this->request->get['product_id'], $product_option_value_id); + $item_info = $this->model_catalog_product->getProductOptionValue( + $this->request->get['product_id'], + $product_option_value_id + ); } else { $this->data['row_id'] = 'new_row'; } diff --git a/public_html/admin/model/catalog/product.php b/public_html/admin/model/catalog/product.php index 4a274654ce..08a37c5fe8 100755 --- a/public_html/admin/model/catalog/product.php +++ b/public_html/admin/model/catalog/product.php @@ -2417,6 +2417,7 @@ public function getProductCondition($product_id) LEFT JOIN ".$this->db->table('product_option_descriptions')." pod ON (pod.product_option_id = pov.product_option_id AND pod.language_id = ".$language_id.") WHERE p.product_id = ".$product_id; + $result = $this->db->query($sql); // id product disabled do not run other checks @@ -2429,23 +2430,28 @@ public function getProductCondition($product_id) if (dateISO2Int($result->row['date_available']) > time()) { $output[] = $this->language->get('text_product_unavailable'); } - + $hasTrackOptions = $this->hasTrackOptions($product_id); + $out_of_stock = false; //check is stock track for whole product(not options) enabled and product quantity more than 0 - if ($result->row['base_subtract'] && $result->row['base_quantity'] <= 0 && !$this->hasTrackOptions($product_id) - && !$result->row['option_name'] + if ($result->row['base_subtract'] + && $result->row['base_quantity'] <= 0 + && !$hasTrackOptions ) { $output[] = $this->language->get('text_product_out_of_stock'); + $out_of_stock = true; } - $out_of_stock = false; + $error_txt = array(); - foreach ($result->rows as $k => $row) { - if ($row['subtract'] && $row['quantity'] <= 0) { - $error_txt[] = $row['option_name'].' => '.$row['option_value_name']; - $out_of_stock = true; + if($hasTrackOptions) { + foreach ($result->rows as $k => $row) { + if ($row['subtract'] && $row['quantity'] <= 0) { + $error_txt[] = $row['option_name'].' => '.$row['option_value_name']; + $out_of_stock = true; + } } } - if ($out_of_stock) { + if ($out_of_stock && $error_txt) { $output[] = $this->language->get('text_product_option_out_of_stock'); $output = array_merge($output, $error_txt); } diff --git a/public_html/storefront/controller/pages/product/product.php b/public_html/storefront/controller/pages/product/product.php index 930b50a5c1..5e18f01902 100755 --- a/public_html/storefront/controller/pages/product/product.php +++ b/public_html/storefront/controller/pages/product/product.php @@ -17,9 +17,7 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE')) { - header('Location: static_pages/'); -} + class ControllerPagesProductProduct extends AController { @@ -364,6 +362,7 @@ public function main() // Prepare options and values for display $elements_with_options = HtmlElementFactory::getElementsWithOptions(); $options = array(); + $option_images = array(); $product_options = $this->model_catalog_product->getProductOptions($product_id); //get info from cart if key presents @@ -460,6 +459,8 @@ public function main() } } + $option_data = array(); + //if not values are build, nothing to show if (count($values)) { $value = ''; @@ -514,17 +515,22 @@ public function main() } // main product image $mSizes = array( - 'main' => [ + 'main' => array( 'width' => $this->config->get('config_image_popup_width'), 'height' => $this->config->get('config_image_popup_height'), - ], - 'thumb' => [ + ), + 'thumb' => array( 'width' => $this->config->get('config_image_thumb_width'), 'height' => $this->config->get('config_image_thumb_height'), - ], + ) + ); + $option_images['main'] = $resource->getResourceAllObjects( + 'product_option_value', + $option_data['value'], + $mSizes, + 1, + false ); - $option_images['main'] = - $resource->getResourceAllObjects('product_option_value', $option_data['value'], $mSizes, 1, false); if (!$option_images['main']) { unset($option_images['main']); } @@ -607,16 +613,16 @@ public function main() } // main product image - $sizes = [ - 'main' => [ + $sizes = array( + 'main' => array( 'width' => $this->config->get('config_image_popup_width'), 'height' => $this->config->get('config_image_popup_height'), - ], - 'thumb' => [ + ), + 'thumb' => array( 'width' => $this->config->get('config_image_thumb_width'), 'height' => $this->config->get('config_image_thumb_height'), - ], - ]; + ), + ); if (!$option_images['main']) { $this->data['image_main'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 1, false); if ($this->data['image_main']) { @@ -631,20 +637,20 @@ public function main() } // additional images - $sizes = [ - 'main' => [ + $sizes = array( + 'main' => array( 'width' => $this->config->get('config_image_popup_width'), 'height' => $this->config->get('config_image_popup_height'), - ], - 'thumb' => [ + ), + 'thumb' => array( 'width' => $this->config->get('config_image_additional_width'), 'height' => $this->config->get('config_image_additional_height'), - ], - 'thumb2' => [ + ), + 'thumb2' => array( 'width' => $this->config->get('config_image_thumb_width'), 'height' => $this->config->get('config_image_thumb_height'), - ], - ]; + ) + ); if (!$option_images['images']) { $this->data['images'] = $resource->getResourceAllObjects('products', $product_id, $sizes, 0, false); } else { diff --git a/public_html/storefront/model/catalog/product.php b/public_html/storefront/model/catalog/product.php index b129d339a9..4053b2a43a 100755 --- a/public_html/storefront/model/catalog/product.php +++ b/public_html/storefront/model/catalog/product.php @@ -77,7 +77,7 @@ public function isStockTrackable($product_id) $track_status += (int)$row['subtract']; } //if no options - check whole product subtract - if (!$track_status && !$query->num_rows) { + if (!$track_status) { //check main product $query = $this->db->query("SELECT subtract FROM ".$this->db->table("products")." p @@ -152,7 +152,7 @@ public function getProductsStockInfo($product_ids = array()) * * @param int $product_id * - * @return int|true - integer as quantity, true as availability when trackstock is off + * @return int */ public function hasAnyStock($product_id) { @@ -176,10 +176,7 @@ public function hasAnyStock($product_id) } $total_quantity += $row['quantity'] < 0 ? 0 : $row['quantity']; } - //if some of option value have subtract NO - think product is available - if ($total_quantity == 0 && $notrack_qnt) { - $total_quantity = true; - } + } else { //get product quantity without options $query = $this->db->query("SELECT quantity From cb4b1b1b4f49eb103cc91d4b5903d5cfaa158da3 Mon Sep 17 00:00:00 2001 From: abantecart Date: Sun, 10 Mar 2019 19:43:30 -0400 Subject: [PATCH 43/81] #1232 Fix switch button attributes --- .../admin/view/default/template/form/switch.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public_html/admin/view/default/template/form/switch.tpl b/public_html/admin/view/default/template/form/switch.tpl index ffc9408de7..7763a1eb49 100644 --- a/public_html/admin/view/default/template/form/switch.tpl +++ b/public_html/admin/view/default/template/form/switch.tpl @@ -1,12 +1,12 @@
> - - - + + + - - - + + +
Date: Sun, 10 Mar 2019 20:22:04 -0400 Subject: [PATCH 44/81] #1198 Fix for subcategories in Storefront API --- public_html/storefront/controller/api/product/category.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public_html/storefront/controller/api/product/category.php b/public_html/storefront/controller/api/product/category.php index e3d42c42b1..5ac0ec7734 100755 --- a/public_html/storefront/controller/api/product/category.php +++ b/public_html/storefront/controller/api/product/category.php @@ -49,6 +49,11 @@ public function get() $url = defined('HTTP_SERVER') ? HTTP_SERVER : 'http://'.REAL_HOST.get_url_path($_SERVER['PHP_SELF']); $category_info['seo_url'] = $url.'/'.$keyword; } + + if (isset($category_info['total_subcategories']) && $category_info['total_subcategories'] > 0) { + $category_info['subcategories'] = $this->getCategories($category_id); + } + } else { $category_info['category_id'] = 0; $category_info['subcategories'] = $this->getCategories(); From 51277f8633cb52bc67ecd5fe57e80fb6b50aa6c1 Mon Sep 17 00:00:00 2001 From: abantecart Date: Sun, 10 Mar 2019 20:47:12 -0400 Subject: [PATCH 45/81] #1194 Improve storefront logo max width and height --- .../storefront/view/default/stylesheet/style.css | 10 +++++++--- .../view/default/stylesheet/style.response.css | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/public_html/storefront/view/default/stylesheet/style.css b/public_html/storefront/view/default/stylesheet/style.css index 368a82efae..05304e0d39 100755 --- a/public_html/storefront/view/default/stylesheet/style.css +++ b/public_html/storefront/view/default/stylesheet/style.css @@ -272,11 +272,15 @@ section.row { } .header-logo { - width: 300px; background-color: #fff; text-align: center; - height: 72px; - line-height: 72px + line-height: 72px; + max-width: 300px; + max-height: 72px; +} +.header-logo img { + max-width: 100%; + max-height: 100%; } #topnav select { diff --git a/public_html/storefront/view/default/stylesheet/style.response.css b/public_html/storefront/view/default/stylesheet/style.response.css index d6e3a35be2..eab8ffcc63 100755 --- a/public_html/storefront/view/default/stylesheet/style.response.css +++ b/public_html/storefront/view/default/stylesheet/style.response.css @@ -268,11 +268,15 @@ section.row { } .header-logo { - width: 300px; background-color: #fff; text-align: center; - height: 72px; - line-height: 72px + line-height: 72px; + max-width: 300px; + max-height: 72px; +} +.header-logo img { + max-width: 100%; + max-height: 100%; } .addresses>section{ From 8ad4e8f7adb3af8925e2b589f462181f2e6dad25 Mon Sep 17 00:00:00 2001 From: abantecart Date: Sun, 10 Mar 2019 21:24:50 -0400 Subject: [PATCH 46/81] #1184 Improve product tags filtering on product create and update --- public_html/admin/model/catalog/product.php | 47 ++++++++++++--------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/public_html/admin/model/catalog/product.php b/public_html/admin/model/catalog/product.php index 08a37c5fe8..770c30ff9f 100755 --- a/public_html/admin/model/catalog/product.php +++ b/public_html/admin/model/catalog/product.php @@ -18,7 +18,6 @@ needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ - /** * @property ModelCatalogDownload $model_catalog_download * @property ALanguageManager $language @@ -165,12 +164,12 @@ public function addProduct($data) if ($data['product_tags']) { if (is_string($data['product_tags'])) { - $tags = (array)explode(',', $data['product_tags']); + $tags = $this->getUniqueTags($data['product_tags']); $tags = array($language_id => $tags); } elseif (is_array($data['product_tags'])) { $tags = $data['product_tags']; foreach ($tags as &$taglist) { - $taglist = (array)explode(',', $taglist); + $taglist = $this->getUniqueTags($taglist); } unset($taglist); } else { @@ -358,8 +357,7 @@ public function updateProduct($product_id, $data) } if (isset($data['product_tags'])) { - $tags = explode(',', $data['product_tags']); - + $tags = $this->getUniqueTags($data['product_tags']); foreach ($tags as &$tag) { $tag = $this->db->escape(trim($tag)); } @@ -2442,7 +2440,7 @@ public function getProductCondition($product_id) } $error_txt = array(); - if($hasTrackOptions) { + if ($hasTrackOptions) { foreach ($result->rows as $k => $row) { if ($row['subtract'] && $row['quantity'] <= 0) { $error_txt[] = $row['option_name'].' => '.$row['option_value_name']; @@ -2637,16 +2635,16 @@ public function hasAnyStock($product_id) * * @return array */ - public function getProductStockLocations($product_id, $product_option_value_id = 0) + public function getProductStockLocations($product_id, $product_option_value_id = 0) { $sql = "SELECT * FROM ".$this->db->table('product_stock_locations')." psl LEFT JOIN ".$this->db->table('locations')." l ON l.location_id = psl.location_id WHERE psl.product_id=".(int)$product_id; - if($product_option_value_id){ + if ($product_option_value_id) { $sql .= " AND psl.product_option_value_id = ".(int)$product_option_value_id; - }else{ + } else { $sql .= " AND psl.product_option_value_id IS NULL"; } @@ -2656,9 +2654,11 @@ public function getProductStockLocations($product_id, $product_option_value_id = return $result->rows; } - public function updateProductStockLocations($locations, $product_id, $product_option_value_id = 0 ) + public function updateProductStockLocations($locations, $product_id, $product_option_value_id = 0) { - if (!$locations) { return false;} + if (!$locations) { + return false; + } $this->db->query( "DELETE @@ -2670,8 +2670,8 @@ public function updateProductStockLocations($locations, $product_id, $product_op ); $totals = array(); - foreach($locations as $location_id=>$location_details){ - if(!(int)$location_id){ + foreach ($locations as $location_id => $location_details) { + if (!(int)$location_id) { continue; } $this->db->query( @@ -2679,9 +2679,9 @@ public function updateProductStockLocations($locations, $product_id, $product_op (product_id, product_option_value_id, location_id, quantity, sort_order) VALUES( ".(int)$product_id.", - ".( (int)$product_option_value_id - ? (int)$product_option_value_id - : 'NULL' ).", + ".((int)$product_option_value_id + ? (int)$product_option_value_id + : 'NULL').", ".(int)$location_id.", ".(int)$location_details['quantity'].", ".(int)$location_details['sort_order']." @@ -2691,11 +2691,10 @@ public function updateProductStockLocations($locations, $product_id, $product_op $totals[] = (int)$location_details['quantity']; } - //update_total_quantity if (!$product_option_value_id) { $this->db->query("UPDATE `".$this->db->table("products`")." SET quantity= '".(int)array_sum($totals)."'"); - }elseif(array_sum($totals)){ + } elseif (array_sum($totals)) { $this->db->query( "UPDATE `".$this->db->table("product_option_values`")." SET quantity= '".(int)array_sum($totals)."' @@ -2710,7 +2709,7 @@ public function updateProductStockLocations($locations, $product_id, $product_op * * @return mixed */ - public function getOrderProductStockLocations($order_product_id) + public function getOrderProductStockLocations($order_product_id) { $sql = "SELECT * FROM ".$this->db->table('order_product_stock_locations')." @@ -2719,4 +2718,14 @@ public function getOrderProductStockLocations($order_product_id) return $result->rows; } + /** + * @param $string + * + * @return array + */ + public function getUniqueTags($string) { + $tags = array_map('trim', explode(',', $string)); + return array_intersect_key($tags, array_unique(array_map('strtolower', $tags))); + } + } \ No newline at end of file From d753295ee77e18c093ed4d8807943c2ef0e2fb01 Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 11 Mar 2019 10:21:18 +0200 Subject: [PATCH 47/81] install sample data sql fix --- .../install/abantecart_sample_data.sql | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/public_html/install/abantecart_sample_data.sql b/public_html/install/abantecart_sample_data.sql index 07694c42e9..7a6e81d92d 100755 --- a/public_html/install/abantecart_sample_data.sql +++ b/public_html/install/abantecart_sample_data.sql @@ -260,16 +260,25 @@ INSERT INTO `ac_block_descriptions` VALUES (20,11,1,'0',0,'Main Page Banner Bott INSERT INTO `ac_block_descriptions` VALUES (18,10,1,'0',0,'Main Page Promo','Promo','',' <section class="row promo_section">\r\n <div class="col-md-3 col-xs-6 promo_block">\r\n <div class="promo_icon"><i class="fa fa-truck fa-fw"></i></div>\r\n <div class="promo_text">\r\n <h2>\r\n Free shipping</h2>\r\n All over in world over $200\r\n </div>\r\n </div>\r\n <div class="col-md-3 col-xs-6 promo_block">\r\n <div class="promo_icon"><i class="fa fa-money fa-fw"></i></div>\r\n <div class="promo_text">\r\n <h2>\r\n Easy Payment</h2>\r\n Payment Gateway support</div>\r\n </div>\r\n <div class="col-md-3 col-xs-6 promo_block">\r\n <div class="promo_icon"><i class="fa fa-clock-o fa-fw"></i></div>\r\n <div class="promo_text">\r\n <h2>\r\n 24hrs Shipping</h2>\r\n For All US States</div>\r\n </div>\r\n <div class="col-md-3 col-xs-6 promo_block">\r\n <div class="promo_icon"><i class="fa fa-tags fa-fw"></i></div>\r\n <div class="promo_text">\r\n <h2>\r\n Large Variety</h2>\r\n 50,000+ Products</div>\r\n </div>\r\n </section>','2015-06-12 09:56:24','2015-06-12 09:56:24'); INSERT INTO `ac_block_descriptions` VALUES (16,9,1,'blocks/banner_block/one_by_one_slider_banner_block.tpl',0,'Main Page Banner Slider','Main Page Banner Slider','','a:1:{s:17:\"banner_group_name\";s:17:\"Main Page Banners\";}','2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (1,12,'manufacturer_id',12,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (2,12,'manufacturer_id',14,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (3,12,'manufacturer_id',13,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (4,12,'manufacturer_id',18,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (5,12,'manufacturer_id',19,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (6,12,'manufacturer_id',20,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (7,12,'manufacturer_id',15,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (8,12,'manufacturer_id',11,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (9,12,'manufacturer_id',17,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); -INSERT INTO `ac_custom_lists` VALUES (10,12,'manufacturer_id',16,0,'2015-06-12 09:56:24','2015-06-12 09:56:24'); +INSERT INTO `ac_custom_lists` +(`rowid`, + `custom_block_id`, + `data_type`, + `id`, + `store_id`, + `sort_order`, + `date_added`, + `date_modified`) +VALUES (1,12,'manufacturer_id',12,0,0,NOW(),NOW()), +(2,12,'manufacturer_id',14,0,0,NOW(),NOW()), +(3,12,'manufacturer_id',13,0,0,NOW(),NOW()), +(4,12,'manufacturer_id',18,0,0,NOW(),NOW()), +(5,12,'manufacturer_id',19,0,0,NOW(),NOW()), +(6,12,'manufacturer_id',20,0,0,NOW(),NOW()), +(7,12,'manufacturer_id',15,0,0,NOW(),NOW()), +(8,12,'manufacturer_id',11,0,0,NOW(),NOW()), +(9,12,'manufacturer_id',17,0,0,NOW(),NOW()), +(10,12,'manufacturer_id',16,0,0,NOW(),NOW()); -- -- Dumping data for table `customers` From 82619e055cb459739738dedf4b510fd5455d583c Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 11 Mar 2019 12:06:52 +0200 Subject: [PATCH 48/81] #1220 --- public_html/storefront/model/catalog/product.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public_html/storefront/model/catalog/product.php b/public_html/storefront/model/catalog/product.php index 4053b2a43a..f444e7c30a 100755 --- a/public_html/storefront/model/catalog/product.php +++ b/public_html/storefront/model/catalog/product.php @@ -176,7 +176,10 @@ public function hasAnyStock($product_id) } $total_quantity += $row['quantity'] < 0 ? 0 : $row['quantity']; } - + //if some of option value have subtract NO - think product is available + if ($total_quantity == 0 && $notrack_qnt) { + $total_quantity = true; + } } else { //get product quantity without options $query = $this->db->query("SELECT quantity From a3c9f80f1ae23a35a65ae8ca53e35ab66723ab0c Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 11 Mar 2019 14:13:10 +0200 Subject: [PATCH 49/81] #1217 --- public_html/admin/model/sale/order.php | 642 ++++++++++++++----------- 1 file changed, 351 insertions(+), 291 deletions(-) diff --git a/public_html/admin/model/sale/order.php b/public_html/admin/model/sale/order.php index d2a543ad8e..167594a418 100755 --- a/public_html/admin/model/sale/order.php +++ b/public_html/admin/model/sale/order.php @@ -17,9 +17,6 @@ versions in the future. If you wish to customize AbanteCart for your needs please refer to http://www.AbanteCart.com for more information. ------------------------------------------------------------------------------*/ -if (!defined('DIR_CORE') || !IS_ADMIN) { - header('Location: static_pages/'); -} /** * Class ModelSaleOrder @@ -44,45 +41,45 @@ public function addOrder($data) $key_sql = ", key_id = '".(int)$data['key_id']."'"; } $this->db->query("INSERT INTO `".$this->db->table("orders")."` - SET store_name = '".$this->db->escape($data['store_name'])."', - store_url = '".$this->db->escape($data['store_url'])."', - firstname = '".$this->db->escape($data['firstname'])."', - lastname = '".$this->db->escape($data['lastname'])."', - telephone = '".$this->db->escape($data['telephone'])."', - email = '".$this->db->escape($data['email'])."', - customer_id = '".(int)$data['customer_id']."', - customer_group_id = '".(int)$data['customer_group_id']."', - shipping_firstname = '".$this->db->escape($data['shipping_firstname'])."', - shipping_lastname = '".$this->db->escape($data['shipping_lastname'])."', - shipping_company = '".$this->db->escape($data['shipping_company'])."', - shipping_address_1 = '".$this->db->escape($data['shipping_address_1'])."', - shipping_address_2 = '".$this->db->escape($data['shipping_address_2'])."', - shipping_city = '".$this->db->escape($data['shipping_city'])."', - shipping_zone = '".$this->db->escape($data['shipping_zone'])."', - shipping_zone_id = '".(int)$data['shipping_zone_id']."', - shipping_country = '".$this->db->escape($data['shipping_country'])."', - shipping_country_id = '".(int)$data['shipping_country_id']."', - payment_method = '".$this->db->escape($data['payment_method'])."', - payment_firstname = '".$this->db->escape($data['payment_firstname'])."', - payment_lastname = '".$this->db->escape($data['payment_lastname'])."', - payment_company = '".$this->db->escape($data['payment_company'])."', - payment_address_1 = '".$this->db->escape($data['payment_address_1'])."', - payment_address_2 = '".$this->db->escape($data['payment_address_2'])."', - payment_city = '".$this->db->escape($data['payment_city'])."', - payment_postcode = '".$this->db->escape($data['payment_postcode'])."', - payment_zone = '".$this->db->escape($data['payment_zone'])."', - payment_zone_id = '".(int)$data['payment_zone_id']."', - payment_country = '".$this->db->escape($data['payment_country'])."', - payment_country_id = '".(int)$data['payment_country_id']."', - value = '".(float)$data['value']."', - currency_id = '".(int)$data['currency_id']."', - currency = '".$this->db->escape($data['currency'])."', - language_id = '".(int)$data['language_id']."', - order_status_id = '".(int)$data['order_status_id']."', - ip = '".$this->db->escape('0.0.0.0')."', - total = '".$this->db->escape(preformatFloat($data['total'], $this->language->get('decimal_point')))."'".$key_sql.", - date_added = NOW(), - date_modified = NOW()" + SET store_name = '".$this->db->escape($data['store_name'])."', + store_url = '".$this->db->escape($data['store_url'])."', + firstname = '".$this->db->escape($data['firstname'])."', + lastname = '".$this->db->escape($data['lastname'])."', + telephone = '".$this->db->escape($data['telephone'])."', + email = '".$this->db->escape($data['email'])."', + customer_id = '".(int)$data['customer_id']."', + customer_group_id = '".(int)$data['customer_group_id']."', + shipping_firstname = '".$this->db->escape($data['shipping_firstname'])."', + shipping_lastname = '".$this->db->escape($data['shipping_lastname'])."', + shipping_company = '".$this->db->escape($data['shipping_company'])."', + shipping_address_1 = '".$this->db->escape($data['shipping_address_1'])."', + shipping_address_2 = '".$this->db->escape($data['shipping_address_2'])."', + shipping_city = '".$this->db->escape($data['shipping_city'])."', + shipping_zone = '".$this->db->escape($data['shipping_zone'])."', + shipping_zone_id = '".(int)$data['shipping_zone_id']."', + shipping_country = '".$this->db->escape($data['shipping_country'])."', + shipping_country_id = '".(int)$data['shipping_country_id']."', + payment_method = '".$this->db->escape($data['payment_method'])."', + payment_firstname = '".$this->db->escape($data['payment_firstname'])."', + payment_lastname = '".$this->db->escape($data['payment_lastname'])."', + payment_company = '".$this->db->escape($data['payment_company'])."', + payment_address_1 = '".$this->db->escape($data['payment_address_1'])."', + payment_address_2 = '".$this->db->escape($data['payment_address_2'])."', + payment_city = '".$this->db->escape($data['payment_city'])."', + payment_postcode = '".$this->db->escape($data['payment_postcode'])."', + payment_zone = '".$this->db->escape($data['payment_zone'])."', + payment_zone_id = '".(int)$data['payment_zone_id']."', + payment_country = '".$this->db->escape($data['payment_country'])."', + payment_country_id = '".(int)$data['payment_country_id']."', + value = '".(float)$data['value']."', + currency_id = '".(int)$data['currency_id']."', + currency = '".$this->db->escape($data['currency'])."', + language_id = '".(int)$data['language_id']."', + order_status_id = '".(int)$data['order_status_id']."', + ip = '".$this->db->escape('0.0.0.0')."', + total = '".$this->db->escape(preformatFloat($data['total'], $this->language->get('decimal_point')))."'".$key_sql.", + date_added = NOW(), + date_modified = NOW()" ); $order_id = $this->db->getLastId(); @@ -90,20 +87,22 @@ public function addOrder($data) if (isset($data['product'])) { foreach ($data['product'] as $product) { if ($product['product_id']) { - $product_query = $this->db->query("SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) - WHERE p.product_id='".(int)$product['product_id']."'"); + $product_query = $this->db->query( + "SELECT *, p.product_id + FROM ".$this->db->table("products")." p + LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) + WHERE p.product_id='".(int)$product['product_id']."'" + ); $this->db->query("INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product['product_id']."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape(preformatFloat($product['price'], $this->language->get('decimal_point')))."', - total = '".$this->db->escape(preformatFloat($product['total'], $this->language->get('decimal_point')))."', - quantity = '".$this->db->escape($product['quantity'])."'"); + SET order_id = '".(int)$order_id."', + product_id = '".(int)$product['product_id']."', + name = '".$this->db->escape($product_query->row['name'])."', + model = '".$this->db->escape($product_query->row['model'])."', + sku = '".$this->db->escape($product_query->row['sku'])."', + price = '".$this->db->escape(preformatFloat($product['price'], $this->language->get('decimal_point')))."', + total = '".$this->db->escape(preformatFloat($product['total'], $this->language->get('decimal_point')))."', + quantity = '".$this->db->escape($product['quantity'])."'"); } } } @@ -124,13 +123,13 @@ public function addOrderTotal($order_id, $data) $value = preformatFloat($data['text'], $this->language->get('decimal_point')); $this->db->query("INSERT INTO ".$this->db->table("order_totals")." - SET `order_id` = '".(int)$order_id."', - `title` = '".$this->db->escape($data['title'])."', - `text` = '".$this->db->escape($data['text'])."', - `value` = '".$this->db->escape($value)."', - `sort_order` = '".(int)$data['sort_order']."', - `type` = '".$this->db->escape($data['type'])."', - `key` = '".$this->db->escape($data['key'])."'" + SET `order_id` = '".(int)$order_id."', + `title` = '".$this->db->escape($data['title'])."', + `text` = '".$this->db->escape($data['text'])."', + `value` = '".$this->db->escape($value)."', + `sort_order` = '".(int)$data['sort_order']."', + `type` = '".$this->db->escape($data['type'])."', + `key` = '".$this->db->escape($data['key'])."'" ); return $this->db->getLastId(); @@ -149,14 +148,16 @@ public function deleteOrderTotal($order_id, $order_total_id) } $this->db->query("DELETE FROM ".$this->db->table("order_totals")." - WHERE order_id = '".(int)$order_id."' AND order_total_id = '".(int)$order_total_id."'"); + WHERE order_id = '".(int)$order_id."' AND order_total_id = '".(int)$order_total_id."'"); return true; } /** - * @param int $order_id + * @param int $order_id * @param array $data + * + * @throws AException */ public function editOrder($order_id, $data) { @@ -196,8 +197,11 @@ public function editOrder($order_id, $data) if ($this->dcrypt->active) { //encrypt order data //check key_id to use from existing record - $query_key = $this->db->query("select key_id from ".$this->db->table("orders")." - WHERE order_id = '".(int)$order_id."'"); + $query_key = $this->db->query( + "SELECT key_id + FROM ".$this->db->table("orders")." + WHERE order_id = '".(int)$order_id."'" + ); $data['key_id'] = $query_key->rows[0]['key_id']; $data = $this->dcrypt->encrypt_data($data, 'orders'); $fields[] = 'key_id'; @@ -209,9 +213,11 @@ public function editOrder($order_id, $data) } } - $this->db->query("UPDATE `".$this->db->table("orders")."` - SET ".implode(',', $update)." - WHERE order_id = '".(int)$order_id."'"); + $this->db->query( + "UPDATE `".$this->db->table("orders")."` + SET ".implode(',', $update)." + WHERE order_id = '".(int)$order_id."'" + ); $order = $this->getOrder($order_id); if (isset($data['product'])) { @@ -222,44 +228,20 @@ public function editOrder($order_id, $data) $order_product_ids[] = $item['order_product_id']; } } - $this->db->query("DELETE FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - AND order_product_id NOT IN ('".(implode("','", $order_product_ids))."')"); + $this->db->query( + "DELETE FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."' + AND order_product_id NOT IN ('".(implode("','", $order_product_ids))."')" + ); foreach ($data['product'] as $product) { - if ($product['product_id']) { - $exists = $this->db->query("SELECT product_id - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - AND product_id='".(int)$product['product_id']."' - AND order_product_id = '".(int)$product['order_product_id']."'"); - $exists = $exists->num_rows; - if ($exists) { - $this->db->query("UPDATE ".$this->db->table("order_products")." - SET price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order['value']))."', - quantity = '".$this->db->escape($product['quantity'])."' - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); - } else { - // new products - $product_query = $this->db->query( - "SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd ON (p.product_id = pd.product_id) - WHERE p.product_id='".(int)$product['product_id']."'"); - - $this->db->query( - "INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product['product_id']."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order['value']))."', - quantity = '".$this->db->escape($product['quantity'])."'"); - } - } + + $productData = array( + 'order_product_id' => $product['order_product_id'], + 'product_id' => $product['product_id'], + 'product' => array($product) + ); + $this->editOrderProduct($order_id,$productData); } } @@ -269,9 +251,9 @@ public function editOrder($order_id, $data) //get number portion together with the sign $number = preformatFloat($text_value, $this->language->get('decimal_point')); $this->db->query("UPDATE ".$this->db->table("order_totals")." - SET `text` = '".$this->db->escape($text_value)."', - `value` = '".$number."' - WHERE order_total_id = '".(int)$total_id."'"); + SET `text` = '".$this->db->escape($text_value)."', + `value` = '".$number."' + WHERE order_total_id = '".(int)$total_id."'"); } // update total in order main table reading back from all totals and select key 'total' $totals = $this->getOrderTotals($order_id); @@ -279,8 +261,8 @@ public function editOrder($order_id, $data) foreach ($totals as $total_id => $t_data) { if ($t_data['key'] == 'total') { $this->db->query("UPDATE ".$this->db->table("orders")." - SET `total` = '".$t_data['value']."' - WHERE order_id = '".(int)$order_id."'"); + SET `total` = '".$t_data['value']."' + WHERE order_id = '".(int)$order_id."'"); break; } } @@ -289,10 +271,11 @@ public function editOrder($order_id, $data) } /** - * @param int $order_id + * @param int $order_id * @param array $data * * @return bool + * @throws AException */ public function editOrderProduct($order_id, $data) { @@ -319,19 +302,27 @@ public function editOrderProduct($order_id, $data) return false; } //check is product exists - $exists = $this->db->query("SELECT op.product_id, op.quantity - FROM ".$this->db->table("order_products")." op - WHERE op.order_id = '".(int)$order_id."' - AND op.product_id='".(int)$product_id."' - AND op.order_product_id = '".(int)$order_product_id."'"); + $exists = $this->db->query( + "SELECT op.product_id, op.quantity + FROM ".$this->db->table("order_products")." op + WHERE op.order_id = '".(int)$order_id."' + AND op.product_id='".(int)$product_id."' + AND op.order_product_id = '".(int)$order_product_id."'" + ); if ($exists->num_rows) { //update order quantity $sql = "UPDATE ".$this->db->table("order_products")." - SET price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order_info['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order_info['value']))."', - quantity = '".$this->db->escape($product['quantity'])."' - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$order_product_id."'"; + SET price = '".$this->db->escape( + preformatFloat( + $product['price'], + $this->language->get('decimal_point')) / $order_info['value'])."', + total = '".$this->db->escape( + preformatFloat( + $product['total'], + $this->language->get('decimal_point')) / $order_info['value'])."', + quantity = '".$this->db->escape($product['quantity'])."' + WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$order_product_id."'"; $this->db->query($sql); //update stock quantity @@ -347,30 +338,38 @@ public function editOrderProduct($order_id, $data) } if ($product_info['subtract']) { $sql = "UPDATE ".$this->db->table("products")." - SET quantity = '".$new_qnt."' - WHERE product_id = '".(int)$product_id."' AND subtract = 1"; + SET quantity = '".$new_qnt."' + WHERE product_id = '".(int)$product_id."' AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, $qnt_diff); } } } else { // add new product into order $sql = "SELECT *, p.product_id - FROM ".$this->db->table("products")." p - LEFT JOIN ".$this->db->table("product_descriptions")." pd - ON (p.product_id = pd.product_id AND pd.language_id=".$this->language->getContentLanguageID().") - WHERE p.product_id='".(int)$product_id."'"; + FROM ".$this->db->table("products")." p + LEFT JOIN ".$this->db->table("product_descriptions")." pd + ON (p.product_id = pd.product_id + AND pd.language_id=".$this->language->getContentLanguageID().") + WHERE p.product_id='".(int)$product_id."'"; $product_query = $this->db->query($sql); $sql = "INSERT INTO ".$this->db->table("order_products")." - SET order_id = '".(int)$order_id."', - product_id = '".(int)$product_id."', - name = '".$this->db->escape($product_query->row['name'])."', - model = '".$this->db->escape($product_query->row['model'])."', - sku = '".$this->db->escape($product_query->row['sku'])."', - price = '".$this->db->escape((preformatFloat($product['price'], $this->language->get('decimal_point')) / $order_info['value']))."', - total = '".$this->db->escape((preformatFloat($product['total'], $this->language->get('decimal_point')) / $order_info['value']))."', - quantity = '".(int)$product['quantity']."'"; + SET order_id = '".(int)$order_id."', + product_id = '".(int)$product_id."', + name = '".$this->db->escape($product_query->row['name'])."', + model = '".$this->db->escape($product_query->row['model'])."', + sku = '".$this->db->escape($product_query->row['sku'])."', + price = '".$this->db->escape( + preformatFloat( + $product['price'], + $this->language->get('decimal_point')) / $order_info['value'])."', + total = '".$this->db->escape( + preformatFloat( + $product['total'], + $this->language->get('decimal_point')) / $order_info['value'])."', + quantity = '".(int)$product['quantity']."'"; $this->db->query($sql); $order_product_id = $this->db->getLastId(); @@ -381,8 +380,9 @@ public function editOrderProduct($order_id, $data) if ($product_info['subtract']) { $this->db->query("UPDATE ".$this->db->table("products")." - SET quantity = '".$new_qnt."' - WHERE product_id = '".(int)$product_id."' AND subtract = 1"); + SET quantity = '".$new_qnt."' + WHERE product_id = '".(int)$product_id."' AND subtract = 1"); + $this->updateStocksInLocations($product_id, $qnt_diff); } } @@ -405,15 +405,15 @@ public function editOrderProduct($order_id, $data) } //get all data of given product options from db $sql = "SELECT *, pov.product_option_value_id, povd.name as option_value_name, pod.name as option_name - FROM ".$this->db->table('product_options')." po - LEFT JOIN ".$this->db->table('product_option_descriptions')." pod - ON (pod.product_option_id = po.product_option_id AND pod.language_id=".$this->language->getContentLanguageID().") - LEFT JOIN ".$this->db->table('product_option_values')." pov - ON po.product_option_id = pov.product_option_id - LEFT JOIN ".$this->db->table('product_option_value_descriptions')." povd - ON (povd.product_option_value_id = pov.product_option_value_id AND povd.language_id=".$this->language->getContentLanguageID().") - WHERE po.product_option_id IN (".implode(',', $po_ids).") - ORDER BY po.product_option_id"; + FROM ".$this->db->table('product_options')." po + LEFT JOIN ".$this->db->table('product_option_descriptions')." pod + ON (pod.product_option_id = po.product_option_id AND pod.language_id=".$this->language->getContentLanguageID().") + LEFT JOIN ".$this->db->table('product_option_values')." pov + ON po.product_option_id = pov.product_option_id + LEFT JOIN ".$this->db->table('product_option_value_descriptions')." povd + ON (povd.product_option_value_id = pov.product_option_value_id AND povd.language_id=".$this->language->getContentLanguageID().") + WHERE po.product_option_id IN (".implode(',', $po_ids).") + ORDER BY po.product_option_id"; $result = $this->db->query($sql); //list of option value that we do not re-save @@ -431,7 +431,7 @@ public function editOrderProduct($order_id, $data) //delete old options and then insert new $sql = "DELETE FROM ".$this->db->table('order_options')." - WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; + WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; if ($exclude_list) { $sql .= " AND product_option_value_id NOT IN (".implode(', ', $exclude_list).")"; } @@ -463,22 +463,22 @@ public function editOrderProduct($order_id, $data) foreach ($values as $value) { $arr_key = $opt_id.'_'.$value; $sql = "INSERT INTO ".$this->db->table('order_options')." - (`order_id`, - `order_product_id`, - `product_option_value_id`, - `name`, - `sku`, - `value`, - `price`, - `prefix`) - VALUES ('".$order_id."', - '".(int)$order_product_id."', - '".(int)$value."', - '".$this->db->escape($option_value_info[$arr_key]['option_name'])."', - '".$this->db->escape($option_value_info[$arr_key]['sku'])."', - '".$this->db->escape($option_value_info[$arr_key]['option_value_name'])."', - '".$this->db->escape($option_value_info[$arr_key]['price'])."', - '".$this->db->escape($option_value_info[$arr_key]['prefix'])."')"; + (`order_id`, + `order_product_id`, + `product_option_value_id`, + `name`, + `sku`, + `value`, + `price`, + `prefix`) + VALUES ('".$order_id."', + '".(int)$order_product_id."', + '".(int)$value."', + '".$this->db->escape($option_value_info[$arr_key]['option_name'])."', + '".$this->db->escape($option_value_info[$arr_key]['sku'])."', + '".$this->db->escape($option_value_info[$arr_key]['option_value_name'])."', + '".$this->db->escape($option_value_info[$arr_key]['price'])."', + '".$this->db->escape($option_value_info[$arr_key]['prefix'])."')"; $this->db->query($sql); @@ -498,9 +498,9 @@ public function editOrderProduct($order_id, $data) if (!in_array($v, $curr_arr)) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity + ".$product['quantity'].") - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; + SET quantity = (quantity + ".$product['quantity'].") + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); } @@ -510,9 +510,9 @@ public function editOrderProduct($order_id, $data) foreach ($curr_arr as $v) { if (!in_array($v, $prev_arr)) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity - ".$product['quantity'].") - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; + SET quantity = (quantity - ".$product['quantity'].") + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); } @@ -528,9 +528,9 @@ public function editOrderProduct($order_id, $data) } foreach ($intersect as $v) { $sql = "UPDATE ".$this->db->table("product_option_values")." - SET quantity = ".$sql_incl." - WHERE product_option_value_id = '".(int)$v."' - AND subtract = 1"; + SET quantity = ".$sql_incl." + WHERE product_option_value_id = '".(int)$v."' + AND subtract = 1"; $this->db->query($sql); } } @@ -544,33 +544,93 @@ public function editOrderProduct($order_id, $data) //fix order total and subtotal $sql = "SELECT SUM(total) as subtotal - FROM ".$this->db->table('order_products')." - WHERE order_id=".$order_id; + FROM ".$this->db->table('order_products')." + WHERE order_id=".$order_id; $result = $this->db->query($sql); $subtotal = $result->row['subtotal']; $text = $this->currency->format($subtotal, $order_info['currency'], $order_info['value']); $sql = "UPDATE ".$this->db->table('order_totals')." - SET `value`='".$subtotal."', `text` = '".$text."' - WHERE order_id=".$order_id." AND type='subtotal'"; + SET `value`='".$subtotal."', `text` = '".$text."' + WHERE order_id=".$order_id." AND type='subtotal'"; $this->db->query($sql); $sql = "SELECT SUM(`value`) as total - FROM ".$this->db->table('order_totals')." - WHERE order_id=".$order_id." AND type<>'total'"; + FROM ".$this->db->table('order_totals')." + WHERE order_id=".$order_id." AND type<>'total'"; $result = $this->db->query($sql); $total = $result->row['total']; $text = $this->currency->format($total, $order_info['currency'], $order_info['value']); $sql = "UPDATE ".$this->db->table('order_totals')." - SET `value`='".$total."', `text` = '".$text."' - WHERE order_id=".$order_id." AND type='total'"; + SET `value`='".$total."', `text` = '".$text."' + WHERE order_id=".$order_id." AND type='total'"; $this->db->query($sql); $this->cache->remove('product'); return true; } + /** + * @param int $product_id + * @param int $qnt_diff - difference between new and old quantities + * + * @return bool + * @throws AException + */ + public function updateStocksInLocations($product_id, $qnt_diff) + { + $this->load->model('catalog/product'); + $stockLocations = $this->model_catalog_product->getProductStockLocations($product_id); + if(!$stockLocations){ + return false; + } + $totalStockQuantity = (int)array_sum(array_column($stockLocations, 'quantity')); + + $remains = abs($qnt_diff); + foreach($stockLocations as $sl){ + //if qnt needs to increase stock quantity + if ($qnt_diff < 0){ + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = quantity + ".(int)$qnt_diff." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id IS NULL"; + $this->db->query($sql); + break; + } + //if needs to decrease stock quantity + else { + //if no stock enough - just made first location with negative quantity + if(!$totalStockQuantity) { + //update stocks + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = -".(int)$qnt_diff." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id IS NULL"; + $this->db->query($sql); + break; + }elseif($sl['quantity']){ + if($sl['quantity']>= $remains){ + $new_qnt = $remains; + $remains = 0; + }else{ + $new_qnt = $sl['quantity']; + $remains = $remains - $sl['quantity']; + } + + $sql = "UPDATE ".$this->db->table("product_stock_locations")." + SET quantity = ".(int)$new_qnt." + WHERE location_id= ".(int)$sl['location_id']." + AND product_id = ".(int)$product_id." + AND product_option_value_id IS NULL"; + $this->db->query($sql); + } + } + } + } + /** * @param int $order_id */ @@ -578,27 +638,27 @@ public function deleteOrder($order_id) { if ($this->config->get('config_stock_subtract')) { $order_query = $this->db->query("SELECT * - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0' AND order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0' AND order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { $product_query = $this->db->query("SELECT * - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."'"); + FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."'"); foreach ($product_query->rows as $product) { $this->db->query("UPDATE `".$this->db->table("products")."` - SET quantity = (quantity + ".(int)$product['quantity'].") - WHERE product_id = '".(int)$product['product_id']."'"); + SET quantity = (quantity + ".(int)$product['quantity'].") + WHERE product_id = '".(int)$product['product_id']."'"); $option_query = $this->db->query("SELECT * - FROM ".$this->db->table("order_options")." - WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); + FROM ".$this->db->table("order_options")." + WHERE order_id = '".(int)$order_id."' AND order_product_id = '".(int)$product['order_product_id']."'"); foreach ($option_query->rows as $option) { $this->db->query("UPDATE ".$this->db->table("product_option_values")." - SET quantity = (quantity + ".(int)$product['quantity'].") - WHERE product_option_value_id = '".(int)$option['product_option_value_id']."' AND subtract = '1'"); + SET quantity = (quantity + ".(int)$product['quantity'].") + WHERE product_option_value_id = '".(int)$option['product_option_value_id']."' AND subtract = '1'"); } } } @@ -621,17 +681,17 @@ public function deleteOrder($order_id) public function addOrderHistory($order_id, $data) { $this->db->query("UPDATE `".$this->db->table("orders")."` - SET order_status_id = '".(int)$data['order_status_id']."', - date_modified = NOW() - WHERE order_id = '".(int)$order_id."'"); + SET order_status_id = '".(int)$data['order_status_id']."', + date_modified = NOW() + WHERE order_id = '".(int)$order_id."'"); if ($data['append']) { $this->db->query("INSERT INTO ".$this->db->table("order_history")." - SET order_id = '".(int)$order_id."', - order_status_id = '".(int)$data['order_status_id']."', - notify = '".(isset($data['notify']) ? (int)$data['notify'] : 0)."', - comment = '".$this->db->escape(strip_tags($data['comment']))."', - date_added = NOW()"); + SET order_id = '".(int)$order_id."', + order_status_id = '".(int)$data['order_status_id']."', + notify = '".(isset($data['notify']) ? (int)$data['notify'] : 0)."', + comment = '".$this->db->escape(strip_tags($data['comment']))."', + date_added = NOW()"); } /* @@ -640,10 +700,10 @@ public function addOrderHistory($order_id, $data) * */ if ($data['notify']) { $order_query = $this->db->query("SELECT *, os.name AS status - FROM `".$this->db->table("orders")."` o - LEFT JOIN ".$this->db->table("order_statuses")." os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) - LEFT JOIN ".$this->db->table("languages")." l ON (o.language_id = l.language_id) - WHERE o.order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` o + LEFT JOIN ".$this->db->table("order_statuses")." os ON (o.order_status_id = os.order_status_id AND os.language_id = o.language_id) + LEFT JOIN ".$this->db->table("languages")." l ON (o.language_id = l.language_id) + WHERE o.order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { //load language specific for the order in admin section @@ -736,8 +796,8 @@ public function addOrderHistory($order_id, $data) public function getOrder($order_id) { $order_query = $this->db->query("SELECT * - FROM `".$this->db->table("orders")."` - WHERE order_id = '".(int)$order_id."'"); + FROM `".$this->db->table("orders")."` + WHERE order_id = '".(int)$order_id."'"); if ($order_query->num_rows) { //Decrypt order data @@ -871,13 +931,13 @@ public function getImFromOrderData($order_id, $customer_id) $p[] = $this->db->escape($protocol); } $sql = "SELECT od.*, odt.name as type_name - FROM ".$this->db->table('order_data')." od - LEFT JOIN ".$this->db->table('order_data_types')." odt ON odt.type_id = od.type_id - WHERE od.order_id = ".(int)$order_id." - AND od.type_id IN ( - SELECT DISTINCT `type_id` - FROM ".$this->db->table('order_data_types')." - WHERE `name` IN ('".implode("', '", $p)."')) "; + FROM ".$this->db->table('order_data')." od + LEFT JOIN ".$this->db->table('order_data_types')." odt ON odt.type_id = od.type_id + WHERE od.order_id = ".(int)$order_id." + AND od.type_id IN ( + SELECT DISTINCT `type_id` + FROM ".$this->db->table('order_data_types')." + WHERE `name` IN ('".implode("', '", $p)."')) "; $result = $this->db->query($sql); foreach ($result->rows as $row) { if ($row['type_name'] == 'email') { @@ -919,20 +979,20 @@ public function getOrders($data = array(), $mode = 'default') $total_sql = 'count(*) as total'; } else { $total_sql = "o.order_id, - CONCAT(o.firstname, ' ', o.lastname) AS name, - (SELECT os.name - FROM ".$this->db->table("order_statuses")." os - WHERE os.order_status_id = o.order_status_id - AND os.language_id = '".(int)$language_id."') AS status, - o.order_status_id, - o.date_added, - o.total, - o.currency, - o.value"; + CONCAT(o.firstname, ' ', o.lastname) AS name, + (SELECT os.name + FROM ".$this->db->table("order_statuses")." os + WHERE os.order_status_id = o.order_status_id + AND os.language_id = '".(int)$language_id."') AS status, + o.order_status_id, + o.date_added, + o.total, + o.currency, + o.value"; } $sql = "SELECT ".$total_sql." - FROM `".$this->db->table("orders")."` o"; + FROM `".$this->db->table("orders")."` o"; if (has_value($data['filter_product_id'])) { $sql .= " LEFT JOIN `".$this->db->table("order_products")."` op ON o.order_id = op.order_id "; @@ -1007,9 +1067,9 @@ public function getOrders($data = array(), $mode = 'default') } } $sql .= " AND ( FLOOR(o.total) IN (".implode(",", $temp).") - OR FLOOR(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp).") - OR CEIL(o.total) IN (".implode(",", $temp2).") - OR CEIL(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp2).") )"; + OR FLOOR(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp).") + OR CEIL(o.total) IN (".implode(",", $temp2).") + OR CEIL(CAST(o.total as DECIMAL(15,4)) * CAST(o.value as DECIMAL(15,4))) IN (".implode(",", $temp2).") )"; } } @@ -1080,8 +1140,8 @@ public function getOrderTotalWithProduct($product_id) return false; } $sql = "SELECT count(DISTINCT op.order_id, op.order_product_id) as total - FROM ".$this->db->table('order_products')." op - WHERE op.product_id = '".(int)$product_id."'"; + FROM ".$this->db->table('order_products')." op + WHERE op.product_id = '".(int)$product_id."'"; $query = $this->db->query($sql); return $query->row['total']; @@ -1105,10 +1165,10 @@ public function generateInvoiceId($order_id) } $this->db->query("UPDATE `".$this->db->table("orders")."` - SET invoice_id = '".(int)$invoice_id."', - invoice_prefix = '".$this->db->escape($this->config->get('invoice_prefix'))."', - date_modified = NOW() - WHERE order_id = '".(int)$order_id."'"); + SET invoice_id = '".(int)$invoice_id."', + invoice_prefix = '".$this->db->escape($this->config->get('invoice_prefix'))."', + date_modified = NOW() + WHERE order_id = '".(int)$order_id."'"); return $this->config->get('invoice_prefix').$invoice_id; } @@ -1122,9 +1182,9 @@ public function generateInvoiceId($order_id) public function getOrderProducts($order_id, $order_product_id = 0) { $query = $this->db->query("SELECT * - FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - ".((int)$order_product_id ? " AND order_product_id='".(int)$order_product_id."'" : '')); + FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."' + ".((int)$order_product_id ? " AND order_product_id='".(int)$order_product_id."'" : '')); return $query->rows; } @@ -1137,13 +1197,13 @@ public function getOrderProducts($order_id, $order_product_id = 0) public function getOrderOptions($order_id, $order_product_id) { $query = $this->db->query("SELECT op.*, po.element_type, po.attribute_id, po.product_option_id, pov.subtract - FROM ".$this->db->table("order_options")." op - LEFT JOIN ".$this->db->table("product_option_values")." pov - ON op.product_option_value_id = pov.product_option_value_id - LEFT JOIN ".$this->db->table("product_options")." po - ON pov.product_option_id = po.product_option_id - WHERE op.order_id = '".(int)$order_id."' - AND op.order_product_id = '".(int)$order_product_id."'"); + FROM ".$this->db->table("order_options")." op + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON op.product_option_value_id = pov.product_option_value_id + LEFT JOIN ".$this->db->table("product_options")." po + ON pov.product_option_id = po.product_option_id + WHERE op.order_id = '".(int)$order_id."' + AND op.order_product_id = '".(int)$order_product_id."'"); return $query->rows; } @@ -1156,12 +1216,12 @@ public function getOrderOptions($order_id, $order_product_id) public function getOrderOption($order_option_id) { $query = $this->db->query("SELECT op.*, po.element_type, po.attribute_id, po.product_option_id, pov.subtract - FROM ".$this->db->table("order_options")." op - LEFT JOIN ".$this->db->table("product_option_values")." pov - ON op.product_option_value_id = pov.product_option_value_id - LEFT JOIN ".$this->db->table("product_options")." po - ON pov.product_option_id = po.product_option_id - WHERE op.order_option_id = '".(int)$order_option_id."'"); + FROM ".$this->db->table("order_options")." op + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON op.product_option_value_id = pov.product_option_value_id + LEFT JOIN ".$this->db->table("product_options")." po + ON pov.product_option_id = po.product_option_id + WHERE op.order_option_id = '".(int)$order_option_id."'"); return $query->row; } @@ -1173,9 +1233,9 @@ public function getOrderOption($order_option_id) public function getOrderTotals($order_id) { $query = $this->db->query("SELECT * - FROM ".$this->db->table("order_totals")." - WHERE order_id = '".(int)$order_id."' - ORDER BY sort_order"); + FROM ".$this->db->table("order_totals")." + WHERE order_id = '".(int)$order_id."' + ORDER BY sort_order"); return $query->rows; } @@ -1191,16 +1251,16 @@ public function getOrderHistory($order_id) $default_language_id = $this->language->getDefaultLanguageID(); $query = $this->db->query("SELECT oh.date_added, - COALESCE( os1.name, os1.name) AS status, - oh.comment, - oh.notify - FROM ".$this->db->table("order_history")." oh - LEFT JOIN ".$this->db->table("order_statuses")." os1 ON oh.order_status_id = os1.order_status_id - AND os1.language_id = '".(int)$language_id."' - LEFT JOIN ".$this->db->table("order_statuses")." os2 ON oh.order_status_id = os2.order_status_id - AND os2.language_id = '".(int)$default_language_id."' - WHERE oh.order_id = '".(int)$order_id."' - ORDER BY oh.date_added"); + COALESCE( os1.name, os1.name) AS status, + oh.comment, + oh.notify + FROM ".$this->db->table("order_history")." oh + LEFT JOIN ".$this->db->table("order_statuses")." os1 ON oh.order_status_id = os1.order_status_id + AND os1.language_id = '".(int)$language_id."' + LEFT JOIN ".$this->db->table("order_statuses")." os2 ON oh.order_status_id = os2.order_status_id + AND os2.language_id = '".(int)$default_language_id."' + WHERE oh.order_id = '".(int)$order_id."' + ORDER BY oh.date_added"); return $query->rows; } @@ -1213,19 +1273,19 @@ public function getOrderHistory($order_id) public function getOrderDownloads($order_id) { $query = $this->db->query("SELECT op.product_id, op.name as product_name, od.* - FROM ".$this->db->table("order_downloads")." od - LEFT JOIN ".$this->db->table("order_products")." op - ON op.order_product_id = od.order_product_id - WHERE od.order_id = '".(int)$order_id."' - ORDER BY op.order_product_id, od.sort_order, od.name"); + FROM ".$this->db->table("order_downloads")." od + LEFT JOIN ".$this->db->table("order_products")." op + ON op.order_product_id = od.order_product_id + WHERE od.order_id = '".(int)$order_id."' + ORDER BY op.order_product_id, od.sort_order, od.name"); $output = array(); foreach ($query->rows as $row) { $output[$row['product_id']]['product_name'] = $row['product_name']; // get download_history $result = $this->db->query("SELECT * - FROM ".$this->db->table("order_downloads_history")." - WHERE order_id = '".(int)$order_id."' AND order_download_id = '".$row['order_download_id']."' - ORDER BY `time` DESC"); + FROM ".$this->db->table("order_downloads_history")." + WHERE order_id = '".(int)$order_id."' AND order_download_id = '".$row['order_download_id']."' + ORDER BY `time` DESC"); $row['download_history'] = $result->rows; $output[$row['product_id']]['downloads'][] = $row; @@ -1241,8 +1301,8 @@ public function getOrderDownloads($order_id) public function getTotalOrderDownloads($order_id) { $query = $this->db->query("SELECT COUNT(*) as total - FROM ".$this->db->table("order_downloads")." od - WHERE od.order_id = '".(int)$order_id."'"); + FROM ".$this->db->table("order_downloads")." od + WHERE od.order_id = '".(int)$order_id."'"); return $query->row['total']; } @@ -1255,8 +1315,8 @@ public function getTotalOrderDownloads($order_id) public function getTotalOrdersByStoreId($store_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE store_id = '".(int)$store_id."'"); + FROM `".$this->db->table("orders")."` + WHERE store_id = '".(int)$store_id."'"); return $query->row['total']; } @@ -1269,10 +1329,10 @@ public function getTotalOrdersByStoreId($store_id) public function getOrderHistoryTotalByOrderStatusId($order_status_id) { $query = $this->db->query("SELECT oh.order_id - FROM ".$this->db->table("order_history")." oh - LEFT JOIN `".$this->db->table("orders")."` o ON (oh.order_id = o.order_id) - WHERE oh.order_status_id = '".(int)$order_status_id."' AND o.order_status_id > '0' - GROUP BY order_id"); + FROM ".$this->db->table("order_history")." oh + LEFT JOIN `".$this->db->table("orders")."` o ON (oh.order_id = o.order_id) + WHERE oh.order_status_id = '".(int)$order_status_id."' AND o.order_status_id > '0' + GROUP BY order_id"); return $query->num_rows; } @@ -1285,8 +1345,8 @@ public function getOrderHistoryTotalByOrderStatusId($order_status_id) public function getTotalOrdersByOrderStatusId($order_status_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id = '".(int)$order_status_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id = '".(int)$order_status_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1298,8 +1358,8 @@ public function getTotalOrdersByOrderStatusId($order_status_id) public function getTotalOrdersByLanguageId($language_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE language_id = '".(int)$language_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE language_id = '".(int)$language_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1311,8 +1371,8 @@ public function getTotalOrdersByLanguageId($language_id) public function getTotalOrdersByCurrencyId($currency_id) { $query = $this->db->query("SELECT COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE currency_id = '".(int)$currency_id."' AND order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE currency_id = '".(int)$currency_id."' AND order_status_id > '0'"); return $query->row['total']; } @@ -1322,8 +1382,8 @@ public function getTotalOrdersByCurrencyId($currency_id) public function getTotalSales() { $query = $this->db->query("SELECT SUM(total) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0'"); return $query->row['total']; } @@ -1335,8 +1395,8 @@ public function getTotalSales() public function getTotalSalesByYear($year) { $query = $this->db->query("SELECT SUM(total) AS total - FROM `".$this->db->table("orders")."` - WHERE order_status_id > '0' AND YEAR(date_added) = '".(int)$year."'"); + FROM `".$this->db->table("orders")."` + WHERE order_status_id > '0' AND YEAR(date_added) = '".(int)$year."'"); return $query->row['total']; } @@ -1353,10 +1413,10 @@ public function getGuestOrdersWithProduct($product_id) return array(); } $query = $this->db->query("SELECT DISTINCT o.* - FROM ".$this->db->table("order_products")." op - INNER JOIN ".$this->db->table("orders")." o - ON o.order_id = op.order_id - WHERE COALESCE(o.customer_id,0) = '0' AND op.product_id='".(int)$product_id."'"); + FROM ".$this->db->table("order_products")." op + INNER JOIN ".$this->db->table("orders")." o + ON o.order_id = op.order_id + WHERE COALESCE(o.customer_id,0) = '0' AND op.product_id='".(int)$product_id."'"); return $query->rows; } @@ -1380,9 +1440,9 @@ public function getCountOrdersByCustomerIds($customers_ids) return array(); } $query = $this->db->query("SELECT customer_id, COUNT(*) AS total - FROM `".$this->db->table("orders")."` - WHERE customer_id IN (".implode(",", $ids).") AND order_status_id > '0' - GROUP BY customer_id"); + FROM `".$this->db->table("orders")."` + WHERE customer_id IN (".implode(",", $ids).") AND order_status_id > '0' + GROUP BY customer_id"); $output = array(); foreach ($query->rows as $row) { $output[$row['customer_id']] = (int)$row['total']; From c65bc8bab35f8446d18c59107709f160d4173878 Mon Sep 17 00:00:00 2001 From: abolabo Date: Mon, 11 Mar 2019 18:58:25 +0200 Subject: [PATCH 50/81] #1217 --- public_html/admin/model/sale/order.php | 97 ++++++++++++++++++++------ 1 file changed, 77 insertions(+), 20 deletions(-) diff --git a/public_html/admin/model/sale/order.php b/public_html/admin/model/sale/order.php index 167594a418..d7b4824ed4 100755 --- a/public_html/admin/model/sale/order.php +++ b/public_html/admin/model/sale/order.php @@ -228,11 +228,32 @@ public function editOrder($order_id, $data) $order_product_ids[] = $item['order_product_id']; } } - $this->db->query( - "DELETE FROM ".$this->db->table("order_products")." - WHERE order_id = '".(int)$order_id."' - AND order_product_id NOT IN ('".(implode("','", $order_product_ids))."')" + //get deleted + $result = $this->db->query( + "SELECT + op.order_product_id, + op.product_id, + op.quantity, + oo.product_option_value_id, + pov.subtract as option_subtract, + pov.quantity as option_quantity, + p.quantity as base_quantity, + p.subtract as base_subtract + FROM ".$this->db->table("order_products")." op + LEFT JOIN ".$this->db->table("products")." p + ON p.product_id = op.product_id + LEFT JOIN ".$this->db->table("order_options")." oo + ON oo.order_product_id = op.order_product_id + LEFT JOIN ".$this->db->table("product_option_values")." pov + ON pov.product_option_value_id = oo.product_option_value_id + WHERE op.order_id = '".(int)$order_id."' + AND op.order_product_id NOT IN ('".(implode("','", $order_product_ids))."')" ); + //then remove + if($result->num_rows) { + $this->removeOrderProducts($order_id, $result->rows); + } + foreach ($data['product'] as $product) { @@ -270,6 +291,36 @@ public function editOrder($order_id, $data) } } + protected function removeOrderProducts( $order_id, $data ) + { + if(!$data){ + return false; + } + //get list of order products that need to delete + foreach($data as $order_product){ + + if($order_product['base_subtract'] && !$order_product['product_option_value_id']){ + $sql = "UPDATE ".$this->db->table('products')." + SET quantity = quantity + ".(int)$order_product['quantity']." + WHERE product_id = '".$order_product['product_id']."'"; + $this->db->query($sql); + $this->updateStocksInLocations($order_product['product_id'], 0, -$order_product['quantity']); + }elseif($order_product['option_subtract']){ + $sql = "UPDATE ".$this->db->table('product_option_values')." + SET quantity = quantity + ".(int)$order_product['quantity']." + WHERE product_option_value_id = '".$order_product['product_option_value_id']."'"; + $this->db->query($sql); + $this->updateStocksInLocations($order_product['product_id'], $order_product['product_option_value_id'], -$order_product['quantity']); + } + } + $order_product_ids = array_column($data,'order_product_id'); + $this->db->query( + "DELETE FROM ".$this->db->table("order_products")." + WHERE order_id = '".(int)$order_id."' + AND order_product_id IN ('".(implode("','", $order_product_ids))."')" + ); + } + /** * @param int $order_id * @param array $data @@ -332,16 +383,16 @@ public function editOrderProduct($order_id, $data) if ($qnt_diff != 0) { if ($qnt_diff < 0) { - $new_qnt = $stock_qnt - abs($qnt_diff); + $new_qnt = $stock_qnt + abs($qnt_diff); } else { - $new_qnt = $stock_qnt + $qnt_diff; + $new_qnt = $stock_qnt - abs($qnt_diff);; } if ($product_info['subtract']) { $sql = "UPDATE ".$this->db->table("products")." SET quantity = '".$new_qnt."' WHERE product_id = '".(int)$product_id."' AND subtract = 1"; $this->db->query($sql); - $this->updateStocksInLocations($product_id, $qnt_diff); + $this->updateStocksInLocations($product_id, 0, $qnt_diff); } } @@ -374,7 +425,7 @@ public function editOrderProduct($order_id, $data) $order_product_id = $this->db->getLastId(); //update stock quantity - $qnt_diff = -$product['quantity']; + $qnt_diff = $product['quantity']; $stock_qnt = $product_query->row['quantity']; $new_qnt = $stock_qnt - (int)$product['quantity']; @@ -382,7 +433,7 @@ public function editOrderProduct($order_id, $data) $this->db->query("UPDATE ".$this->db->table("products")." SET quantity = '".$new_qnt."' WHERE product_id = '".(int)$product_id."' AND subtract = 1"); - $this->updateStocksInLocations($product_id, $qnt_diff); + $this->updateStocksInLocations($product_id, 0, $qnt_diff); } } @@ -431,7 +482,7 @@ public function editOrderProduct($order_id, $data) //delete old options and then insert new $sql = "DELETE FROM ".$this->db->table('order_options')." - WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; + WHERE order_id = ".$order_id." AND order_product_id=".(int)$order_product_id; if ($exclude_list) { $sql .= " AND product_option_value_id NOT IN (".implode(', ', $exclude_list).")"; } @@ -503,6 +554,7 @@ public function editOrderProduct($order_id, $data) AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, -$product['quantity']); } } @@ -513,8 +565,8 @@ public function editOrderProduct($order_id, $data) SET quantity = (quantity - ".$product['quantity'].") WHERE product_option_value_id = '".(int)$v."' AND subtract = 1"; - $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, $product['quantity']); } } @@ -532,6 +584,7 @@ public function editOrderProduct($order_id, $data) WHERE product_option_value_id = '".(int)$v."' AND subtract = 1"; $this->db->query($sql); + $this->updateStocksInLocations($product_id, (int)$v, $qnt_diff); } } } @@ -573,29 +626,33 @@ public function editOrderProduct($order_id, $data) /** * @param int $product_id - * @param int $qnt_diff - difference between new and old quantities + * @param int $product_option_value_id + * @param int $qnt_diff - difference between new and old quantities. + * if negative - decrease qnty in stock, otherwise - increase * * @return bool * @throws AException */ - public function updateStocksInLocations($product_id, $qnt_diff) + public function updateStocksInLocations($product_id, $product_option_value_id, $qnt_diff) { $this->load->model('catalog/product'); - $stockLocations = $this->model_catalog_product->getProductStockLocations($product_id); + $stockLocations = $this->model_catalog_product->getProductStockLocations($product_id, (int)$product_option_value_id); if(!$stockLocations){ return false; } $totalStockQuantity = (int)array_sum(array_column($stockLocations, 'quantity')); + $povId = !(int)$product_option_value_id ? 'IS NULL' : " = ".(int)$product_option_value_id; + $remains = abs($qnt_diff); foreach($stockLocations as $sl){ //if qnt needs to increase stock quantity if ($qnt_diff < 0){ $sql = "UPDATE ".$this->db->table("product_stock_locations")." - SET quantity = quantity + ".(int)$qnt_diff." + SET quantity = quantity + ".abs((int)$qnt_diff)." WHERE location_id= ".(int)$sl['location_id']." AND product_id = ".(int)$product_id." - AND product_option_value_id IS NULL"; + AND product_option_value_id ".$povId; $this->db->query($sql); break; } @@ -608,15 +665,15 @@ public function updateStocksInLocations($product_id, $qnt_diff) SET quantity = -".(int)$qnt_diff." WHERE location_id= ".(int)$sl['location_id']." AND product_id = ".(int)$product_id." - AND product_option_value_id IS NULL"; + AND product_option_value_id ".$povId; $this->db->query($sql); break; }elseif($sl['quantity']){ if($sl['quantity']>= $remains){ - $new_qnt = $remains; + $new_qnt = $sl['quantity'] - $remains; $remains = 0; }else{ - $new_qnt = $sl['quantity']; + $new_qnt = 0; $remains = $remains - $sl['quantity']; } @@ -624,7 +681,7 @@ public function updateStocksInLocations($product_id, $qnt_diff) SET quantity = ".(int)$new_qnt." WHERE location_id= ".(int)$sl['location_id']." AND product_id = ".(int)$product_id." - AND product_option_value_id IS NULL"; + AND product_option_value_id ".$povId; $this->db->query($sql); } } From 7a60199d34765ece54fbb780050fda64ca1d8d45 Mon Sep 17 00:00:00 2001 From: abantecart Date: Mon, 11 Mar 2019 21:52:09 -0400 Subject: [PATCH 51/81] #1169 Add product listing to layout (no update SQL) --- public_html/install/abantecart_database.sql | 35 ++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/public_html/install/abantecart_database.sql b/public_html/install/abantecart_database.sql index bc329c43dd..a29d17e72c 100755 --- a/public_html/install/abantecart_database.sql +++ b/public_html/install/abantecart_database.sql @@ -10088,8 +10088,8 @@ INSERT INTO `ac_pages` (`page_id`, `parent_page_id`, `controller`, `key_param`, (5, 0, 'pages/product/product', '', '', now()), (10, 0, 'pages/index/maintenance', '', '', now() ), (11, 0, 'pages/account', '', '', now() ), -(12, 0, 'pages/checkout/cart', '', '', now() ); - +(12, 0, 'pages/checkout/cart', '', '', now() ), +(13, 0, 'pages/product/category, '', '', now() ); -- -- DDL for table `page_descriptions` @@ -10406,7 +10406,8 @@ INSERT INTO `ac_layouts` (`layout_id`, `template_id`, `layout_type`, `layout_nam (16, 'default', 1, 'Product Listing Page', now()), (17, 'default', 1, 'Maintenance Page', now()), (18, 'default', 1, 'Customer Account Pages', now()), -(19, 'default', 1, 'Cart Page', now()); +(19, 'default', 1, 'Cart Page', now()), +(20, 'default', 1, 'Product Listing Page', now()) ; -- -- DDL for table `pages_layouts` @@ -10426,7 +10427,8 @@ INSERT INTO `ac_pages_layouts` (`layout_id`, `page_id`) VALUES (15, 3), (17, 10), (18, 11), -(19, 12); +(19, 12), +(20, 13); -- -- DDL for table `block_layouts` @@ -10643,6 +10645,31 @@ VALUES (2019, 19, 8, 0, 0, 80, 1, NOW(), NOW()), (2020, 19, 28, 0, 2013, 20, 1, NOW(), NOW()); +-- Product Listing Page template's layouts +INSERT INTO `ac_block_layouts` +(`instance_id`,`layout_id`,`block_id`,`custom_block_id`,`parent_instance_id`,`position`,`status`,`date_added`,`date_modified`) +VALUES +(2043, 20, 1, 0, 0, 10, 1, NOW(), NOW()), +(2044, 20, 2, 0, 0, 20, 1, NOW(), NOW()), +(2045, 20, 3, 0, 0, 30, 1, NOW(), NOW()), +(2046, 20, 4, 0, 0, 40, 1, NOW(), NOW()), +(2047, 20, 5, 0, 0, 50, 1, NOW(), NOW()), +(2048, 20, 6, 0, 0, 60, 1, NOW(), NOW()), +(2049, 20, 7, 0, 0, 70, 1, NOW(), NOW()), +(2050, 20, 8, 0, 0, 80, 1, NOW(), NOW()), +(2051, 20, 25, 0, 2050, 40, 1, NOW(), NOW()), +(2052, 20, 11, 0, 2050, 50, 1, NOW(), NOW()), +(2053, 20, 9, 0, 2044, 10, 1, NOW(), NOW()), +(2054, 20, 24, 0, 2050, 70, 1, NOW(), NOW()), +(2055, 20, 21, 0, 2050, 80, 1, NOW(), NOW()), +(2056, 20, 31, 0, 2043, 20, 1, NOW(), NOW()), +(2057, 20, 27, 0, 2043, 30, 1, NOW(), NOW()), +(2058, 20, 26, 0, 2043, 40, 1, NOW(), NOW()), +(2059, 20, 14, 0, 2043, 60, 1, NOW(), NOW()), +(2060, 20, 13, 0, 2043, 50, 1, NOW(), NOW()), +(2061, 20, 15, 0, 2043, 70, 1, NOW(), NOW()), +(2062, 20, 28, 0, 2044, 20, 1, NOW(), NOW()); + -- -- DDL for table `forms_pages` -- From 11ce31155e1679d1a2baaae96e95233157196b46 Mon Sep 17 00:00:00 2001 From: abantecart Date: Mon, 11 Mar 2019 21:55:44 -0400 Subject: [PATCH 52/81] #1169 Add product listing to layout (no update SQL) --- public_html/install/abantecart_database.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_html/install/abantecart_database.sql b/public_html/install/abantecart_database.sql index a29d17e72c..1f64f44162 100755 --- a/public_html/install/abantecart_database.sql +++ b/public_html/install/abantecart_database.sql @@ -10089,7 +10089,7 @@ INSERT INTO `ac_pages` (`page_id`, `parent_page_id`, `controller`, `key_param`, (10, 0, 'pages/index/maintenance', '', '', now() ), (11, 0, 'pages/account', '', '', now() ), (12, 0, 'pages/checkout/cart', '', '', now() ), -(13, 0, 'pages/product/category, '', '', now() ); +(13, 0, 'pages/product/category', '', '', now() ); -- -- DDL for table `page_descriptions` From 1edc2808ded2052ac2ae2f3b09bf4d699c94f207 Mon Sep 17 00:00:00 2001 From: abantecart Date: Mon, 11 Mar 2019 22:32:55 -0400 Subject: [PATCH 53/81] #1212 Login Display Prices: Off and related products tab --- .../view/default/template/pages/product/product.tpl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public_html/storefront/view/default/template/pages/product/product.tpl b/public_html/storefront/view/default/template/pages/product/product.tpl index f7a78eaf17..e14d42b954 100755 --- a/public_html/storefront/view/default/template/pages/product/product.tpl +++ b/public_html/storefront/view/default/template/pages/product/product.tpl @@ -396,13 +396,15 @@ if ($error){ ?>