Skip to content

Commit 0edcd8d

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-60326' into 2.1.8-develop-pr21
2 parents 07e7ef1 + 97bef0f commit 0edcd8d

File tree

16 files changed

+573
-2
lines changed

16 files changed

+573
-2
lines changed

app/code/Magento/Sales/Model/Order/Payment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ public function getAuthorizationTransaction()
12721272
*/
12731273
public function isCaptureFinal($amountToCapture)
12741274
{
1275-
$total = $this->getOrder()->getTotalDue();
1275+
$total = $this->getOrder()->getBaseTotalDue();
12761276
return $this->formatAmount($total, true) == $this->formatAmount($amountToCapture, true);
12771277
}
12781278

app/code/Magento/Sales/Test/Unit/Model/Order/PaymentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ public function testIsCaptureFinal()
15201520
$partialAmount = 12.00;
15211521

15221522
$this->orderMock->expects(static::exactly(2))
1523-
->method('getTotalDue')
1523+
->method('getBaseTotalDue')
15241524
->willReturn($amount);
15251525

15261526
static::assertFalse($this->payment->isCaptureFinal($partialAmount));

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Repository/ConfigData.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,34 @@
159159
</item>
160160
</field>
161161
</dataset>
162+
163+
<dataset name="config_allow_and_default_currency_eur">
164+
<field name="currency/options/allow" xsi:type="array">
165+
<item name="scope" xsi:type="string">currency</item>
166+
<item name="value" xsi:type="array">
167+
<item name="US Dollar" xsi:type="string">USD</item>
168+
<item name="Euro" xsi:type="string">EUR</item>
169+
</item>
170+
</field>
171+
<field name="currency/options/default" xsi:type="array">
172+
<item name="scope" xsi:type="string">currency</item>
173+
<item name="label" xsi:type="string">Euro</item>
174+
<item name="value" xsi:type="string">EUR</item>
175+
</field>
176+
</dataset>
177+
178+
<dataset name="config_allow_and_default_currency_eur_rollback">
179+
<field name="currency/options/allow" xsi:type="array">
180+
<item name="scope" xsi:type="string">currency</item>
181+
<item name="value" xsi:type="array">
182+
<item name="US Dollar" xsi:type="string">USD</item>
183+
</item>
184+
</field>
185+
<field name="currency/options/default" xsi:type="array">
186+
<item name="scope" xsi:type="string">currency</item>
187+
<item name="label" xsi:type="string">US Dollar</item>
188+
<item name="value" xsi:type="string">USD</item>
189+
</field>
190+
</dataset>
162191
</repository>
163192
</config>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Paypal\Test\Block\Form\PayflowAdvanced;
8+
9+
use Magento\Mtf\Client\Locator;
10+
use Magento\Payment\Test\Block\Form\Cc;
11+
12+
/**
13+
* Card Verification frame block.
14+
*/
15+
class CcAdvanced extends Cc
16+
{
17+
/**
18+
* 'Pay Now' button.
19+
*
20+
* @var string
21+
*/
22+
protected $continue = '#btn_pay_cc';
23+
24+
/**
25+
* Payflow Advanced iFrame locator.
26+
*
27+
* @var string
28+
*/
29+
protected $payflowAdvancedFrame = "#payflow-advanced-iframe";
30+
31+
/**
32+
* Initialize block. Switch to frame.
33+
*
34+
* @return void
35+
*/
36+
protected function init()
37+
{
38+
parent::init();
39+
$this->browser->switchToFrame(new Locator($this->payflowAdvancedFrame));
40+
}
41+
42+
/**
43+
* Press "Continue" button.
44+
*
45+
* @return void
46+
*/
47+
public function pressContinue()
48+
{
49+
$this->_rootElement->find($this->continue)->click();
50+
}
51+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="1">
9+
<fields>
10+
<cc_number>
11+
<selector>#cc_number</selector>
12+
</cc_number>
13+
<cc_exp_month>
14+
<selector>#expdate_month</selector>
15+
</cc_exp_month>
16+
<cc_exp_year>
17+
<selector>#expdate_year</selector>
18+
</cc_exp_year>
19+
<cc_cid>
20+
<selector>#cvv2_number</selector>
21+
</cc_cid>
22+
</fields>
23+
</mapping>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Paypal\Test\Block\Form\PayflowAdvanced;
8+
9+
use Magento\Mtf\Client\Locator;
10+
use Magento\Payment\Test\Block\Form\Cc;
11+
12+
/**
13+
* Card Verification frame block.
14+
*/
15+
class CcLink extends Cc
16+
{
17+
/**
18+
* 'Pay Now' button.
19+
*
20+
* @var string
21+
*/
22+
protected $continue = '#btn_pay_cc';
23+
24+
/**
25+
* Payflow Link iFrame locator.
26+
*
27+
* @var string
28+
*/
29+
protected $payflowLinkFrame = "#payflow-link-iframe";
30+
31+
/**
32+
* Initialize block. Switch to frame.
33+
*
34+
* @return void
35+
*/
36+
protected function init()
37+
{
38+
parent::init();
39+
$this->browser->switchToFrame(new Locator($this->payflowLinkFrame));
40+
}
41+
42+
/**
43+
* Press "Continue" button.
44+
*
45+
* @return void
46+
*/
47+
public function pressContinue()
48+
{
49+
$this->_rootElement->find($this->continue)->click();
50+
}
51+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="1">
9+
<fields>
10+
<cc_number>
11+
<selector>#cc_number</selector>
12+
</cc_number>
13+
<cc_exp_month>
14+
<selector>#expdate_month</selector>
15+
</cc_exp_month>
16+
<cc_exp_year>
17+
<selector>#expdate_year</selector>
18+
</cc_exp_year>
19+
<cc_cid>
20+
<selector>#cvv2_number</selector>
21+
</cc_cid>
22+
</fields>
23+
</mapping>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd">
9+
<page name="CheckoutOnepage" mca="checkout/index">
10+
<block name="paymentBlock" class="Magento\Checkout\Test\Block\Onepage\Payment" locator="#checkout-step-payment" strategy="css selector" />
11+
<block name="payflowAdvancedCcBlock" class="Magento\Paypal\Test\Block\Form\PayflowAdvanced\CcAdvanced" locator="body" strategy="css selector"/>
12+
<block name="payflowLinkCcBlock" class="Magento\Paypal\Test\Block\Form\PayflowAdvanced\CcLink" locator="body" strategy="css selector"/>
13+
</page>
14+
</config>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
9+
<repository class="Magento\Payment\Test\Repository\CreditCard">
10+
<dataset name="visa_direct">
11+
<field name="cc_type" xsi:type="string">Visa</field>
12+
<field name="cc_number" xsi:type="string">4617747819866651</field>
13+
<field name="cc_exp_month" xsi:type="string">01 - January</field>
14+
<field name="cc_exp_year" xsi:type="string">2017</field>
15+
<field name="cc_cid" xsi:type="string">123</field>
16+
</dataset>
17+
18+
<dataset name="visa_payflow">
19+
<field name="cc_type" xsi:type="string">Visa</field>
20+
<field name="cc_number" xsi:type="string">4111111111111111</field>
21+
<field name="cc_exp_month" xsi:type="string">01 - January</field>
22+
<field name="cc_exp_year" xsi:type="string">2020</field>
23+
<field name="cc_cid" xsi:type="string">123</field>
24+
</dataset>
25+
</repository>
26+
</config>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Paypal\Test\TestCase;
7+
8+
use Magento\Mtf\TestCase\Scenario;
9+
use Magento\Mtf\TestStep\TestStepFactory;
10+
11+
/**
12+
* Preconditions:
13+
* 1. Create simple product.
14+
* 2. Configure PayPal Payflow Pro.
15+
* 3. Configure Flat Rate.
16+
* 4. Set Base Currency US Dollar
17+
* 5. Create custom store view for Main Website.
18+
* 6. Set default display currency Euro for custom store view.
19+
*
20+
* Steps:
21+
* 1. Go to storefront.
22+
* 2. Switch to the additional Store View.
23+
* 3. Add simple product to the cart.
24+
* 4. Proceed to checkout.
25+
* 5. Specify shiping address data (US Customer 1).
26+
* 6. Specify shipping method (Fixed Flat Rate).
27+
* 7. Select payment method Credit Card (PayFlow Pro).
28+
* 8. Fill required fields for credit card.
29+
* 9. Click Submit order button.
30+
* 10. Make assertions.
31+
*
32+
* @group PayPal
33+
* @ZephyrId MAGETWO-61668
34+
*/
35+
class CreatePayFlowOrderCustomStoreTest extends Scenario
36+
{
37+
/* tags */
38+
const MVP = 'yes';
39+
const TEST_TYPE = '3rd_party_test';
40+
const SEVERITY = 'S2';
41+
/* end tags */
42+
43+
/**
44+
* Runs sales order on backend.
45+
*
46+
* @return void
47+
*/
48+
public function test()
49+
{
50+
$this->executeScenario();
51+
}
52+
}

0 commit comments

Comments
 (0)