Skip to content

Instantly share code, notes, and snippets.

@nclundsten
Created September 25, 2012 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nclundsten/3784933 to your computer and use it in GitHub Desktop.
Save nclundsten/3784933 to your computer and use it in GitHub Desktop.
public function indexAction()
{
$checkoutService = $this->getServiceLocator()->get('SpeckCheckout\Service\Checkout');
$options = $checkoutService->getOptions();
$paymentMethods = $options->getPaymentMethods();
$methodForm = new \Zend\Form\Form;
foreach ($paymentMethods as $i) {
$valueOptions[$i->getPaymentMethod()] = $i->getDisplayName();
}
$paymentMethod = $checkoutService->getCheckoutStrategy()->getPaymentMethod()->getPaymentMethod();
$methodForm->add(array(
'name' => 'method',
'type' => 'Zend\Form\Element\Radio',
'options' => array(
'label' => 'Payment Method',
'value_options' => $valueOptions,
'value' => array($paymentMethod,), //not sure where it goes!
),
'value' => array($paymentMethod,), //not sure where it goes!
));
return array('form' => $methodForm);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment