Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Dec 13, 2017
1 parent 9201c88 commit 795cc38
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Payment/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -1521,13 +1521,25 @@ final function refund(II $payment, $a) {
return $this;
}

/**
* 2017-12-13
* "Provide an ability to the Magento backend users (merchants)
* to set up the «Require the billing address?» option separately
* for each AlphaCommerceHub's payment option (bank cards, PayPal, POLi Payments, etc.)":
* https://github.com/mage2pro/alphacommercehub/issues/84
* @used-by \Df\Payment\PlaceOrderInternal::_place()
* @return bool
*/
function requireBillingAddress() {return $this->s()->requireBillingAddress();}

/**
* 2016-07-13
* 2017-07-02
* Сегодня заметил, что параметр scope сюда никто не передаёт, поэтому убрал его.
* @see \Df\Payment\Settings::scopeDefault()
* @final I do not use the PHP «final» keyword here to allow refine the return type using PHPDoc.
* @used-by dfps()
* @used-by requireBillingAddress()
* @used-by \Df\Payment\Block\Info::s()
* @used-by \Df\Payment\Init\Action::s()
* @used-by \Df\Payment\W\Strategy::s()
Expand Down
12 changes: 10 additions & 2 deletions Payment/PlaceOrderInternal.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private function __construct($cartId, $isGuest) {$this->_cartId = $cartId; $this
private function _place() {
/** @var int $oid */
try {
BA::disable(!$this->s()->requireBillingAddress());
BA::disable(!$this->m()->requireBillingAddress());
try {$oid = df_quote_m()->placeOrder($this->qid());}
finally {BA::restore();}
}
Expand Down Expand Up @@ -90,13 +90,21 @@ private function qid() {return dfc($this, function() {
return $result;
});}

/**
* 2017-12-13
* @used-by _place()
* @used-by s()
* @return Method
*/
private function m() {return dfc($this, function() {return dfpm(dfp(df_quote($this->qid())));});}

/**
* 2016-07-18
* @used-by _place()
* @used-by message()
* @return Settings
*/
private function s() {return dfc($this, function() {return dfpm(dfp(df_quote($this->qid())))->s();});}
private function s() {return dfc($this, function() {return $this->m()->s();});}

/**
* 2017-03-12
Expand Down
2 changes: 2 additions & 0 deletions Payment/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ function publicKey() {return $this->key('probablyTestable', 'public', 'publishab
*
* 2017-02-16 https://github.com/mage2pro/core/issues/8
*
* @used-by \Df\Payment\ConfigProvider::config()
* @used-by \Df\Payment\Method::requireBillingAddress()
* @return bool
*/
final function requireBillingAddress() {return $this->b(null, null, function() {return
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/core"
,"version": "3.4.10"
,"version": "3.4.11"
,"description": "Mage2.PRO core package."
,"type": "magento2-module"
,"homepage": "https://mage2.pro"
Expand Down

0 comments on commit 795cc38

Please sign in to comment.