Defaulting Mode to Sandbox

- Eliminate the need to define config for mode
This commit is contained in:
japatel
2014-12-18 14:04:19 -06:00
parent 20038e7525
commit 4cb951f8b2
3 changed files with 15 additions and 16 deletions

View File

@@ -93,9 +93,8 @@ class OauthHandler implements IPPHandler
throw new PPConfigurationException('The mode config parameter must be set to either sandbox/live');
}
} else {
throw new PPConfigurationException(
'You must set one of service.endpoint or mode parameters in your configuration'
);
// Defaulting to Sandbox
$baseEndpoint = PPConstants::REST_SANDBOX_ENDPOINT;
}
$baseEndpoint = rtrim(trim($baseEndpoint), '/') . "/v1/oauth2/token";

View File

@@ -116,9 +116,8 @@ class RestHandler implements IPPHandler
break;
}
} else {
throw new PPConfigurationException(
'You must set one of service.endpoint or mode parameters in your configuration'
);
// Defaulting to Sandbox
return PPConstants::REST_SANDBOX_ENDPOINT;
}
}
}