Skip to content

Commit 427db54

Browse files
author
John Campbell
committed
fixing for preview companies
1 parent b909c37 commit 427db54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api_session.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ public function connectCredentialsEntity($companyId, $userId, $password, $sender
145145

146146
$xml = $this->buildHeaderXML($companyId, $userId, $password, $senderId, $senderPassword,$entityType, $entityId);
147147

148-
$response = api_post::execute($xml, self::DEFAULT_LOGIN_URL);
148+
$endpoint = strpos($companyId,"-prv") === FALSE ? self::DEFAULT_LOGIN_URL : self::PRV_LOGIN_URL;
149+
$response = api_post::execute($xml, $endpoint);
149150

150151
self::validateConnection($response);
151152

@@ -177,7 +178,8 @@ public function connectSessionId($sessionId, $senderId, $senderPassword, $entity
177178
$xml = str_replace("{5%}", $senderPassword, $xml);
178179
$xml = str_replace("{6%}", $entityId, $xml);
179180

180-
$response = api_post::execute($xml, self::DEFAULT_LOGIN_URL);
181+
$endpoint = ($this->companyId === null || strpos($this->companyId,"-prv") === FALSE) ? self::DEFAULT_LOGIN_URL : self::PRV_LOGIN_URL;
182+
$response = api_post::execute($xml, $endpoint);
181183

182184
self::validateConnection($response);
183185

0 commit comments

Comments
 (0)