コード例 #1
0
 public function setUp()
 {
     parent::setUp();
     $apiLoginId = getenv('AUTHORIZE_NET_API_LOGIN_ID');
     $transactionKey = getenv('AUTHORIZE_NET_TRANSACTION_KEY');
     if ($apiLoginId && $transactionKey) {
         $this->gateway = new AIMGateway($this->getHttpClient(), $this->getHttpRequest());
         $this->gateway->setDeveloperMode(true);
         $this->gateway->setApiLoginId($apiLoginId);
         $this->gateway->setTransactionKey($transactionKey);
     } else {
         // No credentials were found, so skip this test
         $this->markTestSkipped();
     }
 }
 /**
  * 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;
 }