Skip to content

Instantly share code, notes, and snippets.

@paulosborne
Created April 17, 2012 11:11
Show Gist options
  • Save paulosborne/2405331 to your computer and use it in GitHub Desktop.
Save paulosborne/2405331 to your computer and use it in GitHub Desktop.
/**
* @access public
* @return $request
*/
public function createRequest(Zend_Controller_Request_Http $request) {
if ( !isset($this->paymentRequest)) {
$this->setPaymentRequest(new Payment_Service_Commidea_Request());
}
$this->getPaymentRequest()->setCustomer(new Payment_Service_Commidea_Customer(array(
'firstname' => $request->getParam('firstname'),
'lastname' => $request->getParam('lastname'),
'email_address' => $request->getParam('email'),
'address1' => $request->getParam('address1'),
'address2' => $request->getParam('address2'),
'town' => $request->getParam('town'),
'county' => $request->getParam('county'),
'country' => $request->getParam('country'),
'postcode' => $request->getParam('postcode')
)));
$this->getPaymentRequest()->setTransaction(new Payment_Service_Commidea_Transaction(array(
'transaction_value' => $request->getParam('total'),
'merchant_reference' => $request->getParam('reference'),
'product_name' => 'Symphony Unit'
)));
return $this->getPaymentModel()->insertTransaction(
$this->getPaymentRequest()->getCustomer(),
$this->getPaymentRequest()->getTransaction()
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment