private static function send_impl(Transaction $trans, $obj) { $body = \CivicInfoBC\Form::Encode($obj); try { return self::send_impl_impl($trans, $body); } catch (\Exception $e) { $result = new EXactError(); $result->request = $body; $result->type = \CivicInfoBC\Reflection::GetType($e); $result->code = $e->getCode(); $result->message = $e->getMessage(); $trans->exact = $result; return false; } }
public function Process(Transaction $trans) { if (is_null($trans->id)) { $trans->Save(); } $result = new BeanstreamResult(); $result->request = \CivicInfoBC\Form::Encode(array('requestType' => 'BACKEND', 'merchant_id' => $this->merchant_id, 'trnOrderNumber' => $trans->id, 'trnAmount' => sprintf('%.2f', $trans->amount), 'trnCardOwner' => $trans->name, 'singleUseToken' => $trans->token)); $trans->beanstream = $result; $retr = $this->perform_request($trans); if ($retr) { $retr = $this->parse_response($trans); } $trans->Save(); return $retr; }