From bfb15f176028af6c4324195ab5d4756456021210 Mon Sep 17 00:00:00 2001 From: federicoh Date: Wed, 2 Jun 2021 12:04:50 -0300 Subject: [PATCH] merge conflicts solved --- README.md | 2 +- conektapaymentsprestashop.php | 13 ++++++------- model/Config.php | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b57c5d557..c29320376 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Current version features: Installation ----------- - Clone the module using git clone --recursive git@github.com:conekta/conekta_prestashop.git ./conektapaymentsprestashop + Clone the module using
git clone --recursive git@github.com:conekta/conekta_prestashop.git ./conektapaymentsprestashop
There is no custom installation for this plugin, just the default: diff --git a/conektapaymentsprestashop.php b/conektapaymentsprestashop.php index 08c249b8c..6971fc5de 100644 --- a/conektapaymentsprestashop.php +++ b/conektapaymentsprestashop.php @@ -386,16 +386,13 @@ public function hookUpdateOrderStatus($params) if (!empty($order) && $order->charges[0]->payment_method->object == "card_payment") { if ($order->payment_status == 'pre_authorized') { $order->void(); - } else { - $order->refund(['reason' => 'requested_by_client']); } } } } } - /** - * Create pending chash state + * Create pending cash state * * @return boolean */ @@ -518,7 +515,6 @@ public function hookHeader() { $key = Configuration::get('CONEKTA_MODE') ? Configuration::get('CONEKTA_PRIVATE_KEY_LIVE') : Configuration::get('CONEKTA_PRIVATE_KEY_TEST'); $iso_code = $this->context->language->iso_code; - \Conekta\Conekta::setApiKey($key); \Conekta\Conekta::setPlugin("Prestashop1.7"); \Conekta\Conekta::setApiVersion("2.0.0"); @@ -913,7 +909,6 @@ private function postValidation() if (!Tools::getValue('WEB_HOOK')) { $this->postErrors[] = $this->trans('The "Web Hook" field is required.', array(), 'Modules.ConektaPaymentsPrestashop.Admin'); } - if (Tools::getValue('PAYMENT_METHS_CASH') && !Tools::getValue('EXPIRATION_DATE_LIMIT')) { $this->postErrors[] = $this->trans('The "Expiration date limit" field is required.', array(), 'Modules.ConektaPaymentsPrestashop.Admin'); } @@ -1490,7 +1485,7 @@ public function getContent() $this->html .= $this->displayCheck(); $this->html .= $this->renderForm(); - + return $this->html; } @@ -1562,7 +1557,9 @@ private function createWebhook() if ($is_valid_url && ($config_url != $url) && ($failed_attempts < 5 && $url != Configuration::get('CONEKTA_WEBHOOK_FAILED_URL'))) { try { $webhooks = \Conekta\Webhook::where(); + $urls = array(); + foreach ($webhooks as $webhook) { array_push($urls, $webhook->webhook_url); } @@ -1737,7 +1734,9 @@ public function processPayment($conektaOrderId) if (class_exists('Logger')) { Logger::addLog($this->l('Payment transaction failed') . ' ' . $log_message, 2, null, 'Cart', (int) $this->context->cart->id, true); } + $message = $e->getMessage() . ' '; + $controller = Configuration::get('PS_ORDER_PROCESS_TYPE') ? 'order-opc.php' : 'order.php'; $location = $this->context->link->getPageLink($controller, true) . (strpos($controller, '?') !== false ? '&' : '?') . 'step=3&conekta_error=1&message=' . $message . '#conekta_error'; Tools::redirectLink($location); diff --git a/model/Config.php b/model/Config.php index 1bd2e5070..e809b2981 100644 --- a/model/Config.php +++ b/model/Config.php @@ -122,11 +122,11 @@ public static function getShippingContact($customer = '', $address_delivery = '' return $shipping_contact; } - public static function getCustomerInfo($customer = '', $address_delivery = '') + public static function getCustomerInfo($customer = '') { $customer_info = array( "name" => $customer->firstname . " " . $customer->lastname, - "phone" => $address_delivery->phone, + // "phone" => $address_delivery->phone, "email" => $customer->email, "metadata" => array("soft_validations" => true) );