Skip to content

Commit

Permalink
merge conflicts solved
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoh-serfe committed Jun 2, 2021
1 parent 081dd54 commit bfb15f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pre>git clone --recursive git@github.com:conekta/conekta_prestashop.git ./conektapaymentsprestashop</pre>

There is no custom installation for this plugin, just the default:

Expand Down
13 changes: 6 additions & 7 deletions conektapaymentsprestashop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -1490,7 +1485,7 @@ public function getContent()

$this->html .= $this->displayCheck();
$this->html .= $this->renderForm();

return $this->html;
}

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand Down

0 comments on commit bfb15f1

Please sign in to comment.