Skip to content

Commit

Permalink
Merge pull request #68 from payfort/Release-Feature
Browse files Browse the repository at this point in the history
Release feature
  • Loading branch information
cetozgen authored Oct 6, 2023
2 parents 4235bde + 5693d4d commit 9fa0a1b
Show file tree
Hide file tree
Showing 35 changed files with 295 additions and 211 deletions.
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,10 @@ or
execute below command in your magento installation directory
`composer require amazonpaymentservices/module-fort`

# Amazon Payment Services Account:
If you don't have an APS account click here to sign up for Amazon Payment Services account
https://paymentservices.amazon.com/
Have any questions? Just get in touch -- email the team at [email protected]

# Installation Steps
1. Connect via SFTP and navigate to [your site root folder]
1. Copy APS extension for Magento folder under app/code folder
1. Compile Magento
1. Follow the configuration steps mentioned in Step 3

# Configuration
Follow the below instruction to access configuration page of APS extension for Magento:
1. Navigate to Stores → Configuration
1. At left hand side click on Sales → Payment Methods
1. Under Other Payment Methods section find a payment methods names as “Amazon Payment Services”
1. Click on Configure button

## Configuration and User Guide
You can download the archive [file](/magento2-aps-2.4.9.zip) of the plugin and install it to Magento. Detailed guide is included in the repository [here](/Magento%20Extension%20User%20Guide_v1.1.pdf).


## Payment Options

* Integration Types
Expand All @@ -50,14 +35,16 @@ Follow the below instruction to access configuration page of APS extension for M
* KNET
* NAPS
* Apple Pay

## Configuration and User Guide
You can download the archive [file](/magento2-aps-2.4.8.zip) of the plugin and install it to Magento. Detailed guide is included in the repository [here](https://github.com/payfort/magento2-payfort/wiki).
You can download the archive [file](/magento2-aps-2.4.9.zip) of the plugin and install it to Magento. Detailed guide is included in the repository [here](https://github.com/payfort/magento2-payfort/wiki).


## Changelog

| Plugin Version | Release Notes |
| :---: | :--- |
| 2.4.9 | * Fix - SameSite cookie handling <br/> * Fix - ApplePay is now enabled with Magento payment option checkbox <br/> * Fix - Refund considers Base/Front currencies <br/> * Fix - STCPay to use order id which is enabled via configuration <br/> * Fix - PHP8.2 Compatibility changes|
| 2.4.8 | * Fix - jQuery deprecated size() function is replaced with length |
| 2.4.7 | * Fix - Shipping tax is considered for the refund calculation <br/> * Fix - ApplePay url validation is added <br/> * Fix - item id is considered during subscription product cancellation|
| 2.4.6 | * Fix - Notification endpoints to consider auth and purchase success status codes |
Expand All @@ -75,6 +62,7 @@ You can download the archive [file](/magento2-aps-2.4.8.zip) of the plugin and i
| 2.1.0 | * New - ApplePay is activated in Product and Cart pages |
| 2.0.0 | * New - Integrated payment options: MasterCard, Visa, AMEX, mada, Meeza, KNET, NAPS, Visa Checkout, ApplePay, valU <br/> * New - Tokenization is enabled for Debit/Credit Cards and Installments <br/> * New - Partial/Full Refund, Single/Multiple Capture and Void events are managed in order details |


## API Documentation
This plugin has been implemented by using following [API library](https://paymentservices-reference.payfort.com/docs/api/build/index.html)

Expand Down
Binary file renamed magento2-aps-2.4.8.zip → magento2-aps-2.4.9.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function __construct(
parent::__construct($context, $data);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;
$this->httpContext = $httpContext;
$this->_helper = $helperFort;
}
Expand Down Expand Up @@ -169,4 +168,8 @@ protected function canViewOrder(Order $order)
return $this->httpContext->getValue(Context::CONTEXT_AUTH)
&& $this->isVisible($order);
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function __construct(
\Magento\Directory\Model\CountryFactory $countryFactory,
array $data = []
) {
$this->_isScopePrivate = true;
$this->_orderCollectionFactory = $orderCollectionFactory;
$this->_customerSession = $customerSession;
$this->_orderConfig = $orderConfig;
Expand Down Expand Up @@ -226,4 +225,8 @@ public function getCountryName($countryCode)
$country = $this->_countryFactory->create()->loadByCode($countryCode);
return $country->getName();
}
public function getCacheLifetime()
{
return null;
}
}
5 changes: 4 additions & 1 deletion magento2-aps/Amazonpaymentservices/Fort/Block/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public function __construct(
) {
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;
$this->httpContext = $httpContext;

parent::__construct($context, $checkoutSession, $orderConfig, $httpContext, $data);
Expand Down Expand Up @@ -75,4 +74,8 @@ public function getOrderNumber()
{
return $this->order->getIncrementId();
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_apsModel = $apsModel;
$this->_resultJsonFactory = $resultJsonFactory;
Expand Down Expand Up @@ -299,4 +298,8 @@ public function getRegionIdBy($countryCode)

return null;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;

$this->_helper = $helperFort;

Expand Down Expand Up @@ -144,4 +143,8 @@ public function execute()
$jsonResult->setData($result);
return $jsonResult;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_apsModel = $apsModel;
$this->_resultJsonFactory = $resultJsonFactory;
Expand Down Expand Up @@ -133,4 +132,8 @@ private function validateAppleUrl($apple_url)

return $apple_url;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_apsModel = $apsModel;
$this->_resultJsonFactory = $resultJsonFactory;
Expand Down Expand Up @@ -252,4 +251,8 @@ public function getInstallmentHandler($response)
}
return $dataArr;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Sales\Model\Order;

class GetOtpVerifyData extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface, HttpGetActionInterface, HttpPostActionInterface
Expand All @@ -23,32 +23,21 @@ class GetOtpVerifyData extends \Magento\Framework\App\Action\Action implements C
* @var \Amazonpaymentservices\Fort\Helper\Data
*/
protected $_helper;

/**
* JSON Helper
*
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
protected $_jsonHelper;

/**
* @param \Magento\Framework\App\Action\Context $context,
* @param \Magento\Checkout\Model\Session $checkoutSession,
* @param \Amazonpaymentservices\Fort\Helper\Data $helperFort,
* @param \Magento\Framework\Controller\Result\JsonFactory
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Checkout\Model\Session $checkoutSession,
\Amazonpaymentservices\Fort\Helper\Data $helperFort,
\Magento\Framework\Controller\Result\JsonFactory $jsonFactory
\Amazonpaymentservices\Fort\Helper\Data $helperFort
) {
parent::__construct($context);

$this->_checkoutSession = $checkoutSession;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_jsonHelper = $jsonFactory;
}

public function createCsrfValidationException(
Expand All @@ -71,7 +60,12 @@ public function execute()

$data = $this->_helper->merchantOtpVerifyValuFort($order, $mobileNumber, $otp);

$resultJson = $this->_jsonHelper->create();
return $resultJson->setData($data);
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($data);
return $resultJson;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;

$this->_helper = $helperFort;

Expand Down Expand Up @@ -130,4 +129,8 @@ public function execute()
$jsonResult->setData($result);
return $jsonResult;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Sales\Model\Order;

class GetPurchaseData extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface, HttpGetActionInterface, HttpPostActionInterface
Expand All @@ -34,21 +34,17 @@ class GetPurchaseData extends \Magento\Framework\App\Action\Action implements Cs
/**
* @param \Magento\Framework\App\Action\Context $context,
* @param \Magento\Checkout\Model\Session $checkoutSession,
* @param \Amazonpaymentservices\Fort\Helper\Data $helperFort,
* @param \Magento\Framework\Controller\Result\JsonFactory
* @param \Amazonpaymentservices\Fort\Helper\Data $helperFort
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Checkout\Model\Session $checkoutSession,
\Amazonpaymentservices\Fort\Helper\Data $helperFort,
\Magento\Framework\Controller\Result\JsonFactory $jsonFactory
\Amazonpaymentservices\Fort\Helper\Data $helperFort
) {
parent::__construct($context);

$this->_checkoutSession = $checkoutSession;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_jsonHelper = $jsonFactory;
}

public function createCsrfValidationException(
Expand Down Expand Up @@ -78,7 +74,12 @@ public function execute()

$data = $this->_helper->merchantPurchaseValuFort($order, $mobileNumber, $otp, $tenure, $valuTenureAmount, $valuTenureInterest, $downPayment, $wallet_amount, $cashback_amount);

$resultJson = $this->_jsonHelper->create();
return $resultJson->setData($data);
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($data);
return $resultJson;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;

$this->_helper = $helperFort;

Expand Down Expand Up @@ -115,4 +114,8 @@ public function execute()
$jsonResult->setData($result);
return $jsonResult;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Magento\Framework\App\RequestInterface;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\App\Action\HttpPostActionInterface;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Sales\Model\Order;

class GetUserData extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface, HttpGetActionInterface, HttpPostActionInterface
Expand All @@ -24,30 +24,20 @@ class GetUserData extends \Magento\Framework\App\Action\Action implements CsrfAw
*/
protected $_helper;

/**
* JSON Helper
*
* @var \Magento\Framework\Controller\Result\JsonFactory
*/
protected $_jsonFactory;

/**
* @param \Magento\Framework\App\Action\Context $context,
* @param \Magento\Checkout\Model\Session $checkoutSession,
* @param \Amazonpaymentservices\Fort\Helper\Data $helperFort,
* @param \Magento\Framework\Controller\Result\JsonFactory
* @param \Amazonpaymentservices\Fort\Helper\Data $helperFort
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Checkout\Model\Session $checkoutSession,
\Amazonpaymentservices\Fort\Helper\Data $helperFort,
\Magento\Framework\Controller\Result\JsonFactory $jsonFactory
\Amazonpaymentservices\Fort\Helper\Data $helperFort
) {
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_isScopePrivate = true;
$this->_helper = $helperFort;
$this->_jsonHelper = $jsonFactory;
}

public function createCsrfValidationException(
Expand Down Expand Up @@ -76,7 +66,12 @@ public function execute()
} elseif ($otpCheck == 'requestOtp') {
$data = $this->_helper->execGenOtp($order, $mobileNumber, $downPayment, $wallet_amount, $cashback_amount);
}
$resultJson = $this->_jsonHelper->create();
return $resultJson->setData($data);
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($data);
return $resultJson;
}
public function getCacheLifetime()
{
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function __construct(
parent::__construct($context);
$this->_checkoutSession = $checkoutSession;
$this->_orderConfig = $orderConfig;
$this->_isScopePrivate = true;

$this->_helper = $helperFort;

Expand Down Expand Up @@ -91,4 +90,8 @@ public function execute()
$jsonResult->setData($result);
return $jsonResult;
}
public function getCacheLifetime()
{
return null;
}
}
Loading

0 comments on commit 9fa0a1b

Please sign in to comment.