Skip to content

Commit

Permalink
Coding standards and improvements in Prestashop (#92)
Browse files Browse the repository at this point in the history
* set version 1.1.0

* shipping lines must be an array

* state should be parsed

* missing semicolon

* charges_params -> charge_params

* access details correctly

* remove colon

* Passing the error message to the display section

* remove fiscal entity

* grab price as shown

* Adding all error in to url

* Sending all error messages in URL in order to allow the template to display them

* add empty files

* Event signature authentication added

* add soft validation for customer info

* add tax lines and new amount calculation

* use downloadable when virtual

* Updating discount lines for version 2.0

* upgrade library

* use 2.0.0 and fix discounts

* add fiscal entity

* version bump

* Fixing error string concatenation

* Updating Prestashop lib, and sky issue

* Removing code bar, modifying payment_source to payment_method

* Removing fiscal entity. Updating Oxxo Pay text in frontend

* Reinserting reference for OxxoPay

* Upgrading PHP lib

* Making description optional if it is less than two characters short.

* Removing banorte as a payment method option

* Updating OXXO Pay Visual Elements

* Updating administrator options for OxxoPay

* Fixing webhooks implementation

* This fix verifies the data information before proceeding to do any operations in the order

* Version bump

* fix monthly installments

* Fixing monthly installments bug. Version bump.

* webhook validation

* trnaslation change mail error fix

* version bump

* version bump

* Create CHANGELOG

* Fix oxxopay error

$conekta_transaction_detail send null in oxxopay

* Version bump

* Dev (#66)

* Correction in email ('conektaprestashop.txt not found')

* Remove barcode_url

* Feature/headers prestashop (#68) (#69)

* Header feature to set plugin version and fix copy txt

* Correction in discount lines - Order total was not correct

* Correction in line items unit price and change intval to cast (Prestashop validator)

* Bug fixes (prestashop validator)

* Change order to objOrder

* Round discount lines amount fix

* Update PHP Library

* Prestashop 1.7 update

* Update README.md

* Versión Update

* Certificates update with public CA

* Version bump

* standardize changelog

* Docs: Delete unused changelog

* Docs: Version bump

* Fix in orders with discounts without code

PrestaShop allows you to create voucher codes in without code, which will be automatically loaded into the customer cart, but currently this produces an error code in the process ("conekta.errors.parameter_validation.discount_lines.code.too_short"), since conekta does not allow sending this parameter in blank.

* Feature: PHP lib update

Why is this change neccesary?

How does it address the issue?

What side effects does this change have?

* Feature: Fix webhook

Why is this change neccesary?

How does it address the issue?

What side effects does this change have?

* first commit

* adding magento credentials in readme

* adding folders

* adding --user root

* updated

* changing linio for conekta

* changing more linio for conekta

* changing title

* more changes in readme

* added permissions commands

* 0079705 - Added inputs fields and validations

* 0079705 - small change

* 0079705 - file to handle styles in conekta prestasho settings

* Revert "0079705 - file to handle styles in conekta prestasho settings"

This reverts commit 7155e46.

* 0079705 - Edit on notification.php

* 0079705 - conekta prestashop files added

* 0079705 - Task done

* 0079705 - Task done

* delete prestashop folder from conekta plugin

* 0080936 - send order id as metadata to conekta panel

* 0080616 - Get event refunded or canceled from conekta api and change order status

* 0080936 - send cart id

* 0080616 - Change order status from conekta event

* 0080936 - get order by cart id

* 0080616 - Pulling from dev

* 0080616 - Standard refund done

* 0080616 - Standard refund done

* merge and update branches

* 0082128: [T][I3][Prestashop] - Habilitar guardado de tarjetas

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082449: [T][Prestashop] Codacy check

* 0082128 - Conekta  checkout integration

* 0082449: [T][Prestashop] Codacy check

* 82773 additional metadata information sending was implemented

* 0082449: [T][Prestashop] Codacy check

* 82773 metadata cap was implemented

* 82773 attribute cap changed from 5 to 12

* attribute limit read from a constant value

* 82128 - Integration of the conekta form with Prestashop

* 82128 - The payment workflow changed.

* 82128 - The payment workflow changed.

* 82128 - Enable card save

* 82773 metadata sending adapted

* 83539 - Admin checkbox issue resolved

* 83578 - detect purchases with amounts less than $ 20

* 83578 - Minimum purchase amount warning message added.

* 83662 - added tax lines in order details

* 83819 - the incorporation of the shipping lines in the order was improved.

* 83932 - add metadata of the plugin name and version

* fixed issue of the incorrect added attribute

* 83308 - create checkbox to enable 3ds

* 84000 - Added column in the database type mode

* 83308 - Added the 3ds checkbox in the prestashop admin

* 84000 - fix the bug create duplicated order

* 84386 - correction following the code standard

* 84386 - correction following the code standard

* 84386 - correction following the code standard

* 84386 - correction following the code standard

* 80198- fixed issue with merge

* 80198- recovered missing change on merge

* 80198- added missing drop table required

* 84386 - Merge, update and code standardin branch

* 84386 - correction according to psr-2 standard

* 84628 - Merge and update branch

* 84628 - Merge and update branch

Co-authored-by: Andrea Santillana <andreasantillana@gmail.com>
Co-authored-by: Fernando Ruiz Guzmán <fernando@conekta.io>
Co-authored-by: Fernando Ruiz <fruizg0302@icloud.com>
Co-authored-by: MauricioMurga <mauricio_murga@hotmail.com>
Co-authored-by: Mauricio Murga <mauricio@conekta.io>
Co-authored-by: Eduardo Enriquez <eduardo@MacBook-Air-de-Eduardo-E.local>
Co-authored-by: eduardoconekta <eenriquez@conekta.com>
Co-authored-by: JoValo <ing.martinez0302@gmail.com>
Co-authored-by: Luis Carlos González Hernández <lcarlosglez@gmail.com>
Co-authored-by: KarlaRobinson <karlarobinson5@gmail.com>
Co-authored-by: KarlaRobinson <karla@conekta.io>
Co-authored-by: Rolige eCommerce Solutions <info@rolige.com>
Co-authored-by: lucianop <lucianop@serfe.com>
Co-authored-by: Mauricio <mauricio@serfe.com>
Co-authored-by: Lautaro <lautaro@serfe.com>
Co-authored-by: pablo <pablo@serfe.com>
Co-authored-by: lucianon <lucianon@serfe.com>
Co-authored-by: federicoh <federicoh@serfe.com>
Co-authored-by: lucianon-serfe <67438332+lucianon-serfe@users.noreply.github.com>
Co-authored-by: leandro <leandro@serfe.com>
  • Loading branch information
21 people authored May 13, 2021
1 parent 30b748d commit e49869f
Show file tree
Hide file tree
Showing 148 changed files with 1,370 additions and 471 deletions.
Empty file modified .DS_Store
100755 → 100644
Empty file.
Empty file modified CHANGELOG.md
100755 → 100644
Empty file.
Empty file modified README.md
100755 → 100644
Empty file.
Empty file modified composer.json
100755 → 100644
Empty file.
1,066 changes: 830 additions & 236 deletions conektapaymentsprestashop.php
100755 → 100644

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>conektapaymentsprestashop</name>
<displayName><![CDATA[Conekta Prestashop]]></displayName>
<version><![CDATA[1.1.0]]></version>
<description><![CDATA[Accept payments by Credit and Debit Card with Conekta (Visa, Mastercard, Amex)]]></description>
<author><![CDATA[Conekta]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
Empty file modified controllers/front/index.php
100755 → 100644
Empty file.
56 changes: 38 additions & 18 deletions controllers/front/validation.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
<?php
/**
* 2007-2019 PrestaShop
*
* NOTICE OF LICENSE
* Title : Conekta Card Payment Gateway for Prestashop
* Author : Conekta.io
* URL : https://www.conekta.io/es/docs/plugins/prestashop.
*
* @author Conekta <support@conekta.io>
* @copyright 2012-2019 Conekta
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*
*/
* 2007-2019 PrestaShop
*
* NOTICE OF LICENSE
* Title : Conekta Card Payment Gateway for Prestashop
* Author : Conekta.io
* URL : https://www.conekta.io/es/docs/plugins/prestashop.
* PHP Version 7.0.0
*
* Validation File Doc Comment
*
* @category Validation
* @package Validation
* @author Conekta <support@conekta.io>
* @copyright 2012-2019 Conekta
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @version GIT: @1.1.0@
* @link https://conekta.com/
*/

class ConektaPaymentsPrestashopValidationModuleFrontController extends ModuleFrontController {
/**
* ConektaPaymentsPrestashopValidationModuleFrontController Class Doc Comment
*
* @category Class
* @package ConektaPaymentsPrestashopValidationModuleFrontController
* @author Conekta <support@conekta.io>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @link https://conekta.com/
*/

public function postProcess() {
class ConektaPaymentsPrestashopValidationModuleFrontController extends ModuleFrontController
{
/**
* Returns the module that the payment of the order was made.
*
* @return void
*/
public function postProcess()
{
$cart = $this->context->cart;
$authorized = false;
$customer = new Customer($cart->id_customer);
Expand All @@ -35,11 +57,9 @@ public function postProcess() {
Tools::redirect('index.php?controller=order&step=1');
}

$type = pSQL(Tools::getValue('type'));
$msi = pSQL(Tools::getValue('monthly_installments'));
$conektaToken = pSQL(Tools::getValue('conektaToken'));
$conektaOrderId = pSQL(Tools::getValue('conektaOrdenID'));

$conekta->processPayment($type, $conektaToken, $msi);
$conekta->processPayment($conektaOrderId);

$this->setTemplate('module:conektapaymentsprestashop/views/templates/front/payment_return.tpl');
}
Expand Down
Empty file modified controllers/index.php
100755 → 100644
Empty file.
Empty file modified index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/.gitignore
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/CHANGELOG.md
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/LICENSE
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/README.md
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/composer.json
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Address.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Card.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Charge.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Conekta.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/ConektaList.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/ConektaObject.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/ConektaResource.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Customer.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/DiscountLine.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Event.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/ApiError.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/AuthenticationError.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/Handler.php
100755 → 100644
Empty file.
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/NoConnectionError.php
100755 → 100644
Empty file.
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/ProcessingError.php
100755 → 100644
Empty file.
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Exceptions/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Lang.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/LineItem.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Log.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Method.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Order.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Payee.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/PaymentMethod.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/PaymentSource.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Payout.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/PayoutMethod.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Plan.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Requestor.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/ShippingContact.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/ShippingLine.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Subscription.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/TaxLine.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Token.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Util.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/Webhook.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/WebhookLog.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/Conekta/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/locales/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/locales/messages/en.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/locales/messages/es.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/locales/messages/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/ssl_data/ca_bundle.crt
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/lib/ssl_data/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/phpunit.xml
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/readme_cover.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified lib/conekta-php/test/BaseTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/ChargeTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/ConektaTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/CustomerTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/ErrorTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/EventTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/LangTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/LogTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/PayoutTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/PlanTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/WebhookTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-1.0/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ChargeTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ConektaListTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ConektaTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/CustomerTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/DiscountLineTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ErrorHandlerTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/LangTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/LineItemTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/OrderTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ShippingContactTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/ShippingLineTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/SourceTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/SubscriptionTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/TaxLineTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/WebhookTest.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/Conekta-2.0/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/bootstrap.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/support/fixtures/index.php
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/support/fixtures/orders.json
100755 → 100644
Empty file.
Empty file modified lib/conekta-php/test/support/index.php
100755 → 100644
Empty file.
Empty file modified lib/index.php
100755 → 100644
Empty file.
Empty file modified logo.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified mails/en/conektaefectivo.html
100755 → 100644
Empty file.
Empty file modified mails/en/conektaefectivo.txt
100755 → 100644
Empty file.
Empty file modified mails/en/conektaspei.html
100755 → 100644
Empty file.
Empty file modified mails/en/conektaspei.txt
100755 → 100644
Empty file.
Empty file modified mails/en/index.php
100755 → 100644
Empty file.
Empty file modified mails/es/conektaefectivo.html
100755 → 100644
Empty file.
Empty file modified mails/es/conektaefectivo.txt
100755 → 100644
Empty file.
Empty file modified mails/es/conektaspei.html
100755 → 100644
Empty file.
Empty file modified mails/es/conektaspei.txt
100755 → 100644
Empty file.
Empty file modified mails/es/index.php
100755 → 100644
Empty file.
Empty file modified mails/index.php
100755 → 100644
Empty file.
Empty file modified mails/mx/conektaefectivo.html
100755 → 100644
Empty file.
Empty file modified mails/mx/conektaefectivo.txt
100755 → 100644
Empty file.
Empty file modified mails/mx/conektaspei.html
100755 → 100644
Empty file.
Empty file modified mails/mx/conektaspei.txt
100755 → 100644
Empty file.
Empty file modified mails/mx/index.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion model/Config.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static function getCustomerInfo($customer = '', $address_delivery = '')
{
$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
Loading

0 comments on commit e49869f

Please sign in to comment.