/** * Handle the command. * * @param ConfigurationRepositoryInterface $configuration * @param Repository $config * @return Gateway */ public function handle(ConfigurationRepositoryInterface $configuration, Repository $config) { $testMode = $config->get('anomaly.module.payments::config.test_mode'); if ($testMode) { $key = $configuration->presenter('anomaly.extension.stripe_gateway::test_api_key', $this->account->getSlug())->__value(); } else { $key = $configuration->presenter('anomaly.extension.stripe_gateway::live_api_key', $this->account->getSlug())->__value(); } $gateway = new Gateway(); $gateway->setApiKey($key); $gateway->setTestMode($testMode); return $gateway; }
/** * Handle the command. * * @param ConfigurationRepositoryInterface $configuration */ public function handle(ConfigurationRepositoryInterface $configuration) { $mode = $configuration->get('anomaly.extension.stripe_gateway::test_mode', $this->gateway->getSlug()); /* @var EncryptedFieldTypePresenter $key */ if ($mode->getValue()) { $key = $configuration->presenter('anomaly.extension.stripe_gateway::test_api_key', $this->gateway->getSlug()); } else { $key = $configuration->presenter('anomaly.extension.stripe_gateway::live_api_key', $this->gateway->getSlug()); } $gateway = new Gateway(); $gateway->setApiKey($key->decrypted()); $gateway->setTestMode($mode->getValue()); return $gateway; }
/** * Handle the command. * * @param ConfigurationRepositoryInterface $configuration * @return SIMGateway */ public function handle(ConfigurationRepositoryInterface $configuration) { /* @var EncryptedFieldTypePresenter $id */ /* @var EncryptedFieldTypePresenter $key */ /* @var EncryptedFieldTypePresenter $secret */ /* @var SettingInterface $mode */ $id = $configuration->presenter('anomaly.extension.authorizenet_aim_gateway::api_login_id', $this->gateway->getSlug()); $key = $configuration->presenter('anomaly.extension.authorizenet_aim_gateway::transaction_key', $this->gateway->getSlug()); $mode = $configuration->get('anomaly.extension.authorizenet_aim_gateway::test_mode', $this->gateway->getSlug()); $gateway = new AIMGateway(); $gateway->setTransactionKey($key->decrypted()); $gateway->setDeveloperMode($mode->getValue()); $gateway->setApiLoginId($id->decrypted()); $gateway->setTestMode($mode->getValue()); return $gateway; }
/** * Handle the command. * * @param ConfigurationRepositoryInterface $configuration */ public function handle(ConfigurationRepositoryInterface $configuration) { /* @var EncryptedFieldTypePresenter $username */ /* @var EncryptedFieldTypePresenter $password */ /* @var EncryptedFieldTypePresenter $signature */ /* @var ConfigurationInterface $mode */ $username = $configuration->presenter('anomaly.extension.paypal_express_gateway::username', $this->gateway->getSlug()); $password = $configuration->presenter('anomaly.extension.paypal_express_gateway::password', $this->gateway->getSlug()); $signature = $configuration->presenter('anomaly.extension.paypal_express_gateway::signature', $this->gateway->getSlug()); $mode = $configuration->get('anomaly.extension.paypal_express_gateway::test_mode', $this->gateway->getSlug()); $gateway = new ExpressGateway(); $gateway->setUsername($username->decrypted()); $gateway->setPassword($password->decrypted()); $gateway->setSignature($signature->decrypted()); $gateway->setTestMode($mode->getValue()); return $gateway; }