Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SaveCreditCardStep.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Checkout\Test\Page\CheckoutOnepage;
9 use Magento\Mtf\TestStep\TestStepInterface;
10 
14 class SaveCreditCardStep implements TestStepInterface
15 {
21  protected $checkoutOnepage;
22 
28  protected $payment;
29 
35  protected $creditCardSave;
36 
43  public function __construct(
44  CheckoutOnepage $checkoutOnepage,
45  array $payment,
46  $creditCardSave = 'No'
47  ) {
48  $this->checkoutOnepage = $checkoutOnepage;
49  $this->payment = $payment;
50  $this->creditCardSave = $creditCardSave;
51  }
52 
58  public function run()
59  {
60  $this->checkoutOnepage->getVaultPaymentBlock()->saveCreditCard(
61  $this->payment['method'],
62  $this->creditCardSave
63  );
64  }
65 }
__construct(CheckoutOnepage $checkoutOnepage, array $payment, $creditCardSave='No')