1 | <?php |
||
29 | final class PaymentContext implements Context |
||
30 | { |
||
31 | /** |
||
32 | * @var SharedStorageInterface |
||
33 | */ |
||
34 | private $sharedStorage; |
||
35 | |||
36 | /** |
||
37 | * @var PaymentMethodRepositoryInterface |
||
38 | */ |
||
39 | private $paymentMethodRepository; |
||
40 | |||
41 | /** |
||
42 | * @var ExampleFactoryInterface |
||
43 | */ |
||
44 | private $paymentMethodExampleFactory; |
||
45 | |||
46 | /** |
||
47 | * @var FactoryInterface |
||
48 | */ |
||
49 | private $paymentMethodTranslationFactory; |
||
50 | |||
51 | /** |
||
52 | * @var ObjectManager |
||
53 | */ |
||
54 | private $paymentMethodManager; |
||
55 | |||
56 | /** |
||
57 | * @var array |
||
58 | */ |
||
59 | private $gatewayFactories; |
||
60 | |||
61 | /** |
||
62 | * @param SharedStorageInterface $sharedStorage |
||
63 | * @param PaymentMethodRepositoryInterface $paymentMethodRepository |
||
64 | * @param ExampleFactoryInterface $paymentMethodExampleFactory |
||
65 | * @param FactoryInterface $paymentMethodTranslationFactory |
||
66 | * @param ObjectManager $paymentMethodManager |
||
67 | * @param array $gatewayFactories |
||
68 | */ |
||
69 | public function __construct( |
||
84 | |||
85 | /** |
||
86 | * @Given the store (also )allows paying (with ):paymentMethodName |
||
87 | * @Given the store (also )allows paying with :paymentMethodName at position :position |
||
88 | */ |
||
89 | public function storeAllowsPaying($paymentMethodName, $position = null) |
||
93 | |||
94 | /** |
||
95 | * @Given /^the store allows paying (\w+) for (all channels)$/ |
||
96 | */ |
||
97 | public function storeAllowsPayingForAllChannels($paymentMethodName, array $channels) |
||
105 | |||
106 | /** |
||
107 | * @Given the store has a payment method :paymentMethodName with a code :paymentMethodCode |
||
108 | */ |
||
109 | public function theStoreHasAPaymentMethodWithACode($paymentMethodName, $paymentMethodCode) |
||
113 | |||
114 | /** |
||
115 | * @Given the store has a payment method :paymentMethodName with a code :paymentMethodCode and Paypal Express Checkout gateway |
||
116 | */ |
||
117 | public function theStoreHasPaymentMethodWithCodeAndPaypalExpressCheckoutGateway( |
||
132 | |||
133 | /** |
||
134 | * @Given /^(this payment method) is named "([^"]+)" in the "([^"]+)" locale$/ |
||
135 | */ |
||
136 | public function thisPaymentMethodIsNamedIn(PaymentMethodInterface $paymentMethod, $name, $locale) |
||
147 | |||
148 | /** |
||
149 | * @Given the payment method :paymentMethod is disabled |
||
150 | * @Given /^(this payment method) has been disabled$/ |
||
151 | */ |
||
152 | public function theStoreHasAPaymentMethodDisabled(PaymentMethodInterface $paymentMethod) |
||
158 | |||
159 | /** |
||
160 | * @Given /^(it) has instructions "([^"]+)"$/ |
||
161 | */ |
||
162 | public function itHasInstructions(PaymentMethodInterface $paymentMethod, $instructions) |
||
168 | |||
169 | /** |
||
170 | * @Given the store has :paymentMethodName payment method not assigned to any channel |
||
171 | */ |
||
172 | public function theStoreHasPaymentMethodNotAssignedToAnyChannel($paymentMethodName) |
||
176 | |||
177 | /** |
||
178 | * @param string $name |
||
179 | * @param string $code |
||
180 | * @param string $gatewayFactory |
||
181 | * @param string $description |
||
182 | * @param bool $addForCurrentChannel |
||
183 | * @param int|null $position |
||
184 | * |
||
185 | * @return PaymentMethodInterface |
||
186 | */ |
||
187 | private function createPaymentMethod( |
||
217 | } |
||
218 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.