diff --git a/app/migrations/Version20190109095211.php b/app/migrations/Version20190109095211.php new file mode 100644 index 00000000000..c6a637bb742 --- /dev/null +++ b/app/migrations/Version20190109095211.php @@ -0,0 +1,34 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('CREATE TABLE sylius_shop_billing_data (id INT AUTO_INCREMENT NOT NULL, company VARCHAR(255) DEFAULT NULL, tax_id VARCHAR(255) DEFAULT NULL, country_code VARCHAR(255) DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, postcode VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB'); + $this->addSql('ALTER TABLE sylius_channel ADD shop_billing_data_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119EB5282EDF FOREIGN KEY (shop_billing_data_id) REFERENCES sylius_shop_billing_data (id) ON DELETE CASCADE'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_16C8119EB5282EDF ON sylius_channel (shop_billing_data_id)'); + } + + public function down(Schema $schema) : void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119EB5282EDF'); + $this->addSql('DROP TABLE sylius_shop_billing_data'); + $this->addSql('DROP INDEX UNIQ_16C8119EB5282EDF ON sylius_channel'); + $this->addSql('ALTER TABLE sylius_channel DROP shop_billing_data_id'); + } +} diff --git a/features/channel/managing_channels/adding_channel_with_shop_billing_data.feature b/features/channel/managing_channels/adding_channel_with_shop_billing_data.feature new file mode 100644 index 00000000000..cd188fc7992 --- /dev/null +++ b/features/channel/managing_channels/adding_channel_with_shop_billing_data.feature @@ -0,0 +1,25 @@ +@managing_channels +Feature: Adding a new channel with shop billing data + In order to sell through multiple channels of distributions with specific billing data + As an Administrator + I want to add a new channel with shop billing data to the registry + + Background: + Given the store has currency "Euro" + And the store has locale "English (United States)" + And the store operates in "United States" + And I am logged in as an administrator + + @ui + Scenario: Adding a new channel with shop billing data + Given I want to create a new channel + When I specify its code as "MOBILE" + And I name it "Mobile channel" + And I choose "Euro" as the base currency + And I choose "English (United States)" as a default locale + And I specify company as "Ragnarok" + And I specify tax ID as "1100110011" + And I specify shop billing address as "Pacific Coast Hwy", "90806" "Los Angeles", "United States" + And I add it + Then I should be notified that it has been successfully created + And the channel "Mobile channel" should appear in the registry diff --git a/features/channel/managing_channels/editing_shop_billing_data_on_channel.feature b/features/channel/managing_channels/editing_shop_billing_data_on_channel.feature new file mode 100644 index 00000000000..c4a8d4e9010 --- /dev/null +++ b/features/channel/managing_channels/editing_shop_billing_data_on_channel.feature @@ -0,0 +1,22 @@ +@managing_channels +Feature: Editing shop billing data on channel + In order to have proper shop billing data on shop-related documents + As an Administrator + I want to be able to edit shop billing data on a channel + + Background: + Given the store operates on a channel named "Web Store" + And the store ships to "United States" + And I am logged in as an administrator + + @ui + Scenario: Editing shop billing data on channel + When I want to modify a channel "Web Store" + And I specify company as "Ragnarok" + And I specify tax ID as "1100110011" + And I specify shop billing address as "Pacific Coast Hwy", "90806" "Los Angeles", "United States" + And I save my changes + Then I should be notified that it has been successfully edited + And this channel company should be "Ragnarok" + And this channel tax ID should be "1100110011" + And this channel shop billing address should be "Pacific Coast Hwy", "90806" "Los Angeles", "United States" diff --git a/src/Sylius/Behat/Context/Ui/Admin/ManagingChannelsBillingDataContext.php b/src/Sylius/Behat/Context/Ui/Admin/ManagingChannelsBillingDataContext.php new file mode 100644 index 00000000000..5509e784de7 --- /dev/null +++ b/src/Sylius/Behat/Context/Ui/Admin/ManagingChannelsBillingDataContext.php @@ -0,0 +1,77 @@ +shopBillingDataElement = $shopBillingDataElement; + } + + /** + * @When I specify company as :company + */ + public function specifyCompanyAs(string $company): void + { + $this->shopBillingDataElement->specifyCompany($company); + } + + /** + * @When I specify tax ID as :taxId + */ + public function specifyTaxIdAs(string $taxId): void + { + $this->shopBillingDataElement->specifyTaxId($taxId); + } + + /** + * @When I specify shop billing address as :street, :postcode :city, :country + */ + public function specifyShopBillingAddressAs( + string $street, + string $postcode, + string $city, + CountryInterface $country + ): void { + $this->shopBillingDataElement->specifyBillingAddress($street, $postcode, $city, $country->getCode()); + } + + /** + * @Then this channel company should be :company + */ + public function thisChannelCompanyShouldBe(string $company): void + { + Assert::true($this->shopBillingDataElement->hasCompany($company)); + } + + /** + * @Then this channel tax ID should be :taxId + */ + public function thisChanneTaxIdShouldBe(string $taxId): void + { + Assert::true($this->shopBillingDataElement->hasTaxId($taxId)); + } + + /** + * @Then this channel shop billing address should be :street, :postcode :city, :country + */ + public function thisChannelShopBillingAddressShouldBe( + string $street, + string $postcode, + string $city, + CountryInterface $country + ): void { + Assert::true($this->shopBillingDataElement->hasBillingAddress($street, $postcode, $city, $country->getCode())); + } +} diff --git a/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElement.php b/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElement.php new file mode 100644 index 00000000000..7209c8c993d --- /dev/null +++ b/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElement.php @@ -0,0 +1,60 @@ +getElement('company')->setValue($company); + } + + public function specifyTaxId(string $taxId): void + { + $this->getElement('tax_id')->setValue($taxId); + } + + public function specifyBillingAddress(string $street, string $postcode, string $city, string $countryCode): void + { + $this->getElement('street')->setValue($street); + $this->getElement('postcode')->setValue($postcode); + $this->getElement('city')->setValue($city); + $this->getElement('country_code')->setValue($countryCode); + } + + public function hasCompany(string $company): bool + { + return $company === $this->getElement('company')->getValue(); + } + + public function hasTaxId(string $taxId): bool + { + return $taxId === $this->getElement('tax_id')->getValue(); + } + + public function hasBillingAddress(string $street, string $postcode, string $city, string $countryCode): bool + { + return + $street === $this->getElement('street')->getValue() && + $postcode === $this->getElement('postcode')->getValue() && + $city === $this->getElement('city')->getValue() && + $countryCode === $this->getElement('country_code')->getValue() + ; + } + + protected function getDefinedElements(): array + { + return array_merge(parent::getDefinedElements(), [ + 'city' => '#sylius_channel_shopBillingData_city', + 'company' => '#sylius_channel_shopBillingData_company', + 'country_code' => '#sylius_channel_shopBillingData_countryCode', + 'postcode' => '#sylius_channel_shopBillingData_postcode', + 'street' => '#sylius_channel_shopBillingData_street', + 'tax_id' => '#sylius_channel_shopBillingData_taxId', + ]); + } +} diff --git a/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElementInterface.php b/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElementInterface.php new file mode 100644 index 00000000000..8ffbd894d9c --- /dev/null +++ b/src/Sylius/Behat/Element/Admin/Channel/ShopBillingDataElementInterface.php @@ -0,0 +1,20 @@ +getDocument()->selectFieldOption('Locales', $language); } - public function isLocaleChosen(string $language): bool - { - return $this->getElement('locales')->find('named', ['option', $language])->hasAttribute('selected'); - } - public function chooseCurrency(string $currencyCode): void { $this->getDocument()->selectFieldOption('Currencies', $currencyCode); } - public function isCurrencyChosen(string $currencyCode): bool - { - return $this->getElement('currencies')->find('named', ['option', $currencyCode])->hasAttribute('selected'); - } - public function chooseDefaultTaxZone(string $taxZone): void { $this->getDocument()->selectFieldOption('Default tax zone', $taxZone); @@ -63,6 +53,16 @@ public function chooseTaxCalculationStrategy(string $taxZone): void $this->getDocument()->selectFieldOption('Tax calculation strategy', $taxZone); } + public function isLocaleChosen(string $language): bool + { + return $this->getElement('locales')->find('named', ['option', $language])->hasAttribute('selected'); + } + + public function isCurrencyChosen(string $currencyCode): bool + { + return $this->getElement('currencies')->find('named', ['option', $currencyCode])->hasAttribute('selected'); + } + public function isDefaultTaxZoneChosen(string $taxZone): bool { return $this->getElement('default_tax_zone')->find('named', ['option', $taxZone])->hasAttribute('selected'); diff --git a/src/Sylius/Behat/Page/Admin/Channel/UpdatePageInterface.php b/src/Sylius/Behat/Page/Admin/Channel/UpdatePageInterface.php index 118e37852cc..46e4f7f2d47 100644 --- a/src/Sylius/Behat/Page/Admin/Channel/UpdatePageInterface.php +++ b/src/Sylius/Behat/Page/Admin/Channel/UpdatePageInterface.php @@ -29,20 +29,20 @@ public function setTheme(string $themeName): void; */ public function unsetTheme(): void; - public function isCodeDisabled(): bool; - public function chooseLocale(string $language): void; - public function isLocaleChosen(string $language): bool; - public function chooseCurrency(string $currencyCode): void; - public function isCurrencyChosen(string $currencyCode): bool; - public function chooseDefaultTaxZone(string $taxZone): void; public function chooseTaxCalculationStrategy(string $taxCalculationStrategy): void; + public function isCodeDisabled(): bool; + + public function isLocaleChosen(string $language): bool; + + public function isCurrencyChosen(string $currencyCode): bool; + public function isDefaultTaxZoneChosen(string $taxZone): bool; public function isAnyDefaultTaxZoneChosen(): bool; diff --git a/src/Sylius/Behat/Resources/config/services/contexts/ui.xml b/src/Sylius/Behat/Resources/config/services/contexts/ui.xml index 14186ef775d..4534276a3d3 100644 --- a/src/Sylius/Behat/Resources/config/services/contexts/ui.xml +++ b/src/Sylius/Behat/Resources/config/services/contexts/ui.xml @@ -49,6 +49,11 @@ + + + + + diff --git a/src/Sylius/Behat/Resources/config/services/elements.xml b/src/Sylius/Behat/Resources/config/services/elements.xml index cfafbe56339..9acb9ed3ddf 100644 --- a/src/Sylius/Behat/Resources/config/services/elements.xml +++ b/src/Sylius/Behat/Resources/config/services/elements.xml @@ -16,6 +16,13 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" > + + + + + %__behat__.mink.parameters% + + diff --git a/src/Sylius/Behat/Resources/config/services/elements/shop/account.xml b/src/Sylius/Behat/Resources/config/services/elements/admin.xml similarity index 62% rename from src/Sylius/Behat/Resources/config/services/elements/shop/account.xml rename to src/Sylius/Behat/Resources/config/services/elements/admin.xml index 19238829095..5fb4e7869a9 100644 --- a/src/Sylius/Behat/Resources/config/services/elements/shop/account.xml +++ b/src/Sylius/Behat/Resources/config/services/elements/admin.xml @@ -15,13 +15,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" > - - Sylius\Behat\Element\Shop\Account\RegisterElement - - - + diff --git a/src/Sylius/Behat/Resources/config/services/elements/shop.xml b/src/Sylius/Behat/Resources/config/services/elements/shop.xml index 9fb30a43182..369333fc170 100644 --- a/src/Sylius/Behat/Resources/config/services/elements/shop.xml +++ b/src/Sylius/Behat/Resources/config/services/elements/shop.xml @@ -15,7 +15,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd" > - - - + + + + + diff --git a/src/Sylius/Behat/Resources/config/suites/ui/channel/managing_channels.yml b/src/Sylius/Behat/Resources/config/suites/ui/channel/managing_channels.yml index c563c0e1cd9..77c981a0482 100644 --- a/src/Sylius/Behat/Resources/config/suites/ui/channel/managing_channels.yml +++ b/src/Sylius/Behat/Resources/config/suites/ui/channel/managing_channels.yml @@ -7,7 +7,9 @@ default: contexts_services: - sylius.behat.context.hook.doctrine_orm + - sylius.behat.context.transform.address - sylius.behat.context.transform.channel + - sylius.behat.context.transform.country - sylius.behat.context.transform.currency - sylius.behat.context.transform.locale - sylius.behat.context.transform.shared_storage @@ -15,6 +17,7 @@ default: - sylius.behat.context.setup.channel - sylius.behat.context.setup.currency + - sylius.behat.context.setup.geographical - sylius.behat.context.setup.locale - sylius.behat.context.setup.payment - sylius.behat.context.setup.admin_security @@ -22,6 +25,7 @@ default: - sylius.behat.context.setup.zone - sylius.behat.context.ui.admin.managing_channels + - sylius.behat.context.ui.admin.managing_channels_billing_data - sylius.behat.context.ui.admin.notification filters: tags: "@managing_channels && @ui" diff --git a/src/Sylius/Bundle/AdminBundle/Resources/views/Channel/_form.html.twig b/src/Sylius/Bundle/AdminBundle/Resources/views/Channel/_form.html.twig index bcae809ff3d..cc49c904196 100644 --- a/src/Sylius/Bundle/AdminBundle/Resources/views/Channel/_form.html.twig +++ b/src/Sylius/Bundle/AdminBundle/Resources/views/Channel/_form.html.twig @@ -25,6 +25,21 @@ {{ form_row(form.themeName) }} +
+

{{ form_label(form.shopBillingData) }}

+
+ {{ form_row(form.shopBillingData.company) }} + {{ form_row(form.shopBillingData.taxId) }} +
+
+ {{ form_row(form.shopBillingData.countryCode) }} + {{ form_row(form.shopBillingData.street) }} +
+
+ {{ form_row(form.shopBillingData.city) }} + {{ form_row(form.shopBillingData.postcode) }} +
+
diff --git a/src/Sylius/Bundle/CoreBundle/Form/Extension/ChannelTypeExtension.php b/src/Sylius/Bundle/CoreBundle/Form/Extension/ChannelTypeExtension.php index 5d0ae50824b..4aeb887c3b2 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Extension/ChannelTypeExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Extension/ChannelTypeExtension.php @@ -17,6 +17,7 @@ use Sylius\Bundle\ChannelBundle\Form\Type\ChannelType; use Sylius\Bundle\CoreBundle\Form\EventSubscriber\AddBaseCurrencySubscriber; use Sylius\Bundle\CoreBundle\Form\EventSubscriber\ChannelFormSubscriber; +use Sylius\Bundle\CoreBundle\Form\Type\ShopBillingDataType; use Sylius\Bundle\CoreBundle\Form\Type\TaxCalculationStrategyChoiceType; use Sylius\Bundle\CurrencyBundle\Form\Type\CurrencyChoiceType; use Sylius\Bundle\LocaleBundle\Form\Type\LocaleChoiceType; @@ -80,6 +81,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'label' => 'sylius.form.channel.account_verification_required', 'required' => false, ]) + ->add('shopBillingData', ShopBillingDataType::class, [ + 'label' => 'sylius.form.channel.shop_billing_data', + ]) ->addEventSubscriber(new AddBaseCurrencySubscriber()) ->addEventSubscriber(new ChannelFormSubscriber()) ; diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/ShopBillingDataType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/ShopBillingDataType.php new file mode 100644 index 00000000000..cb98bab3dec --- /dev/null +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/ShopBillingDataType.php @@ -0,0 +1,59 @@ +dataClass = $dataClass; + } + + public function buildForm(FormBuilderInterface $builder, array $options): void + { + $builder + ->add('taxId', TextType::class, [ + 'label' => 'sylius.form.channel.billing_data.tax_id', + 'required' => false, + ]) + ->add('company', TextType::class, [ + 'required' => false, + 'label' => 'sylius.form.channel.billing_data.company', + ]) + ->add('countryCode', CountryCodeChoiceType::class, [ + 'label' => 'sylius.form.channel.billing_data.country', + 'enabled' => true, + 'required' => false, + ]) + ->add('street', TextType::class, [ + 'label' => 'sylius.form.channel.billing_data.street', + 'required' => false, + ]) + ->add('city', TextType::class, [ + 'label' => 'sylius.form.channel.billing_data.city', + 'required' => false, + ]) + ->add('postcode', TextType::class, [ + 'label' => 'sylius.form.channel.billing_data.postcode', + 'required' => false, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefault('data_class', $this->dataClass); + } +} diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/Channel.orm.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/Channel.orm.xml index 56ccb710218..ac02d81001b 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/Channel.orm.xml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/Channel.orm.xml @@ -53,6 +53,12 @@ - + + + + + + + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/ShopBillingData.orm.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/ShopBillingData.orm.xml new file mode 100644 index 00000000000..7eb88cc76df --- /dev/null +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/doctrine/model/ShopBillingData.orm.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/services/form.xml b/src/Sylius/Bundle/CoreBundle/Resources/config/services/form.xml index de59fb4e37b..4a5e4dc13c0 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/services/form.xml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/services/form.xml @@ -48,6 +48,7 @@ sylius + Sylius\Component\Core\Model\ShopBillingData @@ -241,6 +242,11 @@ + + %sylius.model.shop_billing_data.class% + + + diff --git a/src/Sylius/Bundle/CoreBundle/Resources/translations/messages.en.yml b/src/Sylius/Bundle/CoreBundle/Resources/translations/messages.en.yml index 7f87f59cb44..2c56f1e0f88 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/translations/messages.en.yml @@ -22,6 +22,13 @@ sylius: name: Name roles: Roles channel: + billing_data: + city: City + company: Company + country: Country + postcode: Postcode + street: Street + tax_id: Tax ID contact_email: Contact email currencies: Currencies currency_base: Base currency @@ -31,6 +38,7 @@ sylius: locales: Locales payment_methods: Payment Methods shipping_methods: Shipping Methods + shop_billing_data: Shop billing data skipping_shipping_step_allowed: Skip shipping step if only one shipping method is available? skipping_payment_step_allowed: Skip payment step if only one payment method is available? tax_calculation_strategy: Tax calculation strategy diff --git a/src/Sylius/Component/Core/Model/Channel.php b/src/Sylius/Component/Core/Model/Channel.php index 441fb134685..a6624b51dd6 100644 --- a/src/Sylius/Component/Core/Model/Channel.php +++ b/src/Sylius/Component/Core/Model/Channel.php @@ -55,12 +55,16 @@ class Channel extends BaseChannel implements ChannelInterface /** @var bool */ protected $accountVerificationRequired = true; + /** @var ShopBillingDataInterface|null */ + protected $shopBillingData; + public function __construct() { parent::__construct(); $this->currencies = new ArrayCollection(); $this->locales = new ArrayCollection(); + $this->shopBillingData = new ShopBillingData(); } /** @@ -278,4 +282,14 @@ public function setAccountVerificationRequired(bool $accountVerificationRequired { $this->accountVerificationRequired = $accountVerificationRequired; } + + public function getShopBillingData(): ShopBillingDataInterface + { + return $this->shopBillingData; + } + + public function setShopBillingData(ShopBillingDataInterface $shopBillingData): void + { + $this->shopBillingData = $shopBillingData; + } } diff --git a/src/Sylius/Component/Core/Model/ChannelInterface.php b/src/Sylius/Component/Core/Model/ChannelInterface.php index db2867c74db..439ae2a91cf 100644 --- a/src/Sylius/Component/Core/Model/ChannelInterface.php +++ b/src/Sylius/Component/Core/Model/ChannelInterface.php @@ -60,4 +60,8 @@ public function setSkippingPaymentStepAllowed(bool $skippingPaymentStepAllowed): public function isAccountVerificationRequired(): bool; public function setAccountVerificationRequired(bool $accountVerificationRequired): void; + + public function getShopBillingData(): ShopBillingDataInterface; + + public function setShopBillingData(ShopBillingDataInterface $shopBillingData): void; } diff --git a/src/Sylius/Component/Core/Model/ShopBillingData.php b/src/Sylius/Component/Core/Model/ShopBillingData.php new file mode 100644 index 00000000000..064ed9be888 --- /dev/null +++ b/src/Sylius/Component/Core/Model/ShopBillingData.php @@ -0,0 +1,99 @@ +company; + } + + public function setCompany(?string $company): void + { + $this->company = $company; + } + + public function getTaxId(): ?string + { + return $this->taxId; + } + + public function setTaxId(?string $taxId): void + { + $this->taxId = $taxId; + } + + public function getCountryCode(): ?string + { + return $this->countryCode; + } + + public function setCountryCode(?string $countryCode): void + { + $this->countryCode = $countryCode; + } + + public function getStreet(): ?string + { + return $this->street; + } + + public function setStreet(?string $street): void + { + $this->street = $street; + } + + public function getCity(): ?string + { + return $this->city; + } + + public function setCity(?string $city): void + { + $this->city = $city; + } + + public function getPostcode(): ?string + { + return $this->postcode; + } + + public function setPostcode(?string $postcode): void + { + $this->postcode = $postcode; + } +} diff --git a/src/Sylius/Component/Core/Model/ShopBillingDataInterface.php b/src/Sylius/Component/Core/Model/ShopBillingDataInterface.php new file mode 100644 index 00000000000..42424f66d01 --- /dev/null +++ b/src/Sylius/Component/Core/Model/ShopBillingDataInterface.php @@ -0,0 +1,41 @@ +shouldImplement(ShopBillingDataInterface::class); + } + + function its_company_is_mutable(): void + { + $this->setCompany('Ragnarok'); + $this->getCompany()->shouldReturn('Ragnarok'); + } + + function its_tax_id_is_mutable(): void + { + $this->setTaxId('1100110011'); + $this->getTaxId()->shouldReturn('1100110011'); + } + + function its_country_code_is_mutable(): void + { + $this->setCountryCode('US'); + $this->getCountryCode()->shouldReturn('US'); + } + + function its_street_is_mutable(): void + { + $this->setStreet('Blue Street'); + $this->getStreet()->shouldReturn('Blue Street'); + } + + function its_city_is_mutable(): void + { + $this->setCity('New York'); + $this->getCity()->shouldReturn('New York'); + } + + function its_postcode_is_mutable(): void + { + $this->setPostcode('94111'); + $this->getPostcode()->shouldReturn('94111'); + } +} diff --git a/tests/Responses/Expected/channel/create_validation_fail_response.json b/tests/Responses/Expected/channel/create_validation_fail_response.json index f135f8e205a..837984a1a9d 100644 --- a/tests/Responses/Expected/channel/create_validation_fail_response.json +++ b/tests/Responses/Expected/channel/create_validation_fail_response.json @@ -34,6 +34,16 @@ "skippingShippingStepAllowed": {}, "skippingPaymentStepAllowed": {}, "accountVerificationRequired": {}, + "shopBillingData": { + "children": { + "taxId": {}, + "company": {}, + "countryCode": {}, + "street": {}, + "city": {}, + "postcode": {} + } + }, "code": { "errors": [ "Please enter channel code." diff --git a/tests/Responses/Expected/channel/update_validation_fail_response.json b/tests/Responses/Expected/channel/update_validation_fail_response.json index a945736d1ad..6a80359e715 100644 --- a/tests/Responses/Expected/channel/update_validation_fail_response.json +++ b/tests/Responses/Expected/channel/update_validation_fail_response.json @@ -26,6 +26,16 @@ "skippingShippingStepAllowed": {}, "skippingPaymentStepAllowed": {}, "accountVerificationRequired": {}, + "shopBillingData": { + "children": { + "taxId": {}, + "company": {}, + "countryCode": {}, + "street": {}, + "city": {}, + "postcode": {} + } + }, "code": {}, "baseCurrency": {} }