diff --git a/Facade/Charge.php b/Facade/Charge.php index aa2a943..788a5f0 100644 --- a/Facade/Charge.php +++ b/Facade/Charge.php @@ -23,11 +23,9 @@ final class Charge extends \Df\StripeClone\Facade\Charge { * @return oCharge */ function capturePreauthorized($id, $a) { - /** @var oCharge $oCharge */ - $oCharge = $this->load($id); + $oCharge = $this->load($id); /** @var oCharge $oCharge */ return $this->api()->create((new iCharge) - // 2019-02-19 - // Для перестраховки от конверсионных погрешностей не используем $a. + // 2019-02-19 Для перестраховки от конверсионных погрешностей не используем $a. ->setAmount($oCharge->getAmount()) ->setDescription($oCharge->getDescription()) ->setCurrency($oCharge->getCurrency()) @@ -35,17 +33,6 @@ function capturePreauthorized($id, $a) { ); } - /** - * 2017-02-11 - * Идентификаторы банковских карт (в терминологии Paymill - «Payment») имеют вид - * «pay_ddcc9210289ede708c97eb67». - * @override - * @see \Df\StripeClone\Facade\Charge::cardIdPrefix() - * @used-by \Df\StripeClone\Payer::usePreviousCard() - * @return string - */ - function cardIdPrefix() {return 'pay';} - /** * 2017-02-10 * @override @@ -55,18 +42,16 @@ function cardIdPrefix() {return 'pay';} * @return oCharge */ function create(array $p) { - /** @var bool $capture */ - $capture = $p[_Charge::K_CAPTURE]; + $capture = $p[_Charge::K_CAPTURE]; /** @var bool $capture */ // 2017-02-12 // Приходится заводить эту переменную, потому что иначе интерпретатор PHP даёт сбой: // «syntax error, unexpected '->' (T_OBJECT_OPERATOR)». - /** @var iCharge|iAuth $i */ - $i = $capture ? new iCharge : new iAuth; + $i = $capture ? new iCharge : new iAuth; /** @var iCharge|iAuth $i */ /** @var oCharge|oAuth $o */ $o = $this->api()->create($i ->setAmount($p[_Charge::K_AMOUNT]) ->setDescription($p[_Charge::K_DESCRIPTION]) - ->setClient($p[_Charge::K_CUSTOMER]) + ->setClient($p[_Charge::K_CUSTOMER_ID]) ->setCurrency($p[_Charge::K_CURRENCY]) ->setPayment($p[_Charge::K_CARD]) ); @@ -95,6 +80,7 @@ function id($c) {return $c->getId();} * @override * @see \Df\StripeClone\Facade\Charge::pathToCard() * @used-by \Df\StripeClone\Block\Info::prepare() + * @used-by \Df\StripeClone\Facade\Charge::cardData() * @return string */ function pathToCard() {return 'payment';} @@ -127,15 +113,15 @@ function void($id) {return $this->api()->delete( );} /** - * 2017-02-11 The bank card data. + * 2017-02-11 + * Идентификаторы банковских карт (в терминологии Paymill - «Payment») имеют вид + * «pay_ddcc9210289ede708c97eb67». * @override - * @see \Df\StripeClone\Facade\Charge::cardData() - * @used-by \Df\StripeClone\Facade\Charge::card() - * @param oCharge $c - * @return oCard - * @see \Dfe\Paymill\Facade\Customer::cardsData() + * @see \Df\StripeClone\Facade\Charge::cardIdPrefix() + * @used-by \Df\StripeClone\Payer::usePreviousCard() + * @return string */ - protected function cardData($c) {return $c->getPayment();} + protected function cardIdPrefix() {return 'pay_';} /** * 2017-02-11 diff --git a/Facade/Customer.php b/Facade/Customer.php index 90275b9..1e1d7be 100644 --- a/Facade/Customer.php +++ b/Facade/Customer.php @@ -10,16 +10,6 @@ // 2017-02-10 /** @method \Dfe\Paymill\Method m() */ final class Customer extends \Df\StripeClone\Facade\Customer { - /** - * 2017-02-10 - * @override - * @see \Df\StripeClone\Facade\Customer::_get() - * @used-by \Df\StripeClone\Facade\Customer::get() - * @param int $id - * @return C|null - */ - function _get($id) {return $this->api()->getOne((new iCustomer)->setId($id));} - /** * 2017-02-10 * @override @@ -67,6 +57,16 @@ function create(array $p) { */ function id($c) {return $c->getId();} + /** + * 2017-02-10 + * @override + * @see \Df\StripeClone\Facade\Customer::_get() + * @used-by \Df\StripeClone\Facade\Customer::get() + * @param int $id + * @return C|null + */ + protected function _get($id) {return $this->api()->getOne((new iCustomer)->setId($id));} + /** * 2017-02-11 * @override diff --git a/P/Charge.php b/P/Charge.php index 71bdcee..affc9d7 100644 --- a/P/Charge.php +++ b/P/Charge.php @@ -7,7 +7,7 @@ final class Charge extends \Df\StripeClone\P\Charge { /** * 2017-02-11 - * 2017-02-18 Ключ, значением которого является токен банковской карты. + * 2017-10-09 The key name of a bank card token or of a saved bank card ID. * @override * @see \Df\StripeClone\P\Charge::k_CardId() * @used-by \Df\StripeClone\P\Charge::request() diff --git a/T/Auth.php b/T/Auth.php index 73aba79..0b9c8e8 100644 --- a/T/Auth.php +++ b/T/Auth.php @@ -3,7 +3,7 @@ use Paymill\Models\Request\Preauthorization as iAuth; use Paymill\Models\Response\Preauthorization as oAuth; // 2017-02-12 -final class Auth extends TestCase { +final class Auth extends CaseT { /** * 2017-02-12 * [Paymill] An example of a preauthorization response: https://mage2.pro/t/2731 diff --git a/T/Card.php b/T/Card.php index ab25a4d..bccb095 100644 --- a/T/Card.php +++ b/T/Card.php @@ -4,7 +4,7 @@ use Paymill\Models\Request\Payment as iCard; use Paymill\Models\Response\Payment as oCard; use Paymill\Request as API; -final class Card extends TestCase { +final class Card extends CaseT { /** @test 2017-02-08 */ function t00() {} diff --git a/T/TestCase.php b/T/CaseT.php similarity index 96% rename from T/TestCase.php rename to T/CaseT.php index ee53f3a..b7b50d3 100644 --- a/T/TestCase.php +++ b/T/CaseT.php @@ -9,7 +9,7 @@ * @see \Dfe\Paymill\T\Customer * @method \Dfe\Paymill\Settings s() */ -abstract class TestCase extends \Df\Core\TestCase { +abstract class CaseT extends \Df\Core\TestCase { /** * 2017-02-08 * @return API diff --git a/T/Charge.php b/T/Charge.php index 13b7707..42ff28f 100644 --- a/T/Charge.php +++ b/T/Charge.php @@ -8,7 +8,7 @@ use Paymill\Models\Response\Payment as oCard; use Paymill\Models\Response\Transaction as oCharge; use Paymill\Request as lRequest; -final class Charge extends TestCase { +final class Charge extends CaseT { /** @test */ function t00() {} diff --git a/T/Customer.php b/T/Customer.php index 85a920a..e429d88 100644 --- a/T/Customer.php +++ b/T/Customer.php @@ -6,7 +6,7 @@ use Paymill\Models\Response\Client as oCustomer; use Paymill\Models\Response\Payment as oCard; use Paymill\Request as API; -final class Customer extends TestCase { +final class Customer extends CaseT { /** @test */ function t00() {} diff --git a/composer.json b/composer.json index c8fd732..c1a2cc3 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/paymill" - ,"version": "1.5.8" + ,"version": "1.6.0" ,"description": "The «Paymill» payment extension for Magento 2." ,"type": "magento2-module" ,"homepage": "https://mage2.pro/c/extensions/paymill" @@ -11,7 +11,7 @@ "homepage": "https://mage2.pro/users/dmitry_fedyuk", "role": "Developer" }] - ,"require": {"mage2pro/core": ">=2.12.21", "mage2pro/paymill-sdk": "^4.4.4"} + ,"require": {"mage2pro/core": ">=3.1.0", "mage2pro/paymill-sdk": "^4.4.4"} ,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\Paymill\\": ""}} ,"keywords": [ "3D Secure"