/** * @inheritdoc */ public function build(array $buildSubject) { $paymentDO = $this->subjectReader->readPayment($buildSubject); $payment = $paymentDO->getPayment(); $result = [self::AMOUNT => $this->formatPrice($this->subjectReader->readAmount($buildSubject)), self::PAYMENT_METHOD_NONCE => $payment->getAdditionalInformation(DataAssignObserver::PAYMENT_METHOD_NONCE)]; $merchantAccountId = $this->config->getValue(Config::KEY_MERCHANT_ACCOUNT_ID); if (!empty($merchantAccountId)) { $result[self::MERCHANT_ACCOUNT_ID] = $merchantAccountId; } return $result; }
/** * Initializes credentials. * * @return void */ protected function initCredentials() { if ($this->config->getValue(Config::KEY_ENVIRONMENT) == Environment::ENVIRONMENT_PRODUCTION) { $this->environment(Environment::ENVIRONMENT_PRODUCTION); } else { $this->environment(Environment::ENVIRONMENT_SANDBOX); } $this->merchantId($this->config->getValue(Config::KEY_MERCHANT_ID)); $this->publicKey($this->config->getValue(Config::KEY_PUBLIC_KEY)); $this->privateKey($this->config->getValue(Config::KEY_PRIVATE_KEY)); }