Ejemplo n.º 1
0
 /**
  * 
  * deletes a bank account from the system
  * 
  * @param vs_token the bank accounts token
  * @return  the updated deleted bank account
  * @throws BaseCommerceClientException if invalid credentials were given or if there was an internal server error. Please contact tech support if there is an internal server error.
  * @author Rob Kurst <*****@*****.**>
  */
 public function deleteBankAccount($vs_token)
 {
     $triple_des = new TripleDESService($this->is_key);
     $o_query = array();
     $o_query['gateway_username'] = $this->is_gateway_username;
     $o_query['gateway_password'] = $this->is_gateway_password;
     $o_query['payload'] = $triple_des->encrypt($vs_token);
     $s_query = json_encode($o_query);
     $response = $this->do_post_request('/pcms/?f=API_deleteBankAccountV4', $s_query, $triple_des, 0);
     $vo_ba = BankAccount::buildFromJSON($response["bank_account"]);
     if (array_key_exists("exception", $response) && !is_null($response['exception'])) {
         foreach ($response['exception'] as $s_key => $s_error) {
             $vo_ba->addMessage($s_error);
         }
     }
     return $vo_ba;
 }
Ejemplo n.º 2
0
 /**
  * Processes a generic Request.
  * @param type $vs_json the request json
  * @return a json object string that holds the return data
  * @author Rob Kurst <*****@*****.**>
  */
 public function processRequest($vs_json)
 {
     $o_triple_des = new TripleDESService($this->is_key);
     $o_query = array();
     $o_query['gateway_username'] = $this->is_gateway_username;
     $o_query['gateway_password'] = $this->is_gateway_password;
     $o_query['payload'] = $o_triple_des->encrypt(json_encode($vs_json));
     $s_query = json_encode($o_query);
     $response = $this->do_post_request('/pcms/?f=API_processRequest', $s_query, $o_triple_des);
     return $response;
 }