Skip to content

Commit

Permalink
Agrega Datos del pago en Comentarios
Browse files Browse the repository at this point in the history
  • Loading branch information
JKacicM committed Oct 17, 2023
1 parent 61acd7b commit 985407c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
29 changes: 16 additions & 13 deletions Model/Simplified.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@

class Simplified extends \Magento\Payment\Model\Method\AbstractMethod
{

const KHIPU_MAGENTO_VERSION = "2.4.1";

const KHIPU_MAGENTO_VERSION = "2.4.7";
protected $_code = 'simplified';

protected $_isInitializeNeeded = true;

protected $urlBuilder;

protected $storeManager;

protected $_canOrder = true;

protected $_canAuthorize = true;

protected $_canUseCheckout = true;

protected $_canFetchTransactionInfo = true;

/**
Expand Down Expand Up @@ -162,8 +153,6 @@ public function getKhipuRequest(Order $order)
'status' => true,
'payment_url' => $createPaymentResponse->getSimplifiedTransferUrl()
);


}

public function getDecimalPlaces($currencyCode)
Expand Down Expand Up @@ -223,9 +212,23 @@ public function validateKhipuCallback(Order $order, $notificationToken, $apiVers
if ($paymentResponse->getCurrency() != $order->getOrderCurrencyCode()) {
throw new \Exception('Currency mismatch');
}

$responseTxt = 'Pago Khipu Aceptado<br>';
$responseTxt .= 'TransactionId: ' . $paymentResponse->getTransactionId() . '<br>';
$responseTxt .= 'PaymentId: ' . $paymentResponse->getPaymentId() . '<br>';
$responseTxt .= 'Subject: ' . $paymentResponse->getSubject() . '<br>';
$responseTxt .= 'Amount: ' . $paymentResponse->getAmount() .' '.$paymentResponse->getCurrency() .'<br>';
$responseTxt .= 'Status: ' . $paymentResponse->getStatus() .' - ' . $paymentResponse->getStatusDetail() .'<br>';
$responseTxt .= 'Body: ' . $paymentResponse->getBody() . '<br>';
$responseTxt .= 'Bank: ' . $paymentResponse->getBank() . '<br>';
$responseTxt .= 'Bank Account Number: ' . $paymentResponse->getBankAccountNumber() . '<br>';
$responseTxt .= 'Payer Name: ' . $paymentResponse->getPayerName() . '<br>';
$responseTxt .= 'Payer Email: ' . $paymentResponse->getPayerEmail() . '<br>';
$responseTxt .= 'Personal Identifier: ' . $paymentResponse->getPersonalIdentifier() . '<br>';

$order->setState(Order::STATE_PROCESSING, TRUE);
$order->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING));
$order->addStatusToHistory(Order::STATE_PROCESSING, 'Estado del pago KHIPU actualizado.');
$order->addStatusToHistory(Order::STATE_PROCESSING, $responseTxt);
$order->save();
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Magento 2 Khipu Plugin

khipu payment gateway Magento 2.4.5 plugin.
khipu payment gateway Magento 2.4.7 plugin.

This version is compatible with Magento 2.3 to 2.6

You can sign up for khipu account at <https://khipu.com>

## Install via Composer

You can install Magento 2.4.5 khipu plugin via [Composer](http://getcomposer.org/). Run the following command in your terminal:
You can install Magento 2.4.7 khipu plugin via [Composer](http://getcomposer.org/). Run the following command in your terminal:

1. Go to your Magento 2 root folder.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "khipu/magento2-khipu",
"type": "magento2-module",
"description": "khipu integration for Magento 2",
"version": "2.4.5",
"version": "2.4.7",
"homepage": "https://khipu.com",
"license": [
"OSL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noTestSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Khipu_Payment" setup_version="2.4.5" active="true">
<module name="Khipu_Payment" setup_version="2.4.7" active="true">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Checkout"/>
Expand Down

0 comments on commit 985407c

Please sign in to comment.