Пример #1
0
 /**
  * @param FunctionalTest $test
  * @param User           $user
  *
  * @throws \InvalidArgumentException
  *
  * @return FunctionalTest
  */
 private function payWithStripe(FunctionalTest $test, User $user)
 {
     $this->customerWillPayWithStripe();
     return $test->actingAs($user)->visit(route('sales.customer.checkout.choose-payment'))->post(route('sales.customer.stripe.pay'), [StripePaymentRequest::TOKEN => 'mock-token', 'csrf_token' => csrf_token()])->followRedirects();
 }
Пример #2
0
 /**
  * @param FunctionalTest $test
  *
  * @return Address
  */
 private function fillCheckoutAddress(FunctionalTest $test) : Address
 {
     $addressName = uniqid('address-name', false);
     $test->actingAs($this->customerUser())->visit(route('sales.customer.checkout.address'))->type($addressName, 'name')->type('42 Some Street', 'line_one')->type('Some Town', 'line_two')->type('London', 'city')->type('FOO BAR', 'post_code')->select('GB', 'country_code')->press('Continue')->assertResponseOk();
     $this->address = Address::where('name', '=', $addressName)->first();
     return $this->address;
 }