Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Oct 27, 2021
1 parent bcec3c3 commit d1e0089
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Init.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace Dfe\TBCBank;
use Dfe\TBCBank\API\Facade as F;
use Dfe\TBCBank\Session as Sess;
use Magento\Quote\Api\Data\AddressInterface as IQA;
use Magento\Quote\Api\Data\PaymentInterface as IQP;
use Magento\Quote\Model\Quote\Address as QA;
Expand Down Expand Up @@ -42,7 +43,7 @@ function registered($cartId, IQP $qp, IQA $ba = null) {return $this->p();}
* @return string
*/
private function p() {
df_customer_session()->setDfeTBCParams($p = Charge::p()); /** @var array(string => mixed) $p */
Sess::s()->data($p = Charge::p()); /** @var array(string => mixed) $p */
return dfw_encode(['id' => F::s()->init($p)]);
}
}
3 changes: 2 additions & 1 deletion Init/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Df\Payment\Source\AC;
use Df\Payment\W\Event as Ev;
use Df\StripeClone\Facade\Charge as FCharge;
use Dfe\TBCBank\Session as Sess;
/**
* 2018-09-26
* @method \Dfe\TBCBank\Method m()
Expand All @@ -28,7 +29,7 @@ protected function preconfigured() {return $this->s()->tokenization() ? AC::C :
* @used-by \Df\Payment\Init\Action::action()
* @return array(string => mixed)
*/
protected function redirectParams() {return df_customer_session()->getDfeTBCParams();}
protected function redirectParams() {return Sess::s()->data();}

/**
* 2018-09-26
Expand Down
22 changes: 22 additions & 0 deletions Session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
namespace Dfe\TBCBank;
# 2021-10-27 "Improve the custom session data handling interface": https://github.com/mage2pro/core/issues/163
final class Session extends \Df\Core\Session {
/**
* 2021-10-27
* @used-by \Dfe\TBCBank\Init::p()
* @used-by \Dfe\TBCBank\Init\Action::redirectParams()
* @param array(string => mixed)|string $v [optional]
* @return $this|array(string => mixed)
*/
function data($v = DF_N) {return df_prop($this, $v, []);}

/**
* 2021-10-26
* @override
* @see \Df\Core\Session::c()
* @used-by \Df\Core\Session::__construct()
* @return string
*/
protected function c() {return \Magento\Customer\Model\Session\Storage::class;}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/tbc-bank"
,"version": "1.4.5"
,"version": "1.4.6"
,"description": "TBC Bank (Georgia) integration with Magento 2"
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/tbc-bank"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=4.9.2"}
,"require": {"mage2pro/core": ">=7.8.8"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\TBCBank\\": ""}}
,"keywords": [
"API"
Expand Down

0 comments on commit d1e0089

Please sign in to comment.