Пример #1
0
 /**
  * Call the API with the prepared request
  *
  * @throws Trustly_DataException Upon failure to add all the communication
  *		parameters to the data or if the incoming data fails the basic
  *		sanity checks
  *
  * @throws Trustly_ConnectionException When failing to communicate with the
  *		API.
  *
  * @throws Trustly_SignatureException If the incoming message has an
  *		invalid signature
  *
  * @param Trustly_Data_JSONRPCRequest $request Outgoing request
  *
  * @return Trustly_Data_JSONRPCSignedResponse Response from the API.
  */
 public function call($request)
 {
     $uuid = $request->getUUID();
     if ($uuid === NULL) {
         $request->setUUID($this->generateUUID());
     }
     return parent::call($request);
 }
Пример #2
0
 /**
  * Basic communication test to the API.
  *
  * @return Trustly_Data_JSONRPCResponse Response from the API
  */
 public function hello()
 {
     $request = new Trustly_Data_JSONRPCRequest('Hello');
     /* Call parent directly here we never want to get a new session
      * uuid for just this single call, if we have it use it, but
      * otherwise just live happliy */
     $response = parent::call($request);
     return $response;
 }