1 | <?php |
||
26 | final class PaypalContext implements Context |
||
27 | { |
||
28 | /** |
||
29 | * @var SharedStorageInterface |
||
30 | */ |
||
31 | private $sharedStorage; |
||
32 | |||
33 | /** |
||
34 | * @var OrderPaymentsPageInterface |
||
35 | */ |
||
36 | private $orderPaymentsPage; |
||
37 | |||
38 | /** |
||
39 | * @var PaypalExpressCheckoutPageInterface |
||
40 | */ |
||
41 | private $paypalExpressCheckoutPage; |
||
42 | |||
43 | /** |
||
44 | * @var FinalizeStepInterface |
||
45 | */ |
||
46 | private $checkoutFinalizeStep; |
||
47 | |||
48 | /** |
||
49 | * @var PaypalApiMocker |
||
50 | */ |
||
51 | private $paypalApiMocker; |
||
52 | |||
53 | /** |
||
54 | * @var OrderRepositoryInterface |
||
55 | */ |
||
56 | private $orderRepository; |
||
57 | |||
58 | /** |
||
59 | * @param SharedStorageInterface $sharedStorage |
||
60 | * @param OrderPaymentsPageInterface $orderPaymentsPage |
||
61 | * @param PaypalExpressCheckoutPageInterface $paypalExpressCheckoutPage |
||
62 | * @param FinalizeStepInterface $checkoutFinalizeStep |
||
63 | * @param PaypalApiMocker $paypalApiMocker |
||
64 | * @param OrderRepositoryInterface $orderRepository |
||
65 | */ |
||
66 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * @Given /^I confirm my order with paypal payment$/ |
||
84 | */ |
||
85 | public function iConfirmMyOrderWithPaypalPayment() |
||
90 | |||
91 | /** |
||
92 | * @Then I should be redirected to PayPal Express Checkout page |
||
93 | */ |
||
94 | public function iShouldBeRedirectedToPaypalExpressCheckoutPage() |
||
98 | |||
99 | /** |
||
100 | * @When I sign in to PayPal and pay successfully |
||
101 | */ |
||
102 | public function iSignInToPaypalAndPaySuccessfully() |
||
107 | |||
108 | /** |
||
109 | * @When I cancel my PayPal payment |
||
110 | */ |
||
111 | public function iCancelMyPaypalPayment() |
||
115 | |||
116 | /** |
||
117 | * @When I try to pay again |
||
118 | */ |
||
119 | public function iTryToPayAgain() |
||
126 | |||
127 | /** |
||
128 | * @return OrderInterface |
||
129 | * |
||
130 | * @throws \RuntimeException |
||
131 | */ |
||
132 | private function getLastOrder() |
||
144 | } |
||
145 |