commerce_xxx.module
function commerce_xxx_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { if (strpos($form_id,'commerce_checkout_flow_multistep_') === 0) { if ($form['#step_id'] == 'payment') { // Checkout stepを特定 if ($buildInfo = $form_state->getBuildInfo()) { if (isset($buildInfo['callback_object'])) { $callback_object = clone $buildInfo['callback_object']; if (method_exists($callback_object, 'getOrder')) { if ($order = $callback_object->getOrder()) { if ($payment_gateway = $order->get('payment_gateway')) { $name = $payment_gateway->getValue(); if (isset($name[0]['target_id'])) { if ($name[0]['target_id'] == 'xxxxxxxxxxxxx') { // 決済ゲートウェイを特定 $form['#attributes']['accept-charset'] = 'xxxxxxx'; // Shift_JIS など } } } } } } } } } }