$merchant->setAccountId($accountId); // OAuth $oAuth = $merchant->getOAuth(); $oAuth->setConsumerKey($consumerKey); $oAuth->setConsumerSecret($consumerSecret); $oAuth->setOAuthToken($oAuthToken); $oAuth->setOAuthTokenSecret($oAuthTokenSecret); $error = ''; $success = ''; $credentials = new Credentials(); $credentials->setAuthToken($authToken); $credentials->setPublishableKey($publishableKey); $credentials->setProcessorUserId($processorUserId); $gateway = new Gateway(); $gateway->setCredentials($credentials); $merchant->setGateway($gateway); if ($_POST) { $m = $_POST['merchant']; $a = $_POST['address']; try { // Foreign Reference $merchant->setExternalId($m['externalId']); // Profile $merchant->setName($m['name']); $merchant->setEmail($m['email']); $merchant->setSupportEmail($m['supportEmail']); $domainCollection = new ArrayCollection($m['domains']); $merchant->setDomains($domainCollection); // Address $address = $merchant->getAddress(); $address->setStreetAddressLine1($a['streetAddressLine1']);