/** * Process a payment request. To be extended by individual processor type * If there's no break point (i.e exceptions and errors), this should * redirect to the postRedirectURL (merchant-hosted) or the external gateway (gateway-hosted) * * Data passed in the format (Reference is optional) * array('Amount' => 1.00, 'Currency' => 'USD', 'Reference' => 'Ref') * * @see paymentGateway::validate() * @param Array $data Payment data */ public function capture($data) { $this->paymentData = $data; // Do pre-processing $this->setup(); // Validate the payment data $validation = $this->gateway->validate($this->paymentData); if (!$validation->valid()) { // Use the exception message to identify this is a validation exception // Payment pages can call gateway->getValidationResult() to get all the // validation error messages throw new Exception("Validation Exception"); } }