You are here

public function StoreHandler::updateStore in Mailchimp E-Commerce 8

@inheritdoc

Overrides StoreHandlerInterface::updateStore

File

src/StoreHandler.php, line 58

Class

StoreHandler
Store handler.

Namespace

Drupal\mailchimp_ecommerce

Code

public function updateStore($store_id, $name, $currency_code, $platform) {
  try {

    /* @var \Mailchimp\MailchimpEcommerce $mc_ecommerce */
    $mc_ecommerce = mailchimp_get_api_object('MailchimpEcommerce');
    $parameters = [
      'platform' => $platform,
    ];
    $mc_ecommerce
      ->updateStore($store_id, $name, $currency_code, $parameters);
  } catch (\Exception $e) {
    mailchimp_ecommerce_log_error_message('Unable to update a store: ' . $e
      ->getMessage());
    drupal_set_message($e
      ->getMessage(), 'error');
  }
}