function __construct()
 {
     parent::__construct();
     $this->setName('Paypal Settings');
     $this->setMethod('POST');
     $this->setAction('/paypal/admin');
     Paypal_Models_Paypal::initSettings();
     $this->addElement('text', 'APIUsername', array('value' => Paypal_Models_Paypal::get('APIUsername'), 'label' => 'API Username'));
     $this->addElement('text', 'APIPassword', array('value' => Paypal_Models_Paypal::get('APIPassword'), 'label' => 'API Password'));
     $this->addElement('text', 'APISignature', array('value' => Paypal_Models_Paypal::get('APISignature'), 'label' => 'API Signature'));
     $this->addElement('text', 'APIVersion', array('value' => Paypal_Models_Paypal::get('APIVersion'), 'label' => 'The API Version to use'));
     $this->addElement('text', 'IPNUrl', array('value' => Paypal_Models_Paypal::get('IPNUrl'), 'label' => 'IPN URL'));
     $this->addElement('text', 'currencyCode', array('value' => Paypal_Models_Paypal::get('currencyCode'), 'label' => 'Currency Code'));
     $this->addElement('text', 'sellersEmail', array('value' => Paypal_Models_Paypal::get('sellersEmail'), 'label' => 'Your Paypal Email'));
     $this->addElement('submit', 'submit', array('value' => 'save'));
 }
Example #2
0
 function __construct($transaction)
 {
     parent::__construct();
     Paypal_Models_Paypal::initSettings();
     $this->setMethod('POST');
     $this->setAction(Paypal_Models_Paypal::get('IPNUrl'));
     $this->addElement('hidden', 'cmd', array('value' => '_xclick'));
     $this->addElement('hidden', 'business', array('value' => Paypal_Models_Paypal::get('sellersEmail')));
     $this->addElement('hidden', 'amount', array('value' => $transaction->amount));
     $this->addElement('hidden', 'item_name', array('value' => $transaction->name));
     $this->addElement('hidden', 'item_number', array('value' => $transaction->transactionID));
     $this->addElement('hidden', 'notify_url', array('value' => 'http://www.project.supersaid.net/paypal/ipn'));
     $this->addElement('image', 'submit', array('src' => 'https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif'));
     $this->addElement('hidden', 'return', array('value' => $transaction->returnUrl));
     $this->addElement('hidden', 'cancel_return', array('value' => $transaction->cancelUrl));
     foreach ($this->getElements() as $key => $value) {
         $this->getElement($key)->removeDecorator('label');
     }
 }