$authToken = TWITTER_STRIPE_OAUTH_TOKEN;
// Assigned by Stripe
$publishableKey = TWITTER_STRIPE_PUBLISHABLE_KEY;
// Assigned by Stripe
$processorUserId = TWITTER_STRIPE_USER_ID;
// Assigned by Stripe
$error = '';
$success = '';
$client = new RESTClient();
$messageFactory = new MessageFactory();
$signer = new RequestSigner();
$responseHandlerFactory = new ResponseHandlerFactory();
$factory = new ProcessorFactory();
$processor = $factory->getProcessor('default', $client, $messageFactory, $signer, $responseHandlerFactory, $host);
$merchant = new Merchant();
$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);