Skip to content

Commit 770a753

Browse files
committed
Merge pull request #467 from magento-mpi/develop
[MPI] Bugfix
2 parents 7bb68c0 + 3ccd065 commit 770a753

25 files changed

+390
-362
lines changed

app/code/Magento/Paypal/Block/Bml/Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function _construct()
3131
'https://www.securecheckout.billmelater.com/paycapture-content/'
3232
. 'fetch?hash=AU826TU8&content=/bmlweb/ppwpsiw.html'
3333
)->setPaymentAcceptanceMarkSrc(
34-
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppc-acceptance-small.png'
34+
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/ppc-acceptance-medium.png'
3535
)->setPaymentWhatIs(__('See terms'));
3636

3737
$this->_initializeRedirectTemplateWithMark($mark);

app/code/Magento/Paypal/Model/AbstractConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ abstract class AbstractConfig implements ConfigInterface
4747
/**
4848
* @var string
4949
*/
50-
private $pathPattern;
50+
protected $pathPattern;
5151

5252
/**
5353
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig

app/code/Magento/Paypal/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ public function getPaymentMarkImageUrl($localeCode, $orderTotal = null, $pal = n
971971
case self::PAYMENT_MARK_LARGE:
972972
break;
973973
default:
974-
$staticSize = self::PAYMENT_MARK_SMALL;
974+
$staticSize = self::PAYMENT_MARK_MEDIUM;
975975
}
976976

977977
return sprintf(

app/code/Magento/Paypal/Model/PayflowConfig.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Class PayflowConfig
1212
* @todo ELiminate current configuration class
1313
*/
14-
class PayflowConfig extends AbstractConfig
14+
class PayflowConfig extends Config
1515
{
1616
/**#@-*/
1717

@@ -89,4 +89,19 @@ public function isMethodActive($method)
8989
return parent::isMethodActive(Config::METHOD_PAYMENT_PRO)
9090
|| parent::isMethodActive(Config::METHOD_PAYFLOWPRO);
9191
}
92+
93+
/**
94+
* Map any supported payment method into a config path by specified field name
95+
*
96+
* @param string $fieldName
97+
* @return string|null
98+
*/
99+
protected function _getSpecificConfigPath($fieldName)
100+
{
101+
if ($this->pathPattern) {
102+
return sprintf($this->pathPattern, $this->_methodCode, $fieldName);
103+
}
104+
105+
return "payment/{$this->_methodCode}/{$fieldName}";
106+
}
92107
}

app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public function dataProviderGetExpressCheckoutShortcutImageUrl()
347347
],
348348
[
349349
'en_US', null, null, Config::EC_FLAVOR_STATIC, false, Config::EC_BUTTON_TYPE_MARK,
350-
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png'
350+
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png'
351351
],
352352
[
353353
'en_US', null, null, Config::EC_FLAVOR_STATIC, true, Config::EC_BUTTON_TYPE_SHORTCUT,
@@ -413,8 +413,8 @@ public function dataProviderGetPaymentMarkImageUrl()
413413
'https://fpdbs.paypal.com/dynamicimageweb?cmd=_dynamic-image&buttontype=ecmark&locale=en_GB'
414414
],
415415
[
416-
'en_US', null, null, 'small', Config::EC_FLAVOR_STATIC, true,
417-
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png'
416+
'en_US', null, null, 'medium', Config::EC_FLAVOR_STATIC, true,
417+
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png'
418418
],
419419
[
420420
'en_US', null, null, 'medium', Config::EC_FLAVOR_STATIC, true,
@@ -426,7 +426,7 @@ public function dataProviderGetPaymentMarkImageUrl()
426426
],
427427
[
428428
'en_GB', null, null, 'affected', Config::EC_FLAVOR_STATIC, true,
429-
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png'
429+
'https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-medium.png'
430430
],
431431
];
432432
}

app/code/Magento/Paypal/Test/Unit/Model/PayflowConfigTest.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Paypal\Test\Unit\Model;
77

88
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
910
use Magento\Paypal\Model\PayflowConfig;
1011
use Magento\Payment\Model\MethodInterface;
1112
use Magento\Payment\Model\Method\AbstractMethod;
@@ -41,7 +42,13 @@ protected function setUp()
4142
$this->methodInterfaceMock = $this->getMockBuilder('Magento\Payment\Model\MethodInterface')
4243
->getMockForAbstractClass();
4344

44-
$this->config = new PayflowConfig($this->scopeConfigMock);
45+
$om = new ObjectManager($this);
46+
$this->config = $om->getObject(
47+
'Magento\Paypal\Model\PayflowConfig',
48+
[
49+
'scopeConfig' => $this->scopeConfigMock
50+
]
51+
);
4552
}
4653

4754
/**
@@ -163,6 +170,11 @@ public function testIsMethodActive(array $expectsMethods, $currentMethod, $resul
163170
{
164171
$this->config->setStoreId(5);
165172

173+
$this->scopeConfigMock->expects($this->any())
174+
->method('getValue')
175+
->with('paypal/general/merchant_country')
176+
->will($this->returnValue('US'));
177+
166178
$i = 0;
167179
foreach ($expectsMethods as $method => $isActive) {
168180
$this->scopeConfigMock->expects($this->at($i++))

app/code/Magento/Paypal/etc/adminhtml/rules/payment_au.xml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
<!--PayPal Website Payments Standard-->
1111
<payment id="wps_other">
1212
<events selector="[data-enable='payment']">
13-
<event value="0" name="deactivate"/>
14-
<event value="1" name="activate">
13+
<event value="0" name="deactivate-rule"/>
14+
<event value="1" name="activate-rule">
1515
<predicate name="confirm"
1616
message="There is already another PayPal solution enabled. Enable this solution instead?"
17-
event="deactivate"
17+
event="deactivate-rule"
1818
>
1919
<argument name="paypal_payflowpro_au">paypal_payflowpro_au</argument>
2020
<argument name="payments_pro_hosted_solution_au">payments_pro_hosted_solution_au</argument>
@@ -23,17 +23,17 @@
2323
</event>
2424
</events>
2525
<relation target="paypal_payflowpro_au">
26-
<rule type="disable" event="activate"/>
26+
<rule type="disable" event="activate-rule"/>
2727
</relation>
2828
<relation target="payments_pro_hosted_solution_au">
29-
<rule type="disable" event="activate"/>
29+
<rule type="disable" event="activate-rule"/>
3030
</relation>
3131
<relation target="express_checkout_other">
32-
<rule type="disable" event="activate"/>
32+
<rule type="disable" event="activate-rule"/>
3333
</relation>
3434
<relation target=":self">
35-
<rule type="simple/mark-enable" event="activate"/>
36-
<rule type="simple/disable" event="deactivate"/>
35+
<rule type="simple/mark-enable" event="activate-rule"/>
36+
<rule type="simple/disable" event="deactivate-rule"/>
3737
<rule type="conflict" event=":load">
3838
<argument name="paypal_payflowpro_au">paypal_payflowpro_au</argument>
3939
<argument name="payments_pro_hosted_solution_au">payments_pro_hosted_solution_au</argument>
@@ -44,26 +44,26 @@
4444
<!--PayPal Payflow Pro-->
4545
<payment id="paypal_payflowpro_au">
4646
<events selector="[data-enable='payment']">
47-
<event value="0" name="deactivate"/>
48-
<event value="1" name="activate">
47+
<event value="0" name="deactivate-rule"/>
48+
<event value="1" name="activate-rule">
4949
<predicate name="confirm"
5050
message="There is already another PayPal solution enabled. Enable this solution instead?"
51-
event="deactivate"
51+
event="deactivate-rule"
5252
>
5353
<argument name="payments_pro_hosted_solution_au">payments_pro_hosted_solution_au</argument>
5454
<argument name="wps_other">wps_other</argument>
5555
</predicate>
5656
</event>
5757
</events>
5858
<relation target="wps_other">
59-
<rule type="disable" event="activate"/>
59+
<rule type="disable" event="activate-rule"/>
6060
</relation>
6161
<relation target="payments_pro_hosted_solution_au">
62-
<rule type="disable" event="activate"/>
62+
<rule type="disable" event="activate-rule"/>
6363
</relation>
6464
<relation target=":self">
65-
<rule type="simple/mark-enable" event="activate"/>
66-
<rule type="simple/disable" event="deactivate"/>
65+
<rule type="simple/mark-enable" event="activate-rule"/>
66+
<rule type="simple/disable" event="deactivate-rule"/>
6767
<rule type="conflict" event=":load">
6868
<argument name="wps_other">wps_other</argument>
6969
<argument name="payments_pro_hosted_solution_au">payments_pro_hosted_solution_au</argument>
@@ -73,26 +73,26 @@
7373
<!--PayPal Website Payments Pro Hosted Solution-->
7474
<payment id="payments_pro_hosted_solution_au">
7575
<events selector="[data-enable='payment']">
76-
<event value="0" name="deactivate"/>
77-
<event value="1" name="activate">
76+
<event value="0" name="deactivate-rule"/>
77+
<event value="1" name="activate-rule">
7878
<predicate name="confirm"
7979
message="There is already another PayPal solution enabled. Enable this solution instead?"
80-
event="deactivate"
80+
event="deactivate-rule"
8181
>
8282
<argument name="paypal_payflowpro_au">paypal_payflowpro_au</argument>
8383
<argument name="wps_other">wps_other</argument>
8484
</predicate>
8585
</event>
8686
</events>
8787
<relation target="paypal_payflowpro_au">
88-
<rule type="disable" event="activate"/>
88+
<rule type="disable" event="activate-rule"/>
8989
</relation>
9090
<relation target="wps_other">
91-
<rule type="disable" event="activate"/>
91+
<rule type="disable" event="activate-rule"/>
9292
</relation>
9393
<relation target=":self">
94-
<rule type="simple/mark-enable" event="activate"/>
95-
<rule type="simple/disable" event="deactivate"/>
94+
<rule type="simple/mark-enable" event="activate-rule"/>
95+
<rule type="simple/disable" event="deactivate-rule"/>
9696
<rule type="conflict" event=":load">
9797
<argument name="wps_other">wps_other</argument>
9898
<argument name="paypal_payflowpro_au">paypal_payflowpro_au</argument>
@@ -102,22 +102,22 @@
102102
<!--PayPal Express Checkout-->
103103
<payment id="express_checkout_other">
104104
<events selector="[data-enable='payment']">
105-
<event value="0" name="deactivate"/>
106-
<event value="1" name="activate">
105+
<event value="0" name="deactivate-rule"/>
106+
<event value="1" name="activate-rule">
107107
<predicate name="confirm"
108108
message="There is already another PayPal solution enabled. Enable this solution instead?"
109-
event="deactivate"
109+
event="deactivate-rule"
110110
>
111111
<argument name="wps_other">wps_other</argument>
112112
</predicate>
113113
</event>
114114
</events>
115115
<relation target="wps_other">
116-
<rule type="disable" event="activate"/>
116+
<rule type="disable" event="activate-rule"/>
117117
</relation>
118118
<relation target=":self">
119-
<rule type="simple/mark-enable" event="activate"/>
120-
<rule type="simple/disable" event="deactivate"/>
119+
<rule type="simple/mark-enable" event="activate-rule"/>
120+
<rule type="simple/disable" event="deactivate-rule"/>
121121
<rule type="conflict" event=":load">
122122
<argument name="wps_other">wps_other</argument>
123123
</rule>

0 commit comments

Comments
 (0)