diff --git a/HitPay.php b/HitPay.php index db7fb83..b7d35c4 100644 --- a/HitPay.php +++ b/HitPay.php @@ -4,11 +4,11 @@ class HitPay { - const version = '1'; + const version = 'v1'; protected $curl; protected $endpoint = 'https://api.hit-pay.com/'; - protected $endpointSandbox = 'https://api.staging.hit-pay.com/'; + protected $endpointSandbox = 'https://api.sandbox.hit-pay.com/'; protected $apiKey = null; protected $authToken = null; protected $isSandBox = false; @@ -113,8 +113,8 @@ private function api_call($method, $path, array $data=null) } } - if ($responseObj['success'] == false) { - $message = json_encode($responseObj['message']); + if (isset($responseObj['errors']) { + $message = json_encode($responseObj['errors']); throw new \Exception($message . PHP_EOL); }