public function executeAdd(sfWebRequest $request) { $this->forward404Unless($index = $request->getParameter('index')); $payment = new Payment(); $payment->setInvoiceId($request->getParameter('invoice_id')); // insert a PaymentForm with csrf protection disabled $form = new PaymentForm($payment, array('culture' => $this->getUser()->getCulture()), false); $form->getWidgetSchema()->setNameFormat('payments[new_' . $index . '][%s]'); return $this->renderText('<li><ul><a href="#" class="xit"/>' . $form . '</ul></li>'); }
public function ConfirmationForm() { $config = new CheckoutComponentConfig(ShoppingCart::curr(), false); $config->addComponent(new NotesCheckoutComponent()); $config->addComponent(new TermsCheckoutComponent()); $form = new PaymentForm($this->owner, "ConfirmationForm", $config); $form->setFailureLink($this->owner->Link('summary')); $this->owner->extend('updateConfirmationForm', $form); return $form; }
public function PaymentForm() { if (!(bool) $this->Cart()) { return false; } $config = CheckoutComponentConfig::create(ShoppingCart::curr(), false); $config->addComponent(OnsitePaymentCheckoutComponent::create()); $form = PaymentForm::create($this, "PaymentForm", $config); $form->setActions(new FieldList(FormAction::create("submitpayment", "Submit Payment"))); $form->setFailureLink($this->Link()); $this->extend('updatePaymentForm', $form); return $form; }
public function __construct($paymentData, $order) { parent::__construct($paymentData, $order); }
/** * Gets a new PaymentForm from $where * * @param mixed $where * @return PaymentForm */ public static function From(&$where) { $us = new PaymentForm(); $us->merge($where); return $us; }