public function testStandardParams() { $version = new \stdClass(); $version->Version = 1; $version->ID = 'abc123-x'; $r = new AuthenticateSPRequest(); $r->setCustomerReference('X')->setProfileIDVersion($version); $this->assertEquals(1, $r->getProfileIDVersion()->Version); $this->assertEquals('abc123-x', $r->getProfileIDVersion()->ID); $this->assertEquals('X', $r->getCustomerReference()); }
public function AuthenticateSP($profileID, $profileVersion, $customerReference, Identity $identity) { if (!$profileID) { throw new \InvalidArgumentException('No Profile ID has been defined when calling AuthenticateSP()'); } if ($profileVersion === null) { throw new \LogicException('No Profile Version has been defined when calling AuthenticateSP()'); } if (!$customerReference) { throw new \LogicException('No Customer Reference has been defined when calling AuthenticateSP()'); } if (!$identity || !is_a($identity, 'ID3Global\\Identity\\Identity')) { throw new \LogicException('No or invalid Identity defined when calling AuthenticateSP()'); } $request = new AuthenticateSPRequest(); $request->setCustomerReference($customerReference); $profile = new \stdClass(); $profile->Version = $profileVersion; $profile->ID = $profileID; $request->setProfileIDVersion($profile); $request->addFieldsFromIdentity($identity); return $this->getClient()->AuthenticateSP($request); }