Skip to content

Commit

Permalink
軽微な修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kurozumi committed Jul 21, 2020
1 parent 57caf0a commit 2877903
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Form/Extension/CreditCardExtension.php
Expand Up @@ -19,7 +19,6 @@
use Plugin\Stripe4\Form\Type\CreditCardType;
use Plugin\Stripe4\Service\Method\CreditCard;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
Expand Down Expand Up @@ -50,7 +49,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)

$builder
->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) {
/** @var FormBuilderInterface $form */
/** @var FormInterface $form */
$form = $event->getForm();
/** @var Order $order */
$order = $event->getData();
Expand All @@ -62,14 +61,14 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'constraints' => [
new NotBlank()
]
])
->add('stripe_saving_card', ToggleSwitchType::class, [
'mapped' => true,
'label' => 'カード情報を保存する'
]);

if ($Customer = $order->getCustomer()) {
$form
->add('stripe_saving_card', ToggleSwitchType::class, [
'mapped' => true,
'label' => 'カード情報を保存する'
])
->add('cards', CreditCardType::class, [
'mapped' => false,
'expanded' => true,
Expand Down

0 comments on commit 2877903

Please sign in to comment.